Skip to content

Commit f900fa7

Browse files
xrgzsj2rong4cn
andauthored
refactor(deps): migrate @hope-ui/solid to GitHub (#521)
* refactor(deps): migrate @hope-ui/solid to GitHub Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> * fix(deps): update @hope-ui/solid dependency to latest commit * fix(deps): add path mapping for @stitches/core/types in tsconfig * fix(deps): pin solid-icons version to 1.1.0 * fix(icons): resolve ts error Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> * fix(tsx): correct refs usage in Solid https://docs.solidjs.com/concepts/refs#refs-in-solid Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> * chore(types): correct some typescript errors Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> * fix(previews): update Error component import alias in multiple files * fix(api): simplify content type retrieval in fetchText function --------- Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> Co-authored-by: j2rong4cn <j2rong@qq.com>
1 parent 4ce736b commit f900fa7

15 files changed

Lines changed: 43 additions & 41 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"dependencies": {
6565
"@egjs/view360": "4.0.0-beta.7",
6666
"@embedpdf/snippet": "^2.14.2",
67-
"@hope-ui/solid": "0.6.7",
67+
"@hope-ui/solid": "github:OpenListTeam/hope-ui#31b436e36ae5d266016814ba71a442ffa9d91181",
6868
"@jellyfin/libass-wasm": "^4.2.4",
6969
"@monaco-editor/loader": "1.7.0",
7070
"@solid-primitives/i18n": "^2.2.1",
@@ -107,7 +107,7 @@
107107
"seemly": "^0.3.10",
108108
"sha256": "^0.2.0",
109109
"solid-contextmenu": "0.0.2",
110-
"solid-icons": "^1.1.0",
110+
"solid-icons": "1.1.0",
111111
"solid-js": "^1.9.13",
112112
"solid-motionone": "^1.0.4",
113113
"solid-transition-group": "^0.3.0",

pnpm-lock.yaml

Lines changed: 16 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/icons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IconProps, IconTemplate } from "solid-icons/lib"
1+
import { IconProps, IconTemplate } from "solid-icons"
22

33
export function VscodeIconsFileTypePhotoshop2(props: IconProps) {
44
return IconTemplate(

src/pages/home/folder/Pager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const AutoLoadMore = () => {
4545
threshold: 0.1,
4646
},
4747
)
48-
let el: HTMLDivElement
48+
let el!: HTMLDivElement
4949
onMount(() => {
5050
if (!allLoaded()) {
5151
ob.observe(el)
@@ -59,7 +59,7 @@ const AutoLoadMore = () => {
5959
when={!allLoaded()}
6060
fallback={<Text fontStyle="italic">{t("home.no_more")}</Text>}
6161
>
62-
<FullLoading py="$2" size="md" thickness={3} ref={el!} />
62+
<FullLoading py="$2" size="md" thickness={3} ref={el} />
6363
</Show>
6464
)
6565
}

src/pages/home/previews/asciinema.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import "asciinema-player/dist/bundle/asciinema-player.css"
55
import { onMount } from "solid-js"
66
import { objStore } from "~/store"
77
export default function Preview() {
8-
let d: HTMLDivElement
8+
let d!: HTMLDivElement
99

1010
onMount(() => {
1111
AsciinemaPlayer.create(objStore.raw_url, d)
1212
})
13-
return <Box w="$full" ref={d!} />
13+
return <Box w="$full" ref={d} />
1414
}

src/pages/home/previews/doc.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoxWithFullScreen, Error, FullLoading } from "~/components"
1+
import { BoxWithFullScreen, FullLoading, Error as Erro } from "~/components"
22
import { objStore } from "~/store"
33
import { Box, IconButton, Tooltip } from "@hope-ui/solid"
44
import { createSignal, onMount, onCleanup, Show } from "solid-js"
@@ -209,7 +209,7 @@ const DocViewerApp = () => {
209209

210210
{/* 错误状态 */}
211211
<Show when={error()}>
212-
<Error msg={t("preview.failed_load_doc")} h="70vh" />
212+
<Erro msg={t("preview.failed_load_doc")} h="70vh" />
213213
</Show>
214214
</div>
215215
</BoxWithFullScreen>

src/pages/home/previews/ppt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoxWithFullScreen, Error, FullLoading } from "~/components"
1+
import { BoxWithFullScreen, Error as Erro, FullLoading } from "~/components"
22
import { objStore } from "~/store"
33
import { Box, IconButton, Tooltip } from "@hope-ui/solid"
44
import { createSignal, onMount, onCleanup, Show } from "solid-js"
@@ -242,7 +242,7 @@ const PPTViewerApp = () => {
242242

243243
{/* 错误状态 */}
244244
<Show when={error()}>
245-
<Error msg={t("preview.failed_load_ppt")} h="70vh" />
245+
<Erro msg={t("preview.failed_load_ppt")} h="70vh" />
246246
</Show>
247247
</div>
248248
</BoxWithFullScreen>

src/pages/home/previews/xls.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BoxWithFullScreen, Error, FullLoading } from "~/components"
1+
import { BoxWithFullScreen, Error as Erro, FullLoading } from "~/components"
22
import { objStore } from "~/store"
33
import { Box, IconButton, Tooltip, Button, HStack } from "@hope-ui/solid"
44
import { createSignal, onMount, For, Show } from "solid-js"
@@ -295,7 +295,7 @@ const ExcelViewerApp = () => {
295295

296296
{/* 错误状态 */}
297297
<Show when={error()}>
298-
<Error msg={t("preview.failed_load_excel")} h="70vh" />
298+
<Erro msg={t("preview.failed_load_excel")} h="70vh" />
299299
</Show>
300300
</div>
301301
</BoxWithFullScreen>

src/pages/home/toolbar/BatchRename.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export const BatchRename = () => {
252252
<ModalBody>
253253
<RadioGroup
254254
defaultValue="1"
255-
onChange={(event) => {
255+
onChange={(event: string) => {
256256
setType(event)
257257
if (event === "1" || event === "3") {
258258
setNewNameType("string")

src/pages/home/toolbar/LocalSettings.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ function LocalSettingEdit(props: LocalSetting) {
102102
}}
103103
style={{
104104
"-moz-appearance": "textfield",
105+
// @ts-ignore
105106
"::-webkit-inner-spin-button": { display: "none" },
106107
"::-webkit-outer-spin-button": { display: "none" },
107108
}}

0 commit comments

Comments
 (0)