@atlaskit/editor-plugin-synced-block 8.2.12 → 8.2.14
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 +16 -0
- package/dist/cjs/nodeviews/syncedBlock.js +30 -20
- package/dist/cjs/pm-plugins/main.js +10 -0
- package/dist/cjs/ui/SyncBlockRendererWrapper.js +6 -5
- package/dist/es2019/nodeviews/syncedBlock.js +29 -17
- package/dist/es2019/pm-plugins/main.js +10 -0
- package/dist/es2019/ui/SyncBlockRendererWrapper.js +7 -6
- package/dist/esm/nodeviews/syncedBlock.js +30 -20
- package/dist/esm/pm-plugins/main.js +10 -0
- package/dist/esm/ui/SyncBlockRendererWrapper.js +7 -6
- package/dist/types/nodeviews/syncedBlock.d.ts +2 -0
- package/dist/types/ui/SyncBlockRendererWrapper.d.ts +6 -4
- package/dist/types-ts4.5/nodeviews/syncedBlock.d.ts +2 -0
- package/dist/types-ts4.5/ui/SyncBlockRendererWrapper.d.ts +6 -4
- package/docs/0-intro.tsx +5 -5
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 8.2.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f3286bd234240`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f3286bd234240) -
|
|
8
|
+
Only iterate top-level nodes in buildStatusDecorations for improved performance
|
|
9
|
+
- [`4b21ea1a7170f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b21ea1a7170f) -
|
|
10
|
+
Performance improvements behind an experiment.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 8.2.13
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 8.2.12
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -11,12 +11,13 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
11
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
12
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
var _react = _interopRequireDefault(require("react"));
|
|
15
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
17
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
17
18
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
18
19
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
19
|
-
var
|
|
20
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
21
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
21
22
|
var _editorCommands = require("../editor-commands");
|
|
22
23
|
var _SyncBlockRendererWrapper = require("../ui/SyncBlockRendererWrapper");
|
|
@@ -28,6 +29,22 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
28
29
|
var _this;
|
|
29
30
|
(0, _classCallCheck2.default)(this, SyncBlock);
|
|
30
31
|
_this = _callSuper(this, SyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
|
|
32
|
+
// Stable callback references — defined as arrow properties so they keep a
|
|
33
|
+
// fixed identity across render() calls, avoiding defeats of React.memo.
|
|
34
|
+
// The experiment gate lives in render(); these are always available.
|
|
35
|
+
(0, _defineProperty2.default)(_this, "removeSyncBlockStable", function () {
|
|
36
|
+
var pos = _this.getPos();
|
|
37
|
+
if (pos !== undefined) {
|
|
38
|
+
(0, _editorCommands.removeSyncedBlockAtPos)(_this.api, pos);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
(0, _defineProperty2.default)(_this, "fetchSyncBlockSourceInfoStable", function (sourceAri) {
|
|
42
|
+
var _this$api$syncedBlock, _this$api;
|
|
43
|
+
// store is guaranteed non-null: render() guards on syncBlockStore
|
|
44
|
+
// before these callbacks can be invoked.
|
|
45
|
+
var store = (_this$api$syncedBlock = (_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) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : _this.syncBlockStore;
|
|
46
|
+
return store ? store.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri) : Promise.resolve(undefined);
|
|
47
|
+
});
|
|
31
48
|
_this.options = props.options;
|
|
32
49
|
_this.api = props.api;
|
|
33
50
|
_this.syncBlockStore = props.syncBlockStore;
|
|
@@ -59,9 +76,9 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
59
76
|
key: "render",
|
|
60
77
|
value: function render(_ref) {
|
|
61
78
|
var _this$options,
|
|
62
|
-
_this$api$
|
|
63
|
-
_this$api,
|
|
79
|
+
_this$api$syncedBlock2,
|
|
64
80
|
_this$api2,
|
|
81
|
+
_this$api3,
|
|
65
82
|
_this2 = this,
|
|
66
83
|
_this$options2;
|
|
67
84
|
var getPos = _ref.getPos;
|
|
@@ -74,20 +91,21 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
74
91
|
if (!resourceId || !localId) {
|
|
75
92
|
return null;
|
|
76
93
|
}
|
|
77
|
-
var syncBlockStore = (_this$api$
|
|
94
|
+
var syncBlockStore = (_this$api$syncedBlock2 = (_this$api2 = this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.syncedBlock) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.sharedState.currentState()) === null || _this$api2 === void 0 ? void 0 : _this$api2.syncBlockStore) !== null && _this$api$syncedBlock2 !== void 0 ? _this$api$syncedBlock2 : this.syncBlockStore;
|
|
78
95
|
if (!syncBlockStore) {
|
|
79
96
|
return null;
|
|
80
97
|
}
|
|
98
|
+
var isPerfEnabled = (0, _expValEquals.expValEquals)('editor_synced_block_perf', 'isEnabled', true);
|
|
81
99
|
|
|
82
100
|
// get document node from data provider
|
|
83
101
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
84
102
|
component: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
|
|
85
|
-
dispatchAnalyticsEvent: (_this$
|
|
103
|
+
dispatchAnalyticsEvent: (_this$api3 = this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions.fireAnalyticsEvent,
|
|
86
104
|
fallbackComponent: null
|
|
87
105
|
}, /*#__PURE__*/_react.default.createElement(_syncBlock.SyncBlockActionsProvider
|
|
88
106
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
89
107
|
, {
|
|
90
|
-
removeSyncBlock: function
|
|
108
|
+
removeSyncBlock: isPerfEnabled ? this.removeSyncBlockStable : function () {
|
|
91
109
|
var pos = getPos();
|
|
92
110
|
if (pos !== undefined) {
|
|
93
111
|
(0, _editorCommands.removeSyncedBlockAtPos)(_this2.api, pos);
|
|
@@ -95,23 +113,15 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
95
113
|
}
|
|
96
114
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
97
115
|
,
|
|
98
|
-
fetchSyncBlockSourceInfo: function
|
|
116
|
+
fetchSyncBlockSourceInfo: isPerfEnabled ? this.fetchSyncBlockSourceInfoStable : function (sourceAri) {
|
|
99
117
|
return syncBlockStore.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri);
|
|
100
118
|
}
|
|
101
119
|
}, /*#__PURE__*/_react.default.createElement(_SyncBlockRendererWrapper.SyncBlockRendererWrapper, {
|
|
102
|
-
localId:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
,
|
|
106
|
-
|
|
107
|
-
return (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(syncBlockStore, _this2.node);
|
|
108
|
-
}
|
|
109
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
110
|
-
,
|
|
111
|
-
useFetchSyncBlockData: function useFetchSyncBlockData() {
|
|
112
|
-
var _this2$api;
|
|
113
|
-
return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStore, resourceId, localId, (_this2$api = _this2.api) === null || _this2$api === void 0 || (_this2$api = _this2$api.analytics) === null || _this2$api === void 0 || (_this2$api = _this2$api.actions) === null || _this2$api === void 0 ? void 0 : _this2$api.fireAnalyticsEvent);
|
|
114
|
-
},
|
|
120
|
+
localId: localId,
|
|
121
|
+
resourceId: resourceId,
|
|
122
|
+
node: this.node,
|
|
123
|
+
syncBlockStore: syncBlockStore,
|
|
124
|
+
syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
|
|
115
125
|
api: this.api
|
|
116
126
|
})));
|
|
117
127
|
}
|
|
@@ -42,6 +42,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
42
42
|
var syncedBlockPluginKey = exports.syncedBlockPluginKey = new _state.PluginKey('syncedBlockPlugin');
|
|
43
43
|
var mapRetryCreationPosMap = function mapRetryCreationPosMap(oldMap, newRetryCreationPos, mapPos) {
|
|
44
44
|
var resourceId = newRetryCreationPos === null || newRetryCreationPos === void 0 ? void 0 : newRetryCreationPos.resourceId;
|
|
45
|
+
|
|
46
|
+
// Fast path: no new entry and nothing to remap — return the same reference.
|
|
47
|
+
// This is critical for PR-E (EDITOR-6929) which relies on reference equality
|
|
48
|
+
// to short-circuit SharedStateAPI deep-equality checks.
|
|
49
|
+
if ((0, _expValEquals.expValEquals)('editor_synced_block_perf', 'isEnabled', true) && !resourceId && oldMap.size === 0) {
|
|
50
|
+
return oldMap;
|
|
51
|
+
}
|
|
45
52
|
var newMap = new Map(oldMap);
|
|
46
53
|
if (resourceId) {
|
|
47
54
|
var pos = newRetryCreationPos.pos;
|
|
@@ -242,6 +249,9 @@ var buildStatusDecorations = function buildStatusDecorations(doc, syncBlockStore
|
|
|
242
249
|
class: _syncBlock.SyncBlockStateCssClassName.draggingClassName
|
|
243
250
|
}));
|
|
244
251
|
}
|
|
252
|
+
|
|
253
|
+
// only traverse the top-level node of the document, as syncBlock and bodiedSyncBlock are top-level nodes
|
|
254
|
+
return false;
|
|
245
255
|
});
|
|
246
256
|
return _view.DecorationSet.create(doc, [].concat(offlineDecorations, viewModeDecorations, loadingDecorations, dragDecorations));
|
|
247
257
|
};
|
|
@@ -11,14 +11,15 @@ var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider
|
|
|
11
11
|
var _SyncBlockLabel = require("./SyncBlockLabel");
|
|
12
12
|
var SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
|
|
13
13
|
var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperComponent(_ref) {
|
|
14
|
-
var _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3;
|
|
14
|
+
var _api$analytics, _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3;
|
|
15
15
|
var syncedBlockRenderer = _ref.syncedBlockRenderer,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
syncBlockStore = _ref.syncBlockStore,
|
|
17
|
+
node = _ref.node,
|
|
18
|
+
resourceId = _ref.resourceId,
|
|
18
19
|
localId = _ref.localId,
|
|
19
20
|
api = _ref.api;
|
|
20
|
-
var syncBlockFetchResult = useFetchSyncBlockData();
|
|
21
|
-
var title =
|
|
21
|
+
var syncBlockFetchResult = (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStore, resourceId, localId, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
|
|
22
|
+
var title = (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(syncBlockStore, node);
|
|
22
23
|
var contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 || (_syncBlockFetchResult = _syncBlockFetchResult.data) === null || _syncBlockFetchResult === void 0 ? void 0 : _syncBlockFetchResult.contentUpdatedAt;
|
|
23
24
|
var isUnpublishedBlock = ((_syncBlockFetchResult2 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult2 === void 0 || (_syncBlockFetchResult2 = _syncBlockFetchResult2.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.status) === 'unpublished';
|
|
24
25
|
var isUnsyncedBlock = isUnpublishedBlock || (syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 || (_syncBlockFetchResult3 = _syncBlockFetchResult3.error) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.type) === _editorSyncedBlockProvider.SyncBlockError.NotFound;
|
|
@@ -1,15 +1,32 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
4
5
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
6
|
import { SyncBlockSharedCssClassName, SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
6
|
-
import {
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
9
|
import { removeSyncedBlockAtPos } from '../editor-commands';
|
|
9
10
|
import { SyncBlockRendererWrapper } from '../ui/SyncBlockRendererWrapper';
|
|
10
11
|
export class SyncBlock extends ReactNodeView {
|
|
11
12
|
constructor(props) {
|
|
12
13
|
super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props);
|
|
14
|
+
// Stable callback references — defined as arrow properties so they keep a
|
|
15
|
+
// fixed identity across render() calls, avoiding defeats of React.memo.
|
|
16
|
+
// The experiment gate lives in render(); these are always available.
|
|
17
|
+
_defineProperty(this, "removeSyncBlockStable", () => {
|
|
18
|
+
const pos = this.getPos();
|
|
19
|
+
if (pos !== undefined) {
|
|
20
|
+
removeSyncedBlockAtPos(this.api, pos);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
_defineProperty(this, "fetchSyncBlockSourceInfoStable", sourceAri => {
|
|
24
|
+
var _this$api$syncedBlock, _this$api, _this$api$syncedBlock2, _this$api$syncedBlock3;
|
|
25
|
+
// store is guaranteed non-null: render() guards on syncBlockStore
|
|
26
|
+
// before these callbacks can be invoked.
|
|
27
|
+
const store = (_this$api$syncedBlock = (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$syncedBlock2 = _this$api.syncedBlock) === null || _this$api$syncedBlock2 === void 0 ? void 0 : (_this$api$syncedBlock3 = _this$api$syncedBlock2.sharedState.currentState()) === null || _this$api$syncedBlock3 === void 0 ? void 0 : _this$api$syncedBlock3.syncBlockStore) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : this.syncBlockStore;
|
|
28
|
+
return store ? store.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri) : Promise.resolve(undefined);
|
|
29
|
+
});
|
|
13
30
|
this.options = props.options;
|
|
14
31
|
this.api = props.api;
|
|
15
32
|
this.syncBlockStore = props.syncBlockStore;
|
|
@@ -32,7 +49,7 @@ export class SyncBlock extends ReactNodeView {
|
|
|
32
49
|
render({
|
|
33
50
|
getPos
|
|
34
51
|
}) {
|
|
35
|
-
var _this$options, _this$api$
|
|
52
|
+
var _this$options, _this$api$syncedBlock4, _this$api2, _this$api2$syncedBloc, _this$api2$syncedBloc2, _this$api3, _this$api3$analytics, _this$options2;
|
|
36
53
|
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
|
|
37
54
|
return null;
|
|
38
55
|
}
|
|
@@ -43,20 +60,21 @@ export class SyncBlock extends ReactNodeView {
|
|
|
43
60
|
if (!resourceId || !localId) {
|
|
44
61
|
return null;
|
|
45
62
|
}
|
|
46
|
-
const syncBlockStore = (_this$api$
|
|
63
|
+
const syncBlockStore = (_this$api$syncedBlock4 = (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$syncedBloc = _this$api2.syncedBlock) === null || _this$api2$syncedBloc === void 0 ? void 0 : (_this$api2$syncedBloc2 = _this$api2$syncedBloc.sharedState.currentState()) === null || _this$api2$syncedBloc2 === void 0 ? void 0 : _this$api2$syncedBloc2.syncBlockStore) !== null && _this$api$syncedBlock4 !== void 0 ? _this$api$syncedBlock4 : this.syncBlockStore;
|
|
47
64
|
if (!syncBlockStore) {
|
|
48
65
|
return null;
|
|
49
66
|
}
|
|
67
|
+
const isPerfEnabled = expValEquals('editor_synced_block_perf', 'isEnabled', true);
|
|
50
68
|
|
|
51
69
|
// get document node from data provider
|
|
52
70
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
53
71
|
component: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
54
|
-
dispatchAnalyticsEvent: (_this$
|
|
72
|
+
dispatchAnalyticsEvent: (_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$analytics = _this$api3.analytics) === null || _this$api3$analytics === void 0 ? void 0 : _this$api3$analytics.actions.fireAnalyticsEvent,
|
|
55
73
|
fallbackComponent: null
|
|
56
74
|
}, /*#__PURE__*/React.createElement(SyncBlockActionsProvider
|
|
57
75
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
58
76
|
, {
|
|
59
|
-
removeSyncBlock: () => {
|
|
77
|
+
removeSyncBlock: isPerfEnabled ? this.removeSyncBlockStable : () => {
|
|
60
78
|
const pos = getPos();
|
|
61
79
|
if (pos !== undefined) {
|
|
62
80
|
removeSyncedBlockAtPos(this.api, pos);
|
|
@@ -64,19 +82,13 @@ export class SyncBlock extends ReactNodeView {
|
|
|
64
82
|
}
|
|
65
83
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
66
84
|
,
|
|
67
|
-
fetchSyncBlockSourceInfo: sourceAri => syncBlockStore.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri)
|
|
85
|
+
fetchSyncBlockSourceInfo: isPerfEnabled ? this.fetchSyncBlockSourceInfoStable : sourceAri => syncBlockStore.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri)
|
|
68
86
|
}, /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
|
|
69
|
-
localId:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
,
|
|
73
|
-
|
|
74
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
75
|
-
,
|
|
76
|
-
useFetchSyncBlockData: () => {
|
|
77
|
-
var _this$api3, _this$api3$analytics, _this$api3$analytics$;
|
|
78
|
-
return useFetchSyncBlockData(syncBlockStore, resourceId, localId, (_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$analytics = _this$api3.analytics) === null || _this$api3$analytics === void 0 ? void 0 : (_this$api3$analytics$ = _this$api3$analytics.actions) === null || _this$api3$analytics$ === void 0 ? void 0 : _this$api3$analytics$.fireAnalyticsEvent);
|
|
79
|
-
},
|
|
87
|
+
localId: localId,
|
|
88
|
+
resourceId: resourceId,
|
|
89
|
+
node: this.node,
|
|
90
|
+
syncBlockStore: syncBlockStore,
|
|
91
|
+
syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
|
|
80
92
|
api: this.api
|
|
81
93
|
})));
|
|
82
94
|
}
|
|
@@ -27,6 +27,13 @@ import { deferDispatch, wasExtensionInsertedInBodiedSyncBlock, sliceFullyContain
|
|
|
27
27
|
export const syncedBlockPluginKey = new PluginKey('syncedBlockPlugin');
|
|
28
28
|
const mapRetryCreationPosMap = (oldMap, newRetryCreationPos, mapPos) => {
|
|
29
29
|
const resourceId = newRetryCreationPos === null || newRetryCreationPos === void 0 ? void 0 : newRetryCreationPos.resourceId;
|
|
30
|
+
|
|
31
|
+
// Fast path: no new entry and nothing to remap — return the same reference.
|
|
32
|
+
// This is critical for PR-E (EDITOR-6929) which relies on reference equality
|
|
33
|
+
// to short-circuit SharedStateAPI deep-equality checks.
|
|
34
|
+
if (expValEquals('editor_synced_block_perf', 'isEnabled', true) && !resourceId && oldMap.size === 0) {
|
|
35
|
+
return oldMap;
|
|
36
|
+
}
|
|
30
37
|
const newMap = new Map(oldMap);
|
|
31
38
|
if (resourceId) {
|
|
32
39
|
const {
|
|
@@ -219,6 +226,9 @@ const buildStatusDecorations = (doc, syncBlockStore, isOffline, isViewMode, isDr
|
|
|
219
226
|
class: SyncBlockStateCssClassName.draggingClassName
|
|
220
227
|
}));
|
|
221
228
|
}
|
|
229
|
+
|
|
230
|
+
// only traverse the top-level node of the document, as syncBlock and bodiedSyncBlock are top-level nodes
|
|
231
|
+
return false;
|
|
222
232
|
});
|
|
223
233
|
return DecorationSet.create(doc, [...offlineDecorations, ...viewModeDecorations, ...loadingDecorations, ...dragDecorations]);
|
|
224
234
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
3
|
-
import { SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
3
|
+
import { SyncBlockError, useFetchSyncBlockData, useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider';
|
|
4
4
|
import { SyncBlockLabel } from './SyncBlockLabel';
|
|
5
5
|
const SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
|
|
6
6
|
const SyncBlockRendererWrapperComponent = ({
|
|
7
7
|
syncedBlockRenderer,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
syncBlockStore,
|
|
9
|
+
node,
|
|
10
|
+
resourceId,
|
|
10
11
|
localId,
|
|
11
12
|
api
|
|
12
13
|
}) => {
|
|
13
|
-
var _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3, _syncBlockFetchResult4, _syncBlockFetchResult5, _syncBlockFetchResult6;
|
|
14
|
-
const syncBlockFetchResult = useFetchSyncBlockData();
|
|
15
|
-
const title = useFetchSyncBlockTitle
|
|
14
|
+
var _api$analytics, _api$analytics$action, _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3, _syncBlockFetchResult4, _syncBlockFetchResult5, _syncBlockFetchResult6;
|
|
15
|
+
const syncBlockFetchResult = useFetchSyncBlockData(syncBlockStore, resourceId, localId, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent);
|
|
16
|
+
const title = useFetchSyncBlockTitle(syncBlockStore, node);
|
|
16
17
|
const contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 ? void 0 : (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 ? void 0 : (_syncBlockFetchResult2 = _syncBlockFetchResult.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.contentUpdatedAt;
|
|
17
18
|
const isUnpublishedBlock = ((_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 ? void 0 : (_syncBlockFetchResult4 = _syncBlockFetchResult3.data) === null || _syncBlockFetchResult4 === void 0 ? void 0 : _syncBlockFetchResult4.status) === 'unpublished';
|
|
18
19
|
const isUnsyncedBlock = isUnpublishedBlock || (syncBlockFetchResult === null || syncBlockFetchResult === void 0 ? void 0 : (_syncBlockFetchResult5 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult5 === void 0 ? void 0 : (_syncBlockFetchResult6 = _syncBlockFetchResult5.error) === null || _syncBlockFetchResult6 === void 0 ? void 0 : _syncBlockFetchResult6.type) === SyncBlockError.NotFound;
|
|
@@ -4,6 +4,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
4
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
5
|
import _get from "@babel/runtime/helpers/get";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
10
|
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
@@ -12,7 +13,7 @@ import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
|
12
13
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
13
14
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
14
15
|
import { SyncBlockSharedCssClassName, SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
|
|
15
|
-
import {
|
|
16
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
18
|
import { removeSyncedBlockAtPos } from '../editor-commands';
|
|
18
19
|
import { SyncBlockRendererWrapper } from '../ui/SyncBlockRendererWrapper';
|
|
@@ -21,6 +22,22 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
21
22
|
var _this;
|
|
22
23
|
_classCallCheck(this, SyncBlock);
|
|
23
24
|
_this = _callSuper(this, SyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
|
|
25
|
+
// Stable callback references — defined as arrow properties so they keep a
|
|
26
|
+
// fixed identity across render() calls, avoiding defeats of React.memo.
|
|
27
|
+
// The experiment gate lives in render(); these are always available.
|
|
28
|
+
_defineProperty(_this, "removeSyncBlockStable", function () {
|
|
29
|
+
var pos = _this.getPos();
|
|
30
|
+
if (pos !== undefined) {
|
|
31
|
+
removeSyncedBlockAtPos(_this.api, pos);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(_this, "fetchSyncBlockSourceInfoStable", function (sourceAri) {
|
|
35
|
+
var _this$api$syncedBlock, _this$api;
|
|
36
|
+
// store is guaranteed non-null: render() guards on syncBlockStore
|
|
37
|
+
// before these callbacks can be invoked.
|
|
38
|
+
var store = (_this$api$syncedBlock = (_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) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : _this.syncBlockStore;
|
|
39
|
+
return store ? store.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri) : Promise.resolve(undefined);
|
|
40
|
+
});
|
|
24
41
|
_this.options = props.options;
|
|
25
42
|
_this.api = props.api;
|
|
26
43
|
_this.syncBlockStore = props.syncBlockStore;
|
|
@@ -52,9 +69,9 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
52
69
|
key: "render",
|
|
53
70
|
value: function render(_ref) {
|
|
54
71
|
var _this$options,
|
|
55
|
-
_this$api$
|
|
56
|
-
_this$api,
|
|
72
|
+
_this$api$syncedBlock2,
|
|
57
73
|
_this$api2,
|
|
74
|
+
_this$api3,
|
|
58
75
|
_this2 = this,
|
|
59
76
|
_this$options2;
|
|
60
77
|
var getPos = _ref.getPos;
|
|
@@ -67,20 +84,21 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
67
84
|
if (!resourceId || !localId) {
|
|
68
85
|
return null;
|
|
69
86
|
}
|
|
70
|
-
var syncBlockStore = (_this$api$
|
|
87
|
+
var syncBlockStore = (_this$api$syncedBlock2 = (_this$api2 = this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.syncedBlock) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.sharedState.currentState()) === null || _this$api2 === void 0 ? void 0 : _this$api2.syncBlockStore) !== null && _this$api$syncedBlock2 !== void 0 ? _this$api$syncedBlock2 : this.syncBlockStore;
|
|
71
88
|
if (!syncBlockStore) {
|
|
72
89
|
return null;
|
|
73
90
|
}
|
|
91
|
+
var isPerfEnabled = expValEquals('editor_synced_block_perf', 'isEnabled', true);
|
|
74
92
|
|
|
75
93
|
// get document node from data provider
|
|
76
94
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
77
95
|
component: ACTION_SUBJECT.SYNCED_BLOCK,
|
|
78
|
-
dispatchAnalyticsEvent: (_this$
|
|
96
|
+
dispatchAnalyticsEvent: (_this$api3 = this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions.fireAnalyticsEvent,
|
|
79
97
|
fallbackComponent: null
|
|
80
98
|
}, /*#__PURE__*/React.createElement(SyncBlockActionsProvider
|
|
81
99
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
82
100
|
, {
|
|
83
|
-
removeSyncBlock: function
|
|
101
|
+
removeSyncBlock: isPerfEnabled ? this.removeSyncBlockStable : function () {
|
|
84
102
|
var pos = getPos();
|
|
85
103
|
if (pos !== undefined) {
|
|
86
104
|
removeSyncedBlockAtPos(_this2.api, pos);
|
|
@@ -88,23 +106,15 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
88
106
|
}
|
|
89
107
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
90
108
|
,
|
|
91
|
-
fetchSyncBlockSourceInfo: function
|
|
109
|
+
fetchSyncBlockSourceInfo: isPerfEnabled ? this.fetchSyncBlockSourceInfoStable : function (sourceAri) {
|
|
92
110
|
return syncBlockStore.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri);
|
|
93
111
|
}
|
|
94
112
|
}, /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
|
|
95
|
-
localId:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
,
|
|
99
|
-
|
|
100
|
-
return _useFetchSyncBlockTitle(syncBlockStore, _this2.node);
|
|
101
|
-
}
|
|
102
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
103
|
-
,
|
|
104
|
-
useFetchSyncBlockData: function useFetchSyncBlockData() {
|
|
105
|
-
var _this2$api;
|
|
106
|
-
return _useFetchSyncBlockData(syncBlockStore, resourceId, localId, (_this2$api = _this2.api) === null || _this2$api === void 0 || (_this2$api = _this2$api.analytics) === null || _this2$api === void 0 || (_this2$api = _this2$api.actions) === null || _this2$api === void 0 ? void 0 : _this2$api.fireAnalyticsEvent);
|
|
107
|
-
},
|
|
113
|
+
localId: localId,
|
|
114
|
+
resourceId: resourceId,
|
|
115
|
+
node: this.node,
|
|
116
|
+
syncBlockStore: syncBlockStore,
|
|
117
|
+
syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
|
|
108
118
|
api: this.api
|
|
109
119
|
})));
|
|
110
120
|
}
|
|
@@ -35,6 +35,13 @@ import { deferDispatch, wasExtensionInsertedInBodiedSyncBlock, sliceFullyContain
|
|
|
35
35
|
export var syncedBlockPluginKey = new PluginKey('syncedBlockPlugin');
|
|
36
36
|
var mapRetryCreationPosMap = function mapRetryCreationPosMap(oldMap, newRetryCreationPos, mapPos) {
|
|
37
37
|
var resourceId = newRetryCreationPos === null || newRetryCreationPos === void 0 ? void 0 : newRetryCreationPos.resourceId;
|
|
38
|
+
|
|
39
|
+
// Fast path: no new entry and nothing to remap — return the same reference.
|
|
40
|
+
// This is critical for PR-E (EDITOR-6929) which relies on reference equality
|
|
41
|
+
// to short-circuit SharedStateAPI deep-equality checks.
|
|
42
|
+
if (expValEquals('editor_synced_block_perf', 'isEnabled', true) && !resourceId && oldMap.size === 0) {
|
|
43
|
+
return oldMap;
|
|
44
|
+
}
|
|
38
45
|
var newMap = new Map(oldMap);
|
|
39
46
|
if (resourceId) {
|
|
40
47
|
var pos = newRetryCreationPos.pos;
|
|
@@ -235,6 +242,9 @@ var buildStatusDecorations = function buildStatusDecorations(doc, syncBlockStore
|
|
|
235
242
|
class: SyncBlockStateCssClassName.draggingClassName
|
|
236
243
|
}));
|
|
237
244
|
}
|
|
245
|
+
|
|
246
|
+
// only traverse the top-level node of the document, as syncBlock and bodiedSyncBlock are top-level nodes
|
|
247
|
+
return false;
|
|
238
248
|
});
|
|
239
249
|
return DecorationSet.create(doc, [].concat(offlineDecorations, viewModeDecorations, loadingDecorations, dragDecorations));
|
|
240
250
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
3
|
-
import { SyncBlockError } from '@atlaskit/editor-synced-block-provider';
|
|
3
|
+
import { SyncBlockError, useFetchSyncBlockData, useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider';
|
|
4
4
|
import { SyncBlockLabel } from './SyncBlockLabel';
|
|
5
5
|
var SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
|
|
6
6
|
var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperComponent(_ref) {
|
|
7
|
-
var _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3;
|
|
7
|
+
var _api$analytics, _syncBlockFetchResult, _syncBlockFetchResult2, _syncBlockFetchResult3;
|
|
8
8
|
var syncedBlockRenderer = _ref.syncedBlockRenderer,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
syncBlockStore = _ref.syncBlockStore,
|
|
10
|
+
node = _ref.node,
|
|
11
|
+
resourceId = _ref.resourceId,
|
|
11
12
|
localId = _ref.localId,
|
|
12
13
|
api = _ref.api;
|
|
13
|
-
var syncBlockFetchResult = useFetchSyncBlockData();
|
|
14
|
-
var title = useFetchSyncBlockTitle
|
|
14
|
+
var syncBlockFetchResult = useFetchSyncBlockData(syncBlockStore, resourceId, localId, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
|
|
15
|
+
var title = useFetchSyncBlockTitle(syncBlockStore, node);
|
|
15
16
|
var contentUpdatedAt = syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult === void 0 || (_syncBlockFetchResult = _syncBlockFetchResult.data) === null || _syncBlockFetchResult === void 0 ? void 0 : _syncBlockFetchResult.contentUpdatedAt;
|
|
16
17
|
var isUnpublishedBlock = ((_syncBlockFetchResult2 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult2 === void 0 || (_syncBlockFetchResult2 = _syncBlockFetchResult2.data) === null || _syncBlockFetchResult2 === void 0 ? void 0 : _syncBlockFetchResult2.status) === 'unpublished';
|
|
17
18
|
var isUnsyncedBlock = isUnpublishedBlock || (syncBlockFetchResult === null || syncBlockFetchResult === void 0 || (_syncBlockFetchResult3 = syncBlockFetchResult.syncBlockInstance) === null || _syncBlockFetchResult3 === void 0 || (_syncBlockFetchResult3 = _syncBlockFetchResult3.error) === null || _syncBlockFetchResult3 === void 0 ? void 0 : _syncBlockFetchResult3.type) === SyncBlockError.NotFound;
|
|
@@ -25,6 +25,8 @@ export declare class SyncBlock extends ReactNodeView<SyncBlockNodeViewProps> {
|
|
|
25
25
|
private api?;
|
|
26
26
|
private syncBlockStore?;
|
|
27
27
|
constructor(props: SyncBlockNodeViewProps);
|
|
28
|
+
private removeSyncBlockStable;
|
|
29
|
+
private fetchSyncBlockSourceInfoStable;
|
|
28
30
|
unsubscribe: (() => void) | undefined;
|
|
29
31
|
createDomRef(): HTMLElement;
|
|
30
32
|
validUpdate(currentNode: PMNode, newNode: PMNode): boolean;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
5
|
import type { SyncedBlockPlugin, SyncedBlockRendererProps } from '../syncedBlockPluginType';
|
|
5
6
|
type Props = {
|
|
6
7
|
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
7
8
|
localId: string;
|
|
9
|
+
node: PMNode;
|
|
10
|
+
resourceId: string;
|
|
11
|
+
syncBlockStore: SyncBlockStoreManager;
|
|
8
12
|
syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
|
|
9
|
-
useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
|
|
10
|
-
useFetchSyncBlockTitle: () => string | undefined;
|
|
11
13
|
};
|
|
12
|
-
export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer,
|
|
14
|
+
export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer, syncBlockStore, node, resourceId, localId, api, }: Props) => React.JSX.Element>;
|
|
13
15
|
export {};
|
|
@@ -25,6 +25,8 @@ export declare class SyncBlock extends ReactNodeView<SyncBlockNodeViewProps> {
|
|
|
25
25
|
private api?;
|
|
26
26
|
private syncBlockStore?;
|
|
27
27
|
constructor(props: SyncBlockNodeViewProps);
|
|
28
|
+
private removeSyncBlockStable;
|
|
29
|
+
private fetchSyncBlockSourceInfoStable;
|
|
28
30
|
unsubscribe: (() => void) | undefined;
|
|
29
31
|
createDomRef(): HTMLElement;
|
|
30
32
|
validUpdate(currentNode: PMNode, newNode: PMNode): boolean;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
|
|
4
5
|
import type { SyncedBlockPlugin, SyncedBlockRendererProps } from '../syncedBlockPluginType';
|
|
5
6
|
type Props = {
|
|
6
7
|
api?: ExtractInjectionAPI<SyncedBlockPlugin>;
|
|
7
8
|
localId: string;
|
|
9
|
+
node: PMNode;
|
|
10
|
+
resourceId: string;
|
|
11
|
+
syncBlockStore: SyncBlockStoreManager;
|
|
8
12
|
syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
|
|
9
|
-
useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
|
|
10
|
-
useFetchSyncBlockTitle: () => string | undefined;
|
|
11
13
|
};
|
|
12
|
-
export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer,
|
|
14
|
+
export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer, syncBlockStore, node, resourceId, localId, api, }: Props) => React.JSX.Element>;
|
|
13
15
|
export {};
|
package/docs/0-intro.tsx
CHANGED
|
@@ -13,14 +13,14 @@ ${createEditorUseOnlyNotice('Editor Plugin Synced Block', [
|
|
|
13
13
|
])}
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
${
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
${(
|
|
17
|
+
<>
|
|
18
|
+
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}
|
|
19
19
|
<div style={{ marginTop: token('space.100') }}>
|
|
20
20
|
<AtlassianInternalWarning />
|
|
21
21
|
</div>
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
</>
|
|
23
|
+
)}
|
|
24
24
|
|
|
25
25
|
This package includes the synced block plugin used by \`@atlaskit/editor-core\`.
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.14",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^52.
|
|
31
|
+
"@atlaskit/adf-schema": "^52.11.0",
|
|
32
32
|
"@atlaskit/button": "23.11.4",
|
|
33
33
|
"@atlaskit/dropdown-menu": "16.8.10",
|
|
34
34
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^10.0.0",
|
|
36
|
-
"@atlaskit/editor-plugin-block-menu": "^9.
|
|
36
|
+
"@atlaskit/editor-plugin-block-menu": "^9.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-connectivity": "10.0.1",
|
|
38
38
|
"@atlaskit/editor-plugin-content-format": "^4.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^10.0.0",
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
46
46
|
"@atlaskit/editor-synced-block-provider": "^6.5.0",
|
|
47
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
47
|
+
"@atlaskit/editor-toolbar": "^1.1.0",
|
|
48
48
|
"@atlaskit/flag": "^17.11.0",
|
|
49
49
|
"@atlaskit/icon": "34.5.0",
|
|
50
|
-
"@atlaskit/icon-lab": "^6.
|
|
50
|
+
"@atlaskit/icon-lab": "^6.9.0",
|
|
51
51
|
"@atlaskit/logo": "^20.1.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.8.0",
|
|
53
53
|
"@atlaskit/modal-dialog": "^15.0.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^19.0.0",
|
|
56
56
|
"@atlaskit/spinner": "19.1.2",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^78.0.0",
|
|
58
58
|
"@atlaskit/tokens": "13.0.4",
|
|
59
59
|
"@atlaskit/tooltip": "^22.1.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.1.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"date-fns": "^2.17.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^114.
|
|
67
|
+
"@atlaskit/editor-common": "^114.28.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
70
70
|
},
|