@atlaskit/editor-plugin-show-diff 16.0.13 → 16.0.16
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 +26 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +91 -28
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +4 -6
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +11 -8
- package/dist/cjs/pm-plugins/utils/isEmptyParagraphSlice.js +11 -0
- package/dist/cjs/ui/ContributorTag/buildContributorTagDom.js +5 -4
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +70 -13
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +4 -6
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +11 -8
- package/dist/es2019/pm-plugins/utils/isEmptyParagraphSlice.js +5 -0
- package/dist/es2019/ui/ContributorTag/buildContributorTagDom.js +5 -4
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +92 -29
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +4 -6
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +11 -8
- package/dist/esm/pm-plugins/utils/isEmptyParagraphSlice.js +5 -0
- package/dist/esm/ui/ContributorTag/buildContributorTagDom.js +5 -4
- package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +6 -1
- package/dist/types/pm-plugins/utils/isEmptyParagraphSlice.d.ts +3 -0
- package/dist/types/ui/ContributorTag/buildContributorTagDom.d.ts +4 -4
- package/package.json +2 -2
- package/dist/cjs/pm-plugins/areDocsEqualByBlockStructureAndText.js +0 -55
- package/dist/cjs/pm-plugins/utils/hasVisibleContent.js +0 -37
- package/dist/es2019/pm-plugins/areDocsEqualByBlockStructureAndText.js +0 -50
- package/dist/es2019/pm-plugins/utils/hasVisibleContent.js +0 -28
- package/dist/esm/pm-plugins/areDocsEqualByBlockStructureAndText.js +0 -50
- package/dist/esm/pm-plugins/utils/hasVisibleContent.js +0 -32
- package/dist/types/pm-plugins/areDocsEqualByBlockStructureAndText.d.ts +0 -12
- package/dist/types/pm-plugins/utils/hasVisibleContent.d.ts +0 -13
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { isWhitespaceChar } from './charsByOffset';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Whether `fragment` holds anything a reader can see.
|
|
6
|
-
*
|
|
7
|
-
* Text counts once it carries a single non-whitespace character; a leaf node (mention, emoji, date,
|
|
8
|
-
* media, rule, hardBreak, …) counts in its own right, exactly as `resolveTagAnchorPos` treats one.
|
|
9
|
-
* Everything else is descended into, so a paragraph is visible when its content is.
|
|
10
|
-
*
|
|
11
|
-
* A change whose content is nothing but whitespace — a space typed between two words, a run of
|
|
12
|
-
* trailing spaces, an added blank paragraph — has no visible content for a contributor tag to
|
|
13
|
-
* caption, so it carries no tag (EDITOR-8855).
|
|
14
|
-
*/
|
|
15
|
-
var _hasVisibleContent = function hasVisibleContent(fragment) {
|
|
16
|
-
var visible = false;
|
|
17
|
-
fragment.forEach(function (node) {
|
|
18
|
-
if (visible) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (node.isText) {
|
|
22
|
-
var _node$text;
|
|
23
|
-
visible = _toConsumableArray((_node$text = node.text) !== null && _node$text !== void 0 ? _node$text : '').some(function (char) {
|
|
24
|
-
return !isWhitespaceChar(char);
|
|
25
|
-
});
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
visible = node.isLeaf || _hasVisibleContent(node.content);
|
|
29
|
-
});
|
|
30
|
-
return visible;
|
|
31
|
-
};
|
|
32
|
-
export { _hasVisibleContent as hasVisibleContent };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Looser equality for "safe diff" cases: same full text content and same block structure
|
|
4
|
-
* (e.g. text moved across text-node boundaries). Used when strict areNodesEqualIgnoreAttrs fails.
|
|
5
|
-
* This is safe because we ensure decorations get applied to valid positions.
|
|
6
|
-
*
|
|
7
|
-
* Marks are intentionally ignored — two documents that differ only in mark application
|
|
8
|
-
* (e.g. bold/italic boundaries or annotation mark ordering) are considered equal here.
|
|
9
|
-
* Both documents are mark-stripped before comparison so that mark-driven text fragmentation
|
|
10
|
-
* does not produce false inequalities.
|
|
11
|
-
*/
|
|
12
|
-
export declare function areDocsEqualByBlockStructureAndText(doc1: PMNode, doc2: PMNode): boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Whether `fragment` holds anything a reader can see.
|
|
4
|
-
*
|
|
5
|
-
* Text counts once it carries a single non-whitespace character; a leaf node (mention, emoji, date,
|
|
6
|
-
* media, rule, hardBreak, …) counts in its own right, exactly as `resolveTagAnchorPos` treats one.
|
|
7
|
-
* Everything else is descended into, so a paragraph is visible when its content is.
|
|
8
|
-
*
|
|
9
|
-
* A change whose content is nothing but whitespace — a space typed between two words, a run of
|
|
10
|
-
* trailing spaces, an added blank paragraph — has no visible content for a contributor tag to
|
|
11
|
-
* caption, so it carries no tag (EDITOR-8855).
|
|
12
|
-
*/
|
|
13
|
-
export declare const hasVisibleContent: (fragment: Fragment) => boolean;
|