@atlaskit/editor-common 134.5.1 → 134.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 134.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b15354550dd8a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b15354550dd8a) -
8
+ Add `LocalOnlyStep` (`@atlaskit/editor-common/collab-local-only-step`), a base class for steps
9
+ that change no document content and are never sent to collaborators, so settings stored outside
10
+ ADF can be undone.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 134.5.1
4
17
 
5
18
  ### Patch Changes
@@ -12536,8 +12549,8 @@
12536
12549
  ### Patch Changes
12537
12550
 
12538
12551
  - [#171482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/171482)
12539
- [`aaa3084f0ce5e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aaa3084f0ce5e) - \*
12540
- I18n translations, see
12552
+ [`aaa3084f0ce5e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aaa3084f0ce5e) -
12553
+ \* I18n translations, see
12541
12554
  [commit](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/445044272c9e6779d186874b3e2e7ad714a13457)
12542
12555
  - [#169039](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/169039)
12543
12556
  [`d2488752fcad8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d2488752fcad8) -
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/collab-local-only-step",
3
+ "main": "../dist/cjs/collab/local-only-step.js",
4
+ "module": "../dist/esm/collab/local-only-step.js",
5
+ "module:es2019": "../dist/es2019/collab/local-only-step.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/collab/local-only-step.d.ts"
10
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.LocalOnlyStep = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+ var _transform = require("@atlaskit/editor-prosemirror/transform");
14
+ var _transformOverride = require("@atlaskit/editor-prosemirror/transform-override");
15
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
16
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
+ /**
18
+ * A step that never changes the document and is never sent to collaborators.
19
+ *
20
+ * Use it to put a change that lives outside ADF, such as a page setting, into the local undo
21
+ * history: undo history only records steps. The collab plugin drops these steps before it sends,
22
+ * rebases or counts changes, the same way it drops analytics steps. Collaborators learn about the
23
+ * change some other way, for example through the product's own sync.
24
+ */
25
+ var LocalOnlyStep = exports.LocalOnlyStep = /*#__PURE__*/function (_Step) {
26
+ function LocalOnlyStep() {
27
+ (0, _classCallCheck2.default)(this, LocalOnlyStep);
28
+ return _callSuper(this, LocalOnlyStep, arguments);
29
+ }
30
+ (0, _inherits2.default)(LocalOnlyStep, _Step);
31
+ return (0, _createClass2.default)(LocalOnlyStep, [{
32
+ key: "apply",
33
+ value: function apply(doc) {
34
+ return _transform.StepResult.ok(doc);
35
+ }
36
+
37
+ /** Covers no range, so history never groups it with content edits. */
38
+ }, {
39
+ key: "getMap",
40
+ value: function getMap() {
41
+ return _transform.StepMap.empty;
42
+ }
43
+
44
+ /** Has no positions, so mapping through other changes leaves it as is. */
45
+ }, {
46
+ key: "map",
47
+ value: function map() {
48
+ return this;
49
+ }
50
+ }, {
51
+ key: "merge",
52
+ value: function merge() {
53
+ return null;
54
+ }
55
+ }]);
56
+ }(_transformOverride.Step);
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "134.5.0";
30
+ var packageVersion = "134.5.1";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "134.5.0";
26
+ var packageVersion = "134.5.1";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -0,0 +1,29 @@
1
+ import { StepMap, StepResult } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Step } from '@atlaskit/editor-prosemirror/transform-override';
3
+
4
+ /**
5
+ * A step that never changes the document and is never sent to collaborators.
6
+ *
7
+ * Use it to put a change that lives outside ADF, such as a page setting, into the local undo
8
+ * history: undo history only records steps. The collab plugin drops these steps before it sends,
9
+ * rebases or counts changes, the same way it drops analytics steps. Collaborators learn about the
10
+ * change some other way, for example through the product's own sync.
11
+ */
12
+ export class LocalOnlyStep extends Step {
13
+ apply(doc) {
14
+ return StepResult.ok(doc);
15
+ }
16
+
17
+ /** Covers no range, so history never groups it with content edits. */
18
+ getMap() {
19
+ return StepMap.empty;
20
+ }
21
+
22
+ /** Has no positions, so mapping through other changes leaves it as is. */
23
+ map() {
24
+ return this;
25
+ }
26
+ merge() {
27
+ return null;
28
+ }
29
+ }
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "134.5.0";
16
+ const packageVersion = "134.5.1";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "134.5.0";
16
+ const packageVersion = "134.5.1";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -0,0 +1,50 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
+ import { StepMap, StepResult } from '@atlaskit/editor-prosemirror/transform';
9
+ import { Step } from '@atlaskit/editor-prosemirror/transform-override';
10
+
11
+ /**
12
+ * A step that never changes the document and is never sent to collaborators.
13
+ *
14
+ * Use it to put a change that lives outside ADF, such as a page setting, into the local undo
15
+ * history: undo history only records steps. The collab plugin drops these steps before it sends,
16
+ * rebases or counts changes, the same way it drops analytics steps. Collaborators learn about the
17
+ * change some other way, for example through the product's own sync.
18
+ */
19
+ export var LocalOnlyStep = /*#__PURE__*/function (_Step) {
20
+ function LocalOnlyStep() {
21
+ _classCallCheck(this, LocalOnlyStep);
22
+ return _callSuper(this, LocalOnlyStep, arguments);
23
+ }
24
+ _inherits(LocalOnlyStep, _Step);
25
+ return _createClass(LocalOnlyStep, [{
26
+ key: "apply",
27
+ value: function apply(doc) {
28
+ return StepResult.ok(doc);
29
+ }
30
+
31
+ /** Covers no range, so history never groups it with content edits. */
32
+ }, {
33
+ key: "getMap",
34
+ value: function getMap() {
35
+ return StepMap.empty;
36
+ }
37
+
38
+ /** Has no positions, so mapping through other changes leaves it as is. */
39
+ }, {
40
+ key: "map",
41
+ value: function map() {
42
+ return this;
43
+ }
44
+ }, {
45
+ key: "merge",
46
+ value: function merge() {
47
+ return null;
48
+ }
49
+ }]);
50
+ }(Step);
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "134.5.0";
22
+ var packageVersion = "134.5.1";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "134.5.0";
23
+ var packageVersion = "134.5.1";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -0,0 +1,19 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { StepMap, StepResult } from '@atlaskit/editor-prosemirror/transform';
3
+ import { Step } from '@atlaskit/editor-prosemirror/transform-override';
4
+ /**
5
+ * A step that never changes the document and is never sent to collaborators.
6
+ *
7
+ * Use it to put a change that lives outside ADF, such as a page setting, into the local undo
8
+ * history: undo history only records steps. The collab plugin drops these steps before it sends,
9
+ * rebases or counts changes, the same way it drops analytics steps. Collaborators learn about the
10
+ * change some other way, for example through the product's own sync.
11
+ */
12
+ export declare abstract class LocalOnlyStep extends Step {
13
+ apply(doc: PMNode): StepResult;
14
+ /** Covers no range, so history never groups it with content edits. */
15
+ getMap(): StepMap;
16
+ /** Has no positions, so mapping through other changes leaves it as is. */
17
+ map(): Step;
18
+ merge(): null;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "134.5.1",
3
+ "version": "134.6.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"