fix all imports for new structure

This commit is contained in:
jeffvli 2025-05-20 19:23:36 -07:00
parent 249eaf89f8
commit 930165d006
291 changed files with 2056 additions and 1894 deletions

View file

@ -1,4 +1,4 @@
import type { Album, AlbumArtist, Song } from '/@/renderer/api/types';
import type { Album, AlbumArtist, Song } from '/@/shared/types/domain-types';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';

View file

@ -1,3 +1,5 @@
import { ReactNode } from 'react';
// Inspired by https://github.com/navidrome/navidrome/blob/c530ccf13854e3a840ddf63eef5e2323fbe2827d/ui/src/common/AnchorMe.js
const URL_REGEX =
/((?:https?:\/\/)?(?:[\w-]{1,32}(?:\.[\w-]{1,32})+)(?:\/[\w\-./?%&=][^.|^\s]*)?)/g;
@ -5,7 +7,7 @@ const URL_REGEX =
export const replaceURLWithHTMLLinks = (text: string) => {
const urlRegex = new RegExp(URL_REGEX, 'g');
const matches = text.matchAll(urlRegex);
const elements = [];
const elements: (ReactNode | string)[] = [];
let lastIndex = 0;
for (const match of matches) {

View file

@ -11,7 +11,7 @@ const regex = /(url\("?)(?!data:)/gim;
const addStyles = (output: string[], styles: CSSStyleDeclaration) => {
for (let prop = styles.length - 1; prop >= 0; prop -= 1) {
const key = styles[prop] as keyof CSSStyleDeclaration;
const key = styles[prop] as string;
if (key !== 'content' && styles[key]) {
const value = styles[key];
const priority = styles.getPropertyPriority(key as string);
@ -75,7 +75,7 @@ DomPurify.addHook('afterSanitizeAttributes', (node: Element) => {
}
});
DomPurify.addHook('uponSanitizeElement', (node: Element) => {
(DomPurify as any).addHook('uponSanitizeElement', (node: Element) => {
if (node.tagName === 'STYLE') {
const rules = (node as HTMLStyleElement).sheet?.cssRules;
if (rules) {
@ -91,7 +91,7 @@ export const sanitize = (text: string): string => {
};
export const sanitizeCss = (text: string): string => {
return DomPurify.sanitize(text, {
return (DomPurify as any).sanitize(text, {
ALLOWED_ATTR: [],
ALLOWED_TAGS: ['style'],
RETURN_DOM: true,

View file

@ -1,9 +1,9 @@
import type { QueueSong } from '/@/renderer/api/types';
import type { PlayerData, QueueSong } from '/@/shared/types/domain-types';
import isElectron from 'is-electron';
import { api } from '/@/renderer/api';
import { getServerById, PlayerData, useSettingsStore } from '/@/renderer/store';
import { getServerById, useSettingsStore } from '/@/renderer/store';
const mpvPlayer = isElectron() ? window.api.mpvPlayer : null;