Skip to content

Commit 618a8f0

Browse files
committed
Merge branch 'dev-codec' into dev-media
# Conflicts: # package.json # pnpm-lock.yaml resolved by dev-codec version # src/hooks/usePath.ts resolved by dev-codec version # src/lang/en/manage.json resolved by dev-codec version # src/pages/home/previews/aliyun_video.tsx resolved by dev-codec version # src/pages/home/previews/video.tsx resolved by dev-codec version # src/pages/media/video/VideoLibrary.tsx resolved by dev-codec version # src/types/setting.ts resolved by dev-codec version # src/utils/media_api.ts resolved by dev-codec version
2 parents d49747e + b02eda6 commit 618a8f0

50 files changed

Lines changed: 552 additions & 372 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/sync_to_crowdin/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ runs:
1414
- name: Setup Node
1515
uses: actions/setup-node@v6
1616
with:
17-
node-version: "24.14.1"
17+
node-version: "24.15.0"
1818
registry-url: "https://registry.npmjs.org"
1919

2020
- name: Install pnpm
21-
uses: pnpm/action-setup@v5
21+
uses: pnpm/action-setup@v6
2222
with:
2323
# version: 9.9.0
2424
run_install: false

.github/workflows/build_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- name: Setup Node
2121
uses: actions/setup-node@v6
2222
with:
23-
node-version: "24.14.1"
23+
node-version: "24.15.0"
2424
registry-url: "https://registry.npmjs.org"
2525

26-
- uses: pnpm/action-setup@v5
26+
- uses: pnpm/action-setup@v6
2727
name: Install pnpm
2828
id: pnpm-install
2929
with:

.github/workflows/build_release.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ jobs:
5959
- name: Setup Node
6060
uses: actions/setup-node@v6
6161
with:
62-
node-version: "24.14.1"
62+
node-version: "24.15.0"
6363
registry-url: "https://registry.npmjs.org"
6464

6565
- name: Install pnpm
66-
uses: pnpm/action-setup@v5
66+
uses: pnpm/action-setup@v6
6767
with:
6868
run_install: false
6969

@@ -178,19 +178,16 @@ jobs:
178178
exit 1
179179
fi
180180
181-
- name: Publish npm
181+
- name: Publish npm (Trusted publishing)
182182
run: |
183-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
184-
185-
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
186-
echo "NPM_TOKEN not set, performing dry run"
187-
pnpm publish --dry-run --no-git-checks --access public
183+
if [ "${{ secrets[format('{0}', 'NPM_PUBLISH')] }}" = "yes" ]; then
184+
echo "NPM_PUBLISH=yes, publishing to npm with trusted publishing..."
185+
pnpm publish --no-git-checks --access public --provenance
188186
else
189-
echo "Publishing to npm..."
190-
pnpm publish --no-git-checks --access public
187+
echo "NPM_PUBLISH is not yes, performing dry run"
188+
pnpm publish --dry-run --no-git-checks --access public
191189
fi
192-
env:
193-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
194190
195191
permissions:
196192
contents: write
193+
id-token: write

.github/workflows/build_rolling.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
- name: Setup Node
3535
uses: actions/setup-node@v6
3636
with:
37-
node-version: "24.14.1"
37+
node-version: "24.15.0"
3838
registry-url: "https://registry.npmjs.org"
3939

40-
- uses: pnpm/action-setup@v5
40+
- uses: pnpm/action-setup@v6
4141
name: Install pnpm
4242
id: pnpm-install
4343
with:

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v6
16-
- uses: pnpm/action-setup@v5
16+
- uses: pnpm/action-setup@v6
1717

1818
- name: Setup Node.js environment
1919
uses: actions/setup-node@v6
2020
with:
21-
node-version: 24.14.1
21+
node-version: 24.15.0
2222

