@atlaskit/editor-plugin-synced-block 3.5.1 → 3.6.0
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 +11 -0
- package/dist/cjs/nodeviews/bodiedLazySyncedBlock.js +26 -0
- package/dist/cjs/nodeviews/bodiedSyncedBlock.js +87 -0
- package/dist/cjs/nodeviews/syncedBlock.js +8 -115
- package/dist/cjs/pm-plugins/actions.js +48 -40
- package/dist/cjs/pm-plugins/main.js +8 -2
- package/dist/cjs/pm-plugins/utils/track-sync-blocks.js +8 -0
- package/dist/cjs/pm-plugins/utils/utils.js +12 -2
- package/dist/cjs/syncedBlockPlugin.js +3 -0
- package/dist/cjs/ui/BodiedSyncBlockWrapper.js +25 -0
- package/dist/cjs/ui/CreateSyncedBlockDropdownItem.js +15 -2
- package/dist/cjs/ui/SyncBlockLabel.js +3 -2
- package/dist/cjs/ui/floating-toolbar.js +5 -3
- package/dist/es2019/nodeviews/bodiedLazySyncedBlock.js +16 -0
- package/dist/es2019/nodeviews/bodiedSyncedBlock.js +62 -0
- package/dist/es2019/nodeviews/syncedBlock.js +7 -96
- package/dist/es2019/pm-plugins/actions.js +56 -46
- package/dist/es2019/pm-plugins/main.js +8 -2
- package/dist/es2019/pm-plugins/utils/track-sync-blocks.js +8 -0
- package/dist/es2019/pm-plugins/utils/utils.js +11 -1
- package/dist/es2019/syncedBlockPlugin.js +4 -1
- package/dist/es2019/ui/BodiedSyncBlockWrapper.js +19 -0
- package/dist/es2019/ui/CreateSyncedBlockDropdownItem.js +16 -2
- package/dist/es2019/ui/SyncBlockLabel.js +3 -2
- package/dist/es2019/ui/floating-toolbar.js +12 -4
- package/dist/esm/nodeviews/bodiedLazySyncedBlock.js +15 -0
- package/dist/esm/nodeviews/bodiedSyncedBlock.js +80 -0
- package/dist/esm/nodeviews/syncedBlock.js +9 -116
- package/dist/esm/pm-plugins/actions.js +47 -39
- package/dist/esm/pm-plugins/main.js +8 -2
- package/dist/esm/pm-plugins/utils/track-sync-blocks.js +8 -0
- package/dist/esm/pm-plugins/utils/utils.js +11 -1
- package/dist/esm/syncedBlockPlugin.js +4 -1
- package/dist/esm/ui/BodiedSyncBlockWrapper.js +18 -0
- package/dist/esm/ui/CreateSyncedBlockDropdownItem.js +15 -2
- package/dist/esm/ui/SyncBlockLabel.js +3 -2
- package/dist/esm/ui/floating-toolbar.js +6 -4
- package/dist/types/nodeviews/bodiedLazySyncedBlock.d.ts +3 -0
- package/dist/types/nodeviews/bodiedSyncedBlock.d.ts +25 -0
- package/dist/types/nodeviews/syncedBlock.d.ts +1 -20
- package/dist/types/pm-plugins/utils/utils.d.ts +6 -2
- package/dist/types/syncedBlockPluginType.d.ts +2 -0
- package/dist/types/ui/BodiedSyncBlockWrapper.d.ts +9 -0
- package/dist/types-ts4.5/nodeviews/bodiedLazySyncedBlock.d.ts +3 -0
- package/dist/types-ts4.5/nodeviews/bodiedSyncedBlock.d.ts +25 -0
- package/dist/types-ts4.5/nodeviews/syncedBlock.d.ts +1 -20
- package/dist/types-ts4.5/pm-plugins/utils/utils.d.ts +6 -2
- package/dist/types-ts4.5/syncedBlockPluginType.d.ts +2 -0
- package/dist/types-ts4.5/ui/BodiedSyncBlockWrapper.d.ts +9 -0
- package/package.json +3 -3
- package/dist/cjs/ui/SyncBlockEditorWrapper.js +0 -45
- package/dist/es2019/ui/SyncBlockEditorWrapper.js +0 -29
- package/dist/esm/ui/SyncBlockEditorWrapper.js +0 -36
- package/dist/types/ui/SyncBlockEditorWrapper.d.ts +0 -16
- package/dist/types-ts4.5/ui/SyncBlockEditorWrapper.d.ts +0 -16
|
@@ -10,21 +10,8 @@ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prot
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
12
12
|
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
13
|
-
import {
|
|
14
|
-
import { convertSyncBlockPMNodeToSyncBlockData, useFetchDocNode as _useFetchDocNode, useHandleContentChanges as _useHandleContentChanges } from '@atlaskit/editor-synced-block-provider';
|
|
15
|
-
import { SyncBlockEditorWrapper, SyncBlockEditorWrapperDataId } from '../ui/SyncBlockEditorWrapper';
|
|
13
|
+
import { useFetchDocNode as _useFetchDocNode } from '@atlaskit/editor-synced-block-provider';
|
|
16
14
|
import { SyncBlockRendererWrapper } from '../ui/SyncBlockRendererWrapper';
|
|
17
|
-
var defaultSyncBlockEditorDocument = {
|
|
18
|
-
version: 1,
|
|
19
|
-
type: 'doc',
|
|
20
|
-
content: [{
|
|
21
|
-
type: 'paragraph',
|
|
22
|
-
content: [{
|
|
23
|
-
type: 'text',
|
|
24
|
-
text: 'This is a source sync block. Edit me to update the content.'
|
|
25
|
-
}]
|
|
26
|
-
}]
|
|
27
|
-
};
|
|
28
15
|
var defaultSyncBlockRendererDocument = {
|
|
29
16
|
version: 1,
|
|
30
17
|
type: 'doc',
|
|
@@ -55,60 +42,12 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
55
42
|
return domRef;
|
|
56
43
|
}
|
|
57
44
|
}, {
|
|
58
|
-
key: "
|
|
59
|
-
value: function
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: "setInnerEditorView",
|
|
64
|
-
value: function setInnerEditorView(editorView) {
|
|
65
|
-
var _this$options;
|
|
66
|
-
// set inner editor view
|
|
67
|
-
this.syncBlockStore.setSyncBlockNestedEditorView(editorView);
|
|
68
|
-
var nodes = [convertSyncBlockPMNodeToSyncBlockData(this.node, false)];
|
|
69
|
-
(_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.dataProvider) === null || _this$options === void 0 || _this$options.fetchNodesData(nodes).then(function (data) {
|
|
70
|
-
var _data$;
|
|
71
|
-
var tr = editorView.state.tr;
|
|
72
|
-
if (data && (_data$ = data[0]) !== null && _data$ !== void 0 && _data$.content) {
|
|
73
|
-
var newNode = editorView.state.schema.nodeFromJSON(data[0].content);
|
|
74
|
-
editorView.dispatch(tr.replaceWith(0, editorView.state.doc.nodeSize - 2, newNode));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
key: "renderEditor",
|
|
80
|
-
value: function renderEditor() {
|
|
81
|
-
var _this$options2,
|
|
45
|
+
key: "render",
|
|
46
|
+
value: function render() {
|
|
47
|
+
var _this$options,
|
|
82
48
|
_this2 = this,
|
|
83
|
-
_this$
|
|
84
|
-
|
|
85
|
-
if (!(fabricEditorPopupScrollParent instanceof HTMLElement)) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.getSyncedBlockEditor)) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return /*#__PURE__*/React.createElement(SyncBlockEditorWrapper, {
|
|
92
|
-
popupsBoundariesElement: fabricEditorPopupScrollParent,
|
|
93
|
-
popupsMountPoint: fabricEditorPopupScrollParent,
|
|
94
|
-
defaultDocument: defaultSyncBlockEditorDocument,
|
|
95
|
-
useHandleContentChanges: function useHandleContentChanges(updatedDoc) {
|
|
96
|
-
var _this2$options;
|
|
97
|
-
return _useHandleContentChanges(updatedDoc, _this2.isSource(), _this2.node, (_this2$options = _this2.options) === null || _this2$options === void 0 ? void 0 : _this2$options.dataProvider);
|
|
98
|
-
},
|
|
99
|
-
setInnerEditorView: function setInnerEditorView(editorView) {
|
|
100
|
-
return _this2.setInnerEditorView(editorView);
|
|
101
|
-
},
|
|
102
|
-
getSyncedBlockEditor: (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.getSyncedBlockEditor
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "renderRenderer",
|
|
107
|
-
value: function renderRenderer() {
|
|
108
|
-
var _this$options4,
|
|
109
|
-
_this3 = this,
|
|
110
|
-
_this$options5;
|
|
111
|
-
if (!((_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.getSyncedBlockRenderer)) {
|
|
49
|
+
_this$options2;
|
|
50
|
+
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.getSyncedBlockRenderer)) {
|
|
112
51
|
return null;
|
|
113
52
|
}
|
|
114
53
|
|
|
@@ -116,40 +55,12 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
116
55
|
|
|
117
56
|
return /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
|
|
118
57
|
useFetchDocNode: function useFetchDocNode() {
|
|
119
|
-
var
|
|
120
|
-
return _useFetchDocNode(
|
|
58
|
+
var _this2$options;
|
|
59
|
+
return _useFetchDocNode(_this2.view, _this2.node, defaultSyncBlockRendererDocument, (_this2$options = _this2.options) === null || _this2$options === void 0 ? void 0 : _this2$options.dataProvider);
|
|
121
60
|
},
|
|
122
|
-
getSyncedBlockRenderer: (_this$
|
|
61
|
+
getSyncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.getSyncedBlockRenderer
|
|
123
62
|
});
|
|
124
63
|
}
|
|
125
|
-
}, {
|
|
126
|
-
key: "render",
|
|
127
|
-
value: function render() {
|
|
128
|
-
if (this.isSource()) {
|
|
129
|
-
return this.renderEditor();
|
|
130
|
-
}
|
|
131
|
-
return this.renderRenderer();
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
key: "stopEvent",
|
|
135
|
-
value: function stopEvent(event) {
|
|
136
|
-
var _target$closest;
|
|
137
|
-
var target = event.target;
|
|
138
|
-
if (!target) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
var isInNestedEditor = ((_target$closest = target.closest) === null || _target$closest === void 0 ? void 0 : _target$closest.call(target, "[data-testid=\"".concat(SyncBlockEditorWrapperDataId, "\"]"))) != null;
|
|
142
|
-
if (isInNestedEditor) {
|
|
143
|
-
this.selectNode();
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
}, {
|
|
149
|
-
key: "selectNode",
|
|
150
|
-
value: function selectNode() {
|
|
151
|
-
this.selectSyncBlockNode(undefined);
|
|
152
|
-
}
|
|
153
64
|
}, {
|
|
154
65
|
key: "destroy",
|
|
155
66
|
value: function destroy() {
|
|
@@ -157,27 +68,9 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
157
68
|
if (this.fetchIntervalId) {
|
|
158
69
|
window.clearInterval(this.fetchIntervalId);
|
|
159
70
|
}
|
|
160
|
-
this.syncBlockStore.setSyncBlockNestedEditorView(undefined);
|
|
161
71
|
(_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
|
|
162
72
|
_superPropGet(SyncBlock, "destroy", this, 3)([]);
|
|
163
73
|
}
|
|
164
|
-
}, {
|
|
165
|
-
key: "selectSyncBlockNode",
|
|
166
|
-
value: function selectSyncBlockNode(relativeSelectionPos) {
|
|
167
|
-
var _this$reactComponentP;
|
|
168
|
-
var getPos = typeof this.getPos === 'function' ? this.getPos() : 0;
|
|
169
|
-
var selectionAPI = (_this$reactComponentP = this.reactComponentProps.api) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.selection) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.actions;
|
|
170
|
-
if (!selectionAPI) {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
var tr = selectionAPI.selectNearNode({
|
|
174
|
-
selectionRelativeToNode: relativeSelectionPos,
|
|
175
|
-
selection: NodeSelection.create(this.view.state.doc, getPos !== null && getPos !== void 0 ? getPos : 0)
|
|
176
|
-
})(this.view.state);
|
|
177
|
-
if (tr) {
|
|
178
|
-
this.view.dispatch(tr);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
74
|
}]);
|
|
182
75
|
}(ReactNodeView);
|
|
183
76
|
export var syncBlockNodeView = function syncBlockNodeView(_ref) {
|
|
@@ -1,67 +1,75 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE
|
|
5
|
-
import {
|
|
6
|
-
import { canBeConvertedToSyncBlock, findSyncBlock } from './utils/utils';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { copyDomNode, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
6
|
+
import { canBeConvertedToSyncBlock, findSyncBlock, findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from './utils/utils';
|
|
7
7
|
export var createSyncedBlock = function createSyncedBlock(_ref) {
|
|
8
8
|
var tr = _ref.tr,
|
|
9
9
|
syncBlockStore = _ref.syncBlockStore,
|
|
10
10
|
typeAheadInsert = _ref.typeAheadInsert;
|
|
11
11
|
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var syncBlockNode = syncBlockStore.createSyncBlockNode();
|
|
15
|
-
var node = syncBlock.createAndFill(_objectSpread({}, syncBlockNode.attrs));
|
|
16
|
-
if (!node) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
12
|
+
bodiedSyncBlock = _tr$doc$type$schema$n.bodiedSyncBlock,
|
|
13
|
+
paragraph = _tr$doc$type$schema$n.paragraph;
|
|
19
14
|
|
|
20
15
|
// If the selection is empty, we want to insert the sync block on a new line
|
|
21
16
|
if (tr.selection.empty) {
|
|
17
|
+
var storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
|
|
18
|
+
var paragraphNode = paragraph.createAndFill({});
|
|
19
|
+
var newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, storeSyncBlockNode.attrs), paragraphNode ? [paragraphNode] : []);
|
|
20
|
+
if (!newBodiedSyncBlockNode) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
22
23
|
if (typeAheadInsert) {
|
|
23
|
-
tr = typeAheadInsert(
|
|
24
|
+
tr = typeAheadInsert(newBodiedSyncBlockNode);
|
|
24
25
|
} else {
|
|
25
|
-
tr = tr.replaceSelectionWith(
|
|
26
|
+
tr = tr.replaceSelectionWith(newBodiedSyncBlockNode).scrollIntoView();
|
|
26
27
|
}
|
|
27
28
|
} else {
|
|
28
29
|
var conversionInfo = canBeConvertedToSyncBlock(tr.selection);
|
|
29
|
-
if (conversionInfo) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// TMP solution to wait for the nested editor view to be set
|
|
34
|
-
// this will be removed once we have a proper architecture settled
|
|
35
|
-
setTimeout(function () {
|
|
36
|
-
var editorView = syncBlockStore.getSyncBlockNestedEditorView();
|
|
37
|
-
if (editorView) {
|
|
38
|
-
var innerTr = editorView.state.tr;
|
|
39
|
-
var innerNode = editorView.state.schema.nodeFromJSON(innerNodeJson);
|
|
40
|
-
editorView.dispatch(innerTr.replaceWith(0, editorView.state.doc.nodeSize - 2, innerNode));
|
|
41
|
-
}
|
|
42
|
-
}, 1000);
|
|
30
|
+
if (!conversionInfo) {
|
|
31
|
+
// TODO: EDITOR-1665 - Raise an error analytics event
|
|
32
|
+
return false;
|
|
43
33
|
} else {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
var _storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
|
|
35
|
+
var _newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, _storeSyncBlockNode.attrs), conversionInfo.contentToInclude);
|
|
36
|
+
if (!_newBodiedSyncBlockNode) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
tr.replaceWith(conversionInfo.from - 1, conversionInfo.to, _newBodiedSyncBlockNode).scrollIntoView();
|
|
47
40
|
}
|
|
48
41
|
}
|
|
49
42
|
return tr;
|
|
50
43
|
};
|
|
51
44
|
export var copySyncedBlockReferenceToClipboard = function copySyncedBlockReferenceToClipboard(api) {
|
|
52
|
-
return function (state,
|
|
53
|
-
if (!(api !== null && api !== void 0 && api.floatingToolbar)
|
|
45
|
+
return function (state, _dispatch, _view) {
|
|
46
|
+
if (!(api !== null && api !== void 0 && api.floatingToolbar)) {
|
|
54
47
|
return false;
|
|
55
48
|
}
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var newTr = api.floatingToolbar.commands.copyNode(syncBlock, INPUT_METHOD.FLOATING_TB)({
|
|
59
|
-
tr: tr
|
|
60
|
-
});
|
|
61
|
-
if (!newTr) {
|
|
49
|
+
var syncBlockFindResult = findSyncBlockOrBodiedSyncBlock(state);
|
|
50
|
+
if (!syncBlockFindResult) {
|
|
62
51
|
return false;
|
|
63
52
|
}
|
|
64
|
-
|
|
53
|
+
var isBodiedSyncBlock = isBodiedSyncBlockNode(syncBlockFindResult.node, state.schema.nodes.bodiedSyncBlock);
|
|
54
|
+
var referenceSyncBlockNode = null;
|
|
55
|
+
if (isBodiedSyncBlock) {
|
|
56
|
+
var syncBlock = state.tr.doc.type.schema.nodes.syncBlock;
|
|
57
|
+
|
|
58
|
+
// create sync block reference node
|
|
59
|
+
referenceSyncBlockNode = syncBlock.createAndFill({
|
|
60
|
+
resourceId: syncBlockFindResult.node.attrs.resourceId
|
|
61
|
+
});
|
|
62
|
+
if (!referenceSyncBlockNode) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
referenceSyncBlockNode = syncBlockFindResult.node;
|
|
67
|
+
}
|
|
68
|
+
if (!referenceSyncBlockNode) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
var domNode = toDOM(referenceSyncBlockNode, state.tr.doc.type.schema);
|
|
72
|
+
copyDomNode(domNode, referenceSyncBlockNode.type, state.tr.selection);
|
|
65
73
|
return true;
|
|
66
74
|
};
|
|
67
75
|
};
|
|
@@ -99,7 +107,7 @@ export var removeSyncedBlock = function removeSyncedBlock(api) {
|
|
|
99
107
|
from = _state$selection.$from.pos,
|
|
100
108
|
to = _state$selection.$to.pos,
|
|
101
109
|
tr = state.tr;
|
|
102
|
-
var syncBlock =
|
|
110
|
+
var syncBlock = findSyncBlockOrBodiedSyncBlock(state);
|
|
103
111
|
if (!syncBlock) {
|
|
104
112
|
return false;
|
|
105
113
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { lazyBodiedSyncBlockView } from '../nodeviews/bodiedLazySyncedBlock';
|
|
3
4
|
import { lazySyncBlockView } from '../nodeviews/lazySyncedBlock';
|
|
4
5
|
import { trackSyncBlocks } from './utils/track-sync-blocks';
|
|
5
6
|
export var syncedBlockPluginKey = new PluginKey('syncedBlockPlugin');
|
|
@@ -28,6 +29,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
28
29
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
29
30
|
api: api,
|
|
30
31
|
syncBlockStore: syncBlockStore
|
|
32
|
+
}),
|
|
33
|
+
bodiedSyncBlock: lazyBodiedSyncBlockView({
|
|
34
|
+
pluginOptions: options,
|
|
35
|
+
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
36
|
+
api: api,
|
|
37
|
+
syncBlockStore: syncBlockStore
|
|
31
38
|
})
|
|
32
39
|
}
|
|
33
40
|
},
|
|
@@ -36,7 +43,6 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
36
43
|
return {
|
|
37
44
|
destroy: function destroy() {
|
|
38
45
|
syncBlockStore.setEditorView(undefined);
|
|
39
|
-
syncBlockStore.setSyncBlockNestedEditorView(undefined);
|
|
40
46
|
}
|
|
41
47
|
};
|
|
42
48
|
},
|
|
@@ -60,7 +66,7 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
|
|
|
60
66
|
}
|
|
61
67
|
return true;
|
|
62
68
|
},
|
|
63
|
-
appendTransaction: function appendTransaction(trs,
|
|
69
|
+
appendTransaction: function appendTransaction(trs, _oldState, newState) {
|
|
64
70
|
trs.filter(function (tr) {
|
|
65
71
|
return tr.docChanged;
|
|
66
72
|
}).forEach(function (tr) {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
2
|
export var trackSyncBlocks = function trackSyncBlocks(storeManager, tr, state) {
|
|
3
|
+
// TODO: EDITOR-2430 - Disable tracking for now, it will be updated to handle the new bodied sync block
|
|
4
|
+
var dontTrack = true;
|
|
5
|
+
if (dontTrack) {
|
|
6
|
+
return {
|
|
7
|
+
removed: [],
|
|
8
|
+
added: []
|
|
9
|
+
};
|
|
10
|
+
}
|
|
3
11
|
var sourceSyncBlockRemoved = {};
|
|
4
12
|
var sourceSyncBlockAdded = {};
|
|
5
13
|
|
|
@@ -4,7 +4,17 @@ import { getDefaultSyncBlockSchema } from '@atlaskit/editor-synced-block-provide
|
|
|
4
4
|
import { CellSelection, findTable } from '@atlaskit/editor-tables';
|
|
5
5
|
export var findSyncBlock = function findSyncBlock(state, selection) {
|
|
6
6
|
var syncBlock = state.schema.nodes.syncBlock;
|
|
7
|
-
return findSelectedNodeOfType(syncBlock)(selection || state.selection)
|
|
7
|
+
return findSelectedNodeOfType(syncBlock)(selection || state.selection);
|
|
8
|
+
};
|
|
9
|
+
export var findBodiedSyncBlock = function findBodiedSyncBlock(state, selection) {
|
|
10
|
+
var bodiedSyncBlock = state.schema.nodes.bodiedSyncBlock;
|
|
11
|
+
return findSelectedNodeOfType(bodiedSyncBlock)(selection || state.selection) || findParentNodeOfType(bodiedSyncBlock)(selection || state.selection);
|
|
12
|
+
};
|
|
13
|
+
export var findSyncBlockOrBodiedSyncBlock = function findSyncBlockOrBodiedSyncBlock(state, selection) {
|
|
14
|
+
return findSyncBlock(state, selection) || findBodiedSyncBlock(state, selection);
|
|
15
|
+
};
|
|
16
|
+
export var isBodiedSyncBlockNode = function isBodiedSyncBlockNode(node, bodiedSyncBlock) {
|
|
17
|
+
return node.type === bodiedSyncBlock;
|
|
8
18
|
};
|
|
9
19
|
export var canBeConvertedToSyncBlock = function canBeConvertedToSyncBlock(selection) {
|
|
10
20
|
var from = selection.from;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { syncBlock } from '@atlaskit/adf-schema';
|
|
2
|
+
import { bodiedSyncBlock, syncBlock } from '@atlaskit/adf-schema';
|
|
3
3
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { IconSyncBlock } from '@atlaskit/editor-common/quick-insert';
|
|
5
5
|
import { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
@@ -20,6 +20,9 @@ export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
|
|
|
20
20
|
return [{
|
|
21
21
|
name: 'syncBlock',
|
|
22
22
|
node: syncBlock
|
|
23
|
+
}, {
|
|
24
|
+
name: 'bodiedSyncBlock',
|
|
25
|
+
node: bodiedSyncBlock
|
|
23
26
|
}];
|
|
24
27
|
},
|
|
25
28
|
pmPlugins: function pmPlugins() {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useHandleContentChanges } from '@atlaskit/editor-synced-block-provider';
|
|
3
|
+
import { SyncBlockLabel } from './SyncBlockLabel';
|
|
4
|
+
export var BodiedSyncBlockWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5
|
+
var node = _ref.node,
|
|
6
|
+
dataProvider = _ref.dataProvider;
|
|
7
|
+
// TODO: EDITOR-2429 - this should be debounced (either here or in the data provider) to avoid excessive API writes
|
|
8
|
+
var docJSON = {
|
|
9
|
+
version: 1,
|
|
10
|
+
type: 'doc',
|
|
11
|
+
content: node.content.toJSON()
|
|
12
|
+
};
|
|
13
|
+
useHandleContentChanges(docJSON, true, node, dataProvider);
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SyncBlockLabel, null), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
"data-testid": "bodied-sync-block-wrapper",
|
|
16
|
+
ref: ref
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
@@ -14,8 +14,21 @@ export var CreateSyncedBlockDropdownItem = function CreateSyncedBlockDropdownIte
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
var onClick = function onClick() {
|
|
17
|
-
var _api$core;
|
|
18
|
-
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(
|
|
17
|
+
var _api$core, _api$core2;
|
|
18
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
|
19
|
+
var _api$blockControls;
|
|
20
|
+
var tr = _ref2.tr;
|
|
21
|
+
api === null || api === void 0 || api.syncedBlock.commands.insertSyncedBlock()({
|
|
22
|
+
tr: tr
|
|
23
|
+
});
|
|
24
|
+
api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 || (_api$blockControls = _api$blockControls.commands) === null || _api$blockControls === void 0 || _api$blockControls.toggleBlockMenu({
|
|
25
|
+
closeMenu: true
|
|
26
|
+
})({
|
|
27
|
+
tr: tr
|
|
28
|
+
});
|
|
29
|
+
return tr;
|
|
30
|
+
});
|
|
31
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.focus();
|
|
19
32
|
};
|
|
20
33
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
21
34
|
elemBefore: /*#__PURE__*/React.createElement(SyncBlocksIcon, {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
4
5
|
var SyncBlockLabelDataId = 'sync-block-label';
|
|
5
6
|
var SyncBlockLabelComponent = function SyncBlockLabelComponent() {
|
|
6
7
|
var _useIntl = useIntl(),
|
|
7
8
|
formatMessage = _useIntl.formatMessage;
|
|
8
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
"data-
|
|
10
|
+
"data-testid": SyncBlockLabelDataId
|
|
10
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
11
12
|
,
|
|
12
|
-
className:
|
|
13
|
+
className: SyncBlockLabelSharedCssClassName.labelClassName
|
|
13
14
|
}, formatMessage(messages.syncedBlockLabel));
|
|
14
15
|
};
|
|
15
16
|
export var SyncBlockLabel = /*#__PURE__*/React.memo(SyncBlockLabelComponent);
|
|
@@ -9,19 +9,21 @@ import CopyIcon from '@atlaskit/icon/core/copy';
|
|
|
9
9
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
10
10
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
11
11
|
import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock } from '../pm-plugins/actions';
|
|
12
|
-
import {
|
|
12
|
+
import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
13
13
|
export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
14
14
|
var _api$decorations;
|
|
15
15
|
var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
16
16
|
var _providerFactory = arguments.length > 3 ? arguments[3] : undefined;
|
|
17
17
|
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
18
18
|
var syncBlockStore = arguments.length > 5 ? arguments[5] : undefined;
|
|
19
|
-
var syncBlockObject =
|
|
19
|
+
var syncBlockObject = findSyncBlockOrBodiedSyncBlock(state);
|
|
20
20
|
if (!syncBlockObject) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
+
var bodiedSyncBlock = state.schema.nodes.bodiedSyncBlock;
|
|
24
|
+
var isBodiedSyncBlock = isBodiedSyncBlockNode(syncBlockObject.node, bodiedSyncBlock);
|
|
23
25
|
var formatMessage = intl.formatMessage;
|
|
24
|
-
var nodeType =
|
|
26
|
+
var nodeType = syncBlockObject.node.type;
|
|
25
27
|
var hoverDecoration = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration;
|
|
26
28
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
27
29
|
return {
|
|
@@ -44,7 +46,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
44
46
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
|
|
45
47
|
items.push(copyButton);
|
|
46
48
|
var disabled = !syncBlockStore.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
|
|
47
|
-
if (!
|
|
49
|
+
if (!isBodiedSyncBlock) {
|
|
48
50
|
var editSourceButton = _objectSpread({
|
|
49
51
|
id: 'editor.syncedBlock.editSource',
|
|
50
52
|
type: 'button',
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import type { BodiedSyncBlockNodeViewProperties } from './bodiedSyncedBlock';
|
|
3
|
+
export declare const lazyBodiedSyncBlockView: (props: BodiedSyncBlockNodeViewProperties) => NodeViewConstructor;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
+
import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
+
import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
5
|
+
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
9
|
+
import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
|
|
10
|
+
export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
|
|
11
|
+
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
12
|
+
eventDispatcher: EventDispatcher;
|
|
13
|
+
getPos: getPosHandler;
|
|
14
|
+
node: PMNode;
|
|
15
|
+
pluginOptions: SyncedBlockPluginOptions | undefined;
|
|
16
|
+
portalProviderAPI: PortalProviderAPI;
|
|
17
|
+
view: EditorView;
|
|
18
|
+
}
|
|
19
|
+
export interface BodiedSyncBlockNodeViewProperties {
|
|
20
|
+
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
21
|
+
pluginOptions: SyncedBlockPluginOptions | undefined;
|
|
22
|
+
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
23
|
+
syncBlockStore: SyncBlockStoreManager;
|
|
24
|
+
}
|
|
25
|
+
export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
3
|
import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
@@ -19,28 +18,10 @@ export interface SyncBlockNodeViewProps extends ReactComponentProps {
|
|
|
19
18
|
syncBlockStore: SyncBlockStoreManager;
|
|
20
19
|
view: EditorView;
|
|
21
20
|
}
|
|
22
|
-
declare class SyncBlock extends ReactNodeView<SyncBlockNodeViewProps> {
|
|
23
|
-
private options;
|
|
24
|
-
private fetchIntervalId;
|
|
25
|
-
private syncBlockStore;
|
|
26
|
-
constructor(props: SyncBlockNodeViewProps);
|
|
27
|
-
unsubscribe: (() => void) | undefined;
|
|
28
|
-
createDomRef(): HTMLElement;
|
|
29
|
-
private isSource;
|
|
30
|
-
private setInnerEditorView;
|
|
31
|
-
private renderEditor;
|
|
32
|
-
private renderRenderer;
|
|
33
|
-
render(): React.JSX.Element | null;
|
|
34
|
-
stopEvent(event: Event): boolean;
|
|
35
|
-
selectNode(): void;
|
|
36
|
-
destroy(): void;
|
|
37
|
-
private selectSyncBlockNode;
|
|
38
|
-
}
|
|
39
21
|
export interface SyncBlockNodeViewProperties {
|
|
40
22
|
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
41
23
|
options: SyncedBlockPluginOptions | undefined;
|
|
42
24
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
43
25
|
syncBlockStore: SyncBlockStoreManager;
|
|
44
26
|
}
|
|
45
|
-
export declare const syncBlockNodeView: (
|
|
46
|
-
export {};
|
|
27
|
+
export declare const syncBlockNodeView: (props: SyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<SyncBlockNodeViewProps>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import {
|
|
4
|
-
export declare const findSyncBlock: (state: EditorState, selection?: Selection | null) =>
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
export declare const findSyncBlock: (state: EditorState, selection?: Selection | null) => ContentNodeWithPos | undefined;
|
|
6
|
+
export declare const findBodiedSyncBlock: (state: EditorState, selection?: Selection | null) => ContentNodeWithPos | undefined;
|
|
7
|
+
export declare const findSyncBlockOrBodiedSyncBlock: (state: EditorState, selection?: Selection | null) => ContentNodeWithPos | undefined;
|
|
8
|
+
export declare const isBodiedSyncBlockNode: (node: PMNode, bodiedSyncBlock: NodeType) => boolean;
|
|
5
9
|
export interface SyncBlockConversionInfo {
|
|
6
10
|
contentToInclude: Fragment;
|
|
7
11
|
from: number;
|
|
@@ -3,6 +3,7 @@ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
3
3
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
5
5
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
+
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
6
7
|
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
7
8
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
8
9
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
@@ -47,6 +48,7 @@ export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
|
|
|
47
48
|
SelectionPlugin,
|
|
48
49
|
FloatingToolbarPlugin,
|
|
49
50
|
DecorationsPlugin,
|
|
51
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
50
52
|
OptionalPlugin<BlockMenuPlugin>,
|
|
51
53
|
OptionalPlugin<AnalyticsPlugin>
|
|
52
54
|
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { type SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
|
|
4
|
+
interface BodiedSyncBlockWrapperProps {
|
|
5
|
+
dataProvider?: SyncBlockDataProvider | undefined;
|
|
6
|
+
node: PMNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const BodiedSyncBlockWrapper: React.ForwardRefExoticComponent<BodiedSyncBlockWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import type { BodiedSyncBlockNodeViewProperties } from './bodiedSyncedBlock';
|
|
3
|
+
export declare const lazyBodiedSyncBlockView: (props: BodiedSyncBlockNodeViewProperties) => NodeViewConstructor;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
+
import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
+
import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
5
|
+
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
9
|
+
import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
|
|
10
|
+
export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
|
|
11
|
+
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
12
|
+
eventDispatcher: EventDispatcher;
|
|
13
|
+
getPos: getPosHandler;
|
|
14
|
+
node: PMNode;
|
|
15
|
+
pluginOptions: SyncedBlockPluginOptions | undefined;
|
|
16
|
+
portalProviderAPI: PortalProviderAPI;
|
|
17
|
+
view: EditorView;
|
|
18
|
+
}
|
|
19
|
+
export interface BodiedSyncBlockNodeViewProperties {
|
|
20
|
+
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
21
|
+
pluginOptions: SyncedBlockPluginOptions | undefined;
|
|
22
|
+
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
23
|
+
syncBlockStore: SyncBlockStoreManager;
|
|
24
|
+
}
|
|
25
|
+
export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
2
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
3
|
import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
@@ -19,28 +18,10 @@ export interface SyncBlockNodeViewProps extends ReactComponentProps {
|
|
|
19
18
|
syncBlockStore: SyncBlockStoreManager;
|
|
20
19
|
view: EditorView;
|
|
21
20
|
}
|
|
22
|
-
declare class SyncBlock extends ReactNodeView<SyncBlockNodeViewProps> {
|
|
23
|
-
private options;
|
|
24
|
-
private fetchIntervalId;
|
|
25
|
-
private syncBlockStore;
|
|
26
|
-
constructor(props: SyncBlockNodeViewProps);
|
|
27
|
-
unsubscribe: (() => void) | undefined;
|
|
28
|
-
createDomRef(): HTMLElement;
|
|
29
|
-
private isSource;
|
|
30
|
-
private setInnerEditorView;
|
|
31
|
-
private renderEditor;
|
|
32
|
-
private renderRenderer;
|
|
33
|
-
render(): React.JSX.Element | null;
|
|
34
|
-
stopEvent(event: Event): boolean;
|
|
35
|
-
selectNode(): void;
|
|
36
|
-
destroy(): void;
|
|
37
|
-
private selectSyncBlockNode;
|
|
38
|
-
}
|
|
39
21
|
export interface SyncBlockNodeViewProperties {
|
|
40
22
|
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
41
23
|
options: SyncedBlockPluginOptions | undefined;
|
|
42
24
|
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
43
25
|
syncBlockStore: SyncBlockStoreManager;
|
|
44
26
|
}
|
|
45
|
-
export declare const syncBlockNodeView: (
|
|
46
|
-
export {};
|
|
27
|
+
export declare const syncBlockNodeView: (props: SyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<SyncBlockNodeViewProps>;
|