@atlaskit/editor-common 114.25.2 → 114.26.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 +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-selection/index.js +45 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-selection/index.js +40 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-selection/index.js +40 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/node-selection/index.d.ts +17 -0
- package/dist/types-ts4.5/node-selection/index.d.ts +17 -0
- package/node-selection/package.json +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 114.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`38fb4916b9085`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38fb4916b9085) -
|
|
8
|
+
Add `@atlaskit/editor-common/node-selection` entry-point with platform-level node selection
|
|
9
|
+
utilities. Under `platform_editor_maui_jira_updates`, `open-remix-modal` and
|
|
10
|
+
`editor-plugin-block-controls` delegate to these utilities, fixing remix selection in environments
|
|
11
|
+
where `blockControls` is not present.
|
|
12
|
+
|
|
3
13
|
## 114.25.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
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 = "
|
|
22
|
+
var packageVersion = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.selectTableNodeAtPos = exports.selectNodeAtPos = exports.getNodeSelectionForPos = void 0;
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
9
|
+
/**
|
|
10
|
+
* Returns a NodeSelection for the node at `start`.
|
|
11
|
+
* Matches the `platform_editor_block_menu=true` path in block-controls:
|
|
12
|
+
* mediaGroup with a single child → select the child; all others → select the node.
|
|
13
|
+
* Returns false when no node exists at `start`.
|
|
14
|
+
*/
|
|
15
|
+
var getNodeSelectionForPos = exports.getNodeSelectionForPos = function getNodeSelectionForPos(doc, start) {
|
|
16
|
+
var node = doc.nodeAt(start);
|
|
17
|
+
if (!node) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (node.type.name === 'mediaGroup' && node.childCount === 1) {
|
|
21
|
+
return new _state.NodeSelection(doc.resolve(start + 1));
|
|
22
|
+
}
|
|
23
|
+
return new _state.NodeSelection(doc.resolve(start));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Applies a CellSelection to `tr` for the table node at `tableNodePos`. */
|
|
27
|
+
var selectTableNodeAtPos = exports.selectTableNodeAtPos = function selectTableNodeAtPos(tr, tableNodePos) {
|
|
28
|
+
(0, _utils.selectTableClosestToPos)(tr, tr.doc.resolve(tableNodePos + 1));
|
|
29
|
+
return tr;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Selects the node at `nodePos` without any plugin-API dependency.
|
|
34
|
+
* Tables use CellSelection; all other nodes use NodeSelection.
|
|
35
|
+
*/
|
|
36
|
+
var selectNodeAtPos = exports.selectNodeAtPos = function selectNodeAtPos(tr, nodePos, nodeType) {
|
|
37
|
+
if (nodeType === 'table') {
|
|
38
|
+
return selectTableNodeAtPos(tr, nodePos);
|
|
39
|
+
}
|
|
40
|
+
var selection = getNodeSelectionForPos(tr.doc, nodePos);
|
|
41
|
+
if (selection) {
|
|
42
|
+
tr.setSelection(selection);
|
|
43
|
+
}
|
|
44
|
+
return tr;
|
|
45
|
+
};
|
|
@@ -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 = "
|
|
27
|
+
var packageVersion = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "0.0.0-development";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns a NodeSelection for the node at `start`.
|
|
6
|
+
* Matches the `platform_editor_block_menu=true` path in block-controls:
|
|
7
|
+
* mediaGroup with a single child → select the child; all others → select the node.
|
|
8
|
+
* Returns false when no node exists at `start`.
|
|
9
|
+
*/
|
|
10
|
+
export const getNodeSelectionForPos = (doc, start) => {
|
|
11
|
+
const node = doc.nodeAt(start);
|
|
12
|
+
if (!node) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (node.type.name === 'mediaGroup' && node.childCount === 1) {
|
|
16
|
+
return new NodeSelection(doc.resolve(start + 1));
|
|
17
|
+
}
|
|
18
|
+
return new NodeSelection(doc.resolve(start));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Applies a CellSelection to `tr` for the table node at `tableNodePos`. */
|
|
22
|
+
export const selectTableNodeAtPos = (tr, tableNodePos) => {
|
|
23
|
+
selectTableClosestToPos(tr, tr.doc.resolve(tableNodePos + 1));
|
|
24
|
+
return tr;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Selects the node at `nodePos` without any plugin-API dependency.
|
|
29
|
+
* Tables use CellSelection; all other nodes use NodeSelection.
|
|
30
|
+
*/
|
|
31
|
+
export const selectNodeAtPos = (tr, nodePos, nodeType) => {
|
|
32
|
+
if (nodeType === 'table') {
|
|
33
|
+
return selectTableNodeAtPos(tr, nodePos);
|
|
34
|
+
}
|
|
35
|
+
const selection = getNodeSelectionForPos(tr.doc, nodePos);
|
|
36
|
+
if (selection) {
|
|
37
|
+
tr.setSelection(selection);
|
|
38
|
+
}
|
|
39
|
+
return tr;
|
|
40
|
+
};
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "0.0.0-development";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "0.0.0-development";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns a NodeSelection for the node at `start`.
|
|
6
|
+
* Matches the `platform_editor_block_menu=true` path in block-controls:
|
|
7
|
+
* mediaGroup with a single child → select the child; all others → select the node.
|
|
8
|
+
* Returns false when no node exists at `start`.
|
|
9
|
+
*/
|
|
10
|
+
export var getNodeSelectionForPos = function getNodeSelectionForPos(doc, start) {
|
|
11
|
+
var node = doc.nodeAt(start);
|
|
12
|
+
if (!node) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (node.type.name === 'mediaGroup' && node.childCount === 1) {
|
|
16
|
+
return new NodeSelection(doc.resolve(start + 1));
|
|
17
|
+
}
|
|
18
|
+
return new NodeSelection(doc.resolve(start));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Applies a CellSelection to `tr` for the table node at `tableNodePos`. */
|
|
22
|
+
export var selectTableNodeAtPos = function selectTableNodeAtPos(tr, tableNodePos) {
|
|
23
|
+
selectTableClosestToPos(tr, tr.doc.resolve(tableNodePos + 1));
|
|
24
|
+
return tr;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Selects the node at `nodePos` without any plugin-API dependency.
|
|
29
|
+
* Tables use CellSelection; all other nodes use NodeSelection.
|
|
30
|
+
*/
|
|
31
|
+
export var selectNodeAtPos = function selectNodeAtPos(tr, nodePos, nodeType) {
|
|
32
|
+
if (nodeType === 'table') {
|
|
33
|
+
return selectTableNodeAtPos(tr, nodePos);
|
|
34
|
+
}
|
|
35
|
+
var selection = getNodeSelectionForPos(tr.doc, nodePos);
|
|
36
|
+
if (selection) {
|
|
37
|
+
tr.setSelection(selection);
|
|
38
|
+
}
|
|
39
|
+
return tr;
|
|
40
|
+
};
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "0.0.0-development";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a NodeSelection for the node at `start`.
|
|
6
|
+
* Matches the `platform_editor_block_menu=true` path in block-controls:
|
|
7
|
+
* mediaGroup with a single child → select the child; all others → select the node.
|
|
8
|
+
* Returns false when no node exists at `start`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNodeSelectionForPos: (doc: PMNode, start: number) => NodeSelection | false;
|
|
11
|
+
/** Applies a CellSelection to `tr` for the table node at `tableNodePos`. */
|
|
12
|
+
export declare const selectTableNodeAtPos: (tr: Transaction, tableNodePos: number) => Transaction;
|
|
13
|
+
/**
|
|
14
|
+
* Selects the node at `nodePos` without any plugin-API dependency.
|
|
15
|
+
* Tables use CellSelection; all other nodes use NodeSelection.
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectNodeAtPos: (tr: Transaction, nodePos: number, nodeType: string) => Transaction;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a NodeSelection for the node at `start`.
|
|
6
|
+
* Matches the `platform_editor_block_menu=true` path in block-controls:
|
|
7
|
+
* mediaGroup with a single child → select the child; all others → select the node.
|
|
8
|
+
* Returns false when no node exists at `start`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNodeSelectionForPos: (doc: PMNode, start: number) => NodeSelection | false;
|
|
11
|
+
/** Applies a CellSelection to `tr` for the table node at `tableNodePos`. */
|
|
12
|
+
export declare const selectTableNodeAtPos: (tr: Transaction, tableNodePos: number) => Transaction;
|
|
13
|
+
/**
|
|
14
|
+
* Selects the node at `nodePos` without any plugin-API dependency.
|
|
15
|
+
* Tables use CellSelection; all other nodes use NodeSelection.
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectNodeAtPos: (tr: Transaction, nodePos: number, nodeType: string) => Transaction;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/node-selection",
|
|
3
|
+
"main": "../dist/cjs/node-selection/index.js",
|
|
4
|
+
"module": "../dist/esm/node-selection/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/node-selection/index.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/node-selection/index.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/node-selection/index.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED