@atlaskit/editor-plugin-collab-edit 29.0.1 → 30.0.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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 30.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 29.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`31dd8d40ffba2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31dd8d40ffba2) -
|
|
14
|
+
Cleanup `experiment` `cc-markdown-mode`. Markdown mode is unshipped: the markdown schema rebuild,
|
|
15
|
+
source-view toolbar bridge, and markdown-mode layout paths are removed.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 29.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -7,9 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.initialize = void 0;
|
|
8
8
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
9
9
|
var _transformOverride = require("@atlaskit/editor-prosemirror/transform-override");
|
|
10
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var _pluginKey = require("../main/plugin-key");
|
|
12
|
-
var _trackNcsInitialization = require("../track-ncs-initialization");
|
|
13
11
|
var _handlers = require("./handlers");
|
|
14
12
|
var initCollab = function initCollab(collabEditProvider, view) {
|
|
15
13
|
if (collabEditProvider.initialize) {
|
|
@@ -58,51 +56,6 @@ var initialize = exports.initialize = function initialize(_ref) {
|
|
|
58
56
|
*/
|
|
59
57
|
initCollabMemo(provider, view);
|
|
60
58
|
}
|
|
61
|
-
|
|
62
|
-
// Rebind path: if the provider has already initialised (i.e. this view()
|
|
63
|
-
// is running because the editor preset was reconfigured or the EditorView
|
|
64
|
-
// was recreated mid-session, e.g. on a rich-text → markdown-mode flip),
|
|
65
|
-
// the provider's `init` event has already fired and won't fire again.
|
|
66
|
-
// Without intervention the freshly-attached collab plugin view never sees
|
|
67
|
-
// `collabInitialised`, so `filterTransaction` silently drops every
|
|
68
|
-
// doc-changing transaction and the editor appears read-only.
|
|
69
|
-
//
|
|
70
|
-
// PM `state.reconfigure` preserves plugin state by key, so in many cases
|
|
71
|
-
// the plugin state survives and no action is needed; we only seed when
|
|
72
|
-
// state was actually lost (e.g. EditorView recreated from scratch).
|
|
73
|
-
//
|
|
74
|
-
// Gated behind `cc-markdown-mode` (the same experiment that drives the
|
|
75
|
-
// preset rebuild on convert); when off, behaviour is unchanged. Uses
|
|
76
|
-
// `expValEquals` (not `*NoExposure`) so the editor's statsig client
|
|
77
|
-
// enrols the user — otherwise an early rebind can race the FE-side
|
|
78
|
-
// exposure and read the default (false), defeating the gate. The
|
|
79
|
-
// experiment check is last so legacy providers (no `getInitPayload`)
|
|
80
|
-
// short-circuit and don't fire an exposure.
|
|
81
|
-
if (provider.getInitPayload && (0, _expValEquals.expValEquals)('cc-markdown-mode', 'isEnabled', true)) {
|
|
82
|
-
var cachedInit = provider.getInitPayload();
|
|
83
|
-
if (cachedInit) {
|
|
84
|
-
// Defer one microtask so the new pluginView is fully registered
|
|
85
|
-
// before we dispatch (mirrors the timing of a real `init` event).
|
|
86
|
-
Promise.resolve().then(function () {
|
|
87
|
-
if (view.isDestroyed) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
var currentCollabState = _pluginKey.pluginKey.getState(view.state);
|
|
91
|
-
var currentTrackState = _trackNcsInitialization.trackNCSInitializationPluginKey.getState(view.state);
|
|
92
|
-
// State was preserved across reconfigure → nothing to do.
|
|
93
|
-
if (currentCollabState !== null && currentCollabState !== void 0 && currentCollabState.isReady && currentTrackState !== null && currentTrackState !== void 0 && currentTrackState.collabInitialisedAt) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
// Seed the freshly-attached pluginView so `isReady` flips to true,
|
|
97
|
-
// `data-has-collab-initialised` becomes "true", and downstream
|
|
98
|
-
// listeners (analytics, sweet-state, track-ncs) re-receive init.
|
|
99
|
-
// Note: we intentionally do NOT replay `handleInit` (which would
|
|
100
|
-
// call `replaceDocument`) — the document is already in the editor
|
|
101
|
-
// and replacing it would clobber any in-flight local steps.
|
|
102
|
-
view.dispatch(view.state.tr.setMeta('collabInitialised', true));
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
59
|
return cleanup;
|
|
107
60
|
};
|
|
108
61
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
2
|
import { Step } from '@atlaskit/editor-prosemirror/transform-override';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
import { pluginKey } from '../main/plugin-key';
|
|
5
|
-
import { trackNCSInitializationPluginKey } from '../track-ncs-initialization';
|
|
6
4
|
import { subscribe } from './handlers';
|
|
7
5
|
const initCollab = (collabEditProvider, view) => {
|
|
8
6
|
if (collabEditProvider.initialize) {
|
|
@@ -45,50 +43,5 @@ export const initialize = ({
|
|
|
45
43
|
*/
|
|
46
44
|
initCollabMemo(provider, view);
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
// Rebind path: if the provider has already initialised (i.e. this view()
|
|
50
|
-
// is running because the editor preset was reconfigured or the EditorView
|
|
51
|
-
// was recreated mid-session, e.g. on a rich-text → markdown-mode flip),
|
|
52
|
-
// the provider's `init` event has already fired and won't fire again.
|
|
53
|
-
// Without intervention the freshly-attached collab plugin view never sees
|
|
54
|
-
// `collabInitialised`, so `filterTransaction` silently drops every
|
|
55
|
-
// doc-changing transaction and the editor appears read-only.
|
|
56
|
-
//
|
|
57
|
-
// PM `state.reconfigure` preserves plugin state by key, so in many cases
|
|
58
|
-
// the plugin state survives and no action is needed; we only seed when
|
|
59
|
-
// state was actually lost (e.g. EditorView recreated from scratch).
|
|
60
|
-
//
|
|
61
|
-
// Gated behind `cc-markdown-mode` (the same experiment that drives the
|
|
62
|
-
// preset rebuild on convert); when off, behaviour is unchanged. Uses
|
|
63
|
-
// `expValEquals` (not `*NoExposure`) so the editor's statsig client
|
|
64
|
-
// enrols the user — otherwise an early rebind can race the FE-side
|
|
65
|
-
// exposure and read the default (false), defeating the gate. The
|
|
66
|
-
// experiment check is last so legacy providers (no `getInitPayload`)
|
|
67
|
-
// short-circuit and don't fire an exposure.
|
|
68
|
-
if (provider.getInitPayload && expValEquals('cc-markdown-mode', 'isEnabled', true)) {
|
|
69
|
-
const cachedInit = provider.getInitPayload();
|
|
70
|
-
if (cachedInit) {
|
|
71
|
-
// Defer one microtask so the new pluginView is fully registered
|
|
72
|
-
// before we dispatch (mirrors the timing of a real `init` event).
|
|
73
|
-
Promise.resolve().then(() => {
|
|
74
|
-
if (view.isDestroyed) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const currentCollabState = pluginKey.getState(view.state);
|
|
78
|
-
const currentTrackState = trackNCSInitializationPluginKey.getState(view.state);
|
|
79
|
-
// State was preserved across reconfigure → nothing to do.
|
|
80
|
-
if (currentCollabState !== null && currentCollabState !== void 0 && currentCollabState.isReady && currentTrackState !== null && currentTrackState !== void 0 && currentTrackState.collabInitialisedAt) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
// Seed the freshly-attached pluginView so `isReady` flips to true,
|
|
84
|
-
// `data-has-collab-initialised` becomes "true", and downstream
|
|
85
|
-
// listeners (analytics, sweet-state, track-ncs) re-receive init.
|
|
86
|
-
// Note: we intentionally do NOT replay `handleInit` (which would
|
|
87
|
-
// call `replaceDocument`) — the document is already in the editor
|
|
88
|
-
// and replacing it would clobber any in-flight local steps.
|
|
89
|
-
view.dispatch(view.state.tr.setMeta('collabInitialised', true));
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
46
|
return cleanup;
|
|
94
47
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
2
|
import { Step } from '@atlaskit/editor-prosemirror/transform-override';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
import { pluginKey } from '../main/plugin-key';
|
|
5
|
-
import { trackNCSInitializationPluginKey } from '../track-ncs-initialization';
|
|
6
4
|
import { subscribe } from './handlers';
|
|
7
5
|
var initCollab = function initCollab(collabEditProvider, view) {
|
|
8
6
|
if (collabEditProvider.initialize) {
|
|
@@ -51,51 +49,6 @@ export var initialize = function initialize(_ref) {
|
|
|
51
49
|
*/
|
|
52
50
|
initCollabMemo(provider, view);
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
// Rebind path: if the provider has already initialised (i.e. this view()
|
|
56
|
-
// is running because the editor preset was reconfigured or the EditorView
|
|
57
|
-
// was recreated mid-session, e.g. on a rich-text → markdown-mode flip),
|
|
58
|
-
// the provider's `init` event has already fired and won't fire again.
|
|
59
|
-
// Without intervention the freshly-attached collab plugin view never sees
|
|
60
|
-
// `collabInitialised`, so `filterTransaction` silently drops every
|
|
61
|
-
// doc-changing transaction and the editor appears read-only.
|
|
62
|
-
//
|
|
63
|
-
// PM `state.reconfigure` preserves plugin state by key, so in many cases
|
|
64
|
-
// the plugin state survives and no action is needed; we only seed when
|
|
65
|
-
// state was actually lost (e.g. EditorView recreated from scratch).
|
|
66
|
-
//
|
|
67
|
-
// Gated behind `cc-markdown-mode` (the same experiment that drives the
|
|
68
|
-
// preset rebuild on convert); when off, behaviour is unchanged. Uses
|
|
69
|
-
// `expValEquals` (not `*NoExposure`) so the editor's statsig client
|
|
70
|
-
// enrols the user — otherwise an early rebind can race the FE-side
|
|
71
|
-
// exposure and read the default (false), defeating the gate. The
|
|
72
|
-
// experiment check is last so legacy providers (no `getInitPayload`)
|
|
73
|
-
// short-circuit and don't fire an exposure.
|
|
74
|
-
if (provider.getInitPayload && expValEquals('cc-markdown-mode', 'isEnabled', true)) {
|
|
75
|
-
var cachedInit = provider.getInitPayload();
|
|
76
|
-
if (cachedInit) {
|
|
77
|
-
// Defer one microtask so the new pluginView is fully registered
|
|
78
|
-
// before we dispatch (mirrors the timing of a real `init` event).
|
|
79
|
-
Promise.resolve().then(function () {
|
|
80
|
-
if (view.isDestroyed) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
var currentCollabState = pluginKey.getState(view.state);
|
|
84
|
-
var currentTrackState = trackNCSInitializationPluginKey.getState(view.state);
|
|
85
|
-
// State was preserved across reconfigure → nothing to do.
|
|
86
|
-
if (currentCollabState !== null && currentCollabState !== void 0 && currentCollabState.isReady && currentTrackState !== null && currentTrackState !== void 0 && currentTrackState.collabInitialisedAt) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
// Seed the freshly-attached pluginView so `isReady` flips to true,
|
|
90
|
-
// `data-has-collab-initialised` becomes "true", and downstream
|
|
91
|
-
// listeners (analytics, sweet-state, track-ncs) re-receive init.
|
|
92
|
-
// Note: we intentionally do NOT replay `handleInit` (which would
|
|
93
|
-
// call `replaceDocument`) — the document is already in the editor
|
|
94
|
-
// and replacing it would clobber any in-flight local steps.
|
|
95
|
-
view.dispatch(view.state.tr.setMeta('collabInitialised', true));
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
52
|
return cleanup;
|
|
100
53
|
};
|
|
101
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.0.0",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"@atlaskit/adf-schema": "^57.7.0",
|
|
23
23
|
"@atlaskit/custom-steps": "^1.1.0",
|
|
24
24
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
25
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
26
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
27
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
28
|
-
"@atlaskit/editor-plugin-feature-flags": "^
|
|
25
|
+
"@atlaskit/editor-plugin-analytics": "^29.0.0",
|
|
26
|
+
"@atlaskit/editor-plugin-connectivity": "^29.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^31.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-feature-flags": "^28.0.0",
|
|
29
29
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
30
30
|
"@atlaskit/editor-shared-styles": "^4.5.0",
|
|
31
31
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
33
33
|
"@atlaskit/prosemirror-collab": "^1.1.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^242.0.0",
|
|
35
35
|
"@atlaskit/tokens": "^20.6.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"memoize-one": "^6.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^133.0.0",
|
|
41
41
|
"react": "^18.2.0 || ^19.2.0",
|
|
42
42
|
"react-dom": "^18.2.0 || ^19.2.0"
|
|
43
43
|
},
|