mirror of
https://github.com/ilyhalight/voice-over-translation.git
synced 2026-10-19 15:55:24 +00:00
Large refactor: improve subtitle parsing, tokenization and wrapping (displayModel, renderPlan, smartWrap, standards, widget) to handle HTML tags, punctuation, attached word/number cases and VTT/ASS edge cases. Simplify VideoManager/VideoHandler mute API (removed preserve option) and add logic to preserve YouTube volume storage where needed; update smart ducking usage and UI volume handling. Sanitize extension bridge/notifications errors and GM notification fields. Restructure Vite build helpers into vite/lib (paths, env, manifest/userscript tooling, chrome-postbuild) and update configs to use new utilities. Misc utils and filename trimming fixes.
20 lines
476 B
TypeScript
20 lines
476 B
TypeScript
type DefineValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| readonly DefineValue[]
|
|
| { readonly [key: string]: DefineValue };
|
|
|
|
export type ViteDefine = NonNullable<import("vite").UserConfig["define"]>;
|
|
|
|
export function defineConstants(
|
|
constants: Record<string, DefineValue>,
|
|
): ViteDefine {
|
|
return Object.fromEntries(
|
|
Object.entries(constants).map(([key, value]) => [
|
|
key,
|
|
typeof value === "string" ? JSON.stringify(value) : value,
|
|
]),
|
|
);
|
|
}
|