@atlaskit/editor-common 96.0.0 → 96.0.2

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,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 96.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#172333](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172333)
8
+ [`e5c206f3f7783`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5c206f3f7783) -
9
+ [ux] ED-25533 Set default size of nested tables to 2x2
10
+
11
+ ## 96.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#169716](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169716)
16
+ [`4fbd1fe0084b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4fbd1fe0084b3) -
17
+ ED-25072 update and insert layout analytics.
18
+
3
19
  ## 96.0.0
4
20
 
5
21
  ### Major 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 = "96.0.0";
20
+ var packageVersion = "96.0.2";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getPositionAfterTopParentNodeOfType = exports.getParentOfTypeCount = void 0;
7
7
  /*
8
- * Returns the level of nesting of a given `nodeType` in the current selection.
8
+ * Returns the level of nesting of a given `nodeType` in the current position.
9
9
  * eg. table > table is nested 1 level, table > table > table is nested 2 levels.
10
10
  *
11
11
  * ```typescript
12
- * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(selection);
12
+ * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(position);
13
13
  * ```
14
14
  */
15
15
  var getParentOfTypeCount = exports.getParentOfTypeCount = function getParentOfTypeCount(nodeType) {
16
- return function ($from) {
16
+ return function ($pos) {
17
17
  var count = 0;
18
18
  // Loop through parent nodes from bottom to top
19
- for (var depth = $from.depth; depth > 0; depth--) {
20
- var node = $from.node(depth);
19
+ for (var depth = $pos.depth; depth > 0; depth--) {
20
+ var node = $pos.node(depth);
21
21
  // Count the table nodes
22
22
  if (node.type === nodeType) {
23
23
  count++;
@@ -28,20 +28,20 @@ var getParentOfTypeCount = exports.getParentOfTypeCount = function getParentOfTy
28
28
  };
29
29
 
30
30
  /*
31
- * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current selection.
31
+ * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current position.
32
32
  *
33
33
  * ```typescript
34
- * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(selection);
34
+ * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(position);
35
35
  * ```
36
36
  */
37
37
  var getPositionAfterTopParentNodeOfType = exports.getPositionAfterTopParentNodeOfType = function getPositionAfterTopParentNodeOfType(nodeType) {
38
- return function ($from) {
38
+ return function ($pos) {
39
39
  // Loop through parent nodes from top to bottom
40
- for (var depth = 1; depth <= $from.depth; depth++) {
41
- var node = $from.node(depth);
40
+ for (var depth = 1; depth <= $pos.depth; depth++) {
41
+ var node = $pos.node(depth);
42
42
  // Count the table nodes
43
43
  if (node.type === nodeType) {
44
- return $from.after(depth);
44
+ return $pos.after(depth);
45
45
  }
46
46
  }
47
47
  };
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "96.0.0";
27
+ var packageVersion = "96.0.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -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 = "96.0.0";
4
+ const packageVersion = "96.0.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -1,16 +1,16 @@
1
1
  /*
2
- * Returns the level of nesting of a given `nodeType` in the current selection.
2
+ * Returns the level of nesting of a given `nodeType` in the current position.
3
3
  * eg. table > table is nested 1 level, table > table > table is nested 2 levels.
4
4
  *
5
5
  * ```typescript
6
- * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(selection);
6
+ * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(position);
7
7
  * ```
8
8
  */
9
- export const getParentOfTypeCount = nodeType => $from => {
9
+ export const getParentOfTypeCount = nodeType => $pos => {
10
10
  let count = 0;
11
11
  // Loop through parent nodes from bottom to top
12
- for (let depth = $from.depth; depth > 0; depth--) {
13
- const node = $from.node(depth);
12
+ for (let depth = $pos.depth; depth > 0; depth--) {
13
+ const node = $pos.node(depth);
14
14
  // Count the table nodes
15
15
  if (node.type === nodeType) {
16
16
  count++;
@@ -20,19 +20,19 @@ export const getParentOfTypeCount = nodeType => $from => {
20
20
  };
21
21
 
22
22
  /*
23
- * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current selection.
23
+ * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current position.
24
24
  *
25
25
  * ```typescript
26
- * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(selection);
26
+ * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(position);
27
27
  * ```
28
28
  */
29
- export const getPositionAfterTopParentNodeOfType = nodeType => $from => {
29
+ export const getPositionAfterTopParentNodeOfType = nodeType => $pos => {
30
30
  // Loop through parent nodes from top to bottom
31
- for (let depth = 1; depth <= $from.depth; depth++) {
32
- const node = $from.node(depth);
31
+ for (let depth = 1; depth <= $pos.depth; depth++) {
32
+ const node = $pos.node(depth);
33
33
  // Count the table nodes
34
34
  if (node.type === nodeType) {
35
- return $from.after(depth);
35
+ return $pos.after(depth);
36
36
  }
37
37
  }
38
38
  };
@@ -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 = "96.0.0";
16
+ const packageVersion = "96.0.2";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  class DropList extends Component {
@@ -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 = "96.0.0";
10
+ var packageVersion = "96.0.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -1,17 +1,17 @@
1
1
  /*
2
- * Returns the level of nesting of a given `nodeType` in the current selection.
2
+ * Returns the level of nesting of a given `nodeType` in the current position.
3
3
  * eg. table > table is nested 1 level, table > table > table is nested 2 levels.
4
4
  *
5
5
  * ```typescript
6
- * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(selection);
6
+ * const nestingLevel = getParentOfTypeCount(schema.nodes.table)(position);
7
7
  * ```
8
8
  */
9
9
  export var getParentOfTypeCount = function getParentOfTypeCount(nodeType) {
10
- return function ($from) {
10
+ return function ($pos) {
11
11
  var count = 0;
12
12
  // Loop through parent nodes from bottom to top
13
- for (var depth = $from.depth; depth > 0; depth--) {
14
- var node = $from.node(depth);
13
+ for (var depth = $pos.depth; depth > 0; depth--) {
14
+ var node = $pos.node(depth);
15
15
  // Count the table nodes
16
16
  if (node.type === nodeType) {
17
17
  count++;
@@ -22,20 +22,20 @@ export var getParentOfTypeCount = function getParentOfTypeCount(nodeType) {
22
22
  };
23
23
 
24
24
  /*
25
- * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current selection.
25
+ * Returns the (absolute) position directly after the top parent node of a given `nodeType` in the current position.
26
26
  *
27
27
  * ```typescript
28
- * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(selection);
28
+ * const nestingLevel = getEndTopParentNodeOfType(schema.nodes.table)(position);
29
29
  * ```
30
30
  */
31
31
  export var getPositionAfterTopParentNodeOfType = function getPositionAfterTopParentNodeOfType(nodeType) {
32
- return function ($from) {
32
+ return function ($pos) {
33
33
  // Loop through parent nodes from top to bottom
34
- for (var depth = 1; depth <= $from.depth; depth++) {
35
- var node = $from.node(depth);
34
+ for (var depth = 1; depth <= $pos.depth; depth++) {
35
+ var node = $pos.node(depth);
36
36
  // Count the table nodes
37
37
  if (node.type === nodeType) {
38
- return $from.after(depth);
38
+ return $pos.after(depth);
39
39
  }
40
40
  }
41
41
  };
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
21
21
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "96.0.0";
24
+ var packageVersion = "96.0.2";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var DropList = /*#__PURE__*/function (_Component) {
@@ -3,8 +3,10 @@ import type { TrackAEP, UIAEP } from './utils';
3
3
  type ElementAttributes = {
4
4
  nodeDepth: number;
5
5
  nodeType: string;
6
- inputMethod?: string;
7
6
  destinationNodeDepth?: number;
7
+ destinationNodeType?: string;
8
+ isSameParent?: boolean;
9
+ inputMethod?: string;
8
10
  };
9
11
  type ElementMovedAEP = TrackAEP<ACTION.MOVED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
10
12
  type ElementDragAEP = UIAEP<ACTION.DRAGGED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
@@ -105,7 +105,7 @@ type InsertMediaLinkAEP = InsertAEP<ACTION_SUBJECT_ID.MEDIA_LINK, {
105
105
  insertType?: INSERT_MEDIA_VIA;
106
106
  }, undefined>;
107
107
  type InsertLayoutAEP = InsertAEP<ACTION_SUBJECT_ID.LAYOUT, {
108
- inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT;
108
+ inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.DRAG_AND_DROP;
109
109
  }, undefined>;
110
110
  type InsertDateAEP = InsertAEP<ACTION_SUBJECT_ID.DATE, {
111
111
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU;
@@ -1,3 +1,3 @@
1
1
  import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- export declare const getParentOfTypeCount: (nodeType: NodeType) => ($from: ResolvedPos) => number;
3
- export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($from: ResolvedPos) => number | undefined;
2
+ export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: ResolvedPos) => number;
3
+ export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
@@ -3,8 +3,10 @@ import type { TrackAEP, UIAEP } from './utils';
3
3
  type ElementAttributes = {
4
4
  nodeDepth: number;
5
5
  nodeType: string;
6
- inputMethod?: string;
7
6
  destinationNodeDepth?: number;
7
+ destinationNodeType?: string;
8
+ isSameParent?: boolean;
9
+ inputMethod?: string;
8
10
  };
9
11
  type ElementMovedAEP = TrackAEP<ACTION.MOVED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
10
12
  type ElementDragAEP = UIAEP<ACTION.DRAGGED, ACTION_SUBJECT.ELEMENT, ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE, ElementAttributes, null>;
@@ -105,7 +105,7 @@ type InsertMediaLinkAEP = InsertAEP<ACTION_SUBJECT_ID.MEDIA_LINK, {
105
105
  insertType?: INSERT_MEDIA_VIA;
106
106
  }, undefined>;
107
107
  type InsertLayoutAEP = InsertAEP<ACTION_SUBJECT_ID.LAYOUT, {
108
- inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT;
108
+ inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.DRAG_AND_DROP;
109
109
  }, undefined>;
110
110
  type InsertDateAEP = InsertAEP<ACTION_SUBJECT_ID.DATE, {
111
111
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU;
@@ -1,3 +1,3 @@
1
1
  import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- export declare const getParentOfTypeCount: (nodeType: NodeType) => ($from: ResolvedPos) => number;
3
- export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($from: ResolvedPos) => number | undefined;
2
+ export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: ResolvedPos) => number;
3
+ export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "96.0.0",
3
+ "version": "96.0.2",
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/"
@@ -191,7 +191,7 @@
191
191
  "devDependencies": {
192
192
  "@af/visual-regression": "*",
193
193
  "@atlaskit/media-core": "^34.3.0",
194
- "@atlaskit/media-test-helpers": "^34.6.0",
194
+ "@atlaskit/media-test-helpers": "^34.7.0",
195
195
  "@atlaskit/util-data-test": "^17.13.0",
196
196
  "@atlaskit/visual-regression": "*",
197
197
  "@testing-library/dom": "^10.1.0",