@atlaskit/editor-common 112.9.0 → 112.10.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.
@@ -13,7 +13,7 @@ type Props = {
13
13
  [key: string]: string | number | undefined;
14
14
  };
15
15
  isSelected?: boolean;
16
- onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
16
+ onClick: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
17
17
  };
18
18
  export declare const InlineImageWrapper: ({ children, isSelected, aspectRatio, borderSize, borderColor, htmlAttrs, onClick, }: React.PropsWithChildren<Props>) => jsx.JSX.Element;
19
19
  export {};
@@ -6,6 +6,8 @@ export { hasValidListIndentationLevel } from './indentation';
6
6
  export { restoreSelection, computeSelectionOffsets } from './restore-selection';
7
7
  export { buildReplacementFragment } from './build-replacement-fragment';
8
8
  export type { BuildResult } from './build-replacement-fragment';
9
+ export { narrowReplacementRange } from './narrow-replacement-range';
10
+ export type { NarrowedReplacement } from './narrow-replacement-range';
9
11
  export type { FlattenedItem } from './flatten-list';
10
12
  export { flattenList } from './flatten-list';
11
13
  export type { FlattenListOptions, FlattenListResult } from './flatten-list';
@@ -0,0 +1,19 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
+ export type NarrowedReplacement = {
4
+ adjustedContentStartOffsets: number[];
5
+ end: number;
6
+ fragment: Fragment;
7
+ start: number;
8
+ };
9
+ /**
10
+ * Narrows a full-list replacement to the minimal changed range.
11
+ *
12
+ * Compares the old root list node with the new replacement fragment
13
+ * from both ends to find the first and last positions where they differ,
14
+ * then returns only the changed subrange.
15
+ *
16
+ * This reduces the scope of `tr.replaceWith()` so that remote cursors
17
+ * on unchanged items are preserved during collaborative editing.
18
+ */
19
+ export declare function narrowReplacementRange(doc: PMNode, rootListStart: number, rootListEnd: number, fragment: Fragment, contentStartOffsets: number[]): NarrowedReplacement;
@@ -13,7 +13,7 @@ type Props = {
13
13
  [key: string]: string | number | undefined;
14
14
  };
15
15
  isSelected?: boolean;
16
- onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
16
+ onClick: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
17
17
  };
18
18
  export declare const InlineImageWrapper: ({ children, isSelected, aspectRatio, borderSize, borderColor, htmlAttrs, onClick, }: React.PropsWithChildren<Props>) => jsx.JSX.Element;
19
19
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "112.9.0",
3
+ "version": "112.10.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/"
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/editor-toolbar": "^0.20.0",
52
52
  "@atlaskit/editor-toolbar-model": "^0.4.0",
53
53
  "@atlaskit/emoji": "^69.10.0",
54
- "@atlaskit/icon": "^33.0.0",
54
+ "@atlaskit/icon": "^33.1.0",
55
55
  "@atlaskit/icon-object": "^7.5.0",
56
56
  "@atlaskit/link": "^3.3.0",
57
57
  "@atlaskit/link-datasource": "^4.34.0",
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/platform-feature-flags": "^1.1.0",
71
71
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
72
72
  "@atlaskit/popper": "^7.1.0",
73
- "@atlaskit/primitives": "^18.0.0",
73
+ "@atlaskit/primitives": "^18.1.0",
74
74
  "@atlaskit/profilecard": "^24.44.0",
75
75
  "@atlaskit/prosemirror-history": "^0.2.0",
76
76
  "@atlaskit/react-ufo": "^5.5.0",
@@ -81,7 +81,7 @@
81
81
  "@atlaskit/status": "^3.1.0",
82
82
  "@atlaskit/task-decision": "^19.3.0",
83
83
  "@atlaskit/textfield": "^8.2.0",
84
- "@atlaskit/tmp-editor-statsig": "^45.1.0",
84
+ "@atlaskit/tmp-editor-statsig": "^46.1.0",
85
85
  "@atlaskit/tokens": "^11.2.0",
86
86
  "@atlaskit/tooltip": "^21.0.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",