@atlaskit/editor-plugin-collab-edit 0.1.9 → 0.1.11

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,17 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 0.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#72026](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72026) [`0a0cc061a8a7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0a0cc061a8a7) - [No Issue] Improve Confluence Integration tests precision with data-has-collab-initialised
8
+
9
+ ## 0.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [#71133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71133) [`22d7f6ed1f02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/22d7f6ed1f02) - revert prosemirror-collab unfork
14
+
3
15
  ## 0.1.9
4
16
 
5
17
  ### Patch Changes
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.handleTelePointer = exports.handlePresence = exports.handleInit = exports.handleConnection = exports.getSendableSelection = exports.applyRemoteSteps = exports.applyRemoteData = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _prosemirrorCollab = require("prosemirror-collab");
10
9
  var _state = require("@atlaskit/editor-prosemirror/state");
11
10
  var _transform = require("@atlaskit/editor-prosemirror/transform");
11
+ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
12
12
  var _utils = require("./utils");
13
13
  var handleInit = exports.handleInit = function handleInit(initData, view, options) {
14
14
  var doc = initData.doc,
@@ -8,7 +8,7 @@ exports.collabEditPlugin = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
- var _prosemirrorCollab = require("prosemirror-collab");
11
+ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
12
12
  var _analytics = require("./analytics");
13
13
  var _sendTransaction = require("./events/send-transaction");
14
14
  var _main = require("./pm-plugins/main");
@@ -97,7 +97,8 @@ var collabEditPlugin = exports.collabEditPlugin = function collabEditPlugin(_ref
97
97
  var _ref3 = options || {},
98
98
  _ref3$useNativePlugin = _ref3.useNativePlugin,
99
99
  useNativePlugin = _ref3$useNativePlugin === void 0 ? false : _ref3$useNativePlugin,
100
- userId = _ref3.userId;
100
+ _ref3$userId = _ref3.userId,
101
+ userId = _ref3$userId === void 0 ? null : _ref3$userId;
101
102
  return [].concat((0, _toConsumableArray2.default)(useNativePlugin ? [{
102
103
  name: 'pmCollab',
103
104
  plugin: function plugin() {
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.trackNCSInitializationPluginKey = exports.createPlugin = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _collab = require("@atlaskit/editor-common/collab");
8
10
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
11
  var _state = require("@atlaskit/editor-prosemirror/state");
@@ -44,6 +46,12 @@ var createPlugin = exports.createPlugin = function createPlugin() {
44
46
  }
45
47
  return prevPluginState;
46
48
  }
49
+ },
50
+ props: {
51
+ attributes: function attributes(editorState) {
52
+ var trackPluginState = trackNCSInitializationPluginKey.getState(editorState);
53
+ return (0, _defineProperty2.default)({}, 'data-has-collab-initialised', "".concat(Boolean(trackPluginState === null || trackPluginState === void 0 ? void 0 : trackPluginState.collabInitialisedAt)));
54
+ }
47
55
  }
48
56
  });
49
57
  };
@@ -1,6 +1,6 @@
1
- import { receiveTransaction } from 'prosemirror-collab';
2
1
  import { AllSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
2
  import { Step } from '@atlaskit/editor-prosemirror/transform';
3
+ import { receiveTransaction } from '@atlaskit/prosemirror-collab';
4
4
  import { replaceDocument } from './utils';
5
5
  export const handleInit = (initData, view, options) => {
6
6
  const {
@@ -1,4 +1,4 @@
1
- import { collab } from 'prosemirror-collab';
1
+ import { collab } from '@atlaskit/prosemirror-collab';
2
2
  import { addSynchronyErrorAnalytics } from './analytics';
3
3
  import { sendTransaction } from './events/send-transaction';
4
4
  import { createPlugin } from './pm-plugins/main';
@@ -62,7 +62,7 @@ export const collabEditPlugin = ({
62
62
  pmPlugins() {
63
63
  const {
64
64
  useNativePlugin = false,
65
- userId
65
+ userId = null
66
66
  } = options || {};
67
67
  return [...(useNativePlugin ? [{
68
68
  name: 'pmCollab',
@@ -38,6 +38,14 @@ export const createPlugin = () => {
38
38
  }
39
39
  return prevPluginState;
40
40
  }
41
+ },
42
+ props: {
43
+ attributes(editorState) {
44
+ const trackPluginState = trackNCSInitializationPluginKey.getState(editorState);
45
+ return {
46
+ ['data-has-collab-initialised']: `${Boolean(trackPluginState === null || trackPluginState === void 0 ? void 0 : trackPluginState.collabInitialisedAt)}`
47
+ };
48
+ }
41
49
  }
42
50
  });
43
51
  };
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { receiveTransaction } from 'prosemirror-collab';
3
2
  import { AllSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
3
  import { Step } from '@atlaskit/editor-prosemirror/transform';
4
+ import { receiveTransaction } from '@atlaskit/prosemirror-collab';
5
5
  import { replaceDocument } from './utils';
6
6
  export var handleInit = function handleInit(initData, view, options) {
7
7
  var doc = initData.doc,
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- import { collab } from 'prosemirror-collab';
4
+ import { collab } from '@atlaskit/prosemirror-collab';
5
5
  import { addSynchronyErrorAnalytics } from './analytics';
6
6
  import { sendTransaction } from './events/send-transaction';
7
7
  import { createPlugin } from './pm-plugins/main';
@@ -90,7 +90,8 @@ export var collabEditPlugin = function collabEditPlugin(_ref2) {
90
90
  var _ref3 = options || {},
91
91
  _ref3$useNativePlugin = _ref3.useNativePlugin,
92
92
  useNativePlugin = _ref3$useNativePlugin === void 0 ? false : _ref3$useNativePlugin,
93
- userId = _ref3.userId;
93
+ _ref3$userId = _ref3.userId,
94
+ userId = _ref3$userId === void 0 ? null : _ref3$userId;
94
95
  return [].concat(_toConsumableArray(useNativePlugin ? [{
95
96
  name: 'pmCollab',
96
97
  plugin: function plugin() {
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import { isDirtyTransaction } from '@atlaskit/editor-common/collab';
2
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
@@ -38,6 +39,12 @@ export var createPlugin = function createPlugin() {
38
39
  }
39
40
  return prevPluginState;
40
41
  }
42
+ },
43
+ props: {
44
+ attributes: function attributes(editorState) {
45
+ var trackPluginState = trackNCSInitializationPluginKey.getState(editorState);
46
+ return _defineProperty({}, 'data-has-collab-initialised', "".concat(Boolean(trackPluginState === null || trackPluginState === void 0 ? void 0 : trackPluginState.collabInitialisedAt)));
47
+ }
41
48
  }
42
49
  });
43
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,9 +36,9 @@
36
36
  "@atlaskit/editor-plugin-analytics": "0.4.7",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
38
38
  "@atlaskit/editor-prosemirror": "3.0.0",
39
+ "@atlaskit/prosemirror-collab": "^0.2.0",
39
40
  "@babel/runtime": "^7.0.0",
40
- "memoize-one": "^6.0.0",
41
- "prosemirror-collab": "1.3.1"
41
+ "memoize-one": "^6.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "^16.8.0"