2323
- name: Install dependencies
2424
run: pnpm install

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openlist-frontend/openlist-frontend",
3-
"version": "4.1.10",
3+
"version": "4.2.1",
44
"type": "module",
55
"author": {
66
"name": "The OpenList Projects Contributors",
@@ -37,15 +37,15 @@
3737
"license": "MIT",
3838
"devDependencies": {
3939
"@crowdin/cli": "^4.14.1",
40-
"@hrgui/libass-wasm-ts": "^1.0.3",
4140
"@types/bencode": "^2.0.4",
4241
"@types/crypto-js": "^4.2.2",
4342
"@types/mark.js": "^8.11.12",
44-
"@types/node": "^24.12.0",
43+
"@types/node": "^24.12.2",
4544
"@types/qrcode": "^1.5.6",
4645
"@types/sha256": "^0.2.2",
4746
"@types/streamsaver": "^2.0.5",
4847
"@vitejs/plugin-legacy": "^8.0.1",
48+
"baseline-browser-mapping": "^2.10.29",
4949
"cross-env": "^10.1.0",
5050
"husky": "^9.1.7",
5151
"lint-staged": "^16.4.0",
@@ -54,22 +54,22 @@
5454
"rehype-stringify": "^10.0.1",
5555
"remark-parse": "^11.0.0",
5656
"remark-rehype": "^11.1.2",
57-
"terser": "^5.46.1",
57+
"terser": "^5.46.2",
5858
"typescript": "^5.9.3",
5959
"unified": "^11.0.5",
60-
"vite": "^8.0.3",
60+
"vite": "^8.0.10",
6161
"vite-plugin-dynamic-base": "^1.3.0",
62-
"vite-plugin-solid": "^2.11.11",
62+
"vite-plugin-solid": "^2.11.12",
6363
"vite-plugin-static-copy": "^3.4.0"
6464
},
6565
"dependencies": {
6666
"@egjs/view360": "4.0.0-beta.7",
67-
"@embedpdf/snippet": "^2.12.1",
67+
"@embedpdf/snippet": "^2.14.1",
6868
"@github/webauthn-json": "^2.1.1",
6969
"@hope-ui/solid": "0.6.7",
7070
"@mediabunny/ac3": "^1.40.1",
71+
"@jellyfin/libass-wasm": "^4.2.4",
7172
"@monaco-editor/loader": "1.7.0",
72-
"@ruffle-rs/ruffle": "0.2.0-nightly.2026.3.23",
7373
"@solid-primitives/i18n": "^2.2.1",
7474
"@solid-primitives/keyboard": "^1.3.5",
7575
"@solid-primitives/storage": "^1.3.11",
@@ -81,7 +81,7 @@
8181
"artplayer": "^5.4.0",
8282
"artplayer-plugin-danmuku": "^5.3.0",
8383
"asciinema-player": "^3.15.1",
84-
"axios": "^1.13.6",
84+
"axios": "^1.15.2",
8585
"bencode": "^4.0.0",
8686
"chardet": "^2.1.1",
8787
"clsx": "^2.1.1",
@@ -91,11 +91,10 @@
9191
"handlebars": "^4.7.9",
9292
"hash-wasm": "^4.12.0",
9393
"highlight.js": "^11.11.1",
94-
"hls.js": "^1.6.15",
94+
"hls.js": "^1.6.16",
9595
"ini": "^6.0.0",
9696
"just-once": "^2.2.0",
9797
"katex": "^0.16.44",
98-
"libass-wasm": "^4.1.0",
9998
"libheif-js": "^1.19.8",
10099
"lightgallery": "^2.9.0",
101100
"mark.js": "^8.11.1",

patches/vite-plugin-dynamic-base.patch

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
diff --git a/dist/core/utils.js b/dist/core/utils.js
2-
index d0e5538af0ecace66973352e5393675a195f2db5..94ce37fea99dd308847b034677b750379a4ea0fe 100644
2+
index d0e5538af0ecace66973352e5393675a195f2db5..d378e6f52d8c6620695222c0ccf66ecf501c7317 100644
33
--- a/dist/core/utils.js
44
+++ b/dist/core/utils.js
5-
@@ -35,7 +35,7 @@ function replaceInStringLiteral(literal, base, placeholder) {
5+
@@ -16,12 +16,14 @@ function replaceImport(placeholder, code) {
6+
}
7+
exports.replaceImport = replaceImport;
8+
function replaceInStringLiteral(literal, base, placeholder) {
9+
+ // Use raw content to preserve escaping and avoid breaking quoted strings.
10+
+ const rawLiteral = literal.raw.slice(1, -1);
11+
const quoteMark = literal.raw.charAt(0);
12+
const regex = new RegExp(base, 'g');
13+
// Keep track of whether we need to add quotation marks at the beginning of the
14+
// final output
15+
let withStartQuote = true;
16+
- const transformedStr = literal.value.replace(regex, (match, index) => {
17+
+ const transformedStr = rawLiteral.replace(regex, (match, index) => {
18+
let prefix = `${quoteMark}+`;
19+
if (index === 0) {
20+
prefix = '';
21+
@@ -35,7 +37,7 @@ function replaceInStringLiteral(literal, base, placeholder) {
622
exports.replaceInStringLiteral = replaceInStringLiteral;
723
function replaceInTemplateElement(element, base, placeholder) {
824
const regex = new RegExp(base, 'g');
@@ -11,12 +27,3 @@ index d0e5538af0ecace66973352e5393675a195f2db5..94ce37fea99dd308847b034677b75037
1127
}
1228
exports.replaceInTemplateElement = replaceInTemplateElement;
1329
//# sourceMappingURL=utils.js.map
14-
\ No newline at end of file
15-
diff --git a/dist/core/utils.js.map b/dist/core/utils.js.map
16-
index 3e21f6d959a5613b51bc968f42b8e11e552e5314..51b86ff3934a12bf6126598c52d9c9bb6e75d917 100644
17-
--- a/dist/core/utils.js.map
18-
+++ b/dist/core/utils.js.map
19-
@@ -1 +1 @@
20-
-{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":";;;AAGA,SAAgB,OAAO,CAAC,IAAY,EAAE,WAAmB,EAAE,IAAY;IACrE,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,WAAW,CAAC,CAAA;AACtC,CAAC;AAHD,0BAGC;AAED,oBAAoB;AACpB,SAAgB,UAAU,CAAC,WAAmB,EAAE,IAAY;IAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,WAAW,8BAA8B,CAAC,CAAA;AACzF,CAAC;AAFD,gCAEC;AAED,SAAgB,aAAa,CAAC,WAAmB,EAAE,IAAY;IAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,KAAK,WAAW,GAAG,CAAC,CAAA;AAChE,CAAC;AAFD,sCAEC;AAED,SAAgB,sBAAsB,CAAC,OAAsB,EAAE,IAAY,EAAE,WAAmB;IAC9F,MAAM,SAAS,GAAG,OAAO,CAAC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G,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;AACrE,CAAC;AAHD,4DAGC"}

pnpm-lock.yaml

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

src/app/MustUser.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import { r, handleResp, handleRespWithoutAuthAndNotify } from "~/utils"
77

88
const MustUser = (props: { children: JSXElement }) => {
99
const t = useT()
10-
const [loading, data] = useFetch((): PResp<Me> => r.get("/me"))
10+
const [loading, data] = useFetch((): PResp<Me> => r.get("/me"), true)
1111
const [err, setErr] = createSignal<string>()
12-
;(async () => {
13-
// const resp: Resp<User> = await data();
12+
onMount(async () => {
1413
handleResp(await data(), setMe, setErr)
15-
})()
14+
})
1615
return (
1716
<Switch fallback={props.children}>
1817
<Match when={loading()}>
@@ -26,7 +25,8 @@ const MustUser = (props: { children: JSXElement }) => {
2625
}
2726

2827
const UserOrGuest = (props: { children: JSXElement }) => {
29-
const [loading, data] = useFetch((): PResp<Me> => r.get("/me"))
28+
// 将loading默认设置为true,修复children被提前渲染,明显症状:两个公告
29+
const [loading, data] = useFetch((): PResp<Me> => r.get("/me"), true)
3030
const [skipLogin, setSkipLogin] = createSignal(false)
3131
onMount(async () => {
3232
handleRespWithoutAuthAndNotify(await data(), setMe, (_msg, _code) => {
@@ -40,6 +40,7 @@ const UserOrGuest = (props: { children: JSXElement }) => {
4040
permission: 0,
4141
sso_id: "",
4242
otp: false,
43+
allow_ldap: false,
4344
})
4445
setSkipLogin(true)
4546
})

src/components/Markdown.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Motion } from "solid-motionone"
1313
import { unified } from "unified"
1414
import { useCDN, useParseText, useRouter } from "~/hooks"
1515
import { useScrollListener } from "~/pages/home/toolbar/BackTop.jsx"
16-
import { getMainColor, me } from "~/store"
16+
import { getMainColor, getSettingBool, me } from "~/store"
1717
import { api, notify, pathDir, pathJoin, pathResolve } from "~/utils"
1818
import { isMobile } from "~/utils/compatibility.js"
1919
import hljs from "highlight.js"
@@ -169,6 +169,7 @@ const loadMermaidJS = once(
169169

170170
async function renderMarkdown(
171171
content: string,
172+
sanitize: boolean,
172173
): Promise<{ html: string; hasMermaid: boolean }> {
173174
let processor = unified()
174175

@@ -189,10 +190,10 @@ async function renderMarkdown(
189190
)
190191
}
191192

192-
processor
193-
.use(remarkRehype, { allowDangerousHtml: true })
194-
.use(rehypeRaw)
195-
.use(rehypeSanitize, {
193+
processor.use(remarkRehype, { allowDangerousHtml: true }).use(rehypeRaw)
194+
195+
if (sanitize)
196+
processor.use(rehypeSanitize, {
196197
...defaultSchema,
197198
attributes: {
198199
...defaultSchema.attributes,
@@ -220,6 +221,7 @@ export function Markdown(props: {
220221
ext?: string
221222
readme?: boolean
222223
toc?: boolean
224+
sanitize?: boolean
223225
}) {
224226
const [encoding, setEncoding] = createSignal<string>("utf-8")
225227
const [show, setShow] = createSignal(true)
@@ -263,7 +265,10 @@ export function Markdown(props: {
263265
on([md, mermaidTheme], async () => {
264266
setShow(false)
265267

266-
const { html, hasMermaid } = await renderMarkdown(md())
268+
const { html, hasMermaid } = await renderMarkdown(
269+
md(),
270+
props.sanitize || getSettingBool("filter_readme_scripts"),
271+
)
267272
setMarkdownHTML(html)
268273

269274
setTimeout(() => {

0 commit comments

Comments
 (0)