-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from lixinghua123/dev-lixinghua
fix: Tab key wraps automatically & styles adjustment / fix: Audio tool split and merge text by clip
- Loading branch information
Showing
6 changed files
with
121 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/lb-components/src/components/audioAnnotate/utils/dataTransform.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @file Process audio tool data | ||
* @author lixinghua <lixinghua_vendor@sensetime.com> | ||
* @date 2024.05.14 | ||
*/ | ||
|
||
import { IAudioTimeSlice, ITextConfigItem } from '@labelbee/lb-utils'; | ||
import _ from 'lodash'; | ||
|
||
export default class DataTransform { | ||
// clip tool get text by config | ||
public static getClipTextByConfig = ( | ||
region: IAudioTimeSlice, | ||
clipTextList: ITextConfigItem[], | ||
isClear = false, | ||
) => { | ||
const newRegion = _.cloneDeep(region); | ||
clipTextList.forEach((i, index) => { | ||
// index === 0: Compatible with old data | ||
if (index === 0) { | ||
Object.assign(newRegion, { text: isClear ? '' : region[i.key] }); | ||
} else { | ||
Object.assign(newRegion, { [i.key]: isClear ? '' : region[i.key] }); | ||
} | ||
}); | ||
return newRegion; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters