@atlaskit/editor-plugin-show-diff 5.0.4 → 5.0.6

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 (70) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/pm-plugins/calculateDiffDecorations.js +66 -39
  3. package/dist/cjs/pm-plugins/{colorSchemes → decorations/colorSchemes}/standard.js +32 -30
  4. package/dist/cjs/pm-plugins/decorations/colorSchemes/traditional.js +75 -0
  5. package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +75 -0
  6. package/dist/cjs/pm-plugins/{deletedRowsHandler.js → decorations/createChangedRowDecorationWidgets.js} +34 -61
  7. package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +33 -0
  8. package/dist/cjs/pm-plugins/{decorations.js → decorations/createNodeChangedDecorationWidget.js} +27 -71
  9. package/dist/cjs/pm-plugins/{attributeDecorations.js → decorations/utils/getAttrChangeRanges.js} +1 -1
  10. package/dist/cjs/pm-plugins/{deletedBlocksHandler.js → decorations/utils/wrapBlockNodeView.js} +90 -70
  11. package/dist/es2019/pm-plugins/calculateDiffDecorations.js +41 -13
  12. package/dist/es2019/pm-plugins/{colorSchemes → decorations/colorSchemes}/standard.js +31 -29
  13. package/dist/es2019/pm-plugins/{colorSchemes → decorations/colorSchemes}/traditional.js +28 -29
  14. package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +70 -0
  15. package/dist/es2019/pm-plugins/{deletedRowsHandler.js → decorations/createChangedRowDecorationWidgets.js} +30 -57
  16. package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +28 -0
  17. package/dist/es2019/pm-plugins/{decorations.js → decorations/createNodeChangedDecorationWidget.js} +27 -71
  18. package/dist/es2019/pm-plugins/{attributeDecorations.js → decorations/utils/getAttrChangeRanges.js} +1 -1
  19. package/dist/es2019/pm-plugins/{deletedBlocksHandler.js → decorations/utils/wrapBlockNodeView.js} +89 -64
  20. package/dist/esm/pm-plugins/calculateDiffDecorations.js +62 -35
  21. package/dist/esm/pm-plugins/{colorSchemes → decorations/colorSchemes}/standard.js +31 -29
  22. package/dist/esm/pm-plugins/{colorSchemes → decorations/colorSchemes}/traditional.js +28 -29
  23. package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +69 -0
  24. package/dist/esm/pm-plugins/{deletedRowsHandler.js → decorations/createChangedRowDecorationWidgets.js} +32 -59
  25. package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +28 -0
  26. package/dist/esm/pm-plugins/{decorations.js → decorations/createNodeChangedDecorationWidget.js} +27 -71
  27. package/dist/esm/pm-plugins/{attributeDecorations.js → decorations/utils/getAttrChangeRanges.js} +1 -1
  28. package/dist/esm/pm-plugins/{deletedBlocksHandler.js → decorations/utils/wrapBlockNodeView.js} +84 -64
  29. package/dist/types/pm-plugins/NodeViewSerializer.d.ts +1 -1
  30. package/dist/types/pm-plugins/calculateDiffDecorations.d.ts +2 -1
  31. package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +17 -0
  32. package/dist/types/pm-plugins/decorations/colorSchemes/traditional.d.ts +13 -0
  33. package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.d.ts +16 -0
  34. package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +17 -0
  35. package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.d.ts +16 -0
  36. package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +15 -0
  37. package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +15 -0
  38. package/dist/types-ts4.5/pm-plugins/NodeViewSerializer.d.ts +1 -1
  39. package/dist/types-ts4.5/pm-plugins/calculateDiffDecorations.d.ts +2 -1
  40. package/dist/types-ts4.5/pm-plugins/decorations/colorSchemes/standard.d.ts +17 -0
  41. package/dist/types-ts4.5/pm-plugins/decorations/colorSchemes/traditional.d.ts +13 -0
  42. package/dist/types-ts4.5/pm-plugins/decorations/createBlockChangedDecoration.d.ts +16 -0
  43. package/dist/types-ts4.5/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +17 -0
  44. package/dist/types-ts4.5/pm-plugins/decorations/createInlineChangedDecoration.d.ts +16 -0
  45. package/dist/types-ts4.5/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +15 -0
  46. package/dist/types-ts4.5/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +15 -0
  47. package/package.json +3 -3
  48. package/dist/cjs/pm-plugins/colorSchemes/traditional.js +0 -76
  49. package/dist/types/pm-plugins/colorSchemes/standard.d.ts +0 -8
  50. package/dist/types/pm-plugins/colorSchemes/traditional.d.ts +0 -5
  51. package/dist/types/pm-plugins/decorations.d.ts +0 -39
  52. package/dist/types/pm-plugins/deletedBlocksHandler.d.ts +0 -59
  53. package/dist/types/pm-plugins/deletedRowsHandler.d.ts +0 -30
  54. package/dist/types-ts4.5/pm-plugins/colorSchemes/standard.d.ts +0 -8
  55. package/dist/types-ts4.5/pm-plugins/colorSchemes/traditional.d.ts +0 -5
  56. package/dist/types-ts4.5/pm-plugins/decorations.d.ts +0 -39
  57. package/dist/types-ts4.5/pm-plugins/deletedBlocksHandler.d.ts +0 -59
  58. package/dist/types-ts4.5/pm-plugins/deletedRowsHandler.d.ts +0 -30
  59. /package/dist/cjs/pm-plugins/{findSafeInsertPos.js → decorations/utils/findSafeInsertPos.js} +0 -0
  60. /package/dist/cjs/pm-plugins/{markDecorations.js → decorations/utils/getMarkChangeRanges.js} +0 -0
  61. /package/dist/es2019/pm-plugins/{findSafeInsertPos.js → decorations/utils/findSafeInsertPos.js} +0 -0
  62. /package/dist/es2019/pm-plugins/{markDecorations.js → decorations/utils/getMarkChangeRanges.js} +0 -0
  63. /package/dist/esm/pm-plugins/{findSafeInsertPos.js → decorations/utils/findSafeInsertPos.js} +0 -0
  64. /package/dist/esm/pm-plugins/{markDecorations.js → decorations/utils/getMarkChangeRanges.js} +0 -0
  65. /package/dist/types/pm-plugins/{findSafeInsertPos.d.ts → decorations/utils/findSafeInsertPos.d.ts} +0 -0
  66. /package/dist/types/pm-plugins/{attributeDecorations.d.ts → decorations/utils/getAttrChangeRanges.d.ts} +0 -0
  67. /package/dist/types/pm-plugins/{markDecorations.d.ts → decorations/utils/getMarkChangeRanges.d.ts} +0 -0
  68. /package/dist/types-ts4.5/pm-plugins/{findSafeInsertPos.d.ts → decorations/utils/findSafeInsertPos.d.ts} +0 -0
  69. /package/dist/types-ts4.5/pm-plugins/{attributeDecorations.d.ts → decorations/utils/getAttrChangeRanges.d.ts} +0 -0
  70. /package/dist/types-ts4.5/pm-plugins/{markDecorations.d.ts → decorations/utils/getMarkChangeRanges.d.ts} +0 -0
@@ -0,0 +1,13 @@
1
+ export declare const traditionalInsertStyle: string;
2
+ export declare const traditionalInsertStyleActive: string;
3
+ export declare const deletedTraditionalContentStyle: string;
4
+ export declare const deletedTraditionalContentStyleUnbounded: string;
5
+ export declare const deletedTraditionalStyleQuoteNode: string;
6
+ export declare const deletedTraditionalBlockOutline: string;
7
+ export declare const deletedTraditionalBlockOutlineRounded: string;
8
+ export declare const deletedTraditionalRowStyle: string;
9
+ export declare const traditionalStyleQuoteNode: string;
10
+ export declare const traditionalStyleRuleNode: string;
11
+ export declare const traditionalStyleNode: string;
12
+ export declare const traditionalStyleCardBlockNode: string;
13
+ export declare const traditionalDecorationMarkerVariable: string;
@@ -0,0 +1,16 @@
1
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
+ import type { ColorScheme } from '../../showDiffPluginType';
3
+ /**
4
+ * Inline decoration used for insertions as the content already exists in the document
5
+ *
6
+ * @param change Changeset "change" containing information about the change content + range
7
+ * @returns Prosemirror inline decoration
8
+ */
9
+ export declare const createBlockChangedDecoration: ({ change, colorScheme, }: {
10
+ change: {
11
+ from: number;
12
+ name: string;
13
+ to: number;
14
+ };
15
+ colorScheme?: ColorScheme;
16
+ }) => Decoration | undefined;
@@ -0,0 +1,17 @@
1
+ import type { Change } from 'prosemirror-changeset';
2
+ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
+ import type { ColorScheme } from '../../showDiffPluginType';
5
+ import type { NodeViewSerializer } from '../NodeViewSerializer';
6
+ type SimpleChange = Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
7
+ /**
8
+ * Main function to handle deleted rows - computes diff and creates decorations
9
+ */
10
+ export declare const createChangedRowDecorationWidgets: ({ changes, originalDoc, newDoc, nodeViewSerializer, colorScheme, }: {
11
+ changes: SimpleChange[];
12
+ colorScheme?: ColorScheme;
13
+ newDoc: PMNode;
14
+ nodeViewSerializer: NodeViewSerializer;
15
+ originalDoc: PMNode;
16
+ }) => Decoration[];
17
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
+ import type { ColorScheme } from '../../showDiffPluginType';
3
+ /**
4
+ * Inline decoration used for insertions as the content already exists in the document
5
+ *
6
+ * @param change Changeset "change" containing information about the change content + range
7
+ * @returns Prosemirror inline decoration
8
+ */
9
+ export declare const createInlineChangedDecoration: ({ change, colorScheme, isActive, }: {
10
+ change: {
11
+ fromB: number;
12
+ toB: number;
13
+ };
14
+ colorScheme?: ColorScheme;
15
+ isActive?: boolean;
16
+ }) => Decoration;
@@ -0,0 +1,15 @@
1
+ import type { Change } from 'prosemirror-changeset';
2
+ import type { IntlShape } from 'react-intl-next';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
+ import type { ColorScheme } from '../../showDiffPluginType';
6
+ import type { NodeViewSerializer } from '../NodeViewSerializer';
7
+ export declare const createNodeChangedDecorationWidget: ({ change, doc, nodeViewSerializer, colorScheme, newDoc, intl, isActive, }: {
8
+ change: Pick<Change, "fromA" | "toA" | "fromB" | "deleted">;
9
+ colorScheme?: ColorScheme;
10
+ doc: PMNode;
11
+ intl: IntlShape;
12
+ isActive?: boolean;
13
+ newDoc: PMNode;
14
+ nodeViewSerializer: NodeViewSerializer;
15
+ }) => Decoration[] | undefined;
@@ -0,0 +1,15 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { ColorScheme } from '../../../showDiffPluginType';
4
+ /**
5
+ * Handles all block node rendering with appropriate deleted styling.
6
+ * For heading nodes, applies styles directly to preserve natural margins.
7
+ * For other block nodes, uses wrapper approach with optional lozenge.
8
+ */
9
+ export declare const wrapBlockNodeView: ({ dom, nodeView, targetNode, colorScheme, intl, }: {
10
+ colorScheme?: ColorScheme;
11
+ dom: HTMLElement;
12
+ intl: IntlShape;
13
+ nodeView: Node;
14
+ targetNode: PMNode;
15
+ }) => void;
@@ -67,7 +67,7 @@ export declare class NodeViewSerializer {
67
67
  /**
68
68
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
69
69
  */
70
- serializeFragment(fragment: Fragment): HTMLElement | DocumentFragment | null;
70
+ serializeFragment(fragment: Fragment): DocumentFragment | HTMLElement | null;
71
71
  /**
72
72
  * Returns a copy of the current node view blocklist.
73
73
  */
@@ -1,6 +1,7 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import { type EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
+ import type { ColorScheme } from '../showDiffPluginType';
4
5
  import type { ShowDiffPluginState } from './main';
5
6
  import type { NodeViewSerializer } from './NodeViewSerializer';
6
7
  export declare const calculateDiffDecorations: import("memoize-one").MemoizedFn<({ state, pluginState, nodeViewSerializer, colorScheme, intl, activeIndexPos, }: {
@@ -8,7 +9,7 @@ export declare const calculateDiffDecorations: import("memoize-one").MemoizedFn<
8
9
  from: number;
9
10
  to: number;
10
11
  };
11
- colorScheme?: "standard" | "traditional";
12
+ colorScheme?: ColorScheme;
12
13
  intl: IntlShape;
13
14
  nodeViewSerializer: NodeViewSerializer;
14
15
  pluginState: Omit<ShowDiffPluginState, "decorations">;
@@ -0,0 +1,17 @@
1
+ export declare const editingStyle: string;
2
+ export declare const editingStyleActive: string;
3
+ export declare const deletedContentStyle: string;
4
+ export declare const deletedContentStyleActive: string;
5
+ export declare const deletedContentStyleNew: string;
6
+ export declare const deletedContentStyleNewActive: string;
7
+ export declare const deletedContentStyleUnbounded: string;
8
+ export declare const deletedStyleQuoteNode: string;
9
+ export declare const deletedStyleQuoteNodeWithLozenge: string;
10
+ export declare const deletedBlockOutline: string;
11
+ export declare const deletedBlockOutlineRounded: string;
12
+ export declare const deletedRowStyle: string;
13
+ export declare const editingStyleQuoteNode: string;
14
+ export declare const editingStyleRuleNode: string;
15
+ export declare const editingStyleNode: string;
16
+ export declare const editingStyleCardBlockNode: string;
17
+ export declare const standardDecorationMarkerVariable: string;
@@ -0,0 +1,13 @@
1
+ export declare const traditionalInsertStyle: string;
2
+ export declare const traditionalInsertStyleActive: string;
3
+ export declare const deletedTraditionalContentStyle: string;
4
+ export declare const deletedTraditionalContentStyleUnbounded: string;
5
+ export declare const deletedTraditionalStyleQuoteNode: string;
6
+ export declare const deletedTraditionalBlockOutline: string;
7
+ export declare const deletedTraditionalBlockOutlineRounded: string;
8
+ export declare const deletedTraditionalRowStyle: string;
9
+ export declare const traditionalStyleQuoteNode: string;
10
+ export declare const traditionalStyleRuleNode: string;
11
+ export declare const traditionalStyleNode: string;
12
+ export declare const traditionalStyleCardBlockNode: string;
13
+ export declare const traditionalDecorationMarkerVariable: string;
@@ -0,0 +1,16 @@
1
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
+ import type { ColorScheme } from '../../showDiffPluginType';
3
+ /**
4
+ * Inline decoration used for insertions as the content already exists in the document
5
+ *
6
+ * @param change Changeset "change" containing information about the change content + range
7
+ * @returns Prosemirror inline decoration
8
+ */
9
+ export declare const createBlockChangedDecoration: ({ change, colorScheme, }: {
10
+ change: {
11
+ from: number;
12
+ name: string;
13
+ to: number;
14
+ };
15
+ colorScheme?: ColorScheme;
16
+ }) => Decoration | undefined;
@@ -0,0 +1,17 @@
1
+ import type { Change } from 'prosemirror-changeset';
2
+ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
+ import type { ColorScheme } from '../../showDiffPluginType';
5
+ import type { NodeViewSerializer } from '../NodeViewSerializer';
6
+ type SimpleChange = Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
7
+ /**
8
+ * Main function to handle deleted rows - computes diff and creates decorations
9
+ */
10
+ export declare const createChangedRowDecorationWidgets: ({ changes, originalDoc, newDoc, nodeViewSerializer, colorScheme, }: {
11
+ changes: SimpleChange[];
12
+ colorScheme?: ColorScheme;
13
+ newDoc: PMNode;
14
+ nodeViewSerializer: NodeViewSerializer;
15
+ originalDoc: PMNode;
16
+ }) => Decoration[];
17
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
+ import type { ColorScheme } from '../../showDiffPluginType';
3
+ /**
4
+ * Inline decoration used for insertions as the content already exists in the document
5
+ *
6
+ * @param change Changeset "change" containing information about the change content + range
7
+ * @returns Prosemirror inline decoration
8
+ */
9
+ export declare const createInlineChangedDecoration: ({ change, colorScheme, isActive, }: {
10
+ change: {
11
+ fromB: number;
12
+ toB: number;
13
+ };
14
+ colorScheme?: ColorScheme;
15
+ isActive?: boolean;
16
+ }) => Decoration;
@@ -0,0 +1,15 @@
1
+ import type { Change } from 'prosemirror-changeset';
2
+ import type { IntlShape } from 'react-intl-next';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
+ import type { ColorScheme } from '../../showDiffPluginType';
6
+ import type { NodeViewSerializer } from '../NodeViewSerializer';
7
+ export declare const createNodeChangedDecorationWidget: ({ change, doc, nodeViewSerializer, colorScheme, newDoc, intl, isActive, }: {
8
+ change: Pick<Change, "fromA" | "toA" | "fromB" | "deleted">;
9
+ colorScheme?: ColorScheme;
10
+ doc: PMNode;
11
+ intl: IntlShape;
12
+ isActive?: boolean;
13
+ newDoc: PMNode;
14
+ nodeViewSerializer: NodeViewSerializer;
15
+ }) => Decoration[] | undefined;
@@ -0,0 +1,15 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { ColorScheme } from '../../../showDiffPluginType';
4
+ /**
5
+ * Handles all block node rendering with appropriate deleted styling.
6
+ * For heading nodes, applies styles directly to preserve natural margins.
7
+ * For other block nodes, uses wrapper approach with optional lozenge.
8
+ */
9
+ export declare const wrapBlockNodeView: ({ dom, nodeView, targetNode, colorScheme, intl, }: {
10
+ colorScheme?: ColorScheme;
11
+ dom: HTMLElement;
12
+ intl: IntlShape;
13
+ nodeView: Node;
14
+ targetNode: PMNode;
15
+ }) => void;
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.6",
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.4.0",
36
36
  "@atlaskit/tokens": "^11.0.0",
37
37
  "@babel/runtime": "^7.0.0",
38
38
  "lodash": "^4.17.21",
@@ -40,7 +40,7 @@
40
40
  "prosemirror-changeset": "^2.3.1"
41
41
  },
42
42
  "peerDependencies": {
43
- "@atlaskit/editor-common": "^111.30.0",
43
+ "@atlaskit/editor-common": "^111.31.0",
44
44
  "react": "^18.2.0"
45
45
  },
46
46
  "techstack": {
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.traditionalInsertStyleActive = exports.traditionalInsertStyle = exports.getTraditionalNodeStyle = exports.deletedTraditionalContentStyleUnbounded = exports.deletedTraditionalContentStyle = void 0;
7
- var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
8
- var traditionalInsertStyle = exports.traditionalInsertStyle = (0, _lazyNodeView.convertToInlineCss)({
9
- background: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
10
- textDecoration: 'underline',
11
- textDecorationStyle: 'solid',
12
- textDecorationThickness: "var(--ds-space-025, 2px)",
13
- textDecorationColor: "var(--ds-border-accent-green, #22A06B)"
14
- });
15
- var traditionalInsertStyleActive = exports.traditionalInsertStyleActive = (0, _lazyNodeView.convertToInlineCss)({
16
- background: "var(--ds-background-accent-green-subtler, #BAF3DB)",
17
- textDecoration: 'underline',
18
- textDecorationStyle: 'solid',
19
- textDecorationThickness: "var(--ds-space-025, 2px)",
20
- textDecorationColor: "var(--ds-text-accent-green, #216E4E)"
21
- });
22
- var deletedTraditionalContentStyle = exports.deletedTraditionalContentStyle = (0, _lazyNodeView.convertToInlineCss)({
23
- textDecorationColor: "var(--ds-border-accent-red, #E2483D)",
24
- textDecoration: 'line-through',
25
- position: 'relative',
26
- opacity: 1
27
- });
28
- var deletedTraditionalContentStyleUnbounded = exports.deletedTraditionalContentStyleUnbounded = (0, _lazyNodeView.convertToInlineCss)({
29
- position: 'absolute',
30
- top: '50%',
31
- width: '100%',
32
- display: 'inline-block',
33
- borderTop: "1px solid ".concat("var(--ds-border-accent-red, #E2483D)"),
34
- pointerEvents: 'none',
35
- zIndex: 1
36
- });
37
- var traditionalStyleQuoteNode = (0, _lazyNodeView.convertToInlineCss)({
38
- borderLeft: "2px solid ".concat("var(--ds-border-accent-green, #22A06B)")
39
- });
40
- var traditionalStyleRuleNode = (0, _lazyNodeView.convertToInlineCss)({
41
- backgroundColor: "var(--ds-border-accent-green, #22A06B)"
42
- });
43
- var traditionalStyleNode = (0, _lazyNodeView.convertToInlineCss)({
44
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-green, #22A06B)"),
45
- borderRadius: "var(--ds-radius-small, 4px)"
46
- });
47
- var traditionalStyleCardBlockNode = (0, _lazyNodeView.convertToInlineCss)({
48
- boxShadow: "0 0 0 1px ".concat("var(--ds-border-accent-green, #22A06B)"),
49
- borderRadius: "var(--ds-radius-medium, 6px)"
50
- });
51
- var traditionalDecorationMarkerVariable = (0, _lazyNodeView.convertToInlineCss)({
52
- '--diff-decoration-marker-color': "var(--ds-border-accent-green, #22A06B)"
53
- });
54
- var getTraditionalNodeStyle = exports.getTraditionalNodeStyle = function getTraditionalNodeStyle(nodeName) {
55
- if (['mediaSingle', 'mediaGroup', 'table',
56
- // Handle table separately to avoid border issues
57
- 'tableRow', 'tableCell', 'tableHeader', 'paragraph',
58
- // Paragraph and heading nodes do not need special styling
59
- 'heading', 'hardBreak', 'decisionList', 'taskList', 'taskItem', 'bulletList', 'orderedList', 'layoutSection'].includes(nodeName)) {
60
- // Layout nodes do not need special styling
61
- return undefined;
62
- }
63
- if (['extension', 'embedCard', 'listItem'].includes(nodeName)) {
64
- return traditionalDecorationMarkerVariable;
65
- }
66
- if (nodeName === 'blockquote') {
67
- return traditionalStyleQuoteNode;
68
- }
69
- if (nodeName === 'rule') {
70
- return traditionalStyleRuleNode;
71
- }
72
- if (nodeName === 'blockCard') {
73
- return traditionalStyleCardBlockNode;
74
- }
75
- return traditionalStyleNode;
76
- };
@@ -1,8 +0,0 @@
1
- export declare const editingStyle: string;
2
- export declare const editingStyleActive: string;
3
- export declare const deletedContentStyle: string;
4
- export declare const deletedContentStyleActive: string;
5
- export declare const deletedContentStyleNew: string;
6
- export declare const deletedContentStyleNewActive: string;
7
- export declare const deletedContentStyleUnbounded: string;
8
- export declare const getStandardNodeStyle: (nodeName: string) => string | undefined;
@@ -1,5 +0,0 @@
1
- export declare const traditionalInsertStyle: string;
2
- export declare const traditionalInsertStyleActive: string;
3
- export declare const deletedTraditionalContentStyle: string;
4
- export declare const deletedTraditionalContentStyleUnbounded: string;
5
- export declare const getTraditionalNodeStyle: (nodeName: string) => string | undefined;
@@ -1,39 +0,0 @@
1
- import type { Change } from 'prosemirror-changeset';
2
- import type { IntlShape } from 'react-intl-next';
3
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import type { NodeViewSerializer } from './NodeViewSerializer';
6
- /**
7
- * Inline decoration used for insertions as the content already exists in the document
8
- *
9
- * @param change Changeset "change" containing information about the change content + range
10
- * @returns Prosemirror inline decoration
11
- */
12
- export declare const createInlineChangedDecoration: (change: {
13
- fromB: number;
14
- toB: number;
15
- }, colorScheme?: "standard" | "traditional", isActive?: boolean) => Decoration;
16
- export declare const getDeletedContentStyleUnbounded: (colorScheme?: "standard" | "traditional") => string;
17
- export declare const getDeletedContentStyle: (colorScheme?: "standard" | "traditional", isActive?: boolean) => string;
18
- /**
19
- * Inline decoration used for insertions as the content already exists in the document
20
- *
21
- * @param change Changeset "change" containing information about the change content + range
22
- * @returns Prosemirror inline decoration
23
- */
24
- export declare const createBlockChangedDecoration: (change: {
25
- from: number;
26
- name: string;
27
- to: number;
28
- }, colorScheme?: "standard" | "traditional") => Decoration | undefined;
29
- interface DeletedContentDecorationProps {
30
- change: Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
31
- colorScheme?: 'standard' | 'traditional';
32
- doc: PMNode;
33
- intl: IntlShape;
34
- isActive?: boolean;
35
- newDoc: PMNode;
36
- nodeViewSerializer: NodeViewSerializer;
37
- }
38
- export declare const createDeletedContentDecoration: ({ change, doc, nodeViewSerializer, colorScheme, newDoc, intl, isActive, }: DeletedContentDecorationProps) => Decoration[] | undefined;
39
- export {};
@@ -1,59 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
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
- 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
- /**
46
- * Handles special mediaSingle node rendering with lozenge on child media element
47
- * @returns true if mediaSingle was handled, false otherwise
48
- */
49
- 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
- /**
55
- * Handles all block node rendering with appropriate deleted styling.
56
- * For heading nodes, applies styles directly to preserve natural margins.
57
- * For other block nodes, uses wrapper approach with optional lozenge.
58
- */
59
- export declare const handleBlockNodeView: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, colorScheme: "standard" | "traditional" | undefined, intl: IntlShape) => void;
@@ -1,30 +0,0 @@
1
- import type { Change } from 'prosemirror-changeset';
2
- import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
- import type { NodeViewSerializer } from './NodeViewSerializer';
5
- interface DeletedRowInfo {
6
- fromA: number;
7
- fromB: number;
8
- rowIndex: number;
9
- rowNode: PMNode;
10
- toA: number;
11
- }
12
- type SimpleChange = Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
13
- interface DeletedRowsHandlerProps {
14
- colorScheme?: 'standard' | 'traditional';
15
- deletedRows: DeletedRowInfo[];
16
- newDoc: PMNode;
17
- nodeViewSerializer: NodeViewSerializer;
18
- originalDoc: PMNode;
19
- }
20
- /**
21
- * Creates decorations for deleted table rows
22
- */
23
- export declare const createDeletedRowsDecorations: ({ deletedRows, originalDoc, newDoc, nodeViewSerializer, colorScheme, }: DeletedRowsHandlerProps) => Decoration[];
24
- /**
25
- * Main function to handle deleted rows - computes diff and creates decorations
26
- */
27
- export declare const handleDeletedRows: (changes: SimpleChange[], originalDoc: PMNode, newDoc: PMNode, nodeViewSerializer: NodeViewSerializer, colorScheme?: "standard" | "traditional") => {
28
- decorations: Decoration[];
29
- };
30
- export {};
@@ -1,8 +0,0 @@
1
- export declare const editingStyle: string;
2
- export declare const editingStyleActive: string;
3
- export declare const deletedContentStyle: string;
4
- export declare const deletedContentStyleActive: string;
5
- export declare const deletedContentStyleNew: string;
6
- export declare const deletedContentStyleNewActive: string;
7
- export declare const deletedContentStyleUnbounded: string;
8
- export declare const getStandardNodeStyle: (nodeName: string) => string | undefined;
@@ -1,5 +0,0 @@
1
- export declare const traditionalInsertStyle: string;
2
- export declare const traditionalInsertStyleActive: string;
3
- export declare const deletedTraditionalContentStyle: string;
4
- export declare const deletedTraditionalContentStyleUnbounded: string;
5
- export declare const getTraditionalNodeStyle: (nodeName: string) => string | undefined;
@@ -1,39 +0,0 @@
1
- import type { Change } from 'prosemirror-changeset';
2
- import type { IntlShape } from 'react-intl-next';
3
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
- import type { NodeViewSerializer } from './NodeViewSerializer';
6
- /**
7
- * Inline decoration used for insertions as the content already exists in the document
8
- *
9
- * @param change Changeset "change" containing information about the change content + range
10
- * @returns Prosemirror inline decoration
11
- */
12
- export declare const createInlineChangedDecoration: (change: {
13
- fromB: number;
14
- toB: number;
15
- }, colorScheme?: "standard" | "traditional", isActive?: boolean) => Decoration;
16
- export declare const getDeletedContentStyleUnbounded: (colorScheme?: "standard" | "traditional") => string;
17
- export declare const getDeletedContentStyle: (colorScheme?: "standard" | "traditional", isActive?: boolean) => string;
18
- /**
19
- * Inline decoration used for insertions as the content already exists in the document
20
- *
21
- * @param change Changeset "change" containing information about the change content + range
22
- * @returns Prosemirror inline decoration
23
- */
24
- export declare const createBlockChangedDecoration: (change: {
25
- from: number;
26
- name: string;
27
- to: number;
28
- }, colorScheme?: "standard" | "traditional") => Decoration | undefined;
29
- interface DeletedContentDecorationProps {
30
- change: Pick<Change, 'fromA' | 'toA' | 'fromB' | 'deleted'>;
31
- colorScheme?: 'standard' | 'traditional';
32
- doc: PMNode;
33
- intl: IntlShape;
34
- isActive?: boolean;
35
- newDoc: PMNode;
36
- nodeViewSerializer: NodeViewSerializer;
37
- }
38
- export declare const createDeletedContentDecoration: ({ change, doc, nodeViewSerializer, colorScheme, newDoc, intl, isActive, }: DeletedContentDecorationProps) => Decoration[] | undefined;
39
- export {};
@@ -1,59 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
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
- 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
- /**
46
- * Handles special mediaSingle node rendering with lozenge on child media element
47
- * @returns true if mediaSingle was handled, false otherwise
48
- */
49
- 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
- /**
55
- * Handles all block node rendering with appropriate deleted styling.
56
- * For heading nodes, applies styles directly to preserve natural margins.
57
- * For other block nodes, uses wrapper approach with optional lozenge.
58
- */
59
- export declare const handleBlockNodeView: (dom: HTMLElement, nodeView: Node, targetNode: PMNode, colorScheme: "standard" | "traditional" | undefined, intl: IntlShape) => void;