@atlaskit/editor-plugin-show-diff 17.0.2 → 17.1.1
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 +21 -0
- package/dist/cjs/entry-points/show-diff-plugin-type.js +12 -1
- package/dist/cjs/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +4 -4
- package/dist/cjs/pm-plugins/decorations/colorSchemes/attributions.js +14 -3
- package/dist/cjs/pm-plugins/decorations/createAnchorDecorationWidgets.js +28 -8
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +1 -1
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +2 -2
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +4 -3
- package/dist/cjs/showDiffPluginType.js +87 -1
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/es2019/entry-points/calculate-diff.js +1 -0
- package/dist/es2019/entry-points/show-diff-plugin-type.js +3 -0
- package/dist/es2019/entry-points/show-diff-plugin.js +1 -0
- package/dist/es2019/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +4 -4
- package/dist/es2019/pm-plugins/decorations/colorSchemes/attributions.js +12 -3
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +0 -1
- package/dist/es2019/pm-plugins/decorations/createAnchorDecorationWidgets.js +28 -8
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +1 -1
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +2 -2
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +3 -1
- package/dist/es2019/pm-plugins/scrollToDiff.js +1 -0
- package/dist/es2019/showDiffPluginType.js +85 -1
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/esm/entry-points/calculate-diff.js +1 -0
- package/dist/esm/entry-points/show-diff-plugin-type.js +3 -0
- package/dist/esm/entry-points/show-diff-plugin.js +1 -0
- package/dist/esm/pm-plugins/NodeViewSerializer.js +1 -1
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +4 -4
- package/dist/esm/pm-plugins/decorations/colorSchemes/attributions.js +14 -3
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +0 -1
- package/dist/esm/pm-plugins/decorations/createAnchorDecorationWidgets.js +28 -8
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +1 -1
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +1 -1
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +2 -2
- package/dist/esm/pm-plugins/resolveDiffContributors.js +4 -3
- package/dist/esm/pm-plugins/scrollToDiff.js +1 -0
- package/dist/esm/showDiffPluginType.js +85 -1
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +22 -14
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +4 -0
- package/dist/types/entry-points/show-diff-plugin-type.d.ts +2 -1
- package/dist/types/pm-plugins/decorations/colorSchemes/attributions.d.ts +2 -2
- package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/getAttrChangeRanges.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/getMarkChangeRanges.d.ts +1 -1
- package/dist/types/showDiffPluginType.d.ts +6 -1
- package/dist/types/ui/ContributorTag/contributorTagIcons.d.ts +1 -1
- package/package.json +5 -5
|
@@ -27,9 +27,13 @@ var ROVO_HEX_ICON_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" r
|
|
|
27
27
|
|
|
28
28
|
/** ClaudeLogo from ai-mate/studio-browse-kit, inset to fit the agent hexagon. */
|
|
29
29
|
var CLAUDE_ICON_SVG = "<svg width=\"12\" height=\"12\" viewBox=\"8 8 32 32\" role=\"presentation\" style=\"display:block\"><path fill=\"#FFFFFF\" d=\"M14.2785 29.274L20.5732 25.7445L20.6785 25.4369L20.5732 25.2669H20.2653L19.2122 25.2021L15.6152 25.105L12.4962 24.9755L9.47443 24.8136L8.71291 24.6517L8 23.7126L8.07291 23.2431L8.71291 22.8141L9.62835 22.895L11.6537 23.0326L14.6916 23.2431L16.8952 23.3726L20.16 23.7126H20.6785L20.7514 23.5022L20.5732 23.3726L20.4354 23.2431L17.2922 21.1141L13.8896 18.8636L12.1073 17.5684L11.1433 16.9127L10.6572 16.2975L10.4466 14.9537L11.3215 13.9904L12.4962 14.0713L12.7959 14.1523L13.9868 15.067L16.5306 17.0342L19.8522 19.4789L20.3382 19.8836L20.5327 19.746L20.557 19.6489L20.3382 19.2846L18.5316 16.0223L16.6035 12.7033L15.7448 11.3271L15.518 10.5014C15.437 10.1614 15.3803 9.87807 15.3803 9.52998L16.3767 8.17809L16.9276 8L18.2562 8.17809L18.8152 8.6638L19.6415 10.55L20.9782 13.5209L23.0522 17.5603L23.6597 18.7584L23.9838 19.8674L24.1053 20.2074H24.3159V20.0132L24.4861 17.7384L24.802 14.9456L25.1099 11.3514L25.2152 10.3395L25.7175 9.12522L26.7139 8.46952L27.4916 8.84189L28.1316 9.75664L28.0425 10.3476L27.6618 12.8166L26.9165 16.6861L26.4304 19.2765H26.7139L27.038 18.9527L28.3504 17.2122L30.5539 14.4599L31.5261 13.3671L32.6603 12.1609L33.3894 11.5861H34.7666L35.7792 13.0918L35.3256 14.6461L33.9079 16.4432L32.7332 17.9651L31.0481 20.2317L29.9949 22.045L30.0922 22.1907L30.3433 22.1665L34.1509 21.3569L36.2086 20.9846L38.6633 20.5636L39.7732 21.0817L39.8947 21.6079L39.4572 22.6845L36.8324 23.3322L33.7539 23.9474L29.1686 25.0321L29.1119 25.0726L29.1767 25.1536L31.2425 25.3478L32.1256 25.3964H34.2886L38.3149 25.6959L39.3681 26.3921L40 27.2421L39.8947 27.8897L38.2744 28.7154L36.0871 28.1973L30.9833 26.9831L29.2334 26.5459H28.9904V26.6916L30.4486 28.1164L33.122 30.5287L36.4678 33.6372L36.638 34.4063L36.2086 35.0134L35.7549 34.9486L32.8142 32.7387L31.68 31.743L29.1119 29.5816H28.9418V29.8082L29.5332 30.6744L32.6603 35.3696L32.8223 36.8105L32.5954 37.28L31.7853 37.5634L30.8942 37.4015L29.0633 34.8353L27.1757 31.9454L25.6527 29.3549L25.4663 29.4602L24.5671 39.1338L24.1458 39.6276L23.1737 40L22.3635 39.3848L21.9342 38.3891L22.3635 36.422L22.882 33.8558L23.3033 31.8158L23.6841 29.2821L23.9109 28.4402L23.8947 28.3835L23.7084 28.4078L21.7965 31.0306L18.8881 34.9567L16.5873 37.4177L16.0365 37.6362L15.0805 37.1424L15.1696 36.2601L15.7043 35.4748L18.8881 31.4273L20.8081 28.9178L22.0476 27.4688L22.0395 27.2583H21.9666L13.5089 32.7468L12.002 32.9411L11.3539 32.3339L11.4349 31.3382L11.7428 31.0144L14.2866 29.2659L14.2785 29.274Z\"/></svg>";
|
|
30
|
+
|
|
31
|
+
/** ChatGPT Presence avatar from Confluence's `ChatGptPresenceIcon`, at 16px. */
|
|
32
|
+
var CHATGPT_ICON_SVG = '<svg width="16" height="16" viewBox="1 1.5328 16 16" overflow="visible" fill="none" role="presentation" style="display:block"><path d="M7.24707 0.973022C8.33116 0.344106 9.66865 0.342238 10.7539 0.969116L15.751 3.85583C16.8334 4.48117 17.5 5.63699 17.5 6.88708V12.1801C17.5 13.4301 16.8334 14.586 15.751 15.2113L10.751 18.1C9.66769 18.7258 8.33231 18.7258 7.24902 18.1L2.24902 15.2113C1.16658 14.586 0.5 13.4301 0.5 12.1801V6.90271C0.5 5.65489 1.1648 4.50153 2.24414 3.87537L7.24707 0.973022Z" fill="#14120B" stroke="#FFFFFF" stroke-width="1"/><svg x="4" y="4.53355" width="10" height="10" viewBox="10 12.0281 24 24" overflow="visible"><path d="M32.2119 21.2917C32.7552 19.256 32.2283 16.9938 30.6312 15.3967C29.0342 13.7997 26.7722 13.2728 24.7362 13.8161C23.2447 12.3277 21.0224 11.6529 18.8407 12.2376C16.6589 12.8221 15.0717 14.5177 14.5243 16.5524C12.4896 17.0999 10.794 18.6873 10.2094 20.8688C9.62493 23.0506 10.2996 25.2728 11.7881 26.7644C11.2448 28.8002 11.7718 31.0623 13.3688 32.6594C14.9658 34.2564 17.2278 34.7834 19.2638 34.2401C20.7553 35.7284 22.9778 36.4032 25.1593 35.8187C27.3411 35.2342 28.9283 33.5386 29.4757 31.5039C31.5105 30.9564 33.206 29.3691 33.7905 27.1874C34.3751 25.0058 33.7005 22.7834 32.2119 21.2919V21.2917ZM29.6507 16.3775C30.7329 17.4598 31.1792 18.937 30.9897 20.3453L25.9072 17.4108C25.6929 17.2871 25.4289 17.2871 25.2148 17.4108L19.2638 20.8466V18.5936C19.2638 18.4356 19.3485 18.2877 19.4854 18.2087L24.017 15.5924C25.8125 14.5895 28.1246 14.8514 29.6508 16.3775H29.6507ZM22 20.8685L24.7364 22.4483V25.608L22 27.1878L19.2636 25.608V22.4483L22 20.8685ZM15.7028 18.0636C15.732 16.0073 17.1149 14.1359 19.1997 13.5772C20.678 13.1811 22.1806 13.5333 23.3053 14.4014L18.2226 17.3357C18.0084 17.4594 17.8764 17.6881 17.8764 17.9353V24.8069L15.9253 23.6804C15.7885 23.6014 15.7028 23.454 15.7028 23.2959V18.0634V18.0636ZM11.549 21.2278C11.9451 19.7495 13.0014 18.6242 14.3156 18.0843V23.9532C14.3156 24.2004 14.4476 24.4291 14.6618 24.5528L20.6128 27.9886L18.6617 29.1151C18.5249 29.1941 18.3544 29.1946 18.2175 29.1156L13.6859 26.4993C11.9196 25.4459 10.9905 23.3124 11.549 21.2278ZM14.3494 31.6788C13.2671 30.5965 12.8208 29.1193 13.0103 27.7111L18.0928 30.6455C18.3071 30.7692 18.5711 30.7692 18.7852 30.6455L24.7362 27.2098V29.4626C24.7362 29.6207 24.6516 29.7682 24.5146 29.8477L19.983 32.4639C18.1875 33.4667 15.8754 33.2049 14.3492 31.6788H14.3494ZM28.2972 29.9927C28.268 32.049 26.8851 33.9205 24.8003 34.4791C23.322 34.8752 21.8194 34.523 20.6947 33.6549L25.7774 30.7205C25.9917 30.5969 26.1236 30.3682 26.1236 30.1209V23.2494L28.0747 24.3759C28.2115 24.4549 28.2972 24.6023 28.2972 24.7604V29.9929V29.9927ZM32.451 26.8285C32.0549 28.3068 30.9986 29.4321 29.6844 29.972V24.1031C29.6844 23.8559 29.5525 23.6272 29.3382 23.5035L23.3872 20.0678L25.3383 18.9412C25.4751 18.8622 25.6456 18.8617 25.7825 18.9407L30.314 21.5569C32.0804 22.6105 33.0095 24.7439 32.451 26.8285Z" fill="#FFFFFF"/></svg></svg>';
|
|
30
33
|
var markup = {
|
|
31
34
|
aiAgent: AI_AGENT_ICON_SVG,
|
|
32
35
|
aiBot: AI_BOT_ICON_SVG,
|
|
36
|
+
chatgpt: CHATGPT_ICON_SVG,
|
|
33
37
|
claude: CLAUDE_ICON_SVG,
|
|
34
38
|
person: PERSON_ICON_SVG,
|
|
35
39
|
rovoHex: ROVO_HEX_ICON_SVG
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type { ColorScheme, DeletedDiffPlacement, DeletedDiffWidget, DiffContributorProfile, DiffParams, DiffStepAttribution, DiffType, PMDiffParams, RevealMode, RevealOptions, ShowDiffParams, ShowDiffPlugin, SmartDiffThresholds, StepWithAttribution, } from '../showDiffPluginType';
|
|
1
|
+
export type { ColorScheme, DeletedDiffPlacement, DeletedDiffWidget, DiffAgentBrand, DiffContributorProfile, DiffParams, DiffStepAttribution, DiffType, PMDiffParams, RevealMode, RevealOptions, ShowDiffParams, ShowDiffPlugin, SmartDiffThresholds, StepWithAttribution, } from '../showDiffPluginType';
|
|
2
|
+
export { DIFF_AGENT_BRANDS } from '../showDiffPluginType';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Change } from 'prosemirror-changeset';
|
|
2
|
-
import type
|
|
2
|
+
import { type DiffContributors, type DiffStepAttribution, type TagContributor } from '../../../showDiffPluginType';
|
|
3
3
|
import { type AdsAccentColor, type ColorScheme } from './types';
|
|
4
4
|
export type DiffAttributionSpanData = DiffStepAttribution & {
|
|
5
5
|
stepIndex: number;
|
|
@@ -24,7 +24,7 @@ export declare const isAttributionColoringEnabled: (stepAttributions: Array<Diff
|
|
|
24
24
|
* a tag only has to name one.
|
|
25
25
|
*/
|
|
26
26
|
export declare const isContributorTagsEnabled: (stepAttributions: Array<DiffStepAttribution | undefined> | undefined, contributors: ResolvedDiffContributors | undefined) => boolean;
|
|
27
|
-
export declare const createAttributionColorMap: (stepAttributions: Array<DiffStepAttribution | undefined
|
|
27
|
+
export declare const createAttributionColorMap: (stepAttributions: Array<DiffStepAttribution | undefined>, contributors?: ResolvedDiffContributors) => Map<string, AdsAccentColor>;
|
|
28
28
|
/**
|
|
29
29
|
* The attribution key owning a change. Inline and step changes retain direct attribution spans, so
|
|
30
30
|
* resolve those first. Grouped and smart-classified changes can lose that data; for those, fall
|
|
@@ -4,8 +4,8 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { DiffType, RevealOptions } from '../../showDiffPluginType';
|
|
6
6
|
import type { NodeViewSerializer } from '../NodeViewSerializer';
|
|
7
|
-
import { type ContributorTagMountContext } from './createContributorTagWidget';
|
|
8
7
|
import type { ColorScheme } from './colorSchemes/types';
|
|
8
|
+
import { type ContributorTagMountContext } from './createContributorTagWidget';
|
|
9
9
|
/**
|
|
10
10
|
* This function is used to create a decoration widget to show content
|
|
11
11
|
* that is not in the current document.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform-override';
|
|
4
3
|
import { AttrStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform-override';
|
|
5
5
|
export type InlineAttrChangeNodeName = 'date' | 'emoji' | 'mention' | 'status';
|
|
6
6
|
type AttrChangeStep = AttrStep | SetAttrsStep;
|
|
7
7
|
export type AttrStepContext = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform-override';
|
|
2
1
|
import { type StepMap } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
+
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform-override';
|
|
3
3
|
import type { DiffStepAttribution } from '../../../showDiffPluginType';
|
|
4
4
|
type StepRange = {
|
|
5
5
|
attributionKey?: string;
|
|
@@ -37,16 +37,21 @@ export type StepWithAttribution<TStep> = {
|
|
|
37
37
|
step: TStep;
|
|
38
38
|
stepAttribution?: DiffStepAttribution;
|
|
39
39
|
};
|
|
40
|
+
/** Branded agent presentations supported by contributor tags. */
|
|
41
|
+
export type DiffAgentBrand = 'rovo' | 'claude' | 'chatgpt';
|
|
42
|
+
export declare const DIFF_AGENT_BRANDS: ReadonlySet<DiffAgentBrand>;
|
|
40
43
|
/** A complete identity for one of the accounts named by a step attribution. */
|
|
41
44
|
export type DiffContributorProfile = {
|
|
42
45
|
/** Matched against the `userId` and `agentId` on step attributions. */
|
|
43
46
|
accountId: string;
|
|
47
|
+
/** Optional brand for an agent profile, supplied by the host product. */
|
|
48
|
+
agentBrand?: DiffAgentBrand;
|
|
44
49
|
avatarUrl?: string;
|
|
45
50
|
name: string;
|
|
46
51
|
};
|
|
47
52
|
type DiffContributorKind = 'user' | 'agent';
|
|
48
53
|
/** Agent presentation: branded, identified by profile, or a generic external agent. */
|
|
49
|
-
type DiffAgentKind =
|
|
54
|
+
type DiffAgentKind = DiffAgentBrand | 'identified' | 'external';
|
|
50
55
|
/**
|
|
51
56
|
* A contributor the plugin has resolved from a step attribution and a supplied profile. Internal:
|
|
52
57
|
* never re-exported from an entry point and not reachable from any public type. Same for
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* The Rovo hex is the `brand` appearance, whose `--rovo-*-color` variables resolve to `initial` in
|
|
9
9
|
* both themes — the fallbacks below are the rendered colours, so no theme observer is needed.
|
|
10
10
|
*/
|
|
11
|
-
export type ContributorTagIcon = 'aiAgent' | 'aiBot' | 'claude' | 'person' | 'rovoHex';
|
|
11
|
+
export type ContributorTagIcon = 'aiAgent' | 'aiBot' | 'chatgpt' | 'claude' | 'person' | 'rovoHex';
|
|
12
12
|
export declare const getContributorTagIcon: (icon: ContributorTagIcon, doc: Document) => DocumentFragment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.1.1",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
41
|
"@atlaskit/primitives": "^22.5.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^18.2.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^1.0.2",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/button": "^25.3.0",
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^18.3.0",
|
|
56
|
-
"@atlaskit/editor-core": "^229.
|
|
56
|
+
"@atlaskit/editor-core": "^229.1.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^9.8.0",
|
|
58
58
|
"@atlaskit/editor-plugins": "^16.1.0",
|
|
59
59
|
"@atlaskit/form": "^17.2.0",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@atlassian/confluence-presets": "workspace:^",
|
|
65
65
|
"@atlassian/content-reconciliation": "^0.1.3506",
|
|
66
66
|
"@atlassian/editor-ai-injected-editors": "^33.0.0",
|
|
67
|
-
"@atlassian/editor-plugin-ai": "^73.
|
|
67
|
+
"@atlassian/editor-plugin-ai": "^73.3.0",
|
|
68
68
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
69
69
|
"react": "^19.2.0",
|
|
70
70
|
"react-dom": "^19.2.0",
|
|
71
71
|
"react-intl": "^7.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^123.
|
|
74
|
+
"@atlaskit/editor-common": "^123.2.0",
|
|
75
75
|
"react": "^18.2.0 || ^19.2.0",
|
|
76
76
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
77
77
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|