Skip to content

Commit 5d897d2

Browse files
committed
feat(versioning): show copied blocks once in version diffs (experimental)
Behind `experimental.blockCopyDiffs` in the collaboration options; it only changes what a version diff shows. A type change or a move stores a copy of the block, so the diff showed it as a deleted and an inserted block, with the copied content credited to whoever made the change. Pair each copy with its original (by block id) and show it once: - a type change between text blocks as a formatting change; - a move, including an indent, as "Moved"; - a copy in the same place (its children changed) as unchanged. Copied content keeps its authors. Content the earlier version had that no copy kept still shows as deleted.
1 parent b58d678 commit 5d897d2

35 files changed

Lines changed: 1033 additions & 171 deletions

File tree

‎examples/07-collaboration/14-suggestion-gallery/src/App.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ function VersionMerge({
416416
provider: { awareness: setup.diffAwareness },
417417
user: USER_A,
418418
// The gallery shows the experimental diff refinements.
419-
experimental: { lostContentAttribution: true },
419+
experimental: { lostContentAttribution: true, blockCopyDiffs: true },
420420
},
421421
}),
422422
);

‎packages/core/src/i18n/locales/ar.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ export const ar: Dictionary = {
399399
deleted_by: (users: string) => `حُذف بواسطة: ${users}`,
400400
changed: "مُعدَّل",
401401
changed_by: (users: string) => `عُدّل بواسطة: ${users}`,
402+
moved: "تم النقل",
403+
moved_by: (users: string) => `نقله: ${users}`,
402404
formatting_change_by: (formats: string, users: string) =>
403405
`تغيير التنسيق (${formats}) بواسطة: ${users}`,
404406
},

‎packages/core/src/i18n/locales/de.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ export const de: Dictionary = {
433433
deleted_by: (users: string) => `Gelöscht von: ${users}`,
434434
changed: "Geändert",
435435
changed_by: (users: string) => `Geändert von: ${users}`,
436+
moved: "Verschoben",
437+
moved_by: (users: string) => `Verschoben von: ${users}`,
436438
formatting_change_by: (formats: string, users: string) =>
437439
`Formatierungsänderung (${formats}) von: ${users}`,
438440
},

‎packages/core/src/i18n/locales/en.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ export const en = {
414414
deleted_by: (users: string) => `Deleted by: ${users}`,
415415
changed: "Changed",
416416
changed_by: (users: string) => `Changed by: ${users}`,
417+
moved: "Moved",
418+
moved_by: (users: string) => `Moved by: ${users}`,
417419
formatting_change_by: (formats: string, users: string) =>
418420
`Formatting change (${formats}) by: ${users}`,
419421
},

‎packages/core/src/i18n/locales/es.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ export const es: Dictionary = {
412412
deleted_by: (users: string) => `Eliminado por: ${users}`,
413413
changed: "Modificado",
414414
changed_by: (users: string) => `Modificado por: ${users}`,
415+
moved: "Movido",
416+
moved_by: (users: string) => `Movido por: ${users}`,
415417
formatting_change_by: (formats: string, users: string) =>
416418
`Cambio de formato (${formats}) por: ${users}`,
417419
},

‎packages/core/src/i18n/locales/fa.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ export const fa = {
383383
deleted_by: (users: string) => `حذف‌شده توسط: ${users}`,
384384
changed: "تغییر\u200cیافته",
385385
changed_by: (users: string) => `تغییر\u200cیافته توسط: ${users}`,
386+
moved: "منتقل شد",
387+
moved_by: (users: string) => `منتقل شده توسط: ${users}`,
386388
formatting_change_by: (formats: string, users: string) =>
387389
`تغییر قالب‌بندی (${formats}) توسط: ${users}`,
388390
},

‎packages/core/src/i18n/locales/fr.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ export const fr: Dictionary = {
460460
deleted_by: (users: string) => `Supprimé par : ${users}`,
461461
changed: "Modifié",
462462
changed_by: (users: string) => `Modifié par : ${users}`,
463+
moved: "Déplacé",
464+
moved_by: (users: string) => `Déplacé par : ${users}`,
463465
formatting_change_by: (formats: string, users: string) =>
464466
`Modification de mise en forme (${formats}) par : ${users}`,
465467
},

‎packages/core/src/i18n/locales/he.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ export const he: Dictionary = {
414414
deleted_by: (users: string) => `נמחק על ידי: ${users}`,
415415
changed: "שונה",
416416
changed_by: (users: string) => `שונה על ידי: ${users}`,
417+
moved: "הועבר",
418+
moved_by: (users: string) => `הועבר על ידי: ${users}`,
417419
formatting_change_by: (formats: string, users: string) =>
418420
`שינוי עיצוב (${formats}) על ידי: ${users}`,
419421
},

‎packages/core/src/i18n/locales/hr.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ export const hr: Dictionary = {
428428
deleted_by: (users: string) => `Izbrisao/la: ${users}`,
429429
changed: "Promijenjeno",
430430
changed_by: (users: string) => `Promijenio/la: ${users}`,
431+
moved: "Premješteno",
432+
moved_by: (users: string) => `Premjestio: ${users}`,
431433
formatting_change_by: (formats: string, users: string) =>
432434
`Promjena oblikovanja (${formats}) od: ${users}`,
433435
},

‎packages/core/src/i18n/locales/is.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ export const is: Dictionary = {
428428
deleted_by: (users: string) => `Eytt af: ${users}`,
429429
changed: "Breytt",
430430
changed_by: (users: string) => `Breytt af: ${users}`,
431+
moved: "Fært",
432+
moved_by: (users: string) => `Fært af: ${users}`,
431433
formatting_change_by: (formats: string, users: string) =>
432434
`Sniðbreyting (${formats}) af: ${users}`,
433435
},

0 commit comments

Comments
 (0)