@atlaskit/editor-plugin-show-diff 28.0.2 → 29.0.0
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 +33 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/cjs/pm-plugins/decorations/colorSchemes/attributions.js +18 -31
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +17 -65
- package/dist/cjs/showDiffPlugin.js +4 -1
- package/dist/cjs/showDiffPluginType.js +2 -3
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +14 -43
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +1 -9
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/es2019/pm-plugins/decorations/colorSchemes/attributions.js +20 -31
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +17 -67
- package/dist/es2019/showDiffPlugin.js +2 -0
- package/dist/es2019/showDiffPluginType.js +2 -3
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +14 -43
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +1 -9
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +1 -1
- package/dist/esm/pm-plugins/decorations/colorSchemes/attributions.js +18 -31
- package/dist/esm/pm-plugins/resolveDiffContributors.js +17 -66
- package/dist/esm/showDiffPlugin.js +4 -1
- package/dist/esm/showDiffPluginType.js +2 -3
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +14 -43
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +1 -9
- package/dist/types/pm-plugins/decorations/colorSchemes/attributions.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -0
- package/dist/types/showDiffPluginType.d.ts +6 -5
- package/dist/types/ui/ContributorTag/contributorTagIcons.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The icons a contributor tag can draw, as inline SVG.
|
|
3
3
|
*
|
|
4
|
-
* Neither `@atlaskit/icon
|
|
4
|
+
* Neither `@atlaskit/icon` nor `@atlaskit/icon-lab` exposes a raw-SVG entry
|
|
5
5
|
* point, so the markup is copied here rather than kept as a React island for these glyphs. Keep in
|
|
6
6
|
* sync with the sources named on each constant.
|
|
7
7
|
*/
|
|
@@ -18,17 +18,9 @@ var AI_BOT_ICON_SVG = "<svg width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0
|
|
|
18
18
|
* so keep the generated glyph here rather than introducing a React render boundary.
|
|
19
19
|
*/
|
|
20
20
|
var AI_AGENT_ICON_SVG = "<svg width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 16 16\" role=\"presentation\" style=\"display:block\"><path fill=\"currentcolor\" fill-rule=\"evenodd\" d=\"M6.971.493a2 2 0 0 1 2.058 0l5 3A2 2 0 0 1 15 5.208v5.584a2 2 0 0 1-.971 1.715l-5 3a2 2 0 0 1-2.058 0l-5-3A2 2 0 0 1 1 10.792V5.208a2 2 0 0 1 .971-1.715zm1.286 1.286a.5.5 0 0 0-.514 0l-5 3a.5.5 0 0 0-.243.429v5.584a.5.5 0 0 0 .243.429l1.098.66a4.25 4.25 0 1 1 8.318 0l1.098-.66a.5.5 0 0 0 .243-.429V5.208a.5.5 0 0 0-.243-.429zM8 8.25a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5\" clip-rule=\"evenodd\"/></svg>";
|
|
21
|
-
|
|
22
|
-
/** Claude hexagon lockup from the brand asset: the hexagon and knot glyph both baked in. */
|
|
23
|
-
var CLAUDE_ICON_SVG = "<svg width=\"16\" height=\"18\" viewBox=\"0 0 16 18\" fill=\"none\" role=\"presentation\" style=\"display:block\"><path fill=\"#D97757\" d=\"M14.5007 3.28903L9.50384 0.402344C8.5736 -0.13506 7.42701 -0.134016 6.49774 0.405082L1.49458 3.30759C0.569434 3.8443 0 4.83297 0 5.90253V11.1804C0 12.2519 0.571497 13.2421 1.49931 13.7781L6.49931 16.6666C7.42787 17.203 8.57213 17.203 9.50069 16.6666L14.5007 13.7781C15.4285 13.2421 16 12.2519 16 11.1804V5.88671C16 4.8152 15.4285 3.82504 14.5007 3.28903Z\"/><path fill=\"#FAF9F6\" d=\"M5.19791 10.055L7.0123 9.03681L7.04267 8.94806L7.0123 8.89907H6.92357L6.62 8.88034L5.58321 8.85232L4.68418 8.815L3.81317 8.76826L3.59367 8.72158L3.38818 8.4507L3.4092 8.31526L3.59367 8.1915L3.85754 8.21485L4.44133 8.25455L5.317 8.31526L5.95216 8.35262L6.89321 8.4507H7.04267L7.06368 8.38999L7.0123 8.35262L6.97261 8.31526L6.06658 7.70112L5.08582 7.05196L4.5721 6.67834L4.29422 6.48919L4.15411 6.31172L4.09339 5.92409L4.34559 5.64621L4.68418 5.66956L4.77058 5.69291L5.11384 5.95678L5.84708 6.52422L6.80448 7.22943L6.94459 7.34618L7.00063 7.30649L7.00763 7.27846L6.94459 7.17338L6.42385 6.23233L5.86809 5.27492L5.62057 4.87795L5.55519 4.63977C5.53183 4.54169 5.51549 4.45996 5.51549 4.35956L5.80271 3.96959L5.9615 3.91821L6.34446 3.96959L6.50558 4.10969L6.74377 4.65378L7.12907 5.51077L7.72686 6.676L7.90199 7.0216L7.99539 7.34152L8.0304 7.43959H8.09113V7.38354L8.14018 6.72737L8.23124 5.92175L8.31999 4.88496L8.35032 4.59307L8.49511 4.24279L8.78232 4.05365L9.00649 4.16107L9.19098 4.42494L9.16533 4.5954L9.05555 5.30762L8.84073 6.42381L8.70062 7.17105H8.78232L8.87574 7.07764L9.25401 6.57559L9.88922 5.78165L10.1694 5.4664L10.4963 5.11847L10.7065 4.95267H11.1035L11.3953 5.38701L11.2646 5.83535L10.8559 6.35375L10.5173 6.79276L10.0316 7.4466L9.72807 7.96966L9.7561 8.0117L9.82849 8.00469L10.926 7.77118L11.5191 7.66376L12.2266 7.54233L12.5466 7.69178L12.5816 7.84356L12.4555 8.15414L11.6989 8.34095L10.8116 8.51842L9.48985 8.83136L9.4735 8.84303L9.49223 8.86637L10.0877 8.92241L10.3422 8.93639H10.9657L12.1262 9.02283L12.4298 9.2236L12.612 9.46881L12.5816 9.6556L12.1146 9.89382L11.4841 9.74434L10.013 9.3941L9.50858 9.26797H9.43849V9.31004L9.85882 9.721L10.6294 10.4169L11.5938 11.3136L11.6429 11.5354L11.5191 11.7106L11.3884 11.6918L10.5407 11.0544L10.2137 10.7672L9.4735 10.1436H9.42451V10.209L9.59495 10.4589L10.4963 11.8133L10.543 12.2289L10.4776 12.3644L10.2441 12.4461L9.98726 12.3994L9.45952 11.6592L8.91544 10.8255L8.47645 10.0783L8.42271 10.1086L8.16352 12.8991L8.04207 13.0416L7.76188 13.149L7.52837 12.9715L7.40461 12.6843L7.52837 12.1168L7.67781 11.3766L7.79925 10.7881L7.90899 10.0573L7.97438 9.81443L7.96971 9.79808L7.916 9.80507L7.36491 10.5617L6.5266 11.6942L5.86342 12.4041L5.70463 12.4671L5.42909 12.3247L5.45477 12.0702L5.60889 11.8436L6.5266 10.6761L7.08002 9.95217L7.4373 9.53421L7.43497 9.47349H7.41395L4.97607 11.0567L4.54174 11.1127L4.35493 10.9376L4.37828 10.6504L4.46702 10.557L5.20024 10.0526L5.19791 10.055Z\"/></svg>";
|
|
24
|
-
|
|
25
|
-
/** ChatGPT hexagon lockup from the brand asset: the hexagon and knot glyph both baked in. */
|
|
26
|
-
var CHATGPT_ICON_SVG = "<svg width=\"16\" height=\"18\" viewBox=\"0 0 16 18\" fill=\"none\" role=\"presentation\" style=\"display:block\"><path fill=\"#14120B\" d=\"M14.5007 3.289L9.50384 0.402314C8.5736 -0.13509 7.42701 -0.134047 6.49774 0.405051L1.49458 3.30756C0.569434 3.84427 0 4.83294 0 5.9025V11.1804C0 12.2519 0.571497 13.2421 1.49931 13.7781L6.49931 16.6666C7.42787 17.203 8.57213 17.203 9.50069 16.6666L14.5007 13.7781C15.4285 13.2421 16 12.2519 16 11.1804V5.88668C16 4.81517 15.4285 3.82501 14.5007 3.289Z\"/><path fill=\"white\" d=\"M12.255 7.39338C12.4813 6.54514 12.2618 5.60258 11.5963 4.93713C10.9309 4.2717 9.9884 4.05217 9.1401 4.27852C8.51863 3.65837 7.59268 3.37721 6.68362 3.62082C5.77456 3.86436 5.11322 4.57087 4.88512 5.41867C4.03733 5.64676 3.33082 6.30819 3.08727 7.21717C2.84372 8.12623 3.12482 9.05218 3.74503 9.67365C3.51868 10.5219 3.73823 11.4645 4.40366 12.1299C5.06909 12.7953 6.01159 13.0149 6.85992 12.7885C7.48137 13.4087 8.4074 13.6898 9.31638 13.4463C10.2254 13.2027 10.8868 12.4962 11.1149 11.6485C11.9627 11.4203 12.6692 10.7589 12.9127 9.84993C13.1563 8.94089 12.8752 8.01491 12.255 7.39347V7.39338ZM11.1878 5.34578C11.6387 5.79673 11.8247 6.41226 11.7457 6.99902L9.62799 5.77632C9.53872 5.72478 9.42871 5.72478 9.3395 5.77632L6.85992 7.20789V6.26917C6.85992 6.20333 6.89519 6.1417 6.95226 6.10877L8.84042 5.01867C9.58854 4.60079 10.5519 4.7099 11.1878 5.34578H11.1878ZM8.00001 7.21703L9.14016 7.87529V9.19183L8.00001 9.85009L6.85984 9.19183V7.87529L8.00001 7.21703ZM5.37616 6.04832C5.38831 5.19153 5.96453 4.41177 6.83319 4.17899C7.44917 4.01397 8.07524 4.16069 8.54389 4.52241L6.42609 5.74505C6.33682 5.79656 6.28184 5.89186 6.28184 5.99489V8.85803L5.4689 8.38867C5.41189 8.35573 5.37616 8.29433 5.37616 8.22846V6.04826V6.04832ZM3.64542 7.36674C3.81044 6.75079 4.25056 6.28191 4.79817 6.05694V8.50232C4.79817 8.60534 4.85315 8.70061 4.94241 8.75216L7.42202 10.1837L6.60904 10.6531C6.55203 10.686 6.48098 10.6862 6.42397 10.6533L4.53581 9.56321C3.79984 9.12427 3.41272 8.23534 3.64542 7.36674ZM4.81224 11.7213C4.36129 11.2704 4.17534 10.6549 4.25429 10.0681L6.37201 11.2908C6.4613 11.3423 6.57129 11.3423 6.6605 11.2908L9.1401 9.85923V10.7979C9.1401 10.8638 9.10483 10.9254 9.04774 10.9584L7.15958 12.0485C6.41145 12.4663 5.44809 12.3572 4.81215 11.7213H4.81224ZM10.6238 11.0188C10.6117 11.8756 10.0355 12.6554 9.1668 12.8881C8.55083 13.0532 7.92476 12.9064 7.45613 12.5447L9.57391 11.322C9.6632 11.2705 9.71816 11.1753 9.71816 11.0722V8.20906L10.5311 8.67845C10.5881 8.71139 10.6238 8.77279 10.6238 8.83866V11.0189V11.0188ZM12.3546 9.70035C12.1896 10.3163 11.7494 10.7852 11.2018 11.0101V8.5648C11.2018 8.46178 11.1469 8.36648 11.0576 8.31496L8.57798 6.88339L9.39095 6.41401C9.44796 6.38107 9.51902 6.38085 9.57603 6.41378L11.4642 7.50388C12.2002 7.94285 12.5873 8.83178 12.3546 9.70035Z\"/></svg>";
|
|
27
21
|
var markup = {
|
|
28
22
|
aiAgent: AI_AGENT_ICON_SVG,
|
|
29
23
|
aiBot: AI_BOT_ICON_SVG,
|
|
30
|
-
chatgpt: CHATGPT_ICON_SVG,
|
|
31
|
-
claude: CLAUDE_ICON_SVG,
|
|
32
24
|
person: PERSON_ICON_SVG
|
|
33
25
|
};
|
|
34
26
|
|
|
@@ -10,7 +10,7 @@ export type ResolvedDiffContributor = TagContributor & {
|
|
|
10
10
|
};
|
|
11
11
|
/** Contributors addressed by attribution key. The key format is internal. */
|
|
12
12
|
export type ResolvedDiffContributors = Record<string, ResolvedDiffContributor>;
|
|
13
|
-
/** `userId` is primary; `agentId
|
|
13
|
+
/** `userId` is primary; `agentId` separates agents sharing that user. */
|
|
14
14
|
export declare const getAttributionKey: (attribution: DiffStepAttribution | undefined) => string | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Public contributor list to internal key-addressed record. A contributor whose attribution carries
|
|
@@ -25,14 +25,12 @@ export type DiffType = 'inline' | 'block' | 'step' | 'smart';
|
|
|
25
25
|
* Attribution for a ProseMirror step.
|
|
26
26
|
*
|
|
27
27
|
* `userId` is the primary actor identity. `agentId` distinguishes multiple agents (or an agent
|
|
28
|
-
* from its user) when they share that user ID
|
|
29
|
-
*
|
|
30
|
-
* overrides. `wasOffline` preserves additional provenance without affecting identity.
|
|
28
|
+
* from its user) when they share that user ID. `agentNamedId` carries a stable external
|
|
29
|
+
* configuration reference for presentation overrides. `wasOffline` preserves additional provenance without affecting identity.
|
|
31
30
|
*/
|
|
32
31
|
export type DiffStepAttribution = {
|
|
33
32
|
agentId?: string;
|
|
34
33
|
agentNamedId?: string;
|
|
35
|
-
agentType?: string;
|
|
36
34
|
userId?: string;
|
|
37
35
|
wasOffline?: boolean;
|
|
38
36
|
};
|
|
@@ -234,13 +232,16 @@ type PMDiffParamsWithAttribution = Omit<PMDiffParams, 'steps'> & {
|
|
|
234
232
|
/**
|
|
235
233
|
* Identities for the accounts named by the attributed steps. Omitted profiles disable
|
|
236
234
|
* contributor tags without disabling attribution colours. An explicit empty array permits agent fallback tags. When supplied, and the contributor-tag
|
|
237
|
-
* gate is on, every attributed change the plugin can credit to one of them renders a tag
|
|
235
|
+
* gate is on, every attributed change the plugin can credit to one of them renders a tag
|
|
236
|
+
* unless `showContributorTags` is false.
|
|
238
237
|
* Complete entries only: a caller looking identities up (e.g. against a user directory) filters
|
|
239
238
|
* out the ones it could not resolve rather than passing partial entries through. Omitting an
|
|
240
239
|
* account is meaningful — a user the plugin cannot name drops every tag, while an agent falls
|
|
241
240
|
* back to its own presentation.
|
|
242
241
|
*/
|
|
243
242
|
contributorProfiles?: readonly DiffContributorProfile[];
|
|
243
|
+
/** Set false to use profile colours without rendering contributor tags. Defaults to true. */
|
|
244
|
+
showContributorTags?: boolean;
|
|
244
245
|
steps?: never;
|
|
245
246
|
stepsWithAttribution: Array<StepWithAttribution<Step>>;
|
|
246
247
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The icons a contributor tag can draw, as inline SVG.
|
|
3
3
|
*
|
|
4
|
-
* Neither `@atlaskit/icon
|
|
4
|
+
* Neither `@atlaskit/icon` nor `@atlaskit/icon-lab` exposes a raw-SVG entry
|
|
5
5
|
* point, so the markup is copied here rather than kept as a React island for these glyphs. Keep in
|
|
6
6
|
* sync with the sources named on each constant.
|
|
7
7
|
*/
|
|
8
|
-
export type ContributorTagIcon = 'aiAgent' | 'aiBot' | '
|
|
8
|
+
export type ContributorTagIcon = 'aiAgent' | 'aiBot' | 'person';
|
|
9
9
|
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": "
|
|
3
|
+
"version": "29.0.0",
|
|
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.6.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^248.0.0",
|
|
43
43
|
"@atlaskit/tokens": "^20.8.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^1.0.2",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@atlaskit/button": "^25.6.0",
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^21.0.0",
|
|
56
|
-
"@atlaskit/editor-core": "^241.
|
|
56
|
+
"@atlaskit/editor-core": "^241.1.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
58
58
|
"@atlaskit/editor-plugins": "^16.2.0",
|
|
59
59
|
"@atlaskit/form": "^18.3.0",
|
|
60
60
|
"@atlaskit/section-message": "^10.2.0",
|
|
61
61
|
"@atlaskit/textarea": "^10.2.0",
|
|
62
|
-
"@atlaskit/textfield": "^10.
|
|
62
|
+
"@atlaskit/textfield": "^10.3.0",
|
|
63
63
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
64
64
|
"@atlassian/confluence-presets": "workspace:^",
|
|
65
65
|
"@atlassian/content-reconciliation": "^0.1.3506",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"react-intl": "^7.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^134.
|
|
74
|
+
"@atlaskit/editor-common": "^134.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"
|