@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.
Files changed (30) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/pm-plugins/calculateDiffDecorations.js +56 -31
  3. package/dist/cjs/pm-plugins/colorSchemes/standard.js +32 -30
  4. package/dist/cjs/pm-plugins/colorSchemes/traditional.js +29 -30
  5. package/dist/cjs/pm-plugins/decorations.js +57 -16
  6. package/dist/cjs/pm-plugins/deletedBlocksHandler.js +15 -57
  7. package/dist/cjs/pm-plugins/deletedRowsHandler.js +9 -15
  8. package/dist/es2019/pm-plugins/calculateDiffDecorations.js +35 -9
  9. package/dist/es2019/pm-plugins/colorSchemes/standard.js +31 -29
  10. package/dist/es2019/pm-plugins/colorSchemes/traditional.js +28 -29
  11. package/dist/es2019/pm-plugins/decorations.js +51 -8
  12. package/dist/es2019/pm-plugins/deletedBlocksHandler.js +11 -53
  13. package/dist/es2019/pm-plugins/deletedRowsHandler.js +9 -14
  14. package/dist/esm/pm-plugins/calculateDiffDecorations.js +56 -31
  15. package/dist/esm/pm-plugins/colorSchemes/standard.js +31 -29
  16. package/dist/esm/pm-plugins/colorSchemes/traditional.js +28 -29
  17. package/dist/esm/pm-plugins/decorations.js +59 -18
  18. package/dist/esm/pm-plugins/deletedBlocksHandler.js +11 -53
  19. package/dist/esm/pm-plugins/deletedRowsHandler.js +8 -14
  20. package/dist/types/pm-plugins/colorSchemes/standard.d.ts +10 -1
  21. package/dist/types/pm-plugins/colorSchemes/traditional.d.ts +9 -1
  22. package/dist/types/pm-plugins/decorations.d.ts +16 -9
  23. package/dist/types/pm-plugins/deletedBlocksHandler.d.ts +0 -45
  24. package/dist/types/pm-plugins/deletedRowsHandler.d.ts +7 -1
  25. package/dist/types-ts4.5/pm-plugins/colorSchemes/standard.d.ts +10 -1
  26. package/dist/types-ts4.5/pm-plugins/colorSchemes/traditional.d.ts +9 -1
  27. package/dist/types-ts4.5/pm-plugins/decorations.d.ts +16 -9
  28. package/dist/types-ts4.5/pm-plugins/deletedBlocksHandler.d.ts +0 -45
  29. package/dist/types-ts4.5/pm-plugins/deletedRowsHandler.d.ts +7 -1
  30. 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
- fromB: number;
14
- toB: number;
15
- }, colorScheme?: "standard" | "traditional", isActive?: boolean) => Decoration;
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
- from: number;
26
- name: string;
27
- to: number;
28
- }, colorScheme?: "standard" | "traditional") => Decoration | undefined;
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: SimpleChange[], originalDoc: PMNode, newDoc: PMNode, nodeViewSerializer: NodeViewSerializer, colorScheme?: "standard" | "traditional") => {
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.4",
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.0.0",
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",