@atlaskit/editor-common 111.8.6 → 111.8.7
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/selection/index.js +6 -0
- package/dist/cjs/selection/utils.js +36 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/selection/index.js +1 -1
- package/dist/es2019/selection/utils.js +32 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/selection/index.js +1 -1
- package/dist/esm/selection/utils.js +32 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/ai-streaming.d.ts +2 -0
- package/dist/types/analytics/types/utils.d.ts +1 -0
- package/dist/types/selection/index.d.ts +1 -1
- package/dist/types/selection/utils.d.ts +19 -0
- package/dist/types-ts4.5/analytics/types/ai-streaming.d.ts +2 -0
- package/dist/types-ts4.5/analytics/types/utils.d.ts +1 -0
- package/dist/types-ts4.5/selection/index.d.ts +1 -1
- package/dist/types-ts4.5/selection/utils.d.ts +19 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.8.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d34e6bd1197a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d34e6bd1197a5) -
|
|
8
|
+
EDITOR-4178 update document inserted event to have is inside synced block attribute
|
|
9
|
+
- [`e04e057af7743`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e04e057af7743) -
|
|
10
|
+
Adds scrubbed localId and commands to analytics to help narrow root cause issues.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 111.8.6
|
|
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 = "111.8.
|
|
22
|
+
var packageVersion = "111.8.6";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -98,6 +98,12 @@ exports.getAllSelectionAnalyticsPayload = getAllSelectionAnalyticsPayload;
|
|
|
98
98
|
exports.getCellSelectionAnalyticsPayload = getCellSelectionAnalyticsPayload;
|
|
99
99
|
exports.getNodeSelectionAnalyticsPayload = getNodeSelectionAnalyticsPayload;
|
|
100
100
|
exports.getRangeSelectionAnalyticsPayload = getRangeSelectionAnalyticsPayload;
|
|
101
|
+
Object.defineProperty(exports, "getSourceNodesFromSelectionRange", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function get() {
|
|
104
|
+
return _utils2.getSourceNodesFromSelectionRange;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
101
107
|
Object.defineProperty(exports, "hideCaretModifier", {
|
|
102
108
|
enumerable: true,
|
|
103
109
|
get: function get() {
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
});
|
|
@@ -9,13 +10,17 @@ exports.atTheEndOfBlock = atTheEndOfBlock;
|
|
|
9
10
|
exports.atTheEndOfDoc = atTheEndOfDoc;
|
|
10
11
|
exports.deleteSelectedRange = void 0;
|
|
11
12
|
exports.endPositionOfParent = endPositionOfParent;
|
|
12
|
-
exports.
|
|
13
|
+
exports.expandToBlockRange = exports.expandSelectionToBlockRange = exports.expandSelectionBounds = void 0;
|
|
14
|
+
exports.getSourceNodesFromSelectionRange = getSourceNodesFromSelectionRange;
|
|
15
|
+
exports.isMultiBlockRange = void 0;
|
|
13
16
|
exports.isMultiBlockSelection = isMultiBlockSelection;
|
|
14
17
|
exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = void 0;
|
|
15
18
|
exports.selectionIsAtTheBeginningOfBlock = selectionIsAtTheBeginningOfBlock;
|
|
16
19
|
exports.startPositionOfParent = startPositionOfParent;
|
|
20
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
21
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
22
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
23
|
+
var _utils2 = require("../utils");
|
|
19
24
|
var _selection = require("./gap-cursor/selection");
|
|
20
25
|
var isSelectionAtStartOfNode = exports.isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
21
26
|
if (!parentNode) {
|
|
@@ -241,4 +246,34 @@ function isMultiBlockSelection(selection) {
|
|
|
241
246
|
return false;
|
|
242
247
|
}
|
|
243
248
|
return isMultiBlockRange(range);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Extracts the source nodes from a selection range.
|
|
253
|
+
*
|
|
254
|
+
* This function expands the given selection to its block range boundaries and returns
|
|
255
|
+
* an array of the nodes contained within that range. It handles special cases like
|
|
256
|
+
* list nodes, where the slice positions are adjusted to include the list wrapper.
|
|
257
|
+
*
|
|
258
|
+
* @param tr - The transaction containing the document
|
|
259
|
+
* @param selection - The selection to extract nodes from
|
|
260
|
+
* @returns An array of ProseMirror nodes within the expanded selection range
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```typescript
|
|
264
|
+
* const selection = tr.selection;
|
|
265
|
+
* const nodes = getSourceNodesFromSelectionRange(tr, selection);
|
|
266
|
+
* // nodes will contain all block-level nodes in the selection
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
function getSourceNodesFromSelectionRange(tr, selection) {
|
|
270
|
+
var _expandSelectionToBlo2 = expandSelectionToBlockRange(selection),
|
|
271
|
+
$from = _expandSelectionToBlo2.$from,
|
|
272
|
+
$to = _expandSelectionToBlo2.$to;
|
|
273
|
+
var selectedParent = $from.parent;
|
|
274
|
+
var isList = (0, _utils2.isListNode)(selectedParent);
|
|
275
|
+
var sliceStart = isList ? $from.pos - 1 : $from.pos;
|
|
276
|
+
var sliceEnd = isList ? $to.pos + 1 : $to.pos;
|
|
277
|
+
var slice = tr.doc.slice(sliceStart, sliceEnd);
|
|
278
|
+
return (0, _toConsumableArray2.default)(slice.content.content);
|
|
244
279
|
}
|
|
@@ -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 = "111.8.
|
|
27
|
+
var packageVersion = "111.8.6";
|
|
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 = "111.8.
|
|
7
|
+
const packageVersion = "111.8.6";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, getSourceNodesFromSelectionRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
3
|
+
import { isListNode } from '../utils';
|
|
3
4
|
import { GapCursorSelection } from './gap-cursor/selection';
|
|
4
5
|
export const isSelectionAtStartOfNode = ($pos, parentNode) => {
|
|
5
6
|
if (!parentNode) {
|
|
@@ -237,4 +238,35 @@ export function isMultiBlockSelection(selection) {
|
|
|
237
238
|
return false;
|
|
238
239
|
}
|
|
239
240
|
return isMultiBlockRange(range);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Extracts the source nodes from a selection range.
|
|
245
|
+
*
|
|
246
|
+
* This function expands the given selection to its block range boundaries and returns
|
|
247
|
+
* an array of the nodes contained within that range. It handles special cases like
|
|
248
|
+
* list nodes, where the slice positions are adjusted to include the list wrapper.
|
|
249
|
+
*
|
|
250
|
+
* @param tr - The transaction containing the document
|
|
251
|
+
* @param selection - The selection to extract nodes from
|
|
252
|
+
* @returns An array of ProseMirror nodes within the expanded selection range
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```typescript
|
|
256
|
+
* const selection = tr.selection;
|
|
257
|
+
* const nodes = getSourceNodesFromSelectionRange(tr, selection);
|
|
258
|
+
* // nodes will contain all block-level nodes in the selection
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
export function getSourceNodesFromSelectionRange(tr, selection) {
|
|
262
|
+
const {
|
|
263
|
+
$from,
|
|
264
|
+
$to
|
|
265
|
+
} = expandSelectionToBlockRange(selection);
|
|
266
|
+
const selectedParent = $from.parent;
|
|
267
|
+
const isList = isListNode(selectedParent);
|
|
268
|
+
const sliceStart = isList ? $from.pos - 1 : $from.pos;
|
|
269
|
+
const sliceEnd = isList ? $to.pos + 1 : $to.pos;
|
|
270
|
+
const slice = tr.doc.slice(sliceStart, sliceEnd);
|
|
271
|
+
return [...slice.content.content];
|
|
240
272
|
}
|
|
@@ -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 = "111.8.
|
|
17
|
+
const packageVersion = "111.8.6";
|
|
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 = "111.8.
|
|
13
|
+
var packageVersion = "111.8.6";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, getSourceNodesFromSelectionRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
4
|
+
import { isListNode } from '../utils';
|
|
3
5
|
import { GapCursorSelection } from './gap-cursor/selection';
|
|
4
6
|
export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
5
7
|
if (!parentNode) {
|
|
@@ -225,4 +227,34 @@ export function isMultiBlockSelection(selection) {
|
|
|
225
227
|
return false;
|
|
226
228
|
}
|
|
227
229
|
return isMultiBlockRange(range);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Extracts the source nodes from a selection range.
|
|
234
|
+
*
|
|
235
|
+
* This function expands the given selection to its block range boundaries and returns
|
|
236
|
+
* an array of the nodes contained within that range. It handles special cases like
|
|
237
|
+
* list nodes, where the slice positions are adjusted to include the list wrapper.
|
|
238
|
+
*
|
|
239
|
+
* @param tr - The transaction containing the document
|
|
240
|
+
* @param selection - The selection to extract nodes from
|
|
241
|
+
* @returns An array of ProseMirror nodes within the expanded selection range
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const selection = tr.selection;
|
|
246
|
+
* const nodes = getSourceNodesFromSelectionRange(tr, selection);
|
|
247
|
+
* // nodes will contain all block-level nodes in the selection
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
export function getSourceNodesFromSelectionRange(tr, selection) {
|
|
251
|
+
var _expandSelectionToBlo2 = expandSelectionToBlockRange(selection),
|
|
252
|
+
$from = _expandSelectionToBlo2.$from,
|
|
253
|
+
$to = _expandSelectionToBlo2.$to;
|
|
254
|
+
var selectedParent = $from.parent;
|
|
255
|
+
var isList = isListNode(selectedParent);
|
|
256
|
+
var sliceStart = isList ? $from.pos - 1 : $from.pos;
|
|
257
|
+
var sliceEnd = isList ? $to.pos + 1 : $to.pos;
|
|
258
|
+
var slice = tr.doc.slice(sliceStart, sliceEnd);
|
|
259
|
+
return _toConsumableArray(slice.content.content);
|
|
228
260
|
}
|
|
@@ -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 = "111.8.
|
|
24
|
+
var packageVersion = "111.8.6";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -3,8 +3,10 @@ import type { OperationalAEP, UIAEP } from './utils';
|
|
|
3
3
|
type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
|
|
4
4
|
docSize: number | undefined;
|
|
5
5
|
localIdLength: number;
|
|
6
|
+
scrubbedLocalId: string;
|
|
6
7
|
}>;
|
|
7
8
|
type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
|
|
9
|
+
command: string;
|
|
8
10
|
isSameDoc: boolean;
|
|
9
11
|
isSameDocIgnoreAttrs: boolean;
|
|
10
12
|
}>;
|
|
@@ -46,6 +46,7 @@ export interface NonRequiredAttributes {
|
|
|
46
46
|
changeFromLocation?: string;
|
|
47
47
|
insertedLocation?: string;
|
|
48
48
|
insertLocation?: string;
|
|
49
|
+
isInsideSyncedBlock?: boolean;
|
|
49
50
|
nodeLocation?: string;
|
|
50
51
|
selectionPosition?: SELECTION_POSITION;
|
|
51
52
|
selectionType?: SELECTION_TYPE;
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, getSourceNodesFromSelectionRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -75,3 +75,22 @@ export declare const isMultiBlockRange: (range: NodeRange) => boolean;
|
|
|
75
75
|
* Determines if a selection contains multiple block nodes.
|
|
76
76
|
*/
|
|
77
77
|
export declare function isMultiBlockSelection(selection: Selection): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Extracts the source nodes from a selection range.
|
|
80
|
+
*
|
|
81
|
+
* This function expands the given selection to its block range boundaries and returns
|
|
82
|
+
* an array of the nodes contained within that range. It handles special cases like
|
|
83
|
+
* list nodes, where the slice positions are adjusted to include the list wrapper.
|
|
84
|
+
*
|
|
85
|
+
* @param tr - The transaction containing the document
|
|
86
|
+
* @param selection - The selection to extract nodes from
|
|
87
|
+
* @returns An array of ProseMirror nodes within the expanded selection range
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const selection = tr.selection;
|
|
92
|
+
* const nodes = getSourceNodesFromSelectionRange(tr, selection);
|
|
93
|
+
* // nodes will contain all block-level nodes in the selection
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function getSourceNodesFromSelectionRange(tr: Transaction, selection: Selection): PMNode[];
|
|
@@ -3,8 +3,10 @@ import type { OperationalAEP, UIAEP } from './utils';
|
|
|
3
3
|
type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
|
|
4
4
|
docSize: number | undefined;
|
|
5
5
|
localIdLength: number;
|
|
6
|
+
scrubbedLocalId: string;
|
|
6
7
|
}>;
|
|
7
8
|
type AIStreamingNoDocChangeAEP = OperationalAEP<ACTION.NO_DOC_CHANGE_FOUND, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.EXPERIENCE_APPLICATION, {
|
|
9
|
+
command: string;
|
|
8
10
|
isSameDoc: boolean;
|
|
9
11
|
isSameDocIgnoreAttrs: boolean;
|
|
10
12
|
}>;
|
|
@@ -46,6 +46,7 @@ export interface NonRequiredAttributes {
|
|
|
46
46
|
changeFromLocation?: string;
|
|
47
47
|
insertedLocation?: string;
|
|
48
48
|
insertLocation?: string;
|
|
49
|
+
isInsideSyncedBlock?: boolean;
|
|
49
50
|
nodeLocation?: string;
|
|
50
51
|
selectionPosition?: SELECTION_POSITION;
|
|
51
52
|
selectionType?: SELECTION_TYPE;
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, getSourceNodesFromSelectionRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -75,3 +75,22 @@ export declare const isMultiBlockRange: (range: NodeRange) => boolean;
|
|
|
75
75
|
* Determines if a selection contains multiple block nodes.
|
|
76
76
|
*/
|
|
77
77
|
export declare function isMultiBlockSelection(selection: Selection): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Extracts the source nodes from a selection range.
|
|
80
|
+
*
|
|
81
|
+
* This function expands the given selection to its block range boundaries and returns
|
|
82
|
+
* an array of the nodes contained within that range. It handles special cases like
|
|
83
|
+
* list nodes, where the slice positions are adjusted to include the list wrapper.
|
|
84
|
+
*
|
|
85
|
+
* @param tr - The transaction containing the document
|
|
86
|
+
* @param selection - The selection to extract nodes from
|
|
87
|
+
* @returns An array of ProseMirror nodes within the expanded selection range
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const selection = tr.selection;
|
|
92
|
+
* const nodes = getSourceNodesFromSelectionRange(tr, selection);
|
|
93
|
+
* // nodes will contain all block-level nodes in the selection
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function getSourceNodesFromSelectionRange(tr: Transaction, selection: Selection): PMNode[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.8.
|
|
3
|
+
"version": "111.8.7",
|
|
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/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/activity-provider": "^2.5.0",
|
|
33
33
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
34
|
-
"@atlaskit/adf-utils": "^19.
|
|
34
|
+
"@atlaskit/adf-utils": "^19.27.0",
|
|
35
35
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.10.0",
|
|
36
36
|
"@atlaskit/analytics-listeners": "^9.2.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^7.2.0",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
85
|
-
"@atlaskit/tokens": "^10.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^16.27.0",
|
|
85
|
+
"@atlaskit/tokens": "^10.1.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|
|
88
88
|
"@babel/runtime": "^7.0.0",
|