@atlaskit/editor-plugin-show-diff 0.1.3 → 0.1.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+
10
+ ## 0.1.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [`1fc9ea612c6ef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1fc9ea612c6ef) -
15
+ [EDITOR-1358] Fix nit + minor local bug
16
+
3
17
  ## 0.1.3
4
18
 
5
19
  ### Patch Changes
@@ -53,7 +53,7 @@ var NodeViewSerializer = exports.NodeViewSerializer = /*#__PURE__*/function () {
53
53
  this.editorView = params.editorView;
54
54
  }
55
55
  this.nodeViews = (_ref = (_params$nodeViews = params.nodeViews) !== null && _params$nodeViews !== void 0 ? _params$nodeViews : (_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.nodeViews) !== null && _ref !== void 0 ? _ref : {};
56
- this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table']);
56
+ this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table', 'paragraph']);
57
57
  }
58
58
 
59
59
  /**
@@ -92,7 +92,6 @@ var NodeViewSerializer = exports.NodeViewSerializer = /*#__PURE__*/function () {
92
92
  /**
93
93
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
94
94
  */
95
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
95
  }, {
97
96
  key: "serializeFragment",
98
97
  value: function serializeFragment(fragment) {
@@ -43,7 +43,7 @@ export class NodeViewSerializer {
43
43
  this.editorView = params.editorView;
44
44
  }
45
45
  this.nodeViews = (_ref = (_params$nodeViews = params.nodeViews) !== null && _params$nodeViews !== void 0 ? _params$nodeViews : (_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.nodeViews) !== null && _ref !== void 0 ? _ref : {};
46
- this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table']);
46
+ this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table', 'paragraph']);
47
47
  }
48
48
 
49
49
  /**
@@ -76,7 +76,6 @@ export class NodeViewSerializer {
76
76
  /**
77
77
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
78
78
  */
79
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
80
79
  serializeFragment(fragment) {
81
80
  return this.serializer.serializeFragment(fragment);
82
81
  }
@@ -46,7 +46,7 @@ export var NodeViewSerializer = /*#__PURE__*/function () {
46
46
  this.editorView = params.editorView;
47
47
  }
48
48
  this.nodeViews = (_ref = (_params$nodeViews = params.nodeViews) !== null && _params$nodeViews !== void 0 ? _params$nodeViews : (_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.nodeViews) !== null && _ref !== void 0 ? _ref : {};
49
- this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table']);
49
+ this.nodeViewBlocklist = new Set((_params$blocklist = params.blocklist) !== null && _params$blocklist !== void 0 ? _params$blocklist : ['tableRow', 'table', 'paragraph']);
50
50
  }
51
51
 
52
52
  /**
@@ -85,7 +85,6 @@ export var NodeViewSerializer = /*#__PURE__*/function () {
85
85
  /**
86
86
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
87
87
  */
88
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
88
  }, {
90
89
  key: "serializeFragment",
91
90
  value: function serializeFragment(fragment) {
@@ -1,5 +1,5 @@
1
1
  import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
2
- import type { Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Schema, Node as PMNode, Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  /**
5
5
  * Utilities for working with ProseMirror node views and DOM serialization within the
@@ -39,10 +39,10 @@ export declare class NodeViewSerializer {
39
39
  private nodeViews;
40
40
  private nodeViewBlocklist;
41
41
  constructor(params: {
42
- schema: Schema;
42
+ blocklist?: string[];
43
43
  editorView?: EditorView;
44
44
  nodeViews?: Record<string, NodeViewConstructor>;
45
- blocklist?: string[];
45
+ schema: Schema;
46
46
  });
47
47
  /**
48
48
  * Attempts to create a node view for the given node.
@@ -58,5 +58,5 @@ export declare class NodeViewSerializer {
58
58
  /**
59
59
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
60
60
  */
61
- serializeFragment(fragment: any): DocumentFragment | HTMLElement;
61
+ serializeFragment(fragment: Fragment): DocumentFragment | HTMLElement;
62
62
  }
@@ -17,9 +17,9 @@ export declare const createInlineChangedDecoration: (change: {
17
17
  interface DeletedContentDecorationProps {
18
18
  change: Change;
19
19
  doc: PMNode;
20
- tr: Transaction;
21
- nodeViews: Record<string, NodeViewConstructor>;
22
20
  editorView?: EditorView;
21
+ nodeViews: Record<string, NodeViewConstructor>;
22
+ tr: Transaction;
23
23
  }
24
24
  /**
25
25
  * Creates a widget to represent the deleted content in the editor
@@ -6,10 +6,10 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
6
  import { type DiffParams } from '../showDiffPluginType';
7
7
  export declare const showDiffPluginKey: PluginKey<ShowDiffPluginState>;
8
8
  type ShowDiffPluginState = {
9
- steps: ProseMirrorStep[];
10
- originalDoc: PMNode | undefined;
11
9
  decorations: DecorationSet;
12
10
  isDisplayingChanges: boolean;
11
+ originalDoc: PMNode | undefined;
12
+ steps: ProseMirrorStep[];
13
13
  };
14
14
  export declare const createPlugin: (config: DiffParams | undefined) => SafePlugin<ShowDiffPluginState>;
15
15
  export {};
@@ -4,26 +4,26 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Node } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
6
6
  export type DiffParams = {
7
+ originalDoc: JSONDocNode;
7
8
  /**
8
9
  * Prosemirror steps. This is used to calculate and show the diff in the editor
9
10
  */
10
11
  steps: StepJson[];
11
- originalDoc: JSONDocNode;
12
12
  };
13
13
  export type PMDiffParams = {
14
+ originalDoc: Node;
14
15
  /**
15
16
  * Prosemirror steps. This is used to calculate and show the diff in the editor
16
17
  */
17
18
  steps: Step[];
18
- originalDoc: Node;
19
19
  };
20
20
  export type ACTION = 'SHOW_DIFF' | 'HIDE_DIFF';
21
21
  export type ShowDiffPlugin = NextEditorPlugin<'showDiff', {
22
- pluginConfiguration: DiffParams | undefined;
23
22
  commands: {
24
- showDiff: (config: PMDiffParams) => EditorCommand;
25
23
  hideDiff: EditorCommand;
24
+ showDiff: (config: PMDiffParams) => EditorCommand;
26
25
  };
26
+ pluginConfiguration: DiffParams | undefined;
27
27
  sharedState: {
28
28
  /**
29
29
  * Whether the show diff feature is currently displaying changes.
@@ -1,5 +1,5 @@
1
1
  import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
2
- import type { Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Schema, Node as PMNode, Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  /**
5
5
  * Utilities for working with ProseMirror node views and DOM serialization within the
@@ -39,10 +39,10 @@ export declare class NodeViewSerializer {
39
39
  private nodeViews;
40
40
  private nodeViewBlocklist;
41
41
  constructor(params: {
42
- schema: Schema;
42
+ blocklist?: string[];
43
43
  editorView?: EditorView;
44
44
  nodeViews?: Record<string, NodeViewConstructor>;
45
- blocklist?: string[];
45
+ schema: Schema;
46
46
  });
47
47
  /**
48
48
  * Attempts to create a node view for the given node.
@@ -58,5 +58,5 @@ export declare class NodeViewSerializer {
58
58
  /**
59
59
  * Serializes a fragment to a `DocumentFragment` using the schema's `DOMSerializer`.
60
60
  */
61
- serializeFragment(fragment: any): DocumentFragment | HTMLElement;
61
+ serializeFragment(fragment: Fragment): DocumentFragment | HTMLElement;
62
62
  }
@@ -17,9 +17,9 @@ export declare const createInlineChangedDecoration: (change: {
17
17
  interface DeletedContentDecorationProps {
18
18
  change: Change;
19
19
  doc: PMNode;
20
- tr: Transaction;
21
- nodeViews: Record<string, NodeViewConstructor>;
22
20
  editorView?: EditorView;
21
+ nodeViews: Record<string, NodeViewConstructor>;
22
+ tr: Transaction;
23
23
  }
24
24
  /**
25
25
  * Creates a widget to represent the deleted content in the editor
@@ -6,10 +6,10 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
6
  import { type DiffParams } from '../showDiffPluginType';
7
7
  export declare const showDiffPluginKey: PluginKey<ShowDiffPluginState>;
8
8
  type ShowDiffPluginState = {
9
- steps: ProseMirrorStep[];
10
- originalDoc: PMNode | undefined;
11
9
  decorations: DecorationSet;
12
10
  isDisplayingChanges: boolean;
11
+ originalDoc: PMNode | undefined;
12
+ steps: ProseMirrorStep[];
13
13
  };
14
14
  export declare const createPlugin: (config: DiffParams | undefined) => SafePlugin<ShowDiffPluginState>;
15
15
  export {};
@@ -4,26 +4,26 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Node } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
6
6
  export type DiffParams = {
7
+ originalDoc: JSONDocNode;
7
8
  /**
8
9
  * Prosemirror steps. This is used to calculate and show the diff in the editor
9
10
  */
10
11
  steps: StepJson[];
11
- originalDoc: JSONDocNode;
12
12
  };
13
13
  export type PMDiffParams = {
14
+ originalDoc: Node;
14
15
  /**
15
16
  * Prosemirror steps. This is used to calculate and show the diff in the editor
16
17
  */
17
18
  steps: Step[];
18
- originalDoc: Node;
19
19
  };
20
20
  export type ACTION = 'SHOW_DIFF' | 'HIDE_DIFF';
21
21
  export type ShowDiffPlugin = NextEditorPlugin<'showDiff', {
22
- pluginConfiguration: DiffParams | undefined;
23
22
  commands: {
24
- showDiff: (config: PMDiffParams) => EditorCommand;
25
23
  hideDiff: EditorCommand;
24
+ showDiff: (config: PMDiffParams) => EditorCommand;
26
25
  };
26
+ pluginConfiguration: DiffParams | undefined;
27
27
  sharedState: {
28
28
  /**
29
29
  * Whether the show diff feature is currently displaying changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  "prosemirror-changeset": "^2.2.1"
38
38
  },
39
39
  "peerDependencies": {
40
- "@atlaskit/editor-common": "^107.25.0",
40
+ "@atlaskit/editor-common": "^107.28.0",
41
41
  "react": "^18.2.0"
42
42
  },
43
43
  "techstack": {