@atlaskit/editor-plugin-show-diff 12.0.2 → 12.1.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.
@@ -23,6 +23,17 @@ export type DeletedDiffPlacement = 'top' | 'bottom';
23
23
  * - `'after'`: the deleted content is anchored after the new content.
24
24
  */
25
25
  export type InlineDeletedDiffPlacement = 'before' | 'after';
26
+ /**
27
+ * A rendered deleted-content widget: the DOM element show-diff renders for a piece of deleted
28
+ * content, together with the document position it is anchored at. Deleted content is rendered as
29
+ * widget decorations rather than document nodes, so this is how consumers recover the element and
30
+ * its position — via the `getDeletedWidgets` action — without reaching into the plugin's internal
31
+ * state.
32
+ */
33
+ export type DeletedDiffWidget = {
34
+ element: HTMLElement;
35
+ position: number;
36
+ };
26
37
  export type SmartDiffThresholds = SmartDiffThresholdsInternal;
27
38
  export type DiffDescriptor = {
28
39
  id: string;
@@ -86,6 +97,18 @@ export type PMDiffParams = {
86
97
  };
87
98
  export type ACTION = 'SHOW_DIFF' | 'HIDE_DIFF' | 'SCROLL_TO_NEXT' | 'SCROLL_TO_PREVIOUS';
88
99
  export type ShowDiffPlugin = NextEditorPlugin<'showDiff', {
100
+ actions: {
101
+ /**
102
+ * The rendered deleted-content widgets currently displayed, optionally restricted to a
103
+ * document range, ordered by position. This is the safe, read-only way to recover deleted
104
+ * content's element and position (e.g. to position UI relative to it) without access to the
105
+ * plugin's internal decoration set. Returns an empty array when no diff is displayed.
106
+ */
107
+ getDeletedWidgets: (range?: {
108
+ from: number;
109
+ to: number;
110
+ }) => DeletedDiffWidget[];
111
+ };
89
112
  commands: {
90
113
  hideDiff: EditorCommand;
91
114
  scrollToNext: EditorCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "12.0.2",
3
+ "version": "12.1.0",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -20,15 +20,15 @@
20
20
  "sideEffects": false,
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
- "@atlaskit/adf-schema": "^56.6.0",
23
+ "@atlaskit/adf-schema": "^56.7.0",
24
24
  "@atlaskit/custom-steps": "^1.0.0",
25
25
  "@atlaskit/editor-plugin-analytics": "^14.0.0",
26
26
  "@atlaskit/editor-plugin-user-intent": "^12.0.0",
27
27
  "@atlaskit/editor-prosemirror": "^8.0.0",
28
28
  "@atlaskit/editor-tables": "^3.0.0",
29
29
  "@atlaskit/platform-feature-flags": "^2.1.0",
30
- "@atlaskit/tmp-editor-statsig": "^144.0.0",
31
- "@atlaskit/tokens": "^16.4.0",
30
+ "@atlaskit/tmp-editor-statsig": "^146.0.0",
31
+ "@atlaskit/tokens": "^16.6.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@compiled/react": "^1.0.0",
34
34
  "lodash": "^4.17.21",
@@ -42,10 +42,10 @@
42
42
  "@atlaskit/dropdown-menu": "^18.0.0",
43
43
  "@atlaskit/editor-core": "^223.0.0",
44
44
  "@atlaskit/editor-json-transformer": "^9.2.0",
45
- "@atlaskit/form": "^16.1.0",
45
+ "@atlaskit/form": "^17.0.0",
46
46
  "@atlaskit/primitives": "^22.2.0",
47
47
  "@atlaskit/section-message": "^10.0.0",
48
- "@atlaskit/textarea": "^9.1.0",
48
+ "@atlaskit/textarea": "^10.0.0",
49
49
  "@atlassian/confluence-presets": "workspace:^",
50
50
  "@atlassian/content-reconciliation": "^0.1.3506",
51
51
  "@atlassian/structured-docs-types": "workspace:^",
@@ -53,7 +53,7 @@
53
53
  "react-intl": "^7.0.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^118.1.0",
56
+ "@atlaskit/editor-common": "^118.4.0",
57
57
  "react": "^18.2.0 || ^19.2.0"
58
58
  },
59
59
  "techstack": {