mirror of
https://github.com/peritus/obsidian-interactive-ratings.git
synced 2026-07-22 12:20:31 +00:00
Fixed import issue in editor-extension/index.ts - added missing import for ratingViewPlugin before using it in the export array. All type checks and builds now pass successfully.
25 lines
No EOL
810 B
TypeScript
25 lines
No EOL
810 B
TypeScript
import { SymbolSet } from '../types';
|
|
import { isFullOnlySymbol } from './isFullOnlySymbol';
|
|
import { generateSymbolsString } from './generateSymbolsString';
|
|
|
|
/**
|
|
* Generate a string of rating symbols for writing to disk (full-only symbols only include rated ones)
|
|
*/
|
|
export function generateSymbolsStringForDisk(
|
|
rating: number,
|
|
symbolCount: number,
|
|
full: string,
|
|
empty: string,
|
|
half: string,
|
|
supportsHalf: boolean,
|
|
symbolSet?: SymbolSet
|
|
): string {
|
|
// For full-only symbols, only write the rated symbols
|
|
if (symbolSet && isFullOnlySymbol(symbolSet)) {
|
|
const ratedCount = Math.floor(rating);
|
|
return full.repeat(ratedCount);
|
|
}
|
|
|
|
// For regular symbols, use the standard logic
|
|
return generateSymbolsString(rating, symbolCount, full, empty, half, supportsHalf, symbolSet);
|
|
} |