diff --git a/build.rs b/build.rs index d653cc82..b1685a21 100644 --- a/build.rs +++ b/build.rs @@ -128,15 +128,11 @@ fn process_release(manifest_dir: &Path, static_dir: &Path, out_dir: &Path) { // ── 6. Minify ALL individual JS files in static-dist/ ──────────────────── minify_tree_js(&dist_dir.join("js")); - // ── 7. Inline theme-init.js & rewrite index.html ────────────────────── - let theme_init = - fs::read_to_string(static_dir.join("js/core/theme-init.js")).unwrap_or_default(); - let theme_init_min = js_minify_safe(&theme_init); + // ── 7. Rewrite index.html ──────────────────────────────────────────────── let rewritten_index = rewrite_index_html( &index_html, &format!("/css/{css_name}"), &format!("/js/{js_name}"), - &theme_init_min, ); fs::write(dist_dir.join("index.html"), &rewritten_index).expect("write dist index.html"); @@ -326,7 +322,13 @@ fn collect_module_deps( for rel in extract_esm_import_paths(&src) { if rel.starts_with('.') { - collect_module_deps(&base.join(&rel), order, seen); + let target = base.join(&rel); + // Skip vendor bundles: they may use top-level await or other ESM + // patterns that are incompatible with IIFE wrapping. They must be + // loaded via dynamic import() at runtime instead. + if !target.components().any(|c| c.as_os_str() == "vendors") { + collect_module_deps(&target, order, seen); + } } // Non-relative (bare specifiers like 'react') are ignored — not used here. } @@ -660,10 +662,9 @@ fn json_minify(source: &str) -> String { /// Rewrite index.html for release: /// - Collapse all `` into the single CSS bundle. -/// - Inline `theme-init.js` as a `")); - continue; - } - // ── Replace all type="module" scripts with single bundle ───────────── if t.starts_with(" Result<(), Box> { HeaderValue::from_static( "default-src 'self'; \ script-src 'self'; \ + worker-src 'self'; \ style-src 'self' 'unsafe-inline'; \ img-src 'self' data: blob:; \ media-src 'self' blob:; \ diff --git a/static/css/base/variables.css b/static/css/base/variables.css index 60b8921a..73f73ffa 100644 --- a/static/css/base/variables.css +++ b/static/css/base/variables.css @@ -425,4 +425,7 @@ --color-music-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --color-music-background: var(--color-bg-surface); --color-music-public-bg: rgba(74, 144, 217, 0.12); + + --color-video-play: white; + --color-video-play-shadow: black; } diff --git a/static/css/components/fileType.css b/static/css/components/fileType.css index 4b74431d..d68fabaa 100644 --- a/static/css/components/fileType.css +++ b/static/css/components/fileType.css @@ -51,6 +51,15 @@ color: var(--color-ft-video-text); } +/* special case for vidao, add ▶ over the thumbnail (only if not hidden = thumb loaded) */ +.video-icon:has(img:not(.hidden))::before { + content: "▶"; + color: var(--color-video-play); + text-shadow: 0 0 3px var(--color-video-play-shadow); + z-index: 2; /* above the img */ + font-weight: bold; +} + .code-icon { background-color: var(--color-border); } diff --git a/static/css/components/filesView.css b/static/css/components/filesView.css index 5ac0c7ee..72472450 100644 --- a/static/css/components/filesView.css +++ b/static/css/components/filesView.css @@ -65,6 +65,14 @@ color: var(--color-badge-blue-text); } +.file-item .file-icon > i, +.file-item .file-icon > svg { + position: absolute; + display: flex; + align-items: center; + justify-content: center; +} + /* ------------------File list View --------------------- */ .list-header { @@ -145,7 +153,7 @@ align-items: center; justify-content: center; border-radius: 8px; - font-size: 20px; + font-size: 16px; margin-bottom: 0; flex-shrink: 0; } @@ -422,17 +430,14 @@ .files-grid-view .file-item .file-icon { margin: auto; margin-bottom: 10px; + font-size: 30px; } .files-grid-view .file-item .file-icon > i, .files-grid-view .file-item .file-icon > svg { - position: absolute; top: 5px; width: 60px; height: 60px; - display: flex; - align-items: center; - justify-content: center; } /* ----------------------- dragged items -----------*/ diff --git a/static/index.html b/static/index.html index e229745c..22ddc143 100644 --- a/static/index.html +++ b/static/index.html @@ -243,7 +243,7 @@ -