@atlaskit/editor-plugin-show-diff 5.0.4 → 5.0.5
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 +8 -0
- package/dist/cjs/pm-plugins/calculateDiffDecorations.js +56 -31
- package/dist/cjs/pm-plugins/colorSchemes/standard.js +32 -30
- package/dist/cjs/pm-plugins/colorSchemes/traditional.js +29 -30
- package/dist/cjs/pm-plugins/decorations.js +57 -16
- package/dist/cjs/pm-plugins/deletedBlocksHandler.js +15 -57
- package/dist/cjs/pm-plugins/deletedRowsHandler.js +9 -15
- package/dist/es2019/pm-plugins/calculateDiffDecorations.js +35 -9
- package/dist/es2019/pm-plugins/colorSchemes/standard.js +31 -29
- package/dist/es2019/pm-plugins/colorSchemes/traditional.js +28 -29
- package/dist/es2019/pm-plugins/decorations.js +51 -8
- package/dist/es2019/pm-plugins/deletedBlocksHandler.js +11 -53
- package/dist/es2019/pm-plugins/deletedRowsHandler.js +9 -14
- package/dist/esm/pm-plugins/calculateDiffDecorations.js +56 -31
- package/dist/esm/pm-plugins/colorSchemes/standard.js +31 -29
- package/dist/esm/pm-plugins/colorSchemes/traditional.js +28 -29
- package/dist/esm/pm-plugins/decorations.js +59 -18
- package/dist/esm/pm-plugins/deletedBlocksHandler.js +11 -53
- package/dist/esm/pm-plugins/deletedRowsHandler.js +8 -14
- package/dist/types/pm-plugins/colorSchemes/standard.d.ts +10 -1
- package/dist/types/pm-plugins/colorSchemes/traditional.d.ts +9 -1
- package/dist/types/pm-plugins/decorations.d.ts +16 -9
- package/dist/types/pm-plugins/deletedBlocksHandler.d.ts +0 -45
- package/dist/types/pm-plugins/deletedRowsHandler.d.ts +7 -1
- package/dist/types-ts4.5/pm-plugins/colorSchemes/standard.d.ts +10 -1
- package/dist/types-ts4.5/pm-plugins/colorSchemes/traditional.d.ts +9 -1
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +16 -9
- package/dist/types-ts4.5/pm-plugins/deletedBlocksHandler.d.ts +0 -45
- package/dist/types-ts4.5/pm-plugins/deletedRowsHandler.d.ts +7 -1
- package/package.json +2 -2
|
@@ -9,10 +9,14 @@ import type { NodeViewSerializer } from './NodeViewSerializer';
|
|
|
9
9
|
* @param change Changeset "change" containing information about the change content + range
|
|
10
10
|
* @returns Prosemirror inline decoration
|
|
11
11
|
*/
|
|
12
|
-
export declare const createInlineChangedDecoration: (change: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export declare const createInlineChangedDecoration: ({ change, colorScheme, isActive, }: {
|
|
13
|
+
change: {
|
|
14
|
+
fromB: number;
|
|
15
|
+
toB: number;
|
|
16
|
+
};
|
|
17
|
+
colorScheme?: "standard" | "traditional";
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
}) => Decoration;
|
|
16
20
|
export declare const getDeletedContentStyleUnbounded: (colorScheme?: "standard" | "traditional") => string;
|
|
17
21
|
export declare const getDeletedContentStyle: (colorScheme?: "standard" | "traditional", isActive?: boolean) => string;
|
|
18
22
|
/**
|
|
@@ -21,11 +25,14 @@ export declare const getDeletedContentStyle: (colorScheme?: "standard" | "tradit
|
|
|
21
25
|
* @param change Changeset "change" containing information about the change content + range
|
|
22
26
|
* @returns Prosemirror inline decoration
|
|
23
27
|
*/
|
|
24
|
-
export declare const createBlockChangedDecoration: (change: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
export declare const createBlockChangedDecoration: ({ change, colorScheme, }: {
|
|
29
|
+
change: {
|
|
30
|
+
from: number;
|
|
31
|
+
name: string;
|
|
32
|
+
to: number;
|
|
33
|
+
};
|
|
34
|
+
colorScheme?: "standard" | "traditional";
|
|
35
|
+
}) => Decoration | undefined;
|
|
29
36
|
interface DeletedContentDecorationProps {
|
|
30
37
|
change: Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
|
|
31
38
|
colorScheme?: 'standard' | 'traditional';
|
|
@@ -1,56 +1,11 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
export declare const deletedStyleQuoteNode: string;
|
|
4
|
-
export declare const deletedStyleQuoteNodeWithLozenge: string;
|
|
5
|
-
export declare const deletedTraditionalStyleQuoteNode: string;
|
|
6
|
-
export declare const deletedBlockOutline: string;
|
|
7
|
-
export declare const deletedTraditionalBlockOutline: string;
|
|
8
|
-
export declare const deletedBlockOutlineRounded: string;
|
|
9
|
-
export declare const deletedTraditionalBlockOutlineRounded: string;
|
|
10
3
|
export declare const getDeletedStyleNode: (nodeName: string, colorScheme?: "standard" | "traditional") => string | undefined;
|
|
11
|
-
export declare const shouldShowRemovedLozenge: (nodeName: string) => boolean;
|
|
12
|
-
export declare const shouldAddShowDiffDeletedNodeClass: (nodeName: string) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Checks if a node should apply deleted styles directly without wrapper
|
|
15
|
-
* to preserve natural block-level margins
|
|
16
|
-
*/
|
|
17
|
-
export declare const shouldApplyDeletedStylesDirectly: (nodeName: string) => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Creates a "Removed" lozenge to be displayed at the top right corner of deleted block nodes
|
|
20
|
-
*/
|
|
21
|
-
export declare const createRemovedLozenge: (intl: IntlShape, nodeName?: string) => HTMLElement;
|
|
22
|
-
/**
|
|
23
|
-
* Wraps a block node in a container with relative positioning to support absolute positioned lozenge
|
|
24
|
-
*/
|
|
25
|
-
export declare const createBlockNodeWrapper: () => HTMLDivElement;
|
|
26
|
-
/**
|
|
27
|
-
* Wraps content with deleted styling without opacity (for use when content is a direct child of dom)
|
|
28
|
-
*/
|
|
29
|
-
export declare const createDeletedStyleWrapperWithoutOpacity: (colorScheme?: "standard" | "traditional", isActive?: boolean) => HTMLSpanElement;
|
|
30
|
-
/**
|
|
31
|
-
* Applies deleted styles directly to an HTML element by merging with existing styles
|
|
32
|
-
*/
|
|
33
|
-
export declare const applyDeletedStylesToElement: (element: HTMLElement, targetNode: PMNode, colorScheme: "standard" | "traditional" | undefined) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Creates a content wrapper with deleted styles for a block node
|
|
36
|
-
*/
|
|
37
|
-
export declare const createBlockNodeContentWrapper: (nodeView: Node, targetNode: PMNode, colorScheme: "standard" | "traditional" | undefined) => HTMLElement;
|
|
38
|
-
/**
|
|
39
|
-
* Handles embedCard node rendering with lozenge attached to the rich-media-item container.
|
|
40
|
-
* Since embedCard content loads asynchronously, we use a MutationObserver
|
|
41
|
-
* to wait for the rich-media-item to appear before attaching the lozenge.
|
|
42
|
-
* @returns true if embedCard was handled
|
|
43
|
-
*/
|
|
44
|
-
export declare const handleEmbedCardWithLozenge: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, lozenge: HTMLElement, colorScheme: "standard" | "traditional" | undefined) => boolean;
|
|
45
4
|
/**
|
|
46
5
|
* Handles special mediaSingle node rendering with lozenge on child media element
|
|
47
6
|
* @returns true if mediaSingle was handled, false otherwise
|
|
48
7
|
*/
|
|
49
8
|
export declare const handleMediaSingleWithLozenge: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, lozenge: HTMLElement, colorScheme: "standard" | "traditional" | undefined) => boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Appends a block node with wrapper, lozenge, and appropriate styling
|
|
52
|
-
*/
|
|
53
|
-
export declare const appendBlockNodeWithWrapper: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, colorScheme: "standard" | "traditional" | undefined, intl: IntlShape) => void;
|
|
54
9
|
/**
|
|
55
10
|
* Handles all block node rendering with appropriate deleted styling.
|
|
56
11
|
* For heading nodes, applies styles directly to preserve natural margins.
|
|
@@ -24,7 +24,13 @@ export declare const createDeletedRowsDecorations: ({ deletedRows, originalDoc,
|
|
|
24
24
|
/**
|
|
25
25
|
* Main function to handle deleted rows - computes diff and creates decorations
|
|
26
26
|
*/
|
|
27
|
-
export declare const handleDeletedRows: (changes
|
|
27
|
+
export declare const handleDeletedRows: ({ changes, originalDoc, newDoc, nodeViewSerializer, colorScheme, }: {
|
|
28
|
+
changes: SimpleChange[];
|
|
29
|
+
colorScheme?: "standard" | "traditional";
|
|
30
|
+
newDoc: PMNode;
|
|
31
|
+
nodeViewSerializer: NodeViewSerializer;
|
|
32
|
+
originalDoc: PMNode;
|
|
33
|
+
}) => {
|
|
28
34
|
decorations: Decoration[];
|
|
29
35
|
};
|
|
30
36
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
33
33
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^35.
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^35.1.0",
|
|
36
36
|
"@atlaskit/tokens": "^11.0.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
38
|
"lodash": "^4.17.21",
|