mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 19:07:01 +00:00
* feat (nc-gui): discussion mode structure * feat (nc-gui): expanded form discussion mode render audits and comments * fix (nc-gui): refactor different entries in discussion * fix (nc-gui): expanded form discussion mode use rich comments * fix (nc-gui): expanded form discussion mode implement new ui looks * fix (nc-gui): expanded form discussion mode comment actions * fix (nc-gui): comments list start from bottom * fix (nc-gui): expanded form discussion mode better grouping logic * feat (nc-gui): discussion view ui latest polish and mocks * chore (nc-gui): lint * fix (nc-gui): expanded form discussion mode audits list wiring * fix (nc-gui): expanded form discussion mode audits preview attachments * fix (nc-gui): expanded form discussion mode audits in the right sidebar tab * fix (nc-gui): expanded form discussion mode remove unused declarations * fix (nc-gui): expanded form discussion mode remove duplicate rendering * fix (nc-gui): expanded form discussion mode refactor to remove duplication * fix (nc-gui): expanded form discussion mode use Cell component to render data based on colOptions and meta * fix (nc-gui): expanded form discussion mode use proper types * fix (nc-gui): expanded form discussion mode lint * fix (nc-gui): expanded form discussion mode normalize meta and spacings * fix (nc-gui): expanded form discussion mode save expanded form mode to discussion * fix (nc-gui): expanded form discussion mode use cell component for mini audits * fix (nc-gui): expanded form discussion mode small fix * fix (nc-gui): discussion mode records audit ui polishes * fix (nc-gui): records audit items polishes * fix (nc-gui): records audit conditional raw rendering for date/time type cells * fix (nc-gui): records audit ui polishes * fix (nc-gui): records audit diff the changed values * fix (nc-gui): records audit better text wrap and json scrollbar * chore (nc-gui): mock change to run ci * fix (nc-gui): records audit text diff and link ui polish * fix (nc-gui): records audit polish links ui * chore (nc-gui): records audit lint * fix (nc-gui): handle v0 type audit information * fix (nc-gui): move records audit under a feature flag * fix (nc-gui): lint * refactor: enable audit in CE * fix(nc-gui) : v0 audit rendering issue * fix (nc-gui): records audit correctly load after refresh when expanded record is open * fix (nc-gui): records audit code polishes --------- Co-authored-by: Yoones Khoshghadam <yooneskh@gmail.com> Co-authored-by: Pranav C <pranavxc@gmail.com>
25 lines
773 B
TypeScript
25 lines
773 B
TypeScript
import * as Diff from 'diff'
|
|
|
|
/**
|
|
* Perform a diff algorithm on the source string based on the target string. Reports the differences between the two strings as the diff blocks.
|
|
*
|
|
* - Handles two strings
|
|
* - Tokenizes as words
|
|
*
|
|
* @param sourceString - Base text which changes will be relative to
|
|
* @param targetString - the string which containes the changes
|
|
* @returns array of diff blocks
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* // Single string or number search
|
|
* diffTextBlocks("Hello World", "World"); // true
|
|
* ```
|
|
*/
|
|
export const diffTextBlocks = (sourceString: string, targetString: string) => {
|
|
return Diff.diffWords(sourceString, targetString).map((it) => ({
|
|
text: it.value,
|
|
op: it.added ? 'added' : it.removed ? 'removed' : 'unchanged',
|
|
}))
|
|
}
|