@atlaskit/editor-common 105.8.3 → 105.8.4

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,15 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 105.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#158239](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158239)
8
+ [`c2caa0af876e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2caa0af876e0) -
9
+ [ux] ED-28028 add breakout mark to expands, codeblocks and layouts for new resizing experience
10
+ behind the platform_editor_breakout_resizing experiment
11
+ - Updated dependencies
12
+
3
13
  ## 105.8.3
4
14
 
5
15
  ### Patch Changes
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "105.8.3";
20
+ var packageVersion = "105.8.4";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // 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 = "105.8.3";
26
+ var packageVersion = "105.8.4";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -9,8 +9,9 @@ exports.getStepRange = void 0;
9
9
  exports.hasDocAsParent = hasDocAsParent;
10
10
  exports.hasVisibleContent = hasVisibleContent;
11
11
  exports.isEmptyDocument = isEmptyDocument;
12
- exports.isSelectionEndOfParagraph = void 0;
12
+ exports.isSelectionEndOfParagraph = exports.isReplaceDocOperation = void 0;
13
13
  exports.nodesBetweenChanged = nodesBetweenChanged;
14
+ var _transform = require("@atlaskit/editor-prosemirror/transform");
14
15
  var _editorCoreUtils = require("./editor-core-utils");
15
16
  var getStepRange = exports.getStepRange = function getStepRange(transaction) {
16
17
  var from = -1;
@@ -122,4 +123,26 @@ function getChangedNodes(tr) {
122
123
  tr: tr,
123
124
  doc: tr.doc
124
125
  });
125
- }
126
+ }
127
+ // When document first load in Confluence, initially it is an empty document
128
+ // and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
129
+ // isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
130
+ var isReplaceDocOperation = exports.isReplaceDocOperation = function isReplaceDocOperation(transactions, oldState) {
131
+ return transactions.some(function (tr) {
132
+ if (tr.getMeta('replaceDocument')) {
133
+ return true;
134
+ }
135
+ var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
136
+ if (!(step instanceof _transform.ReplaceStep)) {
137
+ return false;
138
+ }
139
+ var isStepReplacingFromDocStart = step.from === 0;
140
+ var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
141
+ if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
142
+ return false;
143
+ }
144
+ return true;
145
+ });
146
+ return hasStepReplacingEntireDocument;
147
+ });
148
+ };
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "105.8.3";
4
+ const packageVersion = "105.8.4";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // 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 = "105.8.3";
16
+ const packageVersion = "105.8.4";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -1,3 +1,4 @@
1
+ import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
1
2
  import { isEmptyParagraph } from './editor-core-utils';
2
3
  export const getStepRange = transaction => {
3
4
  let from = -1;
@@ -111,4 +112,26 @@ export function getChangedNodes(tr) {
111
112
  tr: tr,
112
113
  doc: tr.doc
113
114
  });
114
- }
115
+ }
116
+ // When document first load in Confluence, initially it is an empty document
117
+ // and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
118
+ // isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
119
+ export const isReplaceDocOperation = (transactions, oldState) => {
120
+ return transactions.some(tr => {
121
+ if (tr.getMeta('replaceDocument')) {
122
+ return true;
123
+ }
124
+ const hasStepReplacingEntireDocument = tr.steps.some(step => {
125
+ if (!(step instanceof ReplaceStep)) {
126
+ return false;
127
+ }
128
+ const isStepReplacingFromDocStart = step.from === 0;
129
+ const isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
130
+ if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
131
+ return false;
132
+ }
133
+ return true;
134
+ });
135
+ return hasStepReplacingEntireDocument;
136
+ });
137
+ };
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "105.8.3";
10
+ var packageVersion = "105.8.4";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // 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 = "105.8.3";
23
+ var packageVersion = "105.8.4";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -1,3 +1,4 @@
1
+ import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
1
2
  import { isEmptyParagraph } from './editor-core-utils';
2
3
  export var getStepRange = function getStepRange(transaction) {
3
4
  var from = -1;
@@ -109,4 +110,26 @@ export function getChangedNodes(tr) {
109
110
  tr: tr,
110
111
  doc: tr.doc
111
112
  });
112
- }
113
+ }
114
+ // When document first load in Confluence, initially it is an empty document
115
+ // and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
116
+ // isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
117
+ export var isReplaceDocOperation = function isReplaceDocOperation(transactions, oldState) {
118
+ return transactions.some(function (tr) {
119
+ if (tr.getMeta('replaceDocument')) {
120
+ return true;
121
+ }
122
+ var hasStepReplacingEntireDocument = tr.steps.some(function (step) {
123
+ if (!(step instanceof ReplaceStep)) {
124
+ return false;
125
+ }
126
+ var isStepReplacingFromDocStart = step.from === 0;
127
+ var isStepReplacingUntilTheEndOfDocument = step.to === oldState.doc.content.size;
128
+ if (!isStepReplacingFromDocStart || !isStepReplacingUntilTheEndOfDocument) {
129
+ return false;
130
+ }
131
+ return true;
132
+ });
133
+ return hasStepReplacingEntireDocument;
134
+ });
135
+ };
@@ -21,4 +21,5 @@ export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction):
21
21
  node: Node;
22
22
  pos: number;
23
23
  }[];
24
+ export declare const isReplaceDocOperation: (transactions: readonly Transaction[], oldState: EditorState) => boolean;
24
25
  export {};
@@ -21,4 +21,5 @@ export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction):
21
21
  node: Node;
22
22
  pos: number;
23
23
  }[];
24
+ export declare const isReplaceDocOperation: (transactions: readonly Transaction[], oldState: EditorState) => boolean;
24
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "105.8.3",
3
+ "version": "105.8.4",
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/"