diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ecaa99..d4281dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,14 @@ per Windows (portatile e installabile), Mac e Android, e va online su [GitHub Pa - **Clear** (licenza source-available, non permissiva) si può spegnere dal Centro AI. - **Nota onesta**: i modelli veri non sono stati scaricati né eseguiti; prove con motori finti (`test/unit/funzioni-ai.test.mjs`, `test/unit/motore_ai_server*.py`). +## [1.8.2] — 2026-10-30 · Meno scritte, tutto leggibile e a schermo + +- **Scritte leggibili**: il carattere a 7 segmenti resta solo sui numeri (timecode); pesi, VRAM e dati usano un carattere mono pulito. +- **Centro AI a schede compatte** con ricerca, filtri e dettagli su richiesta. +- **Proprietà più pulite**: schede AI corte, i dettagli col tasto «i». +- **Modifica clip** nella grafica nuova, con menu laterale. +- **Finale a schede**, curve di misura normale, tutto a schermo anche a 1440p e 4K; LIVE, Montage e Home più compatti. + ## [1.8.1] — 2026-10-30 · Aggiornamenti di nuovo funzionanti - **Aggiorna** non diceva più «indirizzo non valido»: il progetto su GitHub ora si chiama DaProdEditorVideo e l'app accetta il nome nuovo (e anche quello vecchio). Anche i link a GitHub dentro l'app puntano al nome nuovo. diff --git a/package-lock.json b/package-lock.json index d916231..cdfbfaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "daprod-video", - "version": "1.8.1", + "version": "1.8.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "daprod-video", - "version": "1.8.1", + "version": "1.8.2", "license": "MIT", "dependencies": { "@desert-ant-labs/clear": "3.6.0", diff --git a/package.json b/package.json index b5b5230..cdbb138 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "daprod-video", "productName": "DaProd Video", - "version": "1.8.1", + "version": "1.8.2", "description": "DaProd Video: il montaggio video vecchio stile, moderno dentro. Timeline, due monitor, pulsantiera e VU a lancetta.", "author": "DaProd", "license": "MIT", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 8cd74ce..f51eb6f 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -19,15 +19,15 @@ dependencies = [ [[package]] name = "alloc-no-stdlib" -version = "2.0.4" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" [[package]] name = "alloc-stdlib" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" dependencies = [ "alloc-no-stdlib", ] @@ -294,9 +294,9 @@ dependencies = [ [[package]] name = "brotli" -version = "8.0.4" +version = "9.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3" +checksum = "627b7cfb0578f0eafce087a90fcd40add1231900b69e4d4de2d456260a4f5d81" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -305,9 +305,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "5.0.3" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" +checksum = "34c6783f42c21c952ad7112b354f0ba2f10760e9decea5b1b60523d6e270faaf" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -408,12 +408,13 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.22.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9" dependencies = [ + "semver", "serde", - "toml 0.9.12+spec-1.1.0", + "toml 1.1.6+spec-1.1.0", ] [[package]] @@ -434,13 +435,13 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfb" -version = "0.7.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +checksum = "a347dcabdae9c31b0825fd6a8bed285ec9c2acb89c47827126d52fa4f59cece3" dependencies = [ - "byteorder", "fnv", "uuid", + "web-time", ] [[package]] @@ -585,9 +586,9 @@ dependencies = [ [[package]] name = "cssparser" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" dependencies = [ "cssparser-macros", "dtoa-short", @@ -598,33 +599,23 @@ dependencies = [ [[package]] name = "cssparser-macros" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" dependencies = [ "quote", - "syn 2.0.119", + "syn 3.0.6", ] [[package]] name = "ctor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - -[[package]] -name = "ctor-proc-macro" -version = "0.0.7" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" [[package]] name = "daprod-video" -version = "1.8.1" +version = "1.8.2" dependencies = [ "getrandom 0.3.4", "libc", @@ -759,9 +750,9 @@ dependencies = [ [[package]] name = "dirs" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" dependencies = [ "dirs-sys", ] @@ -826,9 +817,9 @@ dependencies = [ [[package]] name = "dom_query" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" +checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc" dependencies = [ "bit-set", "cssparser", @@ -863,21 +854,6 @@ dependencies = [ "dtoa", ] -[[package]] -name = "dtor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - [[package]] name = "dunce" version = "1.0.5" @@ -1476,9 +1452,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "html5ever" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" +checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" dependencies = [ "log", "markup5ever", @@ -1592,12 +1568,12 @@ dependencies = [ [[package]] name = "ico" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" +checksum = "d75e94d66081e4d8dcd098bd8dc5254800fea14a26389b298410158d834de167" dependencies = [ "byteorder", - "png 0.17.16", + "png", ] [[package]] @@ -1735,9 +1711,9 @@ dependencies = [ [[package]] name = "infer" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" +checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4" dependencies = [ "cfb", ] @@ -1907,21 +1883,21 @@ dependencies = [ [[package]] name = "json-patch" -version = "3.0.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" +checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.21", ] [[package]] name = "jsonptr" -version = "0.6.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" +checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" dependencies = [ "serde", "serde_json", @@ -1929,13 +1905,12 @@ dependencies = [ [[package]] name = "keyboard-types" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" dependencies = [ "bitflags 2.13.2", "serde", - "unicode-segmentation", ] [[package]] @@ -2031,9 +2006,9 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "markup5ever" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" +checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" dependencies = [ "log", "tendril", @@ -2094,9 +2069,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.19.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd04e60bc0b07438a6771710ee1698f98f6ebbc7f89b61264af1563b8aeb878" +checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996" dependencies = [ "crossbeam-channel", "dpi", @@ -2107,7 +2082,7 @@ dependencies = [ "objc2-core-foundation", "objc2-foundation", "once_cell", - "png 0.18.1", + "png", "serde", "thiserror 2.0.21", "windows-sys 0.61.2", @@ -2128,6 +2103,12 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + [[package]] name = "ndk-sys" version = "0.6.0+11769913" @@ -2210,6 +2191,7 @@ dependencies = [ "objc2", "objc2-core-foundation", "objc2-foundation", + "objc2-quartz-core", ] [[package]] @@ -2567,19 +2549,6 @@ dependencies = [ "time", ] -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide 0.8.9", -] - [[package]] name = "png" version = "0.18.1" @@ -2851,9 +2820,9 @@ dependencies = [ [[package]] name = "rfd" -version = "0.16.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" +checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220" dependencies = [ "block2", "dispatch2", @@ -2861,16 +2830,18 @@ dependencies = [ "gobject-sys", "gtk-sys", "js-sys", + "libc", "log", "objc2", "objc2-app-kit", "objc2-core-foundation", "objc2-foundation", + "percent-encoding", "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2975,9 +2946,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "selectors" -version = "0.36.1" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" +checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d" dependencies = [ "bitflags 2.13.2", "cssparser", @@ -3276,6 +3247,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_vcruntime" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7" + [[package]] name = "string_cache" version = "0.9.0" @@ -3308,9 +3285,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swift-rs" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45c444e496845d3f2a351146bff59aae4975b2280238df1dfaa0c7d1846f38e" +checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9" dependencies = [ "base64 0.21.7", "serde", @@ -3483,9 +3460,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.35.3" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c93047acf68669466a34690ac58cca7010bd1b201e1ec86f1fd0a75d3dd4a9" +checksum = "d5777b06fe6435126ae8d816eba269e050e1e10d302cf5461e9c49eccabc3548" dependencies = [ "bitflags 2.13.2", "block2", @@ -3503,20 +3480,20 @@ dependencies = [ "libc", "log", "ndk", + "ndk-context", "ndk-sys", "objc2", "objc2-app-kit", "objc2-foundation", "objc2-ui-kit", - "once_cell", "parking_lot", "percent-encoding", "raw-window-handle", "tao-macros", "unicode-segmentation", "url", - "windows", - "windows-core 0.61.2", + "windows 0.62.2", + "windows-core 0.62.2", "windows-version", "x11-dl", ] @@ -3540,9 +3517,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.11.6" +version = "2.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa5bacdb9bbad5954af3d1bd6cf6ae9192cab1b2e270f4a07f904610b9e85f4" +checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072" dependencies = [ "anyhow", "bytes", @@ -3586,14 +3563,14 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows", + "windows 0.62.2", ] [[package]] name = "tauri-build" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9ce40b16101cb6ea63d3e221567affd1c3a9205f95d7bc574941a10636b632" +checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614" dependencies = [ "anyhow", "cargo_toml", @@ -3605,6 +3582,8 @@ dependencies = [ "semver", "serde", "serde_json", + "static_vcruntime", + "strsim", "tauri-utils", "tauri-winres", "walkdir", @@ -3612,16 +3591,16 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08279169ff42f8fc45a1dbc9dcae888893ba95288142e5880c59b93a26d2cfc5" +checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "brotli", "ico", "json-patch", "plist", - "png 0.17.16", + "png", "proc-macro2", "quote", "semver", @@ -3639,9 +3618,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b394794f399a421811d06966343e7933fcae92d59f5180b9388d1174497a45" +checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -3653,9 +3632,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.6.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74be5dd4bed9afbd145e5716b5fa2ec28cbc29c34ffa61c258c9273d896c8020" +checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291" dependencies = [ "anyhow", "glob", @@ -3669,9 +3648,9 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.7.3" +version = "2.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61854a36651aa48381e5e209f69a01273b77f3f9f91f0c430b1b98d33bd47229" +checksum = "ce0fb9c2b6d34a9720627ed930ebc8af26f61e648695aecaeb03d5c33c5896f5" dependencies = [ "log", "raw-window-handle", @@ -3687,9 +3666,9 @@ dependencies = [ [[package]] name = "tauri-plugin-fs" -version = "2.5.2" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de22eef34fd78c0da050e748710edd50bf127e651d02ea1b2bfada1523cc5c51" +checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b" dependencies = [ "anyhow", "dunce", @@ -3727,7 +3706,7 @@ dependencies = [ "tauri-plugin", "thiserror 2.0.21", "url", - "windows", + "windows 0.61.3", "zbus", ] @@ -3749,9 +3728,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.11.3" +version = "2.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b4bc95aed361b0019067d189a1174a603d460d0f6c72606512d59fc9c12ec8" +checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9" dependencies = [ "cookie", "dpi", @@ -3769,14 +3748,14 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows", + "windows 0.62.2", ] [[package]] name = "tauri-runtime-wry" -version = "2.11.4" +version = "2.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e6fac707727b7a2f48e4ded90976324267371073edbb415ffb73bb0458d203f" +checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f" dependencies = [ "gtk", "http", @@ -3784,7 +3763,6 @@ dependencies = [ "log", "objc2", "objc2-app-kit", - "once_cell", "percent-encoding", "raw-window-handle", "softbuffer", @@ -3794,15 +3772,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows", + "windows 0.62.2", "wry", ] [[package]] name = "tauri-utils" -version = "2.9.3" +version = "2.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e176a18e67764923c4f1ce66f25ae4abe5f688384d5eb1a0fa6c77f3d90f887" +checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3" dependencies = [ "anyhow", "brotli", @@ -3994,21 +3972,6 @@ dependencies = [ "toml_edit 0.20.2", ] -[[package]] -name = "toml" -version = "0.9.12+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" -dependencies = [ - "indexmap 2.14.2", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 0.7.5+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 0.7.15", -] - [[package]] name = "toml" version = "1.1.6+spec-1.1.0" @@ -4033,15 +3996,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - [[package]] name = "toml_datetime" version = "1.1.1+spec-1.1.0" @@ -4180,9 +4134,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045979e3f037cd18ad1cb2a419dfda133c5c29c9f3453370079f2255d46c257e" +checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72" dependencies = [ "crossbeam-channel", "dirs", @@ -4194,7 +4148,7 @@ dependencies = [ "objc2-core-graphics", "objc2-foundation", "once_cell", - "png 0.18.1", + "png", "serde", "thiserror 2.0.21", "windows-sys 0.61.2", @@ -4229,47 +4183,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - [[package]] name = "unicode-ident" version = "1.0.26" @@ -4297,13 +4210,13 @@ dependencies = [ [[package]] name = "urlpattern" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" +checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b" dependencies = [ + "icu_properties", "regex", "serde", - "unic-ucd-ident", "url", ] @@ -4469,6 +4382,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "web_atoms" version = "0.2.6" @@ -4527,16 +4450,14 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.38.2" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" +checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows", - "windows-core 0.61.2", - "windows-implement", - "windows-interface", + "windows 0.62.2", + "windows-core 0.62.2", ] [[package]] @@ -4552,13 +4473,13 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.38.2" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" +checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb" dependencies = [ "thiserror 2.0.21", - "windows", - "windows-core 0.61.2", + "windows 0.62.2", + "windows-core 0.62.2", ] [[package]] @@ -4594,16 +4515,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window-vibrancy" -version = "0.6.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" +checksum = "111e51caca442cafd9bab396628ac4d814880eaea4e63dfd76a12e9f342b5580" dependencies = [ "objc2", "objc2-app-kit", "objc2-core-foundation", "objc2-foundation", + "objc2-quartz-core", "raw-window-handle", - "windows-sys 0.59.0", + "windows-sys 0.61.2", "windows-version", ] @@ -4613,11 +4535,23 @@ version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-collections", + "windows-collections 0.2.0", "windows-core 0.61.2", - "windows-future", + "windows-future 0.2.1", "windows-link 0.1.3", - "windows-numerics", + "windows-numerics 0.2.0", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections 0.3.2", + "windows-core 0.62.2", + "windows-future 0.3.2", + "windows-numerics 0.3.1", ] [[package]] @@ -4629,6 +4563,15 @@ dependencies = [ "windows-core 0.61.2", ] +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", +] + [[package]] name = "windows-core" version = "0.61.2" @@ -4663,7 +4606,18 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", "windows-link 0.1.3", - "windows-threading", + "windows-threading 0.1.0", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", ] [[package]] @@ -4710,6 +4664,16 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", +] + [[package]] name = "windows-result" version = "0.3.4" @@ -4839,6 +4803,15 @@ dependencies = [ "windows-link 0.1.3", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", +] + [[package]] name = "windows-version" version = "0.1.7" @@ -4995,12 +4968,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - [[package]] name = "winnow" version = "1.0.4" @@ -5034,11 +5001,11 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "wry" -version = "0.55.1" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186f9871daa55fd9c016578b810d149de58367113db7fb72b462d2323ce19514" +checksum = "759c50ddad0ef9913bb5496cb9d509a50433a3b78cb0238d61105526589cf0e9" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "block2", "cookie", "crossbeam-channel", @@ -5059,7 +5026,6 @@ dependencies = [ "objc2-foundation", "objc2-ui-kit", "objc2-web-kit", - "once_cell", "percent-encoding", "raw-window-handle", "sha2", @@ -5070,8 +5036,8 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows", - "windows-core 0.61.2", + "windows 0.62.2", + "windows-core 0.62.2", "windows-version", "x11-dl", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e347518..29904f6 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daprod-video" -version = "1.8.1" +version = "1.8.2" description = "DaProd Video: il montaggio vecchio stile, moderno dentro" authors = ["DaProd"] license = "MIT" diff --git a/src/stile/banco.css b/src/stile/banco.css index 914e239..a2d3473 100644 --- a/src/stile/banco.css +++ b/src/stile/banco.css @@ -157,7 +157,7 @@ input[type='range']:focus-visible { outline-offset: 4px; } .bin-albero { background: #101015; } .bin-barra { background: #17161d; } .bin-cat { min-height: 30px; border-radius: var(--raggio-piccolo); font-size: 14px; font-weight: 600; } -.bin-cat .conta { font: 700 12px var(--tc); color: var(--etichetta); } +.bin-cat .conta { font: 700 12px var(--mono); color: var(--etichetta); } .pannello { background: var(--pann); } .schede { background: #101015; } @@ -201,7 +201,7 @@ input[type='range']:focus-visible { outline-offset: 4px; } background: var(--metallo-tasto); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 3px 0 #09080c, 0 4px 8px rgba(0, 0, 0, 0.4); } .tasto-num:hover { background: var(--metallo-chiaro); } -.tasto-num .tasto-numero { font: 700 12px var(--tc); color: var(--oro); text-shadow: 0 0 6px rgba(255, 213, 74, 0.5); } +.tasto-num .tasto-numero { font: 700 12px var(--mono); color: var(--oro); text-shadow: 0 0 6px rgba(255, 213, 74, 0.5); } .tasto-num .nome { font: 700 11px var(--ui); letter-spacing: 1.5px; text-transform: uppercase; } .tasto-num.rosso { background: linear-gradient(180deg, #5a2631, #3e171f); border-color: rgba(255, 77, 109, 0.35); } .tasto-modo, .tasto-piccolo { @@ -251,7 +251,7 @@ input[type='range']:focus-visible { outline-offset: 4px; } .scene-titolo.acceso { opacity: 1; } .live-scene, .tele-scene { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .live-scene .scena-btn, .live-mini .scena-btn { min-height: 44px; height: 44px; padding: 0 6px; gap: 5px; min-width: 0; font: 700 13px var(--ui); } -.scena-btn kbd { font: 12px var(--tc); opacity: .7; } +.scena-btn kbd { font: 12px var(--mono); opacity: .7; } .live .scena-btn.attiva, .live-mini .scena-btn.attiva { background: var(--cia-fondo); border-color: var(--cia); color: var(--cia); box-shadow: inset 0 -2px var(--cia); } /* Telecomando Banco: tutti i comandi restano nella finestra, anche con anteprima spenta. */ @@ -283,7 +283,7 @@ input[type='range']:focus-visible { outline-offset: 4px; } .live-mini:not(.sta-registrando):not(.in-pausa) .live-mini-punto { background: var(--verde); animation: none; box-shadow: none; } .live-mini:not(.sta-registrando) .tele-rec { background: var(--metallo-tasto); color: var(--testo); border-color: var(--bordo-forte); } /* I caratteri del telecomando e di LIVE sono quelli del Banco, anche per i numeri. */ -.live, .live-mini { --tc: 'Share Tech Mono', monospace; } + .live-mini.su .live-btn { min-height: 44px; height: 44px; font-family: var(--ui); background: var(--metallo-tasto); color: var(--testo); border-color: var(--bordo-forte); } .live-mini.su .live-btn.acceso, .live-mini.su .scena-btn.attiva { color: var(--cia); border-color: var(--cia); } .live-mini.su.in-onda .tele-rec { background: var(--metallo-tasto); color: var(--testo); border-color: var(--bordo-forte); } diff --git a/src/stile/coloreAvanzato.css b/src/stile/coloreAvanzato.css index 5a9102d..82f8892 100644 --- a/src/stile/coloreAvanzato.css +++ b/src/stile/coloreAvanzato.css @@ -11,3 +11,32 @@ .colore-avanzato .ca-punto-riga { display: flex; gap: 6px; flex-wrap: wrap; } .colore-avanzato .ca-numero { font-size: 14px; } .colore-avanzato .ca-stato { min-height: 1.4em; overflow-wrap: anywhere; } + +/* Curve: superficie quadrata, comandi vicini, valori precisi su richiesta. */ +.colore-avanzato { font: 500 15px/1.3 var(--ui); gap: 8px; } +.colore-avanzato legend { letter-spacing: 1px; } +.colore-avanzato .ca-curva { width: min(100%, clamp(240px, 30vh, 360px)); height: auto; aspect-ratio: 1; } +.ca-curve-banco { display: grid; grid-template-columns: minmax(0, min(60%, clamp(240px, 30vh, 360px))) minmax(110px, 1fr); align-items: start; gap: 12px; } +.ca-curve-strumenti { display: flex; flex-direction: column; gap: 8px; min-width: 0; } +.colore-avanzato .ca-numero { font-size: 15px; } +.colore-avanzato :is(input, select) { min-height: var(--riga, clamp(34px, 3.15vh, 36px)); font: 400 13px var(--mono, 'Share Tech Mono', monospace); } +.ca-avanzate { min-width: 0; } +.ca-avanzate summary { cursor: pointer; min-height: 34px; font: 600 15px/1.3 var(--ui); padding: 8px 0; } +.ca-avanzate[open] { display: grid; gap: 8px; } +.ca-avanzate[open] > .ca-punto-riga { margin-bottom: 8px; } +.colore-avanzato .ca-stato:empty { display: none; } +.ca-fin-host .ca-libreria { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 240px; overflow: auto; padding: 2px; } +.ca-lut b { font: 700 12px/1.3 var(--ui); } +.ca-lut.scelta { box-shadow: inset 0 0 0 2px var(--cia, #35e8ff); } +.ca-fin-host .ca-ruote { grid-template-columns: repeat(3, minmax(0, 1fr)); } +.ca-fin-host .ca-ruota { padding: 8px; } +.ca-fin-host .ca-numero { flex-wrap: wrap; } +.ca-fin-host .ca-fin-scelta select { max-width: 100%; } +@media (max-width: 700px) { + .ca-curve-banco { grid-template-columns: minmax(0, 1fr); } + .ca-curve-strumenti { flex-direction: row; flex-wrap: wrap; } +} + +.ca-finestra .ca-curve-banco { grid-template-columns: minmax(0, 1fr); } +.ca-finestra .ca-curve-strumenti { flex-direction: row; flex-wrap: wrap; } +.ca-finestra .ca-curva { justify-self: center; } diff --git a/src/stile/copieAI.css b/src/stile/copieAI.css index b04f089..5bf4331 100644 --- a/src/stile/copieAI.css +++ b/src/stile/copieAI.css @@ -28,3 +28,41 @@ .fun-presenza[data-presenza='si'] { color: var(--verde); } .fun-presenza { font: 700 12px var(--ui); letter-spacing: 1px; color: var(--testo2); } @media (max-width: 700px) { .fun-riga { grid-template-columns: minmax(0, 1fr); } } +/* Centro AI: banco compatto, dettagli solo su richiesta. */ +.dialogo.centro-ai { width: min(1120px, calc(100vw - 48px)); max-height: calc(100dvh - 80px); display: flex; flex-direction: column; } +.centro-ai .dlg-corpo { min-height: 0; overflow: auto; padding: 12px; } +.centro-ai .dlg-testa, .centro-ai .dlg-piede { flex: none; } +.centro-ai .ai-pagina[hidden] { display: none; } +.centro-ai .ai-schede, .centro-ai .ai-ricerca, .centro-ai .ai-filtri, .centro-ai .ai-paginazione { display: flex; align-items: center; gap: 8px; } +.centro-ai .ai-schede { margin-bottom: 8px; } +.centro-ai .ai-schede button[aria-pressed='true'], .centro-ai .ai-filtri button[aria-pressed='true'] { border-color: var(--cia); color: var(--cia); } +.centro-ai .ai-ricerca { justify-content: space-between; flex-wrap: wrap; } +.centro-ai .ai-ricerca input { min-width: 180px; flex: 1; height: var(--riga); } +.centro-ai .ai-schede button, .centro-ai .ai-filtri button, .centro-ai .ai-paginazione button { min-height: var(--riga); } +.centro-ai .sch-funzioni { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; } +.centro-ai .sch-funzione { height: clamp(104px, 10.4vh, 112px); box-sizing: border-box; display: grid; grid-template-rows: 22px 20px 34px; gap: 4px; padding: 8px; border-radius: 6px; } +.centro-ai .sch-funzione-testa, .centro-ai .sch-funzione-azioni { display: flex; align-items: center; gap: 6px; min-width: 0; } +.centro-ai .sch-funzione-testa b { font: 700 16px/1.3 var(--ui); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.centro-ai .sch-funzione p { font: 500 15px/1.3 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.centro-ai .sch-cartellino { min-height: 22px; padding: 0 5px; font: 700 12px var(--ui); letter-spacing: .3px; gap: 4px; } +.centro-ai .sch-funzione-azioni .btn-mini { min-height: 34px; margin: 0; padding: 0 10px; } +.centro-ai .ai-chip, .centro-ai .ai-pagina-num { font: 400 12px var(--mono); color: var(--testo2); } +.centro-ai .ai-chip { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.centro-ai .ai-paginazione { justify-content: center; margin-top: 8px; } +.centro-ai .ai-sezione { margin-top: 8px; padding-top: 8px; } +.centro-ai :focus-visible { outline: 2px solid var(--cia); outline-offset: 2px; } +@media (max-width: 800px) { .centro-ai .sch-funzioni { grid-template-columns: repeat(2, minmax(0, 1fr)); } } +@media (max-width: 520px) { .centro-ai .sch-funzioni { grid-template-columns: 1fr; } } +.centro-ai .sch-funzione p.ai-manca { color: var(--ambra); } +.centro-ai .hub-riga { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 36px; } +.centro-ai .hub-nome { flex: 1; min-width: 0; } +.centro-ai .hub-nome b { display: block; font: 700 16px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.centro-ai .hub-stato { min-height: 0; padding: 4px 6px; font: 12px var(--mono); } +.centro-ai .hub-riga > .btn-mini { min-height: 34px; min-width: 0; padding: 0 10px; font-size: 15px; } +.centro-ai .hub-dettagli { position: relative; } +.centro-ai .hub-dettagli summary { cursor: pointer; list-style: none; padding: 8px; } +.centro-ai .hub-dettagli-corpo { position: absolute; right: 0; top: 100%; z-index: 5; width: min(320px, 70vw); padding: 12px; background: #15141b; border: 1px solid var(--sch-bordo-forte); border-radius: 6px; box-shadow: 0 4px 16px #000; } +.centro-ai .hub-dettagli-corpo small { display: block; } +.centro-ai .hub-riga:has(.hub-dettagli[open]) { flex-wrap: wrap; } +.centro-ai .hub-dettagli[open] { flex-basis: 100%; } +.centro-ai .hub-dettagli-corpo { position: static; width: auto; box-shadow: none; } diff --git a/src/stile/editor.css b/src/stile/editor.css index 0588503..b27e300 100644 --- a/src/stile/editor.css +++ b/src/stile/editor.css @@ -53,7 +53,9 @@ /* la timeline nella pagina Finale: piccola, perché lì conta la schermata dei ritocchi */ --tlpag: clamp(110px, 17vh, 170px); --livecol: clamp(380px, 30vw, 600px); - --tc: 'DSEG7', 'Share Tech Mono', monospace; + --mono: 'Share Tech Mono', monospace; + --tc: 'DSEG7', monospace; + --riga: clamp(34px, 3.15vh, 36px); --ui: 'Rajdhani', 'Segoe UI', system-ui, sans-serif; --marchio: 'Orbitron', 'Arial Black', sans-serif; color-scheme: dark; @@ -66,7 +68,7 @@ html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--testo); font: 600 14px/1.25 var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; } button, input, select, textarea { font: inherit; color: inherit; } button { cursor: pointer; } -kbd { font: 700 11px var(--tc); background: var(--vetrino); border: 1px solid var(--bordo-forte); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--oro); } +kbd { font: 700 12px var(--mono); background: var(--vetrino); border: 1px solid var(--bordo-forte); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--oro); } ::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #34323d; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-thumb:hover { background: #4a4857; border: 2px solid transparent; background-clip: padding-box; } @@ -546,7 +548,7 @@ button svg { pointer-events: none; } .tasto-edit.rosso { background: linear-gradient(180deg, #7a2d3c, #551d28); color: #ffd6de; } .tasto-edit small { color: var(--oro); font-size: 11px; } .shuttle-vel:empty { display: none; } -.shuttle-vel { font: 700 12px var(--tc); color: var(--cia); min-width: 42px; text-shadow: 0 0 6px rgba(53, 232, 255, 0.6); } +.shuttle-vel { font: 700 12px var(--mono); color: var(--cia); min-width: 42px; text-shadow: 0 0 6px rgba(53, 232, 255, 0.6); } .mon-segni { display: flex; align-items: center; gap: 6px; } .segno-io { display: flex; align-items: center; gap: 3px; } .segno-io label { font-size: 9.5px; color: var(--testo3); font-weight: 800; letter-spacing: 0.5px; } @@ -640,7 +642,7 @@ button svg { pointer-events: none; } .isp-testa { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; } .isp-nome { background: #0e0d12; border: 1px solid #000; border-radius: 6px; padding: 5px 8px; font-weight: 700; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); } .isp-info { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--testo3); } -.tc-testo { font: 10.5px var(--tc); color: var(--ambra); } +.tc-testo { font: 12px var(--mono); color: var(--ambra); } .isp-sorgente { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .isp-gruppo { border: 1px solid #000; border-radius: 8px; background: #1a1920; margin-bottom: 7px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); } .isp-gruppo summary { padding: 6px 9px; font: 800 11px var(--ui); letter-spacing: 1px; text-transform: uppercase; color: var(--oro); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; } @@ -810,7 +812,7 @@ button svg { pointer-events: none; } .avvio.via { opacity: 0; pointer-events: none; } .avvio-targa { background: #07060d; border: 3px solid var(--oro); border-radius: 14px; padding: 18px 30px; text-align: center; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 213, 74, 0.3); } .avvio-targa .marchio-grande { font-size: 34px; } -.avvio-targa small { display: block; margin-top: 6px; font: 400 13px var(--tc); color: var(--ambra); letter-spacing: 2px; } +.avvio-targa small { display: block; margin-top: 6px; font: 400 13px var(--mono); color: var(--ambra); letter-spacing: 2px; } /* ——— telefono e tablet stretto ——— */ #app.stretto, #app.stretto[data-pagina='finale'] { diff --git a/src/stile/finale.css b/src/stile/finale.css index 76d8e88..465a2e7 100644 --- a/src/stile/finale.css +++ b/src/stile/finale.css @@ -95,3 +95,83 @@ html #app[data-pagina='finale'] { /* un solo pulsante oro per schermata: nel Finale è «Esporta video»; quello della testata diventa di metallo */ #app[data-pagina='finale'] .testata .btn.primario { background: linear-gradient(180deg, #2c2b34, #1d1c23); color: var(--testo); border-color: var(--bordo-forte); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07); } + +/* Banco compatto: misure CSS fisse, lo spazio in più va al monitor. */ +html #app[data-pagina='finale']:not(.stretto) { + grid-template-columns: minmax(0, 1fr) 6px minmax(640px, var(--fin)); + grid-template-rows: 44px minmax(0, 1fr) auto 7px var(--tlpag, clamp(160px, 18vh, 240px)) 22px; +} +#app[data-pagina='finale'] { --tlpag: clamp(160px, 18vh, 240px); } +.finale { min-height: 0; min-width: 0; font: 500 15px/1.3 var(--ui); } +.finale .fin-testa { height: 48px; min-height: 48px; padding: 4px 12px; } +.finale .fin-titolo { font: 700 18px/1.3 var(--ui); } +.finale .fin-tc { font: 400 22px/1.3 var(--tc); } +.finale .fin-etichetta, .finale .fin-sezione h4 { font: 700 12px/1.3 var(--ui); letter-spacing: 1px; } +.finale .fin-colonna .fin-corpo { padding: 12px; gap: 8px; } +.finale .fin-pagina, .finale .fin-sezione { gap: 8px; min-height: 0; min-width: 0; } +.finale .fin-menu { width: 132px; padding: 12px 8px; gap: 8px; } +.finale .fin-voce { flex-direction: row; justify-content: flex-start; min-height: var(--riga, clamp(34px, 3.15vh, 36px)); padding: 6px 8px; gap: 8px; font: 600 15px/1.3 var(--ui); letter-spacing: 0; text-align: left; } +.finale .fin-voce svg { width: 18px; height: 18px; flex: none; } +.finale .fin-riga { min-height: var(--riga, clamp(34px, 3.15vh, 36px)); font-size: 15px; grid-template-columns: 100px minmax(0, 1fr) 60px; } +.finale .fin-val { font: 400 13px/1.3 var(--mono, 'Share Tech Mono', monospace); } +.finale .btn { font-size: 15px; min-height: var(--riga, clamp(34px, 3.15vh, 36px)); } +.finale .btn-mini, .finale .btn.piccolo { min-height: var(--riga, clamp(34px, 3.15vh, 36px)); font-size: 15px; } +.finale :is(select, input, textarea) { font: 400 13px/1.3 var(--mono, 'Share Tech Mono', monospace); } +.finale .fin-look small { display: none; } +.finale .fin-look b { font-size: 15px; } +.finale .fin-look-col { height: 24px; } +.finale .fin-looks { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; } +.finale .fin-riepilogo-dettagli { flex: none; font-size: 13px; } +.finale summary { cursor: pointer; min-height: 34px; padding: 8px 0; } +.fin-schede { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; } +.fin-schede-nav { display: flex; flex-wrap: wrap; gap: 8px; flex: none; } +.fin-schede-nav button { min-height: var(--riga, clamp(34px, 3.15vh, 36px)); font: 600 15px/1.3 var(--ui); } +.fin-schede-nav button[aria-pressed='true'] { border-color: var(--cia, #35e8ff); color: var(--cia, #35e8ff); } +.fin-schede-corpo { min-width: 0; min-height: 0; } +.fin-schede-corpo > [hidden] { display: none !important; } +.finale :is(button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--cia); outline-offset: 2px; } +.fin-misure { gap: 8px; padding: 8px 12px; } +.fm-cella { padding: 6px 10px; } +.fm-nome { letter-spacing: 1px; } +.fm-valore { font-size: 16px; } +.finale .fin-numeri small { font-size: 12px; letter-spacing: 1px; } +.finale .fin-numeri b { font-size: 16px; } +.finale .ctl-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; } +.finale .ctl-riga { gap: 6px; min-height: 34px; font-size: 15px; padding: 4px 0; } +.ctl-simbolo { font: 700 13px var(--ui); } +.finale .ctl-spia { display: none; } +.ctl-riga.verde .ctl-simbolo { color: var(--verde); } +.ctl-riga.ambra .ctl-simbolo { color: var(--ambra); } +.ctl-riga.rossa .ctl-simbolo { color: var(--rosso); } +.finale .ctl-dett { font-size: 13px; max-width: 58%; } +.finale .fin-piede .es-fondo { padding: 8px 12px; gap: 8px; } +.finale .es-fondo .es-azioni { flex-direction: row; } +.finale .es-fondo .es-azioni .btn { width: auto; flex: 1; min-height: 44px; font-size: 15px; } +.finale .es-piede { font: 400 13px var(--mono, 'Share Tech Mono', monospace); } +.finale .es-banco .es-preset { grid-template-columns: repeat(2, minmax(0, 1fr)); } +.finale .es-dest { min-height: 56px; padding: 6px 8px; gap: 8px; } +.finale .es-dest-testi b { font-size: 16px; } +.finale .es-dest-testi small { font-size: 12px; } +.finale .es-dest-codec { font-size: 12px; } +.finale .es-dettagli > summary { letter-spacing: 1px; min-height: 34px; } +.finale .es-lista, .finale .sott-lista { max-height: 32vh; overflow: auto; } +.finale :is(.es-riga > span, .es-riga small, .es-qdice small, .es-voce-testi small, .es-voce-stato, .fin-formato) { font-size: 12px; letter-spacing: 0; } +@media (max-width: 1300px) { + html #app[data-pagina='finale']:not(.stretto) { grid-template-columns: minmax(0, 1fr) 6px minmax(560px, 58vw); } + .finale .fin-menu { width: 112px; } + .finale .fin-voce { font-size: 13px; padding: 6px; } + .finale .ctl-lista { grid-template-columns: 1fr; } +} +@media (pointer: coarse) { + .finale :is(button, select, input:not([type=range]), summary) { min-height: 44px; } +} + +.finale .fin-aiuto { font-size: 15px; } +.finale .fin-aiuto > summary { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; border: 1px solid var(--bordo); border-radius: 6px; background: var(--metallo-chiaro); font: 700 15px var(--ui); list-style: none; } +.finale .fin-aiuto > summary::-webkit-details-marker { display: none; } +.finale .fin-aiuto[open] > .nota { margin-top: 8px; } +.finale .fin-scelte { font-size: 15px; grid-template-columns: 94px minmax(0, 1fr); } +.finale .ai-vai { min-height: 44px; } + +.finale .fin-piede .btn.fin-vai { background: var(--oro); color: #14110a; border-color: var(--oro); font-weight: 700; letter-spacing: 0; } +.finale .fin-piede .btn.fin-vai:disabled { background: #4a4631; border-color: #4a4631; color: #c6be9b; } diff --git a/src/stile/home.css b/src/stile/home.css index c9979f6..25846d4 100644 --- a/src/stile/home.css +++ b/src/stile/home.css @@ -88,3 +88,26 @@ @media (max-width: 1000px) { .hm-corpo { grid-template-columns: 1fr; } .hm-passo { grid-template-columns: 22px 1fr; } .hm-passo-testo { grid-column: 2; } } @media (prefers-reduced-motion: reduce) { .hm-aggiusta-tasto.lavora .hm-led, .hm-passo.corre .hm-segno { animation: none; } } + +/* Più spazio per i progetti, senza ingrandire i testi con la risoluzione. */ +.home.hm .hm-dentro { padding: 12px; gap: 12px; } +.home.hm .hm-col { padding: 12px; gap: 8px; border-radius: 6px; } +.hm-corpo, .hm-destra { gap: 12px; min-height: 0; } +.hm-intesta, .hm-titolo { font: 700 12px/1.3 var(--ui); letter-spacing: 1px; } +.hm-etichetta-doppia b { font: 700 16px/1.3 var(--ui); } +.hm-etichetta-doppia small, .hm-conta { font-size: 12px; line-height: 1.3; } +.home.hm .hm-quando { font: 400 13px/1.3 var(--mono, 'Share Tech Mono', monospace) !important; } +.hm-sotto, .hm-aggiusta-riga { font-size: 15px; line-height: 1.3; } + +@media (min-width: 1400px) { + .hm-corpo { grid-template-columns: minmax(480px, 1fr) minmax(0, 1.2fr); } + .home.hm .hm-inizio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; } + .hm-inizio > :is(.hm-intesta, .home-continua, .hm-nuovo) { grid-column: 1 / -1; } + .home.hm .home-obiettivi { grid-template-columns: repeat(3, minmax(0, 1fr)); } + .home.hm .home-obiettivo { padding: 6px; gap: 4px; min-height: 48px; } + .home.hm .home-obiettivo small { font-size: 12px; } + .home.hm .hm-strade, .home.hm .home-impara { margin: 0; align-self: start; } + .home.hm .hm-strada, .home.hm .home-grande { min-height: 44px; padding: 8px; } + .home.hm .home-impara .btn { min-height: 44px; padding: 8px; font-size: 15px; } + .home.hm .home-formato-riga b { font: 400 13px var(--mono, 'Share Tech Mono', monospace); } +} diff --git a/src/stile/live.css b/src/stile/live.css index acbfbe0..245175a 100644 --- a/src/stile/live.css +++ b/src/stile/live.css @@ -185,3 +185,13 @@ .live-corsia .live-sfondo { width: 34px; height: 34px; } .live-comandi .live-configurazione { gap: 2px; } } + +/* Densità del banco: dimensioni CSS, anche sui display 4K. */ +.live-comandi .live-sez, .live .live-etichetta { letter-spacing: 1px; font-size: 12px; line-height: 1.3; } +.live-comandi .live-guida { font-size: 12px; line-height: 1.3; } +#app .live .live-comandi { padding: 12px; gap: 8px; } +#app .live .live-barra { min-height: 48px; padding: 8px 12px; gap: 8px 12px; } +.live-comandi :is(select, input[type=number], .fin-interruttore) { min-height: var(--riga, clamp(34px, 3.15vh, 36px)); } +.live-comandi :is(select, input[type=number]) { font: 400 13px var(--mono, 'Share Tech Mono', monospace); } +.live-comandi .fin-interruttore { font-size: 15px; line-height: 1.3; } +#app .live .live-tc { font-size: 22px; } diff --git a/src/stile/montage.css b/src/stile/montage.css index 2b70393..f2f1227 100644 --- a/src/stile/montage.css +++ b/src/stile/montage.css @@ -224,3 +224,11 @@ } .montage .fin-interruttore.acceso { border-color: var(--cia); } .montage .fin-interruttore.acceso .led.acceso { background: var(--cia); box-shadow: 0 0 6px var(--cia); } + +/* I quattro passi tengono i comandi grandi; i titoli restano compatti. */ +.montage .mt-titolo h2 { font: 700 18px/1.3 var(--ui); } +.montage .mt-titolo p { font: 500 15px/1.3 var(--ui); } +.montage .mt-scheda h4 { font: 700 12px/1.3 var(--ui); letter-spacing: 1px; } +.montage .mt-vai { min-height: 44px; font-size: 15px; } +.montage .mt-passo { min-width: 0; min-height: 0; } +.montage .mt-scheda { border-radius: 6px; } diff --git a/src/stile/proprieta.css b/src/stile/proprieta.css index 7fe1567..c4be5b6 100644 --- a/src/stile/proprieta.css +++ b/src/stile/proprieta.css @@ -4,7 +4,7 @@ (--lato) e dentro si scorre. Colori: solo spie (oro = il valore che si regola, ciano = selezione, rosso = muto/errore, verde = pronto); il metallo è per i tasti, il vetrino scuro per i numeri. Le variabili sono quelle di editor.css: qui se ne leggono, non se ne ridefiniscono (i fallback servono solo se mancano). - Vale solo per .ispettore.banco: l'editor della clip (doppio clic) tiene il suo aspetto. */ + Il popup .editor-clip usa la stessa grafica con navigazione laterale. */ .ispettore.banco { --pp-vetrino: var(--vetrino, #050407); @@ -201,3 +201,124 @@ .ispettore.banco .ck-numero { font-size: 14px; } .ispettore.banco .ck-numero input { background: var(--pp-vetrino); border: 1px solid var(--bordo); border-radius: 5px; color: var(--oro); font: 14px var(--pp-mono); padding: 4px 6px; min-height: 32px; } .ispettore.banco .ck-altre summary { min-height: 34px; display: flex; align-items: center; font-size: 14px; color: var(--testo2); } +/* Banco compatto: i dettagli stanno nei menu, le azioni restano visibili. */ +.ispettore.banco .pp-testa { padding: 8px 12px; gap: 6px; } +.ispettore.banco .pp-mini { width: 48px; height: 27px; } +.ispettore.banco .isp-nome { font: 700 16px/1.3 var(--ui); } +.ispettore.banco .pp-testa-riga { gap: 8px; } +.ispettore.banco .pp-dati { font: 13px/1.3 var(--pp-mono); } +.ispettore.banco .pp-mini-btn { height: var(--riga, 34px); font: 600 15px/1.3 var(--ui); border-radius: 6px; } +.ispettore.banco .pp-azioni .pp-menu { flex: 0 0 34px; } +.ispettore.banco .pp-schede { padding: 6px 8px; } +.ispettore.banco .pp-scheda { height: 36px; font-size: 12px; letter-spacing: 1px; } +.ispettore.banco .pp-scroll { padding: 12px; } +.ispettore.banco .pp-pannello { gap: 8px; } +.ispettore.banco .pp-inciso, .ispettore.banco .etichetta, .ispettore.banco .isp-gruppo summary { letter-spacing: 1px; } +.ispettore.banco .pp-piede { padding: 8px 12px; } +.ispettore.banco .pp-pie { font-size: 15px; } +.ispettore.banco .pp-ai { height: 64px; min-height: 64px; padding: 5px 8px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; border-radius: 6px; } +.pp-ai-testa, .pp-ai-comandi { display: flex; align-items: center; gap: 6px; } +.pp-ai-testa b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px/1.3 var(--ui); } +.ispettore.banco .pp-ai-stato { font: 12px/1.3 var(--pp-mono); letter-spacing: 0; } +.pp-ai-peso { flex: 1; font: 12px/1.3 var(--pp-mono); color: var(--testo2); } +.ispettore.banco .pp-ai-comandi .pp-mini-btn { height: 30px; padding: 0 6px; font-size: 13px; } +.ispettore.banco .pp-ai-comandi .pp-info { width: 30px; flex: 0 0 30px; } +.pp-ai-filtri, .pp-ai-pagine { display: flex; gap: 8px; align-items: center; } +.pp-ai-filtri > button { flex: 1; } +.pp-ai-filtri [aria-pressed='true'], .ec-scelte [aria-pressed='true'] { border-color: var(--cia); color: var(--cia); } +.pp-ai-pagine { justify-content: center; } +.ispettore.banco .pp-centro-ai { width: 100%; } + +/* Il popup mantiene i campi vivi e Ctrl+Z, con una sezione per volta. */ +.dialogo.editor-clip { width: min(1120px, calc(100vw - 48px)); height: min(760px, calc(100dvh - 80px)); max-height: calc(100dvh - 80px); background: #15141b; border: 1px solid var(--bordo-forte); border-radius: 6px; display: flex; flex-direction: column; font: 500 15px/1.3 var(--ui); } +.editor-clip .dlg-testa { flex: none; height: 48px; padding: 0 12px; background: linear-gradient(#2c2b34, #1d1c23); } +.editor-clip .dlg-testa b { font: 700 18px/1.3 var(--ui); } +.editor-clip .dlg-corpo { flex: 1; min-height: 0; max-height: none; padding: 0; overflow: hidden; display: flex; } +.editor-clip .ispettore.completo { width: 100%; padding: 0; min-height: 0; display: flex; } +.editor-clip .isp-corpo { display: grid; grid-template-columns: 160px minmax(0, 1fr); width: 100%; min-height: 0; gap: 0; } +.editor-clip .ec-nav { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--bordo); background: #0b0a0f; overflow-y: auto; } +.editor-clip .ec-nav button { flex-shrink: 0; height: var(--riga, 34px); display: flex; align-items: center; gap: 8px; padding: 0 8px; text-align: left; border: 1px solid var(--bordo); border-radius: 6px; background: linear-gradient(#2c2b34, #1d1c23); color: var(--testo); font: 600 15px/1.3 var(--ui); } +.editor-clip .ec-nav button > span { font-size: 18px; width: 20px; text-align: center; } +.editor-clip .ec-nav [aria-pressed='true'] { border-color: var(--cia); color: var(--cia); background: #123039; } +.editor-clip .ec-area { min-width: 0; min-height: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; } +.editor-clip .ec-titolo { display: flex; align-items: center; justify-content: space-between; flex: none; } +.editor-clip .ec-titolo h2 { font: 700 18px/1.3 var(--ui); margin: 0; } +.editor-clip .ec-scelte { display: flex; flex-wrap: wrap; gap: 8px; flex: none; } +.editor-clip .ec-contenuto { min-height: 0; overflow: auto; flex: 1; overscroll-behavior: contain; } +.editor-clip .isp-gruppo { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; } +.editor-clip .isp-gruppo[hidden] { display: none; } +.editor-clip .isp-gruppo > summary { display: none; } +.editor-clip .isp-gruppo > :not(summary) { margin: 0 0 12px; } + + +.editor-clip .isp-gruppo > .etichetta { grid-column: 1 / -1; font: 700 12px/1.3 var(--ui); letter-spacing: 1px; } +.editor-clip .isp-riga { min-width: 0; font: 500 15px/1.3 var(--ui); } +.editor-clip .isp-riga > label { font: 500 15px/1.3 var(--ui); } +.editor-clip .isp-riga label small { display: none; } +.editor-clip .nota { font: 500 13px/1.3 var(--ui); color: var(--testo2); } +.editor-clip .isp-gruppo > .nota:not(.avviso-rosso):not(.ok) { grid-column: 1 / -1; } +.editor-clip :is(.num, .dur-numero, .dur-dove, .dur-velocita, .aai-nota, .aai-stato) { font: 13px/1.3 'Share Tech Mono', monospace; } +.editor-clip :is(input, select, .mini-select, .campo-testo) { min-width: 0; max-width: 100%; min-height: var(--riga, 34px); border-radius: 6px; background: #0b0a0f; color: var(--testo); border: 1px solid var(--bordo); } +.editor-clip :is(.btn-mini, .pp-mini-btn, .chip, .aai-bottone) { min-height: var(--riga, 34px); padding: 0 10px; font: 600 15px/1.3 var(--ui); border: 1px solid var(--bordo-forte); border-radius: 6px; background: linear-gradient(#2c2b34, #1d1c23); color: var(--testo); } +.editor-clip :is(.chip.acceso, .pp-tessera.acceso) { border-color: var(--cia); color: var(--cia); box-shadow: inset 0 0 0 1px var(--cia); } +.editor-clip .pp-griglia { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } +.editor-clip .pp-tessera { height: 64px; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 8px; background: linear-gradient(#2c2b34, #1d1c23); border: 1px solid var(--bordo); border-radius: 6px; color: var(--testo); font: 600 15px/1.3 var(--ui); } +.editor-clip .pp-tessera > span:last-child { font: inherit; } +.editor-clip :is(.pp-ico, .mv-prev) { flex: 0 0 64px; width: 64px; height: 36px; } +.editor-clip .pp-ico > b, .editor-clip .mv-box { background: linear-gradient(135deg, #a9e9ee, #237386); } +.editor-clip .mv-daSinistra { left: 5%; } +.editor-clip .mv-daDestra { left: 60%; } +.editor-clip .mv-dalBasso { top: 55%; height: 30%; } +.editor-clip .mv-dallAlto { top: 5%; height: 30%; } +.editor-clip .mv-avvicina { left: 14%; top: 10%; width: 72%; height: 80%; } +.editor-clip .mv-allontana { left: 40%; top: 35%; width: 20%; height: 30%; } +.editor-clip .mv-scivola { left: 12%; top: 12%; transform: rotate(-12deg); } +.editor-clip .mv-gira { transform: rotate(35deg); } +.editor-clip .dlg-piede { flex: none; min-height: 68px; padding: 12px; border-top: 1px solid var(--bordo); background: #0b0a0f; } +.editor-clip .dlg-piede .nota { margin: 0; } +.editor-clip .dlg-piede .btn { height: 44px; padding: 0 24px; font: 600 15px/1.3 var(--ui); border-radius: 6px; } +.editor-clip .dlg-piede .primario { background: linear-gradient(#ffe28a, #d5aa39); color: #191407; } +.editor-clip :focus-visible { outline: 2px solid var(--cia); outline-offset: 2px; } +@media (pointer: coarse) { .ispettore.banco button, .editor-clip button { min-height: 44px; } .ispettore.banco .pp-ai { height: auto; min-height: 84px; } } +@media (max-width: 760px) { .editor-clip .isp-corpo { grid-template-columns: 120px minmax(0, 1fr); } .editor-clip .pp-griglia, .editor-clip .isp-gruppo[open] { grid-template-columns: minmax(0, 1fr); } .editor-clip .ec-nav { padding: 8px; } } +.editor-clip .isp-gruppo > .tessere-blocco { grid-column: 1 / -1; } +.editor-clip .ec-aiuto { justify-self: start; } +.editor-clip .aai-scheda { padding: 12px; border: 1px solid var(--bordo); border-radius: 6px; background: #0b0a0f; } +.editor-clip .aai-testa { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; } +.editor-clip .aai-testa > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1; } +.editor-clip .aai-testa b { font: 700 16px/1.3 var(--ui); } +.editor-clip .aai-bottoni { display: flex; flex-direction: column; gap: 8px; } +.editor-clip .tessera-nome { font: 700 12px/1.3 var(--ui); } +.editor-clip .isp-pulsanti { display: flex; flex-wrap: wrap; gap: 8px; } +.editor-clip .isp-num small { font: 12px/1.3 'Share Tech Mono', monospace; } +.editor-clip .isp-gruppo[hidden] { display: none; } +.editor-clip .isp-gruppo > .aai-scheda { margin: 0; } +.editor-clip .isp-riga.spunta input { min-height: 20px; width: 20px; } +/* La scheda AI usa la colonna alta: quattro funzioni e azioni restano visibili. */ +#app[data-pagina='montaggio']:not(.stretto):not(.senza-lato):has(.ispettore.banco .pp-scheda[data-scheda='ai'].attiva) { + grid-template-areas: 'testa testa testa testa testa' 'bin bbin monitor blato lato' 'div div div blato lato' 'puls puls puls blato lato' 'tl tl tl blato lato' 'stato stato stato stato stato'; +} +.ispettore.banco .pp-testa { padding: 4px 12px; gap: 4px; } +.ispettore.banco .isp-nome { height: 22px; min-height: 22px; } +.editor-clip .isp-gruppo[open] { display: block; } +.editor-clip .isp-gruppo[hidden] { display: none; } +.editor-clip .isp-gruppo > .ec-campi { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; } +.editor-clip .ec-campi > * { min-width: 0; margin: 0; } +.editor-clip .ec-campi > :is(.pp-griglia, .isp-riga.col, .tessere-blocco, .isp-durata, .etichetta, .nota) { grid-column: 1 / -1; } +.editor-clip .ec-campi > .etichetta { font: 700 12px/1.3 var(--ui); letter-spacing: 1px; text-transform: uppercase; } +.editor-clip .pp-tessera { text-align: left; } +.editor-clip .aai-scheda .aai-testa { margin-bottom: 12px; } +@media (max-width: 760px) { .editor-clip .isp-gruppo > .ec-campi { grid-template-columns: minmax(0,1fr); } } +.editor-clip .aai-bottone.primario { background: linear-gradient(#2c2b34, #1d1c23); color: var(--testo); border-color: var(--bordo-forte); } +.editor-clip :is(small, .tessere-filtro, .kf-freccia, .pp-piu > summary) { font-size: 12px; } +.editor-clip .pp-piu > summary { min-height: var(--riga, 34px); font: 600 15px/1.3 var(--ui); } +.pp-dati { font-family: var(--mono, 'Share Tech Mono', monospace); overflow-wrap: anywhere; } +.ispettore.banco .pp-ai { padding: 2px 8px; gap: 0; } +.ispettore.banco .pp-ai-comandi .pp-mini-btn { height: var(--riga, 34px); } +.ispettore.banco .pp-ai-comandi .pp-info { width: 34px; flex-basis: 34px; } +.dialogo p.pp-dati { white-space: normal; overflow: visible; font: 13px/1.3 var(--mono, 'Share Tech Mono', monospace); } +.ispettore.banco .pp-testa { display: grid; grid-template-rows: 39px var(--riga, 34px); height: 88px; min-height: 88px; max-height: 88px; align-content: center; } +.ispettore.banco .pp-testa-riga { min-height: 0; } +.dialogo.editor-clip.largo { width: min(1120px, calc(100vw - 48px)); } +.dialogo.editor-clip .dlg-corpo { max-height: none; } +@media (pointer: coarse) { .ispettore.banco .pp-testa { height: 104px; min-height: 104px; max-height: 104px; grid-template-rows: 44px 44px; } } diff --git a/src/stile/schermate.css b/src/stile/schermate.css index 0875652..d3ea9f4 100644 --- a/src/stile/schermate.css +++ b/src/stile/schermate.css @@ -56,14 +56,14 @@ min-height: 40px; border-radius: 5px; background: var(--sch-vetro); border: 1px solid var(--sch-bordo-forte); color: var(--testo, #ebe7f4); padding: 0 10px; font: 500 15px var(--ui); } :is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta), .ca-finestra) textarea { padding: 8px 10px; } -:is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .num { font-family: var(--tc); } +:is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .num { font-family: var(--mono); } :is(.montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .fin-interruttore { min-height: 44px; border-radius: var(--sch-raggio); background: var(--sch-metallo); border: 1px solid var(--sch-bordo-forte); font: 600 15px var(--ui); color: var(--testo, #ebe7f4); } :is(.montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .fin-interruttore.acceso { box-shadow: inset 0 0 0 1px rgba(93, 255, 180, 0.5); } :is(.montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .fin-interruttore .led.acceso { background: var(--verde, #5dffb4); box-shadow: 0 0 8px var(--verde, #5dffb4); } :is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) .nota { color: #a19db0; font: 500 14px/1.4 var(--ui); } -:is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) kbd { background: var(--sch-metallo); border: 1px solid var(--sch-bordo-forte); border-bottom-width: 2px; border-radius: 4px; color: var(--testo, #ebe7f4); font: 600 12px var(--tc); } +:is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) kbd { background: var(--sch-metallo); border: 1px solid var(--sch-bordo-forte); border-bottom-width: 2px; border-radius: 4px; color: var(--testo, #ebe7f4); font: 600 12px var(--mono); } :is(.home, .montage, .dialogo:not(.editor-clip):not(.dlg-esporta)) :focus-visible { outline: 2px solid var(--cia, #35e8ff); outline-offset: 2px; } /* la barra di avanzamento: una spia che si riempie, oro, senza sfumatura rosa */ @@ -89,7 +89,7 @@ .menu-contesto { background: var(--sch-pann); border: 1px solid var(--sch-bordo-forte); border-radius: 8px; padding: 6px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); } .menu-contesto .voce { min-height: 34px; padding: 4px 12px 4px 8px; border-radius: 5px; font: 600 15px var(--ui); color: var(--testo, #ebe7f4); } .menu-contesto .voce:hover { background: var(--sch-metallo); } -.menu-contesto .voce .tasto { font: 400 13px var(--tc); color: var(--sch-incisa); } +.menu-contesto .voce .tasto { font: 400 13px var(--mono); color: var(--sch-incisa); } .menu-contesto .voce .spunta { color: var(--cia, #35e8ff); } .menu-contesto .sep { background: var(--sch-bordo); box-shadow: none; } .menu .voce-menu { min-height: 34px; border-radius: 5px; font: 700 14px var(--ui); letter-spacing: 1.5px; text-transform: uppercase; } @@ -126,10 +126,10 @@ .novita-testo h3 { font: 700 18px var(--ui); color: var(--testo, #ebe7f4); } .novita-testo h4 { font: 700 12.5px var(--ui); letter-spacing: 3px; text-transform: uppercase; color: var(--sch-incisa); } .novita-testo a { color: var(--cia, #35e8ff); } -.novita-testo code { background: var(--sch-vetro); border: 1px solid var(--sch-bordo); color: var(--testo, #ebe7f4); font-family: var(--tc); } +.novita-testo code { background: var(--sch-vetro); border: 1px solid var(--sch-bordo); color: var(--testo, #ebe7f4); font-family: var(--mono); } .novita-titolo { font: 700 20px var(--ui); margin: 8px 0; } .agg-attuale { font: 500 16px var(--ui); } -.agg-attuale b { font-family: var(--tc); color: var(--testo, #ebe7f4); } +.agg-attuale b { font-family: var(--mono); color: var(--testo, #ebe7f4); } .agg-stato { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--sch-raggio); background: var(--sch-vetro); border: 1px solid var(--sch-bordo); font: 600 16px var(--ui); } .agg-ok { color: var(--verde, #5dffb4); } .agg-nuova { color: var(--cia, #35e8ff); } @@ -138,7 +138,7 @@ /* ——— avvio e browser non adatto ——— */ .avvio { background: linear-gradient(90deg, #8d889c 0 20%, #c8a92f 0 40%, #1fb5c4 0 60%, #2fbf86 0 80%, #c4405a 0); } .avvio-targa { background: var(--sch-vetro); border: 1px solid var(--sch-bordo-forte); border-radius: 8px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6); } -.avvio-targa small { color: var(--verde, #5dffb4); font-family: var(--tc); } +.avvio-targa small { color: var(--verde, #5dffb4); font-family: var(--mono); } .non-supportato { background: var(--fondo, #0b0a0f); } .non-supportato .avvio-targa { max-width: min(560px, 100%); } @@ -151,7 +151,7 @@ .home .home-obiettivo small { font: 500 12.5px var(--ui); color: #a19db0; } .home .home-obiettivo.acceso .home-forma { background: linear-gradient(135deg, #8cf3ff, var(--cia, #35e8ff)); } .home .home-formato-riga { font: 500 15px var(--ui); color: #a19db0; } -.home .home-formato-riga b { color: var(--testo, #ebe7f4); font-family: var(--tc); font-weight: 400; } +.home .home-formato-riga b { color: var(--testo, #ebe7f4); font-family: var(--mono); font-weight: 400; } .home .home-etichetta { margin-top: 6px; } .home .home-montage { background: var(--sch-metallo) !important; color: var(--testo, #ebe7f4) !important; border: 1px solid var(--sch-bordo-forte) !important; } .home .home-continua { border-radius: var(--sch-raggio); background: var(--sch-vetro); box-shadow: inset 0 0 0 1px rgba(93, 255, 180, 0.4); } @@ -176,7 +176,7 @@ .live-mini-punto { width: 12px; height: 12px; } .tele-spia { font: 700 13px var(--ui); letter-spacing: 3px; } .tele-tempo { font: 400 28px var(--tc); letter-spacing: 1px; min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; } -.tele-segni { font: 400 14px var(--tc); color: var(--cia, #35e8ff); } +.tele-segni { font: 400 14px var(--mono); color: var(--cia, #35e8ff); } .live-mini .tele-torna { height: 36px; min-width: 44px; } .tele-quadro { min-height: 96px; border-radius: var(--sch-raggio); background: var(--sch-vetro); border: 1px solid var(--sch-bordo-forte); box-shadow: none; } .tele-cam { border-color: rgba(255, 255, 255, 0.7); } @@ -196,7 +196,7 @@ .live-mini.in-onda .live-btn.ferma { background: var(--rosso, #ff4d6d); color: #1d060b; border-color: var(--rosso, #ff4d6d); } .live-mini .live-btn.segna { color: var(--testo, #ebe7f4); } .tele-piede { font: 500 13px var(--ui); color: #a19db0; } -.tele-piede kbd { font: 600 12px var(--tc); } +.tele-piede kbd { font: 600 12px var(--mono); } body.pip-live { background: var(--fondo, #0b0a0f); } /* ——— Centro AI: ogni modello è una scheda col suo cartellino ——— */ @@ -211,7 +211,7 @@ body.pip-live { background: var(--fondo, #0b0a0f); } .centro-ai .hub-nome { grid-column: 1; grid-row: 1 / span 2; gap: 3px; } .centro-ai .hub-nome b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: 700 18px var(--ui); color: var(--testo, #ebe7f4); } .centro-ai .hub-nome small { font: 500 14px/1.35 var(--ui); color: #a19db0; } -.centro-ai .hub-stato { grid-column: 2 / span 2; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 34px; border-radius: 5px; background: var(--sch-vetro); border: 1px solid var(--sch-bordo); font: 600 14px var(--tc); letter-spacing: 0.5px; } +.centro-ai .hub-stato { grid-column: 2 / span 2; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 34px; border-radius: 5px; background: var(--sch-vetro); border: 1px solid var(--sch-bordo); font: 600 14px var(--mono); letter-spacing: 0.5px; } .centro-ai .hub-stato::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #3a3844; box-shadow: inset 0 0 0 1px #000; flex: none; } .centro-ai .hub-stato.pronto { color: var(--verde, #5dffb4); } .centro-ai .hub-stato.pronto::before { background: var(--verde, #5dffb4); box-shadow: 0 0 8px var(--verde, #5dffb4); } @@ -220,7 +220,7 @@ body.pip-live { background: var(--fondo, #0b0a0f); } .centro-ai .hub-riga > .btn-mini { grid-row: 2; align-self: end; min-height: 44px; min-width: 96px; padding: 0 18px; font-size: 16px; } .centro-ai .hub-riga > .btn-mini:nth-of-type(1) { grid-column: 2; } .centro-ai .hub-riga > .btn-mini:nth-of-type(2) { grid-column: 3; } -.centro-ai .hub-msg { color: var(--oro, #ffd54a); font-family: var(--tc); } +.centro-ai .hub-msg { color: var(--oro, #ffd54a); font-family: var(--mono); } /* il cartellino: PRONTA, OPZIONALE o SPERIMENTALE, con la sua spia */ .centro-ai .hub-opzionale, .sch-cartellino { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 0 10px; min-height: 26px; border-radius: 4px; background: var(--sch-vetro); border: 1px solid var(--sch-bordo-forte); @@ -229,7 +229,7 @@ body.pip-live { background: var(--fondo, #0b0a0f); } .centro-ai .hub-opzionale::before, .sch-cartellino::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cia, #35e8ff); box-shadow: 0 0 6px var(--cia, #35e8ff); } .sch-cartellino[data-stato='pronta']::before { background: var(--verde, #5dffb4); box-shadow: 0 0 6px var(--verde, #5dffb4); } .sch-cartellino[data-stato='sperimentale']::before { background: var(--oro, #ffd54a); box-shadow: 0 0 6px var(--oro, #ffd54a); } -.centro-ai .hub-peso, .sch-pesovram { font: 400 14px var(--tc) !important; letter-spacing: 0.5px; color: var(--testo, #ebe7f4) !important; margin-top: 4px; } +.centro-ai .hub-peso, .sch-pesovram { font: 400 14px var(--mono); letter-spacing: 0.5px; color: var(--testo, #ebe7f4); margin-top: 4px; } .centro-ai .hub-macchina { font-size: 13.5px !important; } .centro-ai .hub-macchina[data-esito='lento'] { color: var(--ambra, #ffb23d); } /* le funzioni del registro AI: una scheda per ognuna */ @@ -243,10 +243,10 @@ body.pip-live { background: var(--fondo, #0b0a0f); } .centro-ai .ai-riga, .centro-ai .ai-imp { gap: 12px; } .centro-ai .ai-sezione summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font: 700 12.5px var(--ui); letter-spacing: 3px; text-transform: uppercase; color: var(--sch-incisa); } .centro-ai .ai-diag { grid-template-columns: 24px minmax(110px, 160px) minmax(0, 1fr); font: 500 15px var(--ui); overflow-wrap: anywhere; } -.centro-ai .ai-diag .ai-diag-seg { font-family: var(--tc); } +.centro-ai .ai-diag .ai-diag-seg { font-family: var(--mono); } .centro-ai .ai-diag.ok .ai-diag-seg { color: var(--verde, #5dffb4); text-shadow: 0 0 8px rgba(93, 255, 180, 0.5); } .centro-ai .ai-diag.no .ai-diag-seg { color: var(--rosso, #ff4d6d); } -.centro-ai .hub-progresso { font: 400 14px var(--tc); color: var(--oro, #ffd54a); } +.centro-ai .hub-progresso { font: 400 14px var(--mono); color: var(--oro, #ffd54a); } .centro-ai .ai-chiave .campo-testo { min-width: 0; flex: 1 1 200px; } .centro-ai .motore-locale { padding: 14px; border-radius: 8px; background: var(--sch-pann); border: 1px solid var(--sch-bordo-forte); margin-top: 0; } .centro-ai .motore-locale h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } @@ -271,7 +271,7 @@ body.pip-live { background: var(--fondo, #0b0a0f); } .montaggio-testo .testo-parola:hover, .montaggio-testo .testo-parola:focus-visible { outline: 1px solid var(--cia, #35e8ff); } .montaggio-testo .testo-riga { gap: 10px; } .montaggio-testo .testo-riga label { font: 700 12.5px var(--ui); letter-spacing: 2px; text-transform: uppercase; color: var(--sch-incisa); } -.montaggio-testo .testo-anteprima { font: 400 14px var(--tc); color: var(--oro, #ffd54a); } +.montaggio-testo .testo-anteprima { font: 400 14px var(--mono); color: var(--oro, #ffd54a); } /* ——— colore avanzato: la finestra mobile ——— */ :root .ca-finestra { background: var(--sch-pann); backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--sch-bordo-forte); border-radius: 8px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); } @@ -281,7 +281,7 @@ body.pip-live { background: var(--fondo, #0b0a0f); } :root .ca-finestra .colore-avanzato fieldset { border-color: var(--sch-bordo-forte); border-radius: var(--sch-raggio); background: var(--sch-vetro); } :root .ca-finestra .colore-avanzato legend { font: 700 12px var(--ui); letter-spacing: 3px; text-transform: uppercase; color: var(--sch-incisa); } :root .ca-finestra .colore-avanzato label, :root .ca-finestra .colore-avanzato .nota { font: 500 15px var(--ui); } -:root .ca-finestra .colore-avanzato .ca-numero { font: 400 14px var(--tc); } +:root .ca-finestra .colore-avanzato .ca-numero { font: 400 14px var(--mono); } :root .ca-finestra .colore-avanzato h3 { font: 700 20px var(--ui); margin: 0; } :root .ca-lut:hover { box-shadow: inset 0 0 0 1px rgba(53, 232, 255, 0.6); } :root .ca-lut.scelta { box-shadow: inset 0 0 0 2px var(--cia, #35e8ff); } @@ -295,3 +295,8 @@ body.pip-live { background: var(--fondo, #0b0a0f); } /* il puntino «c'è una versione nuova» sul tasto aggiornamenti: ciano (selezione/avviso), mai magenta */ .tasto-aggiorna .aggiorna-punto { background: var(--cia, #35e8ff); box-shadow: 0 0 8px var(--cia, #35e8ff); } +/* Sigle, scorciatoie e valori non sono display a sette segmenti. */ +.avviso.tasto, .hm-quando, .montage .mt-etapes .live-tastiera, .montage .mt-vai .mt-n { font-family: var(--mono); } +.home .hm-quando { font-family: var(--mono) !important; font-size: 12px !important; } +.home .hm-targa .hm-seg { font-family: var(--mono); } +.dialogo.centro-ai { width: min(1120px, calc(100vw - 48px)); max-height: calc(100dvh - 80px); } diff --git a/src/ui/audioAI.ts b/src/ui/audioAI.ts index beb2386..d281b2a 100644 --- a/src/ui/audioAI.ts +++ b/src/ui/audioAI.ts @@ -6,7 +6,7 @@ import { store } from '../core/store'; import type { Clip } from '../core/tipi'; import { registra as reg } from '../azioni'; import { clearAttivo } from '../media/clear'; -import { avviso, h } from './dom'; +import { avviso, dialogo, h } from './dom'; import { avanzamentoAudioAI, haOriginale, installaSeparazione, lavoriAudioAI, modelloRumoreScelto, possibilita, separaVoceBase, statoAudioAI, tornaOriginale, togliRumore, type Forza, } from '../media/audioAI'; @@ -92,7 +92,7 @@ export function righeAudioAI(c: Clip): HTMLElement[] { const stato = h('div', { class: 'aai-stato', hidden: true }) as HTMLElement; stati.push({ el: stato, tipo }); return h('div', { class: 'aai-scheda', 'data-aai': tipo }, - h('div', { class: 'aai-testa' }, h('i', null, icona), h('div', null, h('b', null, titolo), h('span', null, sotto))), + h('div', { class: 'aai-testa' }, h('i', null, icona), h('div', null, h('b', null, titolo), h('button', { type: 'button', class: 'pp-mini-btn', title: sotto, 'aria-label': 'Informazioni: ' + titolo, on: { click: () => { const d = dialogo(titolo); d.corpo.append(h('p', null, sotto)); d.piede.append(h('button', { class: 'btn', on: { click: () => d.chiudi() } }, 'Chiudi')); } } }, 'i'))), h('div', { class: 'aai-bottoni' }, voci), stato); }; const bottone = (tipo: 'rumore' | 'separa', chiave: string, testo: string, info: string, fn: () => void, primario = false) => { @@ -121,7 +121,7 @@ export function righeAudioAI(c: Clip): HTMLElement[] { st.el.replaceChildren( h('div', { class: 'aai-testo' }, l.inCoda ? 'Aspetto il mio turno… (altri lavori pesanti sono prima)' : (l.testo || 'Sto lavorando…')), h('div', { class: 'aai-barra' + (k === null ? ' indeterminata' : '') }, h('i', { style: k === null ? '' : `width:${k}%` })), - h('div', { class: 'aai-nota' }, 'Puoi continuare a montare: il lavoro va avanti dietro le quinte (Centro attività, in basso a destra).')); + h('div', { class: 'aai-nota' }, 'Avanzamento nel Centro attività.')); } }; // finché c'è un lavoro la sezione si aggiorna da sola; quando il lavoro finisce (o la sezione sparisce) il controllo si ferma @@ -140,10 +140,10 @@ export function righeAudioAI(c: Clip): HTMLElement[] { if (!poss.rumore) righe.push(h('p', { class: 'nota avviso-rosso' }, poss.perche ?? 'Su questa clip non si può')); righe.push( scheda('rumore', '🎙', 'Togli i rumori', 'Una voce con fruscio, ventola o rumore di fondo: il rumore va via e la voce resta.', - FORZE.filter(([f]) => f !== 'podcast' || clearAttivo()).map(([f, nome, info]) => bottone('rumore', 'rumore:' + f, nome, info, () => void faiTogliRumore(c.id, f), f === 'pulita'))), + FORZE.filter(([f]) => f !== 'podcast' || clearAttivo()).map(([f, nome, info]) => bottone('rumore', 'rumore:' + f, ({ pulita: '✦ Pulisci', podcast: '✦ Migliora', isolata: '✦ Isola' } as Partial>)[f] ?? nome, info, () => void faiTogliRumore(c.id, f), f === 'pulita'))), scheda('separa', '🎤', 'Separa voce e musica', 'Da una canzone: la voce da una parte e la base (lo strumentale) dall\'altra, su due tracce nuove.', [ - bottone('separa', 'separa:entrambe', 'Voce e base', 'Due tracce nuove: "Voce" e "Base"', () => void faiSeparaVoce(c.id, 'entrambe'), true), + bottone('separa', 'separa:entrambe', '⑂ Separa', 'Due tracce nuove: "Voce" e "Base"', () => void faiSeparaVoce(c.id, 'entrambe'), true), bottone('separa', 'separa:voce', 'Solo voce', 'Tiene solo la voce (acapella)', () => void faiSeparaVoce(c.id, 'voce')), bottone('separa', 'separa:base', 'Solo base', 'Tiene solo lo strumentale', () => void faiSeparaVoce(c.id, 'base')), ])); @@ -157,9 +157,9 @@ export function righeAudioAI(c: Clip): HTMLElement[] { const sep = s.separa.stato === 'pronto' ? 'pronto' : s.separa.stato === 'in-uso' ? 'sta lavorando' : s.separa.stato === 'errore' ? 'ha dato un errore (si userà la separazione rapida)' : `da scaricare (${s.separa.peso})`; stato.textContent = `Togli i rumori: ${s.rumore.stato === 'pronto' ? 'pronto' : s.rumore.stato === 'in-uso' ? 'sta lavorando' : 'si scarica la prima volta'} · Voce e base: ${sep}. Lavora sul tuo computer, niente esce.`; }).catch(() => { stato.textContent = ''; }); - const scarica = h('button', { class: 'btn-mini', title: 'Scarica adesso il modello per separare voce e base (una volta sola)', on: { click: () => { void installaSeparazione().then(() => avviso('Modello scaricato', 'ok', 2200)).catch(dopoErrore); } } }, 'Scarica il modello per separare'); + const scarica = h('button', { class: 'btn-mini', title: 'Scarica adesso il modello per separare voce e base (una volta sola)', on: { click: () => { void installaSeparazione().then(() => avviso('Modello scaricato', 'ok', 2200)).catch(dopoErrore); } } }, 'Scarica'); const rapido = h('input', { type: 'checkbox', checked: separazioneRapida(), on: { change: (e: Event) => impostaRapida((e.target as HTMLInputElement).checked) } }) as HTMLInputElement; - righe.push(stato, h('details', { class: 'pp-piu' }, h('summary', null, 'Avanzate'), + righe.push(h('details', { class: 'pp-piu' }, h('summary', null, 'Avanzate'), stato, h('label', { class: 'isp-riga spunta-riga' }, rapido, h('span', null, 'Separazione rapida, senza AI (meno precisa, non scarica niente)')), h('div', { class: 'isp-azioni' }, scarica), h('p', { class: 'nota' }, 'Si lavora solo sulla parte della clip che usi (più un secondo per lato). Il risultato è un file nuovo nel contenitore, cartella "Audio lavorato".'))); diff --git a/src/ui/centroAI.ts b/src/ui/centroAI.ts index 0ea87fe..10a4ef8 100644 --- a/src/ui/centroAI.ts +++ b/src/ui/centroAI.ts @@ -28,7 +28,7 @@ import '../stile/copieAI.css'; import { schedaMotoreLocale } from './motoreAI'; import { FUNZIONI_AI as REGISTRO_AI } from '../core/funzioniAI'; import { etichettaStato, ordinaPerStato, pesoDaMb, pesoEVram } from '../core/schedaAI'; -import { faiRallentaFluido, faiSottotitoliParole, faiTrovaScene, faiVocePulitaMotore, faiVoceMusicaMotore, interruttoreClear, schedaFunzioniAI, schedaModelliMotore } from './funzioniMotoreUI'; +import { faiRallentaFluido, faiSottotitoliParole, faiTrovaScene, faiVocePulitaMotore, faiVoceMusicaMotore, interruttoreClear, schedaModelliMotore } from './funzioniMotoreUI'; export interface FunzioneAI { id: string; @@ -285,7 +285,8 @@ export function finestraCentroAI(subito = false) { const attuale = () => lista.find((x) => x.id === m.id)!; const bScarica = h('button', { class: 'btn-mini', disabled: true, on: { click: async () => { bloccaTutto(true); await scarica(attuale()); bloccaTutto(false); await disegna(); void aggSpazio(); } } }, 'Scarica') as HTMLButtonElement; const bTogli = h('button', { class: 'btn-mini', disabled: true, title: 'Toglie il modello dal computer (potrai scaricarlo di nuovo)', on: { click: async () => { bloccaTutto(true); try { await attuale().togli(); } finally { bloccaTutto(false); await disegna(); void aggSpazio(); } } } }, 'Togli') as HTMLButtonElement; - const el = h('div', { class: 'hub-riga', 'data-m': m.id }, h('div', { class: 'hub-nome' }, h('b', null, m.nome, h('span', { class: 'hub-opzionale' }, etichettaStato('opzionale'))), h('small', null, m.uso), h('small', null, m.info), peso, macchina, msg), stato, bScarica, bTogli); + const dettagli = h('details', { class: 'hub-dettagli' }, h('summary', { title: 'Dettagli e altre azioni', 'aria-label': `Dettagli ${m.nome}` }, '⋯'), h('div', { class: 'hub-dettagli-corpo' }, h('p', null, m.uso), h('p', null, m.info), peso, macchina, bTogli)); + const el = h('div', { class: 'hub-riga', 'data-m': m.id }, h('div', { class: 'hub-nome' }, h('b', null, m.nome), msg), stato, bScarica, dettagli); righe.set(m.id, { el, stato, msg, peso, macchina, scarica: bScarica, togli: bTogli }); return el; }), @@ -304,7 +305,7 @@ export function finestraCentroAI(subito = false) { // ——— controlla: nessun modello viene scaricato da questo tasto, nemmeno con subito=true const esito = h('div', { class: 'ai-diagnosi' }); const progresso = h('p', { class: 'nota hub-progresso' }); - const ripara = h('button', { class: 'btn primario ai-ripara', on: { click: () => void fai() } }, '🔍 Controlla l’AI') as HTMLButtonElement; + const ripara = h('button', { class: 'btn primario ai-ripara', on: { click: () => { (d.el.querySelectorAll('.ai-schede button')[2] as HTMLButtonElement)?.click(); const dettagli = impostazioni.querySelector('details'); if (dettagli) dettagli.open = true; void fai(); } } }, 'Controlla AI') as HTMLButtonElement; async function fai() { if (occupato) return; ripara.disabled = true; @@ -344,41 +345,72 @@ export function finestraCentroAI(subito = false) { await aggSpazio(); } } }, 'Togli motore e modelli')) : null; - d.corpo.append( - schedaFunzioniAI(), + const funzioni = schedeRegistro(d.chiudi, () => void fai()); + const modelli = h('div', { class: 'ai-pagina', hidden: true }, schedaModelliMotore(), tabella); + const impostazioni = h('div', { class: 'ai-pagina', hidden: true }, schedaMotoreLocale(), - schedeRegistro(), - schedaModelliMotore(), - h('section', { class: 'ai-sezione' }, - h('p', { class: 'nota' }, 'Tutti i modelli sono opzionali. Montaggio ed export funzionano anche senza. Scegli «Scarica» solo per quelli che vuoi, oppure avvia tu la funzione che li usa. I tuoi video restano sul computer.'), - h('div', { class: 'ai-riga' }, ripara, h('span', { class: 'nota' }, 'Controlla motore, scheda video e connessione senza scaricare modelli. I pesi sono indicativi; le prestazioni vanno provate sul modello.')), - progresso, tabella), - h('details', { class: 'ai-sezione' }, h('summary', null, 'Se qualcosa non va'), h('div', { class: 'ai-riga' }, h('button', { class: 'btn ai-controlla', on: { click: () => void fai() } }, '🔍 Controlla l\'AI'), h('span', { class: 'nota' }, 'Prova il motore AI, la scheda video e la connessione, e ti dice cosa fare.')), esito), + h('details', { class: 'ai-sezione' }, h('summary', null, 'Diagnosi'), progresso, esito), h('section', { class: 'ai-sezione' }, h('h4', null, 'Impostazioni'), - h('label', { class: 'ai-imp spunta-riga', title: 'Su alcuni computer la scheda video c\'è ma sbaglia: spenta, l\'AI usa il processore (più lento ma sicuro)' }, scheda, ' Usa la scheda video quando c\'è'), - interruttoreClear(), + h('label', { class: 'ai-imp spunta-riga' }, scheda, ' Usa la scheda video'), interruttoreClear(), h('div', { class: 'ai-imp' }, spazio, svuota), - h('div', { class: 'ai-imp' }, h('span', null, 'Dopo un minuto e mezzo senza AI i modelli escono da soli dalla scheda video'), liberaMemoria), - h('div', { class: 'ai-imp ai-chiave', title: 'Per i modelli che Hugging Face concede solo con una chiave (se richiesto). Resta sul tuo computer e viaggia solo verso huggingface.co' }, h('span', null, 'Chiave Hugging Face'), chiaveHF, salvaChiave), - nvidia)); - d.piede.append(h('button', { class: 'btn', on: { click: () => { d.chiudi(); document.dispatchEvent(new CustomEvent('dpv:guida', { detail: 'problemi-ai' })); } } }, '❓ Se un\'AI non parte'), h('span', { class: 'spazio' }), h('button', { class: 'btn chiudi', on: { click: d.chiudi } }, 'Chiudi')); - if (subito) void fai(); + h('div', { class: 'ai-imp' }, liberaMemoria), + h('div', { class: 'ai-imp ai-chiave' }, h('span', null, 'Chiave Hugging Face'), chiaveHF, salvaChiave), nvidia)); + const pagine = [funzioni, modelli, impostazioni]; + const schede = h('nav', { class: 'ai-schede', 'aria-label': 'Centro AI' }); + ['Funzioni', 'Modelli', 'Impostazioni'].forEach((nome, i) => { + const b = h('button', { class: 'btn-mini', 'aria-pressed': i === 0 ? 'true' : 'false', on: { click: () => { + pagine.forEach((p, j) => { p.hidden = i !== j; }); + schede.querySelectorAll('button').forEach((t, j) => t.setAttribute('aria-pressed', String(i === j))); + } } }, nome); + schede.append(b); + }); + d.corpo.append(schede, ...pagine); + d.piede.append(ripara, h('button', { class: 'btn', on: { click: () => { d.chiudi(); document.dispatchEvent(new CustomEvent('dpv:guida', { detail: 'problemi-ai' })); } } }, '❓ Se un\'AI non parte'), h('span', { class: 'spazio' }), h('button', { class: 'btn chiudi', on: { click: d.chiudi } }, 'Chiudi')); + if (subito) ripara.click(); return d; } /** le funzioni del registro AI (src/core/funzioniAI.ts), una scheda per ognuna: cartellino, peso, VRAM e il tasto per usarla */ -function schedeRegistro(): HTMLElement { - const sez = h('section', { class: 'ai-sezione', 'data-ai': 'registro' }); - if (!REGISTRO_AI.length) { sez.hidden = true; return sez; } - sez.append(h('h4', null, 'Funzioni AI'), h('div', { class: 'sch-funzioni' }, ordinaPerStato(REGISTRO_AI).map((f) => { - const pv = pesoEVram(f); - return h('div', { class: 'sch-funzione', 'data-funzione': f.id }, - h('span', { class: 'sch-cartellino', 'data-stato': f.stato }, etichettaStato(f.stato)), - h('b', null, f.nome), h('p', null, f.descrizione), - h('small', { class: 'sch-pesovram' }, pv.riga + ' · ' + (f.motore === 'locale' ? 'motore locale' : 'nel browser')), - f.esegui ? h('button', { class: 'btn-mini', on: { click: () => { void f.esegui!({ clipIds: [...store.sel] }).catch((e) => avviso(spiegaErroreAI(e), 'errore', 6000)); } } }, 'Usa') : null); - }))); - return sez; +function schedeRegistro(chiudi: () => void, controlla: () => void): HTMLElement { + const sez = h('section', { class: 'ai-pagina', 'data-ai': 'registro' }); + const ricerca = h('input', { class: 'campo-testo', type: 'search', placeholder: 'Cerca una funzione', 'aria-label': 'Cerca una funzione AI' }) as HTMLInputElement; + const filtri = h('div', { class: 'ai-filtri', 'aria-label': 'Filtra funzioni' }); + const griglia = h('div', { class: 'sch-funzioni' }); + const pagina = h('span', { class: 'ai-pagina-num', 'aria-live': 'polite' }); + let filtro = 'Tutte', indice = 0; + const precedente = h('button', { class: 'btn-mini', on: { click: () => { indice--; disegna(); } } }, '‹') as HTMLButtonElement; + const successiva = h('button', { class: 'btn-mini', on: { click: () => { indice++; disegna(); } } }, '›') as HTMLButtonElement; + precedente.setAttribute('aria-label', 'Pagina precedente'); successiva.setAttribute('aria-label', 'Pagina successiva'); + const categoria = (f: typeof REGISTRO_AI[number]) => f.dove === 'audio' ? 'Audio' : f.dove === 'finale' ? 'Testo' : 'Video'; + function disegna() { + const q = ricerca.value.trim().toLocaleLowerCase('it'); + const lista = ordinaPerStato(REGISTRO_AI).filter((f) => (filtro === 'Tutte' || categoria(f) === filtro) && (f.nome + ' ' + f.descrizione).toLocaleLowerCase('it').includes(q)); + const pagine = Math.max(1, Math.ceil(lista.length / 12)); indice = Math.max(0, Math.min(indice, pagine - 1)); + precedente.disabled = indice === 0; successiva.disabled = indice === pagine - 1; pagina.textContent = `${indice + 1} / ${pagine}`; + griglia.replaceChildren(...lista.slice(indice * 12, indice * 12 + 12).map((f) => { + const guida = FUNZIONI_AI.find((x) => x.id === f.id); + const nome = f.nome.replace(/ \(.*$/, '').slice(0, 24); + const manca = guida?.manca(); + const descrizione = manca ? '⚠ ' + manca.slice(0, 52) : f.descrizione.split(/[.;(]/)[0].slice(0, 55); + const peso = !f.peso || /nessun modello/i.test(f.peso) ? 'Integrata' : f.id === 'rumore' ? 'da 9 MB' : f.id === 'sottotitoli' ? 'da 40 MB' : (f.peso.match(/[\d,.]+(?:–[\d,.]+)?\s*(?:MB|GB)/i)?.[0] ?? 'Peso da verificare'); + const info = h('button', { class: 'btn-mini ai-info', 'aria-label': `Informazioni su ${f.nome}`, title: 'Dettagli e requisiti', on: { click: () => { + const d = dialogo(f.nome); d.corpo.append(h('p', null, f.descrizione), h('p', { class: 'sch-pesovram' }, pesoEVram(f).riga)); if (guida) d.corpo.append(h('p', null, guida.come.join(' · '))); + d.piede.append(h('button', { class: 'btn', on: { click: d.chiudi } }, 'Chiudi')); + } } }, 'i'); + const azione = h('button', { class: 'btn-mini', on: { click: () => { + if (f.id === 'aggiusta') { controlla(); return; } + if (guida) { chiudi(); guida.apri(); } else if (f.esegui) void f.esegui({ clipIds: [...store.sel] }).catch((e) => avviso(spiegaErroreAI(e), 'errore', 6000)); else { chiudi(); if (f.id === 'clear') vaiSezione('audioai'); else vaiFinale(f.id === 'sottotitoli-nemotron' ? 'sottotitoli' : 'lingue'); } + } } }, f.id === 'aggiusta' ? 'Controlla' : 'Apri'); + return h('article', { class: 'sch-funzione', 'data-funzione': f.id }, + h('div', { class: 'sch-funzione-testa' }, h('b', { title: f.nome }, guida?.icona ? guida.icona + ' ' + nome : nome), h('span', { class: 'sch-cartellino', 'data-stato': f.stato }, etichettaStato(f.stato))), + h('p', { title: manca || f.descrizione, class: manca ? 'ai-manca' : '' }, descrizione), h('div', { class: 'sch-funzione-azioni' }, h('span', { class: 'ai-chip' }, peso), info, azione)); + })); + } + for (const nome of ['Tutte', 'Video', 'Audio', 'Testo']) { + const b = h('button', { class: 'btn-mini', 'aria-pressed': String(nome === filtro), on: { click: () => { filtro = nome; indice = 0; filtri.querySelectorAll('button').forEach((x) => x.setAttribute('aria-pressed', String(x === b))); disegna(); } } }, nome); filtri.append(b); + } + ricerca.addEventListener('input', () => { indice = 0; disegna(); }); + sez.append(h('div', { class: 'ai-ricerca' }, ricerca, filtri), griglia, h('div', { class: 'ai-paginazione' }, precedente, pagina, successiva)); disegna(); return sez; } function disegnaDiagnosi(el: HTMLElement, g: Diagnosi) { diff --git a/src/ui/coloreAvanzato.ts b/src/ui/coloreAvanzato.ts index 8745cae..ecf2f29 100644 --- a/src/ui/coloreAvanzato.ts +++ b/src/ui/coloreAvanzato.ts @@ -9,6 +9,7 @@ import { LUT_DI_PARTENZA, applicaAScena, caricaLutDiPartenza, scenaDiProva } fro import { creaDuckingClip } from './duckingClip'; import { CANALI_CURVA, identitaCurva, normalizzaCurva, valutaCurva } from '../render/curve'; import { h } from './dom'; +import { schedeFinale } from './finaleSchede'; const NOMI_CURVE: Record = { master: 'RGB insieme', red: 'Rosso', green: 'Verde', blue: 'Blu', luma: 'Luma · Rec.709' }; const errore = (e: unknown) => e instanceof Error ? e.message : String(e); @@ -30,7 +31,8 @@ function disegnaScena(ctx: CanvasRenderingContext2D, px: number[][]) { export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: () => void } = {}) { const el = h('section', { class: 'colore-avanzato', 'aria-label': 'Colore avanzato' }); let canale: CanaleCurva = 'master', trascina = false, morto = false; - let messaggio = '', selezionato = 'inizio'; + let messaggio = '', selezionato = 'inizio', scheda = 0; + let osservaCurva: ResizeObserver | null = null; const stato = h('p', { class: 'ca-stato', role: 'status', 'aria-live': 'polite' }); const dice = (s: string) => { messaggio = s; stato.textContent = s; }; const modifica = (nome: string, fn: (p: Project, c: Clip) => void) => { @@ -75,28 +77,34 @@ export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: gruppo.append(disco, numero('Livello', medio, campo === 'lift' ? -1 : .1, campo === 'lift' ? 1 : 4, .01, (v) => cambiaColore((c) => { c[campo] = valori.map((x) => Math.max(campo === 'gamma' ? .1 : campo === 'gain' ? 0 : -1, Math.min(campo === 'lift' ? 1 : 4, x + v - medio))) as [number, number, number]; }))); - ['R', 'G', 'B'].forEach((n, i) => gruppo.append(numero(n, valori[i], campo === 'lift' ? -1 : campo === 'gain' ? 0 : .1, campo === 'lift' ? 1 : 4, .01, (v) => cambiaColore((c) => { + const rgb = h('details', { class: 'ca-avanzate' }, h('summary', null, 'Avanzate')); + gruppo.append(rgb); + ['R', 'G', 'B'].forEach((n, i) => rgb.append(numero(n, valori[i], campo === 'lift' ? -1 : campo === 'gain' ? 0 : .1, campo === 'lift' ? 1 : 4, .01, (v) => cambiaColore((c) => { const vv: [number, number, number] = [...valori]; vv[i] = v; c[campo] = vv; })))); return gruppo; } function editorCurve(col: ColoreAvanzato) { - const box = h('fieldset', null, h('legend', null, 'Curve')); + const box = h('fieldset', { class: 'ca-curve' }, h('legend', null, 'Curve')); const scelta = h('select', { 'aria-label': 'Canale della curva' }, CANALI_CURVA.map((c) => h('option', { value: c, selected: c === canale }, NOMI_CURVE[c]))); scelta.onchange = () => { canale = scelta.value as CanaleCurva; selezionato = 'inizio'; aggiorna(); }; const punti = normalizzaCurva(col.curve?.[canale]); - const tela = h('canvas', { width: 320, height: 200, class: 'ca-curva', 'aria-label': 'Curva: trascina i punti; doppio clic per aggiungerne uno' }); + const tela = h('canvas', { width: 320, height: 320, class: 'ca-curva', 'aria-label': 'Curva: trascina i punti; doppio clic per aggiungerne uno' }); const disegna = () => { + const lato = tela.clientWidth || 320; + const pixel = Math.round(lato * (window.devicePixelRatio || 1)); + if (tela.width !== pixel || tela.height !== pixel) { tela.width = pixel; tela.height = pixel; } const ctx = tela.getContext('2d')!; + ctx.setTransform(pixel / 320, 0, 0, pixel / 320, 0, 0); const p = normalizzaCurva(clipDi(store.doc, clipId)?.fx.colore?.curve?.[canale]); - ctx.fillStyle = '#17171e'; ctx.fillRect(0, 0, 320, 200); ctx.strokeStyle = '#44444f'; ctx.lineWidth = 1; - for (let i = 1; i < 4; i++) { ctx.beginPath(); ctx.moveTo(i * 80, 0); ctx.lineTo(i * 80, 200); ctx.moveTo(0, i * 50); ctx.lineTo(320, i * 50); ctx.stroke(); } + ctx.fillStyle = '#17171e'; ctx.fillRect(0, 0, 320, 320); ctx.strokeStyle = '#44444f'; ctx.lineWidth = 1; + for (let i = 1; i < 4; i++) { ctx.beginPath(); ctx.moveTo(i * 80, 0); ctx.lineTo(i * 80, 320); ctx.moveTo(0, i * 80); ctx.lineTo(320, i * 80); ctx.stroke(); } ctx.strokeStyle = canale === 'red' ? '#ff7777' : canale === 'green' ? '#88df98' : canale === 'blue' ? '#88baff' : '#ffe09a'; ctx.lineWidth = 2; ctx.beginPath(); - for (let x = 0; x <= 320; x++) { const y = (1 - valutaCurva(p, x / 320)) * 200; if (x) ctx.lineTo(x, y); else ctx.moveTo(x, y); } ctx.stroke(); - for (const pt of p) { ctx.beginPath(); ctx.arc(pt.x * 320, (1 - pt.y) * 200, pt.id === selezionato ? 6 : 4, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); } + for (let x = 0; x <= 320; x++) { const y = (1 - valutaCurva(p, x / 320)) * 320; if (x) ctx.lineTo(x, y); else ctx.moveTo(x, y); } ctx.stroke(); + for (const pt of p) { ctx.beginPath(); ctx.arc(pt.x * 320, (1 - pt.y) * 320, pt.id === selezionato ? 6 : 4, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); } }; - const coordinate = (e: MouseEvent) => { const r = tela.getBoundingClientRect(); return { x: Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)), y: Math.max(0, Math.min(1, 1 - (e.clientY - r.top) / r.height)) }; }; + const coordinate = (e: MouseEvent) => { const r = tela.getBoundingClientRect(); return { x: Math.max(0, Math.min(1, (e.clientX - r.left - tela.clientLeft) / tela.clientWidth)), y: Math.max(0, Math.min(1, 1 - (e.clientY - r.top - tela.clientTop) / tela.clientHeight)) }; }; tela.ondblclick = (e) => { const q = coordinate(e); if (q.x <= .005 || q.x >= .995 || punti.some((p) => Math.abs(p.x - q.x) < .005)) return; selezionato = crypto.randomUUID(); @@ -119,7 +127,20 @@ export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: tela.onpointercancel = () => { tela.onpointermove = null; trascina = false; store.cancelLive(); aggiorna(); }; disegna(); }; - box.append(scelta, tela, h('p', { class: 'nota' }, 'Doppio clic: aggiungi un punto. Gli estremi restano ai bordi.')); + const sceltaPunto = h('select', { 'aria-label': 'Punto della curva' }, punti.map((p, i) => h('option', { value: p.id, selected: p.id === selezionato }, `Punto ${i + 1}`))); + sceltaPunto.onchange = () => { selezionato = sceltaPunto.value; aggiorna(); el.querySelector('[aria-label="Punto della curva"]')?.focus({ preventScroll: true }); }; + const strumenti = h('div', { class: 'ca-curve-strumenti' }, scelta, sceltaPunto, + bottone('Aggiungi', () => { + let x = .5, distanza = 0; + for (let i = 1; i < punti.length; i++) if (punti[i].x - punti[i - 1].x > distanza) { distanza = punti[i].x - punti[i - 1].x; x = (punti[i].x + punti[i - 1].x) / 2; } + selezionato = crypto.randomUUID(); + cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = normalizzaCurva([...punti, { id: selezionato, x, y: valutaCurva(punti, x) }]); }); + }), + bottone('Togli punto', () => cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = punti.filter((p, i) => i === 0 || i === punti.length - 1 || p.id !== selezionato); }), !punti.slice(1, -1).some((p) => p.id === selezionato)), + bottone('Ripristina', () => cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = identitaCurva(); }))); + box.append(h('div', { class: 'ca-curve-banco' }, tela, strumenti)); + const precise = h('details', { class: 'ca-avanzate' }, h('summary', null, 'Avanzate')); + box.append(precise); for (const [i, p] of punti.entries()) { const riga = h('div', { class: 'ca-punto-riga' }, numero(`Ingresso ${i + 1}`, p.x, i ? punti[i - 1].x + .001 : 0, i < punti.length - 1 ? punti[i + 1].x - .001 : 1, .001, (v) => { if (i === 0 || i === punti.length - 1) return; @@ -127,9 +148,9 @@ export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: }), numero(`Uscita ${i + 1}`, p.y, 0, 1, .001, (v) => cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = punti.map((q) => q.id === p.id ? { ...q, y: v } : q); }))); if (i === 0 || i === punti.length - 1) riga.querySelector('input')!.readOnly = true; if (i > 0 && i < punti.length - 1) riga.append(bottone('Togli punto', () => cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = punti.filter((q) => q.id !== p.id); }))); - box.append(riga); + precise.append(riga); } - box.append(bottone('Azzera questa curva', () => cambiaColore((c) => { c.curve ??= {}; c.curve[canale] = identitaCurva(); }))); + osservaCurva = new ResizeObserver(disegna); osservaCurva.observe(tela); disegna(); return box; } @@ -169,24 +190,28 @@ export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: function aggiorna() { if (morto || trascina) return; + osservaCurva?.disconnect(); osservaCurva = null; el.replaceChildren(); const c = clipDi(store.doc, clipId); if (!c) { el.append(h('p', null, 'La clip non c’è più')); return; } const t = store.doc.tracks.find((t) => t.id === c.track); if (t?.kind === 'video' && c.kind !== 'fx') { const col = c.fx.colore ?? {}; - el.append(h('h3', null, 'Colore della clip'), h('p', { class: 'nota' }, 'SDR · usa LUT pensate per lo spazio colore della ripresa. Nessuna conversione log automatica.'), - h('div', { class: 'ca-ruote' }, ruota(col, 'lift', 'Lift · ombre'), ruota(col, 'gamma', 'Gamma · mezzi toni'), ruota(col, 'gain', 'Gain · luci')), editorCurve(col)); + const ruote = h('div', { class: 'ca-ruote' }, ruota(col, 'lift', 'Ombre'), ruota(col, 'gamma', 'Mezzi toni'), ruota(col, 'gain', 'Luci')); + const curve = editorCurve(col); const lut = store.doc.luts?.find((l) => l.id === col.lut?.id); const file = h('input', { type: 'file', accept: '.cube', 'aria-label': 'Carica il tuo file .cube' }); file.onchange = async () => { const f = file.files?.[0]; if (!f) return; try { await mettiLut(await leggiLut(f), 'LUT caricata e incorporata nel progetto'); } catch (e) { dice(errore(e)); } }; - el.append(h('fieldset', { class: 'ca-luts' }, h('legend', null, 'LUT 3D · look di partenza'), libreria(col.lut?.id), + const looks = h('fieldset', { class: 'ca-luts' }, h('legend', null, 'LUT 3D · look di partenza'), libreria(col.lut?.id), h('label', { class: 'ca-carica' }, h('span', null, 'Carica il tuo .cube'), file), h('p', null, lut?.nome ?? (col.lut ? 'LUT mancante: ricarica il file .cube' : 'Nessuna LUT')), numero('Intensità LUT (%)', (col.lut?.intensita ?? 0) * 100, 0, 100, 1, (v) => cambiaColore((c) => { if (c.lut) c.lut.intensita = v / 100; })), - bottone('Togli LUT', () => cambiaColore((c) => { delete c.lut; }))), - bottone('Azzera il colore avanzato', () => modifica('Azzera colore avanzato', (_, c) => { delete c.fx.colore; }))); + bottone('Togli LUT', () => cambiaColore((c) => { delete c.lut; }))); + el.append(schedeFinale([looks, ruote, curve], ['Look', 'Ruote', 'Curve'], scheda, (i) => { scheda = i; }), + h('details', { class: 'ca-avanzate' }, h('summary', null, 'Colore: avanzate'), + h('p', { class: 'nota' }, 'SDR · usa LUT adatte alla ripresa. Nessuna conversione log automatica.'), + bottone('Azzera tutto', () => modifica('Azzera colore avanzato', (_, c) => { delete c.fx.colore; })))); } const voce = creaDuckingClip(clipId, { ascolta: opzioni.ascolta }); if (voce.el.childElementCount) el.append(h('fieldset', null, h('legend', null, 'Voce e musica'), voce.el)); @@ -194,7 +219,7 @@ export function creaPannelloColoreAvanzato(clipId: string, opzioni: { ascolta?: } const off = store.on('doc', aggiorna); aggiorna(); - return { el, aggiorna, distruggi() { morto = true; off(); if (trascina) { trascina = false; store.cancelLive(); } el.remove(); } }; + return { el, aggiorna, distruggi() { morto = true; osservaCurva?.disconnect(); off(); if (trascina) { trascina = false; store.cancelLive(); } el.remove(); } }; } /** Configurazione neutra per chi costruisce il pannello senza usare lo Store. */ diff --git a/src/ui/controlloUscita.ts b/src/ui/controlloUscita.ts index 2e643f0..db50023 100644 --- a/src/ui/controlloUscita.ts +++ b/src/ui/controlloUscita.ts @@ -82,7 +82,7 @@ export function creaControlloUscita(): ControlloUscita { return h(cliccabile ? 'button' : 'div', { class: `ctl-riga ${c.luce}${cliccabile ? ' ctl-vai' : ''}`, 'data-c': c.id, title: c.aiuto ?? '', ...(cliccabile ? { type: 'button', on: { click: vai } } : {}), - }, h('span', { class: 'ctl-spia' }), h('span', { class: 'ctl-nome' }, c.nome), h('span', { class: 'ctl-dett' }, c.dettaglio)); + }, h('span', { class: 'ctl-spia', 'aria-hidden': 'true' }), h('span', { class: 'ctl-simbolo', 'aria-label': c.luce === 'verde' ? 'Pronto' : c.luce === 'rossa' ? 'Errore' : 'Da controllare' }, c.luce === 'verde' ? '✓' : '!'), h('span', { class: 'ctl-nome' }, c.nome), h('span', { class: 'ctl-dett' }, c.dettaglio)); } function ridisegna() { diff --git a/src/ui/editorClip.ts b/src/ui/editorClip.ts index 6d18ee2..4d3422a 100644 --- a/src/ui/editorClip.ts +++ b/src/ui/editorClip.ts @@ -12,12 +12,29 @@ let aperto: { chiudi: () => void; isp: Ispettore } | null = null; export function apriEditorClip(id: string, sezione?: string) { if (!store.doc.clips.some((c) => c.id === id)) return; store.select(withLinked(store.doc, [id])); - if (aperto) { aperto.isp.apriSezione(sezione ?? ''); return; } + if (aperto) { aperto.isp.apriSezione(sezione ?? 'immagine'); return; } const isp = new Ispettore(true); - const d = dialogo('Modifica clip', { largo: true, onChiudi: () => { isp.dispose(); aperto = null; } }); + const sulMonitor = () => d.chiudi(); + const annulla = (e: KeyboardEvent) => { + const veli = document.querySelectorAll('.velo'); + if (veli[veli.length - 1] !== d.el.parentElement || !(e.ctrlKey || e.metaKey) || e.altKey) return; + const k = e.key.toLowerCase(); + if (k !== 'z' && k !== 'y') return; + e.preventDefault(); e.stopImmediatePropagation(); + if (k === 'y' || e.shiftKey) store.doRedo(); else store.doUndo(); + }; + const eventiMonitor = ['dpv:scegli', 'dpv:mira', 'dpv:maschera']; + const d = dialogo('Modifica clip', { largo: true, onChiudi: () => { + for (const evento of eventiMonitor) document.removeEventListener(evento, sulMonitor); + document.removeEventListener('keydown', annulla, true); + isp.dispose(); aperto = null; + } }); + // Il contagocce e le selezioni devono poter raggiungere il monitor. + for (const evento of eventiMonitor) document.addEventListener(evento, sulMonitor); + document.addEventListener('keydown', annulla, true); d.el.classList.add('editor-clip'); d.corpo.append(isp.el); - d.piede.append(h('span', { class: 'nota' }, 'Le modifiche valgono subito e si annullano con Ctrl+Z.'), h('span', { class: 'spazio' }), h('button', { class: 'btn primario', on: { click: () => d.chiudi() } }, 'Fatto')); + d.piede.append(h('span', { class: 'nota' }, 'Modifiche immediate · Ctrl+Z annulla'), h('span', { class: 'spazio' }), h('button', { class: 'btn primario', on: { click: () => d.chiudi() } }, 'Fatto')); aperto = { chiudi: d.chiudi, isp }; if (sezione) setTimeout(() => isp.apriSezione(sezione), 60); } diff --git a/src/ui/esportazione.ts b/src/ui/esportazione.ts index 3219e77..12f85c4 100644 --- a/src/ui/esportazione.ts +++ b/src/ui/esportazione.ts @@ -5,6 +5,7 @@ // I conti stanno in `src/core/esportazione.ts`, la coda in `src/export/coda.ts`, i codec in `src/export/codec.ts`, // le scelte condivise in `src/ui/uscita.ts`, la misura del volume in `src/media/loudness.ts`. import '../stile/esportazione.css'; +import { schedeFinale } from './finaleSchede'; import { store } from '../core/store'; import { projectEnd } from '../core/progetto'; import { durataUmana, f2s, frameToTc } from '../core/timecode'; @@ -66,16 +67,18 @@ export function pannelloEsporta(preset?: string, opz: { banco?: boolean } = {}): const controllo = banco ? creaControlloUscita() : null; const sez = (titolo: string, ic: string, ...figli: HTMLElement[]) => h('div', { class: 'fin-sezione es-sezione' }, h('h4', null, icona(ic, 14), titolo), ...figli); const altreDest = h('details', { class: 'es-dettagli es-altre' }, h('summary', null, 'Altre destinazioni'), altre) as HTMLDetailsElement; - const dettagli = h('details', { class: 'es-dettagli' }, h('summary', null, 'Come esce, nei dettagli'), anteprima, regole) as HTMLDetailsElement; const codaSez = sez('Coda', 'esporta', h('div', { class: 'es-coda-testa' }, testaCoda, h('button', { class: 'btn piccolo', title: 'Toglie dalla lista quelle già finite', on: { click: () => pulisciFinite() } }, 'Svuota le finite')), lista); const fondo = h('div', { class: 'es-fondo' }, piede, azioni); if (banco) { el.append( - sez('Controllo prima dell\'uscita', 'info', controllo!.el), - sez('Destinazione', 'video', pre, altreDest), - sez('Volume', 'altoparlante', volume), - dettagli, - codaSez); + sez('Controllo', 'info', controllo!.el), + schedeFinale([ + sez('Destinazione', 'video', pre, altreDest), + sez('Volume', 'altoparlante', volume), + sez('Formato', 'info', anteprima), + sez('Opzioni', 'ingranaggio', regole), + codaSez, + ])); } else { el.append( sez('Dove lo porti', 'video', pre, altreDest), diff --git a/src/ui/finale.ts b/src/ui/finale.ts index 6c9cc4b..9124e8a 100644 --- a/src/ui/finale.ts +++ b/src/ui/finale.ts @@ -29,6 +29,7 @@ import '../stile/finale.css'; import { pannelloEsporta, type PannelloEsporta } from './esportazione'; import { creaMisureFinale, type MisureFinale } from './misureFinale'; import { avviso, clamp, conferma, h, icona } from './dom'; +import { aiutoFinale, schedeFinale } from './finaleSchede'; import { creaPannelloColoreAvanzato } from './coloreAvanzato'; import { faiParlareLocale, pannelloVoceLocale } from './motoreAI'; import { motoreLocaleDisponibile } from '../media/motoreAI'; @@ -109,7 +110,7 @@ export class Finale { }, icona(z.icona, 19), h('span', null, z.nome)))); this.el = h('section', { class: 'pannello finale' }, h('header', { class: 'fin-testa' }, icona('finale', 18), - h('div', { class: 'fin-testa-testi' }, h('span', { class: 'fin-etichetta' }, 'FINALE · CONTROLLO PRIMA DELL\'USCITA'), this.titoloProgetto), this.tcFine), + h('div', { class: 'fin-testa-testi' }, h('span', { class: 'fin-etichetta' }, 'FINALE'), this.titoloProgetto), this.tcFine), h('div', { class: 'fin-dentro' }, h('div', { class: 'fin-colonna' }, this.corpo, this.piede), this.menu)); this.mostra('esporta'); this.aggiornaTesta(); @@ -154,9 +155,9 @@ export class Finale { this.menu.querySelectorAll('.fin-voce').forEach((b) => b.classList.toggle('attiva', (b as HTMLElement).dataset.s === z)); let pg = this.pagine.get(z); if (!pg) { pg = this.costruisci(z); this.pagine.set(z, pg); } - const sez = (titolo: string, ic: string, ...figli: (HTMLElement | null)[]) => h('div', { class: 'fin-sezione' }, h('h4', null, icona(ic, 14), titolo), ...figli.filter(Boolean) as HTMLElement[]); // nella pagina Uscita il riepilogo (buchi neri, file da ricollegare) sta sotto: sopra c'è il controllo - this.corpo.replaceChildren(...(z === 'esporta' ? [pg, sez('Riepilogo del montaggio', 'info', this.riepilogo)] : [sez('Riepilogo', 'info', this.riepilogo), pg])); + const riepilogo = h('details', { class: 'fin-riepilogo-dettagli' }, h('summary', null, 'Riepilogo'), this.riepilogo); + this.corpo.replaceChildren(pg, riepilogo); this.corpo.scrollTop = 0; this.pannelloUscita?.mostrata(this.visibile && z === 'esporta'); this.piede.replaceChildren(...(z === 'esporta' && this.pannelloUscita ? [this.pannelloUscita.fondo] : [])); @@ -172,8 +173,7 @@ export class Finale { scelta.onchange = () => { this.clipColore = scelta.value || null; this.sincronizzaClipColore(false); const c = this.clipColore ? store.doc.clips.find((x) => x.id === this.clipColore) : null; if (c) motore.vaiA(c.start); }; this.sceltaClip = scelta; this.postoClip = h('div', { class: 'ca-fin-host' }); this.firmaClip = ''; return h('div', { class: 'ca-fin' }, - h('label', { class: 'ca-fin-scelta' }, h('span', null, 'Clip'), scelta), - h('p', { class: 'nota' }, 'LUT .cube con intensità, ruote lift/gamma/gain e curve, solo sulla clip scelta. Il monitor mostra il risultato; Ctrl+Z torna indietro. Sceglierla nella timeline cambia anche qui.'), + h('label', { class: 'ca-fin-scelta' }, h('span', null, 'Clip scelta'), scelta), this.postoClip); } @@ -210,11 +210,17 @@ export class Finale { private costruisci(z: Sezione): HTMLElement { const sez = (titolo: string, ic: string, ...figli: (HTMLElement | null)[]) => h('div', { class: 'fin-sezione' }, h('h4', null, icona(ic, 14), titolo), ...figli.filter(Boolean) as HTMLElement[]); - const pagina = (...figli: HTMLElement[]) => h('div', { class: 'fin-pagina', 'data-s': z }, ...figli); + const pagina = (...figli: HTMLElement[]) => { + const el = h('div', { class: 'fin-pagina', 'data-s': z }); + const pannelli = figli.filter((f) => f.classList.contains('fin-sezione')); + const aiuti = figli.filter((f) => !f.classList.contains('fin-sezione')); + el.append(...(pannelli.length > 1 ? [schedeFinale(pannelli)] : pannelli), ...aiuti); + return el; + }; if (z === 'colore') { // colore automatico: un interruttore grande e la forza const auto = h('button', { class: 'fin-interruttore', on: { click: () => this.cambia(this.m().auto ? 'Colore automatico spento' : 'Colore automatico acceso', (m) => { m.auto = !m.auto; }) } }, - h('span', { class: 'led' }), h('span', { class: 'fin-int-testo' }, 'Colore automatico su tutte le riprese')); + h('span', { class: 'led' }), h('span', { class: 'fin-int-testo' }, 'Colore automatico')); this.campi.push({ aggiorna: () => { auto.classList.toggle('acceso', this.m().auto); auto.querySelector('.led')!.classList.toggle('acceso', this.m().auto); } }); const looks = h('div', { class: 'fin-looks' }, LOOKS.map((l) => { const b = h('button', { class: 'fin-look', title: l.info, on: { click: () => this.cambia(`Look ${l.nome}`, (m) => { m.look = l.id as LookFinale; if (!m.intensita) m.intensita = 1; }) } }, @@ -223,11 +229,11 @@ export class Finale { this.campi.push({ aggiorna: () => b.classList.toggle('acceso', this.m().look === l.id) }); return b; })); - return pagina( - sez('Colore automatico', 'effetti', auto, + const montaggio = schedeFinale([ + sez('Automatico', 'effetti', auto, this.cursore('Forza', 0, 100, (m) => Math.round(m.autoK * 100), (m, v) => { m.autoK = v / 100; }, '%'), - h('button', { class: 'btn', on: { click: async () => { await preparaOra(senzaColoreMisurato(store.doc), 'colore'); this.aggiornaRiepilogo(); } } }, 'Misura ora le riprese'), h('p', { class: 'nota' }, 'Accendere il colore non avvia analisi. Senza misure la ripresa resta neutra. Misura ora è una richiesta esplicita: avanzamento e annullamento in Attività.')), - sez('Look di tutto il montaggio', 'immagine', looks, + h('button', { class: 'btn', on: { click: async () => { await preparaOra(senzaColoreMisurato(store.doc), 'colore'); this.aggiornaRiepilogo(); } } }, 'Misura ora'), aiutoFinale('Accendere il colore non avvia analisi. Senza misure la ripresa resta neutra. Misura ora è una richiesta esplicita: avanzamento e annullamento in Attività.')), + sez('Look', 'immagine', looks, this.cursore('Intensità', 0, 100, (m) => Math.round(m.intensita * 100), (m, v) => { m.intensita = v / 100; }, '%')), sez('Ritocchi', 'ingranaggio', this.cursore('Luce', -100, 100, (m) => Math.round(m.bright * 100), (m, v) => { m.bright = v / 100; }, ''), @@ -238,17 +244,20 @@ export class Finale { this.cursore('Vignetta', 0, 100, (m) => Math.round(m.vignette * 100), (m, v) => { m.vignette = v / 100; }, ''), this.cursore('Grana', 0, 100, (m) => Math.round(m.grain * 100), (m, v) => { m.grain = v / 100; }, ''), h('div', { class: 'isp-pulsanti' }, - h('button', { class: 'btn-mini', on: { click: () => this.cambia('Azzera ritocchi', (m) => { Object.assign(m, { look: 'nessuno', intensita: 1, bright: 0, contrast: 1, sat: 1, temp: 0, tint: 0, vignette: 0, grain: 0 }); }) } }, 'Azzera look e ritocchi'), - h('button', { class: 'btn-mini prima-dopo-fin', on: { click: () => (document.querySelector('.monitor .prima-dopo') as HTMLElement | null)?.click() } }, 'Prima | dopo'))), - sez('Colore avanzato di una clip', 'immagine', this.coloreAvanzatoClip())); + h('button', { class: 'btn-mini', on: { click: () => this.cambia('Azzera ritocchi', (m) => { Object.assign(m, { look: 'nessuno', intensita: 1, bright: 0, contrast: 1, sat: 1, temp: 0, tint: 0, vignette: 0, grain: 0 }); }) } }, 'Ripristina'), + h('button', { class: 'btn-mini prima-dopo-fin', on: { click: () => (document.querySelector('.monitor .prima-dopo') as HTMLElement | null)?.click() } }, 'Prima | dopo'))) + ]); + return pagina( + sez('Montaggio', 'effetti', montaggio), + sez('Clip scelta', 'immagine', this.coloreAvanzatoClip())); } if (z === 'audio') { return pagina(sez('Audio finale', 'altoparlante', this.cursore('Volume finale', -24, 12, (m) => m.volume, (m, v) => { m.volume = v; }, 'dB', 0.5), this.spunta('Limitatore (niente distorsione)', (m) => m.limiter, (m, v) => { m.limiter = v; }), h('div', { class: 'isp-pulsanti' }, - h('button', { class: 'btn-mini', title: 'Porta ogni clip audio a un livello simile (si annulla con Ctrl+Z)', on: { click: () => this.livellaTutto() } }, 'Livella il volume di tutte le clip')), - h('p', { class: 'nota' }, 'Il fade in e il fade out delle singole clip: trascinali dal contenitore (Effetti → Audio) o tira i quadratini in alto sulle clip.'))); + h('button', { class: 'btn-mini', title: 'Porta ogni clip audio a un livello simile (si annulla con Ctrl+Z)', on: { click: () => this.livellaTutto() } }, 'Livella tutto')), + aiutoFinale('Il fade in e il fade out delle singole clip: trascinali dal contenitore (Effetti → Audio) o tira i quadratini in alto sulle clip.'))); } if (z === 'sottotitoli') return pagina(...this.paginaSottotitoli(sez)); if (z === 'logo') return pagina(this.paginaLogo(sez)); @@ -259,13 +268,13 @@ export class Finale { this.pannelloUscita.mostrata(this.visibile && this.sezione === 'esporta'); const esporta = h('div', { class: 'fin-esporta' }, this.pannelloUscita.el, - sez('Altri file', 'cartella', + h('details', { class: 'fin-altri-file' }, h('summary', null, 'Altri file'), h('div', { class: 'fin-altri' }, h('button', { class: 'btn piccolo', title: 'La lista di montaggio per Resolve, Avid, Premiere, EDIUS', on: { click: () => esportaEdl() } }, 'EDL CMX3600'), h('button', { class: 'btn piccolo', title: 'Il fotogramma sotto il cursore, con il colore finale', on: { click: () => esportaFotogramma() } }, 'Fotogramma PNG'), h('button', { class: 'btn piccolo', title: 'I sottotitoli in un file a parte', on: { click: () => void this.esportaSrt() } }, 'Sottotitoli .srt'), h('button', { class: 'btn piccolo', title: 'I sottotitoli in un file a parte, per il web (WebVTT)', on: { click: () => void this.esportaSrt('vtt') } }, 'Sottotitoli .vtt')), - h('p', { class: 'nota' }, 'Nel master escono anche il logo e i sottotitoli (se sono "scritti nel video"), gli FX sulle clip (coi loro suoni) e il colore finale.'))); + aiutoFinale('Nel master escono anche il logo e i sottotitoli (se sono "scritti nel video"), gli FX sulle clip (coi loro suoni) e il colore finale.'))); return pagina(esporta); } @@ -306,7 +315,7 @@ export class Finale { stile('Dove', [['basso', 'In basso'], ['alto', 'In alto']], () => (s().alto ? 'alto' : 'basso'), (x, v) => { x.alto = v === 'alto'; }), stile('Fascia', [['si', 'Con la fascia'], ['no', 'Solo il testo']], () => (s().fascia ? 'si' : 'no'), (x, v) => { x.fascia = v === 'si'; })), sez('Le righe', 'titolo', this.listaSott, - h('p', { class: 'nota' }, 'Clic sul tempo per andarci. Le righe vuote non si vedono. La riga sotto il cursore è evidenziata.')), + aiutoFinale('Clic sul tempo per andarci. Le righe vuote non si vedono. La riga sotto il cursore è evidenziata.')), ]; } @@ -323,7 +332,7 @@ export class Finale { } this.firmaSott = firma; if (!righe.length) { - this.listaSott.replaceChildren(h('p', { class: 'nota' }, 'Nessuna riga. Premi "Prepara i tempi dai dialoghi": le righe vuote compaiono dove si parla. Oppure "+ Riga al cursore", o importa un .srt.')); + this.listaSott.replaceChildren(h('p', { class: 'nota' }, 'Nessuna riga. Aggiungi una riga o importa i sottotitoli.')); return; } const r = fps(p.rate); @@ -378,7 +387,7 @@ export class Finale { return h('div', { class: 'fin-scelte' }, h('span', null, nome), h('div', { class: 'isp-chips' }, bott)); }; const lavoro = new BarraLavoro('Sottotitoli con l\'AI', 'ai', () => { this.lavoroAI?.abort(); fermaVoce(); }); - const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'sottotitoli', on: { click: () => void this.scriviConAI(lavoro, vai, ferma) } }, '✨ Scrivi i sottotitoli con l\'AI'); + const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'sottotitoli', on: { click: () => void this.scriviConAI(lavoro, vai, ferma) } }, '✨ Trascrivi'); const ferma = h('button', { class: 'btn-mini', style: 'display:none', on: { click: () => { this.lavoroAI?.abort(); fermaVoce(); } } }, '■ Ferma'); const nemotron = () => this.motoreAI() === 'nemotron'; const motore = scelta('Ascolta con', [ @@ -417,7 +426,7 @@ export class Finale { h('div', { class: 'isp-pulsanti' }, vai, ferma), ...lavoro.elementi, avanzate, - nota, + h('details', { class: 'fin-aiuto' }, h('summary', { 'aria-label': 'Informazioni' }, 'i'), nota), ]; salva(); return out; @@ -487,7 +496,7 @@ export class Finale { }; const lavoro = new BarraLavoro('Voce AI dai sottotitoli', 'ai', () => this.lavoroVoce?.abort()); const ferma = h('button', { class: 'btn-mini', style: 'display:none', on: { click: () => this.lavoroVoce?.abort() } }, '■ Ferma'); - const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'voce', title: 'Legge i sottotitoli con la voce scelta e mette il risultato su una traccia audio nuova', on: { click: () => void this.faiParlare(lavoro, vai, ferma) } }, '🗣 Fai parlare i sottotitoli'); + const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'voce', title: 'Legge i sottotitoli con la voce scelta e mette il risultato su una traccia audio nuova', on: { click: () => void this.faiParlare(lavoro, vai, ferma) } }, '🗣 Crea voce'); const silenzia = h('input', { type: 'checkbox' }) as HTMLInputElement; silenzia.addEventListener('change', () => { this.voce.silenzia = silenzia.checked; salva(); }); sinc.push(() => { silenzia.checked = this.voce.silenzia; }); @@ -620,7 +629,7 @@ export class Finale { h('div', { class: 'fin-scelte' }, h('span', null, 'Angolo'), h('div', { class: 'isp-chips' }, bott)), this.cursore('Grandezza', 4, 40, (m) => Math.round((m.logo?.scala ?? 0.12) * 100), (m, v) => { if (m.logo) m.logo.scala = v / 100; }, '%'), this.cursore('Opacità', 10, 100, (m) => Math.round((m.logo?.opacita ?? 0.85) * 100), (m, v) => { if (m.logo) m.logo.opacita = v / 100; }, '%'), - h('p', { class: 'nota' }, 'Un PNG con lo sfondo trasparente è l\'ideale. Il logo sta sopra a tutto, non prende il colore finale ed esce nel master.')); + aiutoFinale('Un PNG con lo sfondo trasparente è l\'ideale. Il logo sta sopra a tutto, non prende il colore finale ed esce nel master.')); } // ——— apertura e chiusura ——— @@ -636,21 +645,21 @@ export class Finale { const r = () => fps(store.doc.rate); return [ sez('Una clip all\'inizio o alla fine', 'apertura', - h('div', { class: 'fin-scelte' }, h('span', null, 'Clip'), scelta), + h('div', { class: 'fin-scelte' }, h('span', null, 'Clip scelta'), scelta), h('div', { class: 'isp-pulsanti' }, h('button', { class: 'btn-mini', title: 'Entra all\'inizio e sposta avanti tutto il montaggio', on: { click: () => this.clipAgliEstremi(scelta.value, 'inizio') } }, '⇤ Metti all\'inizio'), h('button', { class: 'btn-mini', on: { click: () => this.clipAgliEstremi(scelta.value, 'fine') } }, 'Metti alla fine ⇥')), - h('p', { class: 'nota' }, 'La sigla, il logo animato, lo sponsor: una piccola clip prima o dopo. Se ha segnati attacco e stacco, entra solo quel pezzo.')), + aiutoFinale('La sigla, il logo animato, lo sponsor: una piccola clip prima o dopo. Se ha segnati attacco e stacco, entra solo quel pezzo.')), sez('Titoli', 'titolo', h('div', { class: 'isp-pulsanti' }, h('button', { class: 'btn-mini', title: 'Tre secondi col nome del progetto, all\'inizio (il resto scorre avanti)', on: { click: () => this.titoloApertura() } }, 'Titolo d\'apertura'), h('button', { class: 'btn-mini', title: 'Il rullo dei titoli di coda alla fine', on: { click: () => this.titoliCoda() } }, 'Titoli di coda')), - h('p', { class: 'nota' }, 'Il testo si cambia dalle proprietà del titolo (pagina Montaggio).')), + aiutoFinale('Il testo si cambia dalle proprietà del titolo (pagina Montaggio).')), sez('Dal nero e al nero', 'effetti', h('div', { class: 'isp-pulsanti' }, h('button', { class: 'btn-mini', title: 'Un secondo: l\'immagine esce dal nero e l\'audio sale', on: { click: () => this.estremiNero('inizio', Math.round(r())) } }, 'Entra dal nero'), h('button', { class: 'btn-mini', title: 'Un secondo e mezzo: l\'immagine va nel nero e l\'audio scende', on: { click: () => this.estremiNero('fine', Math.round(r() * 1.5)) } }, 'Chiudi nel nero')), - h('p', { class: 'nota' }, 'Mette i blocchetti "Dal nero" e "Al nero" sulla traccia video più in alto e sfuma l\'audio: li puoi allungare dalla timeline.')), + aiutoFinale('Mette i blocchetti "Dal nero" e "Al nero" sulla traccia video più in alto e sfuma l\'audio: li puoi allungare dalla timeline.')), ]; } @@ -732,7 +741,7 @@ export class Finale { aTrad.addEventListener('change', () => { this.trad.a = aTrad.value; try { localStorage.setItem('dpv-trad', JSON.stringify(this.trad)); } catch { /* niente */ } this.campi.forEach((c) => c.aggiorna()); }); const lavoro = new BarraLavoro('Traduzione dei sottotitoli', 'ai', () => { this.lavoroTrad?.abort(); fermaTraduzione(); }); const ferma = h('button', { class: 'btn-mini', style: 'display:none', on: { click: () => { this.lavoroTrad?.abort(); fermaTraduzione(); } } }, '■ Ferma'); - const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'traduci', on: { click: () => void this.traduciSottotitoli(lavoro, vai, ferma) } }, '🌍 Traduci i sottotitoli'); + const vai = h('button', { class: 'btn primario ai-vai', 'data-ai': 'traduci', on: { click: () => void this.traduciSottotitoli(lavoro, vai, ferma) } }, '🌍 Traduci'); const nota = h('p', { class: 'nota' }); this.campi.push({ aggiorna: () => { const s = sottotitoliDi(store.doc); @@ -754,7 +763,7 @@ export class Finale { ...lavoro.elementi, nota), sez('2 · Voce', 'altoparlante', ...this.pannelloVoce()), - h('p', { class: 'nota' }, 'Tutto gira sul tuo computer: i testi e l\'audio non vanno da nessuna parte e i modelli si scaricano una volta sola. I sottotitoli e la voce possono essere in lingue diverse: se la voce parla un\'altra lingua, i testi si traducono da soli prima di leggerli.'), + aiutoFinale('Tutto gira sul tuo computer: i testi e l\'audio non vanno da nessuna parte e i modelli si scaricano una volta sola. I sottotitoli e la voce possono essere in lingue diverse: se la voce parla un\'altra lingua, i testi si traducono da soli prima di leggerli.'), ]; } diff --git a/src/ui/finaleSchede.ts b/src/ui/finaleSchede.ts new file mode 100644 index 0000000..ad7fc05 --- /dev/null +++ b/src/ui/finaleSchede.ts @@ -0,0 +1,22 @@ +// Una sezione per volta: navigazione sempre visibile, contenuti lunghi nella lista interna. +import { h } from './dom'; + +export function schedeFinale(pannelli: HTMLElement[], nomi?: string[], iniziale = 0, cambiata?: (i: number) => void) { + const corpo = h('div', { class: 'fin-schede-corpo' }, ...pannelli); + const nav = h('nav', { class: 'fin-schede-nav', 'aria-label': 'Sezioni del pannello' }); + const scegli = (i: number) => { + pannelli.forEach((p, n) => { p.hidden = n !== i; }); + nav.querySelectorAll('button').forEach((b, n) => b.setAttribute('aria-pressed', String(n === i))); + cambiata?.(i); + }; + pannelli.forEach((p, i) => nav.append(h('button', { + type: 'button', class: 'btn-mini', on: { click: () => scegli(i) }, + }, nomi?.[i] ?? p.querySelector('h4, legend')?.textContent ?? `Sezione ${i + 1}`))); + scegli(iniziale); + return h('div', { class: 'fin-schede' }, nav, corpo); +} + +/** Aiuto breve apribile anche da tastiera. Gli errori restano nei loro elementi di stato. */ +export function aiutoFinale(testo: string) { + return h('details', { class: 'fin-aiuto' }, h('summary', { 'aria-label': 'Informazioni' }, 'i'), h('p', { class: 'nota' }, testo)); +} diff --git a/src/ui/ispettore.ts b/src/ui/ispettore.ts index f0200c9..d00b7d3 100644 --- a/src/ui/ispettore.ts +++ b/src/ui/ispettore.ts @@ -10,7 +10,7 @@ import { nuovaMaschera, nomeForma } from '../core/maschereForma'; import { creaRombo, frameLocale, nomeParametro, parametriAnimabili, valoreVivo } from './keyframe'; import { clipById, end, isVideoClip, mediaOf, newClip, newTrack, nextTrackName, trackOf, FX0 } from '../core/progetto'; import { frameToTc, fps } from '../core/timecode'; -import { avviso, conferma, h, evidenzia } from './dom'; +import { avviso, conferma, dialogo, menuContesto, h, evidenzia } from './dom'; import { SCHEDE, copiaScheda, dbTesto, destinatarieDellaCopia, etichettaStato, funzioniAIPerSelezione, haProprieta, lufsStimati, lufsTesto, pesoEVram, posizioniChiavi, ripristinaScheda, schedaDaMostrare, schedaDiSezione, schedeUsabili, zoomSuiClic, zoomTesto, type Scheda } from '../core/proprieta'; import { mediaRT, PEAKS_PER_SEC, quandoPicchi } from '../media/libreria'; import { applicaZoomCursore } from '../core/zoomCursore'; @@ -74,8 +74,12 @@ export class Ispettore { private chiave = ''; private disiscrivi: (() => void)[] = []; - /** il pannello «Banco» a destra (schede QUADRO / COLORE / AUDIO / AI); l'editor della clip (`completo`) tiene l'elenco lungo di sempre */ + /** il pannello «Banco» a destra (schede QUADRO / COLORE / AUDIO / AI); l'editor della clip (`completo`) usa la navigazione laterale */ private banco: boolean; + private editorSezione = 'quadro'; + private editorGruppo = ''; + private aiFiltro = 'video'; + private aiPagina = 0; /** la scheda aperta (si ricorda anche fra una sessione e l'altra) */ private scheda: Scheda = leggiScheda(); private navi: HTMLElement | null = null; @@ -137,7 +141,8 @@ export class Ispettore { const tr = blocchi[0].fxb?.tipo === 'transizione'; const parti = this.conOrdine(tr ? 'blocco:transizione' : 'blocco:effetto', this.blocchi(blocchi)); // nel pannello Banco anche i blocchetti FX hanno il loro corpo che scorre - this.corpo.replaceChildren(...(this.banco ? [h('div', { class: 'pp-scroll' }, h('div', { class: 'pp-pannello', 'data-chiave': tr ? 'blocco:transizione' : 'blocco:effetto' }, ...parti))] : parti)); + this.corpo.replaceChildren(...(this.banco ? [h('div', { class: 'pp-scroll' }, h('div', { class: 'pp-pannello', 'data-chiave': tr ? 'blocco:transizione' : 'blocco:effetto' }, ...parti))] : [])); + if (this.completo) this.montaEditor(parti); return; } const video = cs.filter(isVideoClip); @@ -190,10 +195,10 @@ export class Ispettore { const pronte = h('div', { class: 'pp-griglia' }, posizioniPronte().map((x) => h('button', { class: 'pp-tessera', title: x.titolo, on: { click: () => store.edit(x.nome, () => { for (const c of vive()) { c.tf = x.fn(c); c.tfFine = undefined; c.via = undefined; togliAnimazione(c, 'tf.x', 'tf.y', 'tf.scale', 'tf.sx', 'tf.rot'); } }) }, - }, disegnino(x.box), h('span', null, x.nome)))); + }, disegnino(x.box), h('span', null, this.completo ? ({ 'In alto a sinistra': 'Alto sx', 'In alto a destra': 'Alto dx', 'In basso a sinistra': 'Basso sx', 'In basso a destra': 'Basso dx' }[x.nome] ?? x.nome) : x.nome)))); const opacita = this.cursore('Opacità', 0, 100, 1, (c) => Math.round(c.opacity * 100), (c, v) => { c.opacity = v / 100; c.opKeys = []; }, '%', video, 'opacity'); const notaOpacita = video.some((c) => c.opKeys.length) ? h('p', { class: 'nota' }, 'Questa clip ha una linea elastica: la trasparenza cambia nel tempo. Muovere l\'opacità la toglie.') : null; - out.push(this.gruppo('immagine', this.completo ? 'Posizione e movimento' : 'Posizioni e movimento', [ + out.push(this.gruppo('immagine', this.completo ? 'Posizione' : 'Posizioni e movimento', [ h('label', { class: 'etichetta' }, 'Posizioni pronte'), pronte, this.completo ? opacita : null, h('div', { class: 'isp-riga col' }, h('label', null, 'Movimento', h('small', null, 'la clip si sposta o si ingrandisce da sola durante la ripresa')), @@ -337,7 +342,7 @@ export class Ispettore { this.montaBanco({ cs, primo, m, tipo, legate, out, video, audio, sonore, conAudio: !!conAudio, preparazioni, bQuadro, bColore, bAudio, chiaveClip }); return; } - this.corpo.replaceChildren(...this.conOrdine('clip:' + chiaveClip, out)); + this.montaEditor(out); } /** gli effetti rapidi dell'audio: tessere con un disegnino del suono (si animano al passaggio), le due AI per la voce e gli effetti sul filtro */ @@ -888,7 +893,7 @@ export class Ispettore { quadro: [...sezioni.quadro.filter(inCima), ...dentro(x.bQuadro), ...sezioni.quadro.filter((e) => !inCima(e))], colore: [...dentro(x.bColore), ...sezioni.colore], audio: [...sezioni.audio.filter(inCima), ...dentro(x.bAudio), ...sezioni.audio.filter((e) => !inCima(e))], - ai: [...(x.cs.some((c) => c.media) ? [x.preparazioni] : []), ...this.elencoAI({ video: x.video.length, audio: x.audio.length, conAudio: x.conAudio || x.sonore.length > 0 }), ...sezioni.ai], + ai: this.elencoAI({ video: x.video.length, audio: x.audio.length, conAudio: x.conAudio || x.sonore.length > 0 }), }; const pannelli: HTMLElement[] = []; this.pannelli.clear(); @@ -943,10 +948,10 @@ export class Ispettore { const c = store.doc.clips.find((x) => x.id === primo.id); if (!c) return; const p = store.doc; - const tc = frameToTc(c.len, p.rate, p.drop); + dati.textContent = (m && m.type !== 'audio' && m.width - ? [`${m.width}×${m.height}`, m.fps ? `${Math.round(m.fps * 100) / 100} fps` : '', tc] - : [tipo, trackOf(p, c.track).name, tc]).filter(Boolean).join(' · '); + ? [tipo, (c.len / r).toFixed(2).replace('.', ',') + ' s'] + : [tipo, (c.len / r).toFixed(2).replace('.', ',') + ' s']).filter(Boolean).join(' · '); da.textContent = frameToTc(c.start, p.rate, p.drop); dura.textContent = (c.len / r).toFixed(2).replace('.', ',') + ' s'; }; @@ -959,17 +964,11 @@ export class Ispettore { class: 'isp-nome', value: cs.length > 1 ? `${cs.length} clip scelte` : primo.name, disabled: cs.length > 1, 'aria-label': 'Nome della clip', on: { change: (e: Event) => store.edit('Rinomina clip', () => { for (const c of this.sel()) c.name = (e.target as HTMLInputElement).value; }) }, }), - dati)), - h('div', { class: 'isp-riassunto' }, - h('span', { class: 'chip-tipo' }, tipo), - h('span', null, 'da ', da), - h('span', null, 'dura ', dura), - legate ? h('span', { class: 'chip-link' }, `⛓ +${legate}`) : null, - m ? h('span', { class: 'isp-sorgente' }, m.name) : null), + dati), h('button', { type: 'button', class: 'pp-mini-btn pp-info', 'aria-label': 'Dati clip', on: { click: () => { const d = dialogo('Dati clip'); d.corpo.append(h('p', null, primo.name), h('p', { class: 'pp-dati' }, [m?.name, m?.path, m?.width ? `${m.width}×${m.height}` : '', m?.fps ? `${m.fps} fps` : '', `Inizio ${da.textContent}`, `Durata ${dura.textContent}`].filter(Boolean).join(' · '))); } } }, 'i')), h('div', { class: 'isp-azioni pp-azioni' }, h('button', { type: 'button', class: 'pp-mini-btn', title: 'Una copia subito dopo (Ctrl+D)', on: { click: () => esegui('duplica') } }, '⧉ Duplica'), h('button', { type: 'button', class: 'pp-mini-btn', title: 'Porta il cursore all\'inizio della clip', on: { click: () => { motore.setMonitor('recorder'); motore.vaiA(primo.start); } } }, '⇤ All\'inizio'), - h('button', { type: 'button', class: 'pp-mini-btn', title: 'Toglie la clip (2)', on: { click: () => esegui('elimina') } }, '🗑 Elimina'))); + h('button', { type: 'button', class: 'pp-mini-btn pp-menu', 'aria-label': 'Altre azioni clip', on: { click: (e: Event) => { const b = (e.currentTarget as HTMLElement).getBoundingClientRect(); menuContesto(b.left, b.bottom, [{ nome: 'ⓘ Dati clip', fn: () => { const d = dialogo('Dati clip'); d.corpo.append(h('p', null, primo.name), h('p', { class: 'pp-dati' }, [m?.name, m?.path, m?.width ? `${m.width}×${m.height}` : '', m?.fps ? `${m.fps} fps` : '', `Inizio ${da.textContent}`, `Durata ${dura.textContent}`, legate ? `${legate} clip legate` : ''].filter(Boolean).join(' · '))); } }, { nome: 'Modifica clip', fn: () => { void import('./editorClip').then((x) => x.apriEditorClip(primo.id)); } }, { nome: 'Elimina', fn: () => esegui('elimina') }]); } } }, '⋯'))); this.campi.push({ el: testa, aggiorna: agg }); return testa; } @@ -1240,28 +1239,122 @@ export class Ispettore { return el; } + /** Il popup riusa gli stessi campi: cambia soltanto la navigazione. */ + private montaEditor(out: HTMLElement[]) { + const quadro = out.find((e) => e.dataset.g === 'immagine'); + const movimento = quadro?.querySelector('.isp-riga.col:has(.mv-prev)'); + if (movimento) out.push(this.gruppo('editor-movimento', 'Movimento', [movimento])); + const numeri = quadro?.querySelector('.pp-piu'); + if (numeri) out.push(this.gruppo('editor-coordinate', 'Coordinate', [...numeri.children].filter((e) => e.tagName !== 'SUMMARY') as HTMLElement[])); + numeri?.remove(); + for (const [origine, id, nome] of [['sfondo', 'editor-qualita', 'Qualità AI'], ['segui', 'editor-tracking', 'Tracking']]) { + const g = out.find((e) => e.dataset.g === origine); + const dettagli = [...(g?.querySelectorAll(':scope > .pp-piu') ?? [])]; + if (dettagli.length) out.push(this.gruppo(id, nome, dettagli)); + } + const categorie: [string, string, string, string[]][] = [ + ['quadro', '▣', 'Quadro', ['immagine', 'titolo', 'animazione', 'generatore']], + ['movimento', '↗', 'Movimento', ['editor-movimento']], + ['effetti', '✦', 'Effetti', ['fxv', 'btipo']], + ['colore', '◐', 'Colore', ['colore']], + ['audio', '♪', 'Audio', ['audio', 'fxa', 'ducking', 'csuono', 'bsuono']], + ['ai', '✧', 'AI', ['sfondo', 'segui', 'audioai']], + ['tempo', '◷', 'Tempo', ['durata', 'trclip', 'bdurata']], + ['avanzate', '⚙', 'Avanzate', ['editor-coordinate', 'editor-qualita', 'editor-tracking', 'anim', 'maschere', 'ritaglio']], + ]; + for (const g of out) { + for (const nota of g.querySelectorAll(':scope > p.nota')) { + if (!['immagine', 'anim', 'maschere', 'ritaglio', 'editor-coordinate'].includes(g.dataset.g ?? '') || nota.textContent!.length < 100 || nota.classList.contains('avviso-rosso') || nota.classList.contains('ok')) continue; + const testo = nota.textContent!; + const aiuto = h('button', { type: 'button', class: 'pp-mini-btn ec-aiuto', 'aria-label': 'Aiuto: ' + (g.querySelector('summary')?.textContent ?? 'Clip'), on: { click: () => { const d = dialogo('Come funziona'); d.corpo.append(h('p', null, testo)); d.piede.append(h('button', { class: 'btn', on: { click: () => d.chiudi() } }, 'Chiudi')); } } }, 'ⓘ Aiuto'); + nota.replaceWith(aiuto); + } + } + for (const g of out.filter((e) => e.dataset.g)) { + const campi = [...g.children].filter((e) => e.tagName !== 'SUMMARY'); + g.append(h('div', { class: 'ec-campi' }, ...campi as HTMLElement[])); + } + const nav = h('nav', { class: 'ec-nav', 'aria-label': 'Sezioni clip' }); + const area = h('div', { class: 'ec-area' }); + const disponibili = categorie.filter(([, , , ids]) => out.some((e) => ids.includes(e.dataset.g ?? ''))); + if (!disponibili.some(([id]) => id === this.editorSezione)) this.editorSezione = disponibili[0]?.[0] ?? 'quadro'; + const mostra = (id: string) => { + this.editorSezione = id; + nav.querySelectorAll('button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.sezione === id))); + const cat = disponibili.find(([k]) => k === id)!; + const gruppi = out.filter((e) => cat[3].includes(e.dataset.g ?? '')) as HTMLDetailsElement[]; + const scelte = h('div', { class: 'ec-scelte' }); + const contenuto = h('div', { class: 'ec-contenuto' }); + const apri = (g: HTMLDetailsElement) => { + this.editorGruppo = g.dataset.g!; + for (const x of gruppi) { x.hidden = x !== g; x.open = true; } + scelte.querySelectorAll('button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.gruppo === g.dataset.g))); + contenuto.scrollTop = 0; + }; + for (const g of gruppi) { + scelte.append(h('button', { class: 'pp-mini-btn', 'data-gruppo': g.dataset.g, on: { click: () => apri(g) } }, g.querySelector('summary')?.childNodes[0]?.textContent ?? 'Controlli')); + contenuto.append(g); + } + const avanzate = h('button', { class: 'pp-mini-btn', on: { click: () => mostra('avanzate') } }, '⚙ Avanzate'); + area.replaceChildren(h('div', { class: 'ec-titolo' }, h('h2', null, cat[2]), ...(id !== 'avanzate' && disponibili.some(([k]) => k === 'avanzate') ? [avanzate] : [])), ...(gruppi.length > 1 ? [scelte] : []), contenuto); + apri(gruppi.find((g) => g.dataset.g === this.editorGruppo) ?? gruppi[0]); + }; + for (const [id, ico, nome] of disponibili) nav.append(h('button', { type: 'button', 'data-sezione': id, on: { click: () => mostra(id) } }, h('span', { 'aria-hidden': 'true' }, ico), nome)); + this.corpo.replaceChildren(nav, area); + mostra(this.editorSezione); + } + // ——— AI ——— /** l'elenco delle funzioni AI del registro (src/core/funzioniAI.ts): nome, che cosa fa, PRONTA / OPZIONALE / SPERIMENTALE, peso e VRAM */ private elencoAI(s: { video: number; audio: number; conAudio: boolean }): HTMLElement[] { - const { clip, audio } = funzioniAIPerSelezione(s); + const funzioni = funzioniAIPerSelezione(s); + const clip = s.video ? funzioni.clip : [], audio = funzioni.audio; + const elenco = h('div', { class: 'pp-ai-elenco' }); + const pagine = h('span', { class: 'pp-dati', 'aria-live': 'polite' }); + const filtri = h('div', { class: 'pp-ai-filtri', role: 'group', 'aria-label': 'Tipo funzione AI' }); + const info = (f: FunzioneAI) => { + const d = dialogo(f.nome); + d.corpo.append(h('p', null, f.descrizione), h('p', { class: 'pp-dati' }, pesoEVram(f)), h('p', null, f.motore === 'locale' ? 'Richiede il motore AI locale.' : 'Lavora nel browser dell’app.')); + d.piede.append(h('button', { class: 'btn', on: { click: () => d.chiudi() } }, 'Chiudi')); + }; const voce = (f: FunzioneAI) => { - const et = etichettaStato(f.stato), peso = pesoEVram(f); - return h('button', { type: 'button', class: 'pp-ai', 'data-ai': f.id, 'data-stato': f.stato, title: f.descrizione, on: { click: (e: Event) => void this.eseguiAI(f, e.currentTarget as HTMLButtonElement) } }, - h('span', { class: 'pp-ai-testo' }, - h('b', null, f.nome), - h('small', null, f.descrizione), - peso || f.motore === 'locale' ? h('small', { class: 'pp-ai-peso' }, [peso, f.motore === 'locale' ? 'MOTORE LOCALE' : ''].filter(Boolean).join(' · ')) : null), - h('span', { class: 'pp-ai-stato', style: `color:${et.colore}` }, et.testo)); + const et = etichettaStato(f.stato); + const nomi: Record = { clear: 'Voce da podcast', 'voce-pulita': 'Voce pulita locale', 'voce-musica': 'Voce e musica' }; + const pesi = [...(f.peso ?? '').matchAll(/(\d+(?:[.,]\d+)?)\s*(MB|GB)/g)]; + const peso = f.id === 'rumore' ? 'da 9 MB' : pesi.length ? `${pesi[0][1]} ${pesi[0][2]}` : 'Integrata'; + const azione = h('button', { type: 'button', class: 'pp-mini-btn pp-ai-vai', title: f.descrizione, on: { click: () => void this.eseguiAI(f, azione as HTMLButtonElement) } }, f.id === 'rumore' ? '✦ Pulisci' : f.id === 'separa' ? '⑂ Separa' : '↗ Apri'); + return h('article', { class: 'pp-ai', 'data-ai': f.id, 'data-stato': f.stato }, + h('div', { class: 'pp-ai-testa' }, h('b', { title: f.nome }, nomi[f.id] ?? f.nome), h('span', { class: 'pp-ai-stato', style: `color:${et.colore}` }, '● ' + et.testo)), + h('div', { class: 'pp-ai-comandi' }, h('span', { class: 'pp-ai-peso' }, peso), + h('button', { type: 'button', class: 'pp-mini-btn pp-info', 'aria-label': 'Informazioni: ' + f.nome, on: { click: () => info(f) } }, 'i'), azione, + h('button', { type: 'button', class: 'pp-mini-btn pp-info', 'aria-label': 'Opzioni: ' + f.nome, on: { click: (e: Event) => { const b = (e.currentTarget as HTMLElement).getBoundingClientRect(); menuContesto(b.left, b.bottom, [{ nome: 'Dettagli', fn: () => info(f) }, { nome: 'Centro AI', fn: () => document.dispatchEvent(new CustomEvent('dpv:centro-ai')) }]); } } }, '⋯'))); }; - const out: HTMLElement[] = []; - if (clip.length) out.push(h('div', { class: 'pp-inciso' }, 'SULLA CLIP'), h('div', { class: 'pp-ai-elenco' }, clip.map(voce))); - if (audio.length) out.push(h('div', { class: 'pp-inciso' }, 'SULL\'AUDIO'), h('div', { class: 'pp-ai-elenco' }, audio.map(voce))); - if (!clip.length && !audio.length) out.push(h('p', { class: 'nota' }, 'Le funzioni AI per questa clip compaiono qui, con quanto pesano e quanta memoria della scheda video chiedono. Intanto trovi qui sotto lo sfondo e, nella scheda AUDIO, la pulizia della voce.')); - out.push(h('button', { type: 'button', class: 'pp-mini-btn pp-centro-ai', title: 'Tutte le funzioni intelligenti, come si usano e se sono pronte', on: { click: () => document.dispatchEvent(new CustomEvent('dpv:centro-ai')) } }, '✨ Apri il Centro AI')); + const aggiorna = () => { + const lista = this.aiFiltro === 'audio' ? audio : clip; + const n = Math.max(1, Math.ceil(lista.length / 4)); + this.aiPagina = Math.max(0, Math.min(this.aiPagina, n - 1)); + elenco.replaceChildren(...lista.slice(this.aiPagina * 4, this.aiPagina * 4 + 4).map(voce)); + if (!lista.length) elenco.append(h('p', { class: 'nota' }, 'Nessuna funzione per questa selezione.')); + pagine.textContent = `${this.aiPagina + 1} / ${n}`; + prima.disabled = this.aiPagina === 0; dopo.disabled = this.aiPagina >= n - 1; + filtri.querySelectorAll('button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.filtro === this.aiFiltro))); + }; + if (!audio.length) this.aiFiltro = 'video'; + else if (!clip.length) this.aiFiltro = 'audio'; + for (const [id, nome] of [['video', 'Video'], ['audio', 'Audio']]) filtri.append(h('button', { type: 'button', class: 'pp-mini-btn', 'data-filtro': id, disabled: id === 'audio' ? !audio.length : !clip.length, on: { click: () => { this.aiFiltro = id; this.aiPagina = 0; aggiorna(); } } }, nome)); + const prima = h('button', { class: 'pp-mini-btn', 'aria-label': 'Funzioni precedenti', on: { click: () => { this.aiPagina--; aggiorna(); } } }, '‹') as HTMLButtonElement; + const dopo = h('button', { class: 'pp-mini-btn', 'aria-label': 'Funzioni successive', on: { click: () => { this.aiPagina++; aggiorna(); } } }, '›') as HTMLButtonElement; + aggiorna(); + const out = [filtri, elenco, h('div', { class: 'pp-ai-pagine' }, prima, pagine, dopo), h('button', { type: 'button', class: 'pp-grande pp-centro-ai', on: { click: () => document.dispatchEvent(new CustomEvent('dpv:centro-ai')) } }, '✦ Centro AI')]; return out; } private async eseguiAI(f: FunzioneAI, tasto?: HTMLButtonElement) { + const sezioni: Record = { sfondo: 'sfondo', segui: 'segui' }; + if (sezioni[f.id] && this.sel().length) { + const c = this.sel().find(isVideoClip) ?? this.sel()[0]; + const { apriEditorClip } = await import('./editorClip'); apriEditorClip(c.id, sezioni[f.id]); return; + } if (!f.esegui) { document.dispatchEvent(new CustomEvent('dpv:centro-ai')); return; } // un lavoro alla volta per tasto: un secondo clic non lo fa partire due volte if (tasto?.disabled) return; @@ -1275,12 +1368,23 @@ export class Ispettore { * false se per la clip scelta quella sezione non c'è (per esempio "Togli lo sfondo" su una clip audio). */ apriSezione(id: string): boolean { + if (this.completo) { + const mappa: Record = { immagine: 'quadro', titolo: 'quadro', animazione: 'quadro', generatore: 'quadro', 'editor-movimento': 'movimento', fxv: 'effetti', btipo: 'effetti', colore: 'colore', audio: 'audio', fxa: 'audio', ducking: 'audio', csuono: 'audio', bsuono: 'audio', sfondo: 'ai', segui: 'ai', audioai: 'ai', durata: 'tempo', trclip: 'tempo', bdurata: 'tempo' }; + this.editorSezione = mappa[id] ?? 'avanzate'; this.editorGruppo = id; + } this.aperti.add(id); this.chiusi.delete(id); this.firma = ''; this.costruisci(); const el = this.corpo.querySelector(`.isp-gruppo[data-g="${id}"]`) as HTMLDetailsElement | null; - if (!el) return false; + if (!el) { + if (this.banco && ['sfondo', 'segui', 'audioai'].includes(id) && this.sel().length) { + const clipId = this.sel()[0].id; + void import('./editorClip').then((x) => x.apriEditorClip(clipId, id)); + return true; + } + return false; + } const scheda = el.closest('.pp-pannello')?.dataset.scheda as Scheda | undefined; if (scheda) this.mostraScheda(scheda, true); el.open = true; diff --git a/test/prove-aiuto.mjs b/test/prove-aiuto.mjs index c035b92..eebfdd5 100644 --- a/test/prove-aiuto.mjs +++ b/test/prove-aiuto.mjs @@ -112,13 +112,12 @@ export async function proveAiuto({ page: paginaDi, prova }) { await page.click('.btn-ai'); await page.waitForSelector('.dialogo.centro-ai'); const righe = await page.$$eval('.hub-riga', (c) => c.map((x) => x.dataset.m)); - prova('il Centro AI è l\'elenco dei modelli (sfondo, sottotitoli, rumori, voce e base), non più le schede delle funzioni', ['sam3', 'whisper-base', 'rumore', 'separa'].every((k) => righe.includes(k)) && !righe.some((k) => ['ben2', 'modnet', 'birefnet', 'sam2', 'slimsam'].includes(k)) && (await page.$$('.ai-carta')).length === 0, JSON.stringify(righe)); + prova('il Centro AI conserva i modelli e mostra le funzioni', ['sam3', 'whisper-base', 'rumore', 'separa'].every((k) => righe.includes(k)) && !righe.some((k) => ['ben2', 'modnet', 'birefnet', 'sam2', 'slimsam'].includes(k)) && (await page.$$('.ai-carta')).length === 0, JSON.stringify(righe)); prova('niente "Cosa vuoi fare" né "Clip esplicita"', (await page.$$('select[aria-label="Cosa vuoi fare"], select[aria-label="Clip su cui usare AI"]')).length === 0); await page.waitForFunction(() => [...document.querySelectorAll('.hub-riga')].every((x) => x.dataset.stato), null, { timeout: 15000 }); const stati = await page.$$eval('.hub-riga', (c) => c.map((x) => x.dataset.stato)); prova('ogni modello dice com\'è messo (pronto, da completare o da scaricare) e ha i suoi pulsanti', stati.length === righe.length && stati.every((x) => ['pronto', 'parziale', 'da-scaricare'].includes(x)) && (await page.$$('.hub-riga button')).length === righe.length * 2, JSON.stringify(stati)); - await page.evaluate(() => { document.querySelector('.centro-ai details').open = true; }); - await page.click('.ai-controlla'); + await page.click('.ai-ripara'); await page.waitForFunction(() => document.querySelectorAll('.ai-diag').length >= 4, null, { timeout: 90000 }); const diag = await page.$$eval('.ai-diag', (d) => d.map((x) => ({ ok: x.className, t: x.textContent }))); const motore = diag.find((x) => /Motore AI/.test(x.t)); diff --git a/test/prove-banco-clip.mjs b/test/prove-banco-clip.mjs new file mode 100644 index 0000000..6151469 --- /dev/null +++ b/test/prove-banco-clip.mjs @@ -0,0 +1,70 @@ +import { chromium } from 'playwright'; +import { mkdirSync } from 'node:fs'; +import assert from 'node:assert/strict'; +const browser = await chromium.launch(); +const errors = []; +const out = 'test/.out/banco-clip'; mkdirSync(out, { recursive: true }); +try { + const page = await browser.newPage(); page.setDefaultTimeout(10000); page.on('pageerror', e => errors.push(e.message)); + await page.goto(process.env.DPV_URL ?? 'http://127.0.0.1:4173/app/'); + await page.waitForSelector('.pulsantiera'); await page.addStyleTag({content:'*,*::before,*::after { animation: none !important; transition: none !important; }'}); + await page.evaluate(() => { + const { P } = window.__dpvTest, s = window.__dpv; + const p = P.newProject({w:1920,h:1080,rate:{num:25,den:1},drop:false}); + const v = P.newClip('bars',p.tracks.find(t=>t.kind==='video').id,0,250,{name:'Ripresa di prova',gen:{bars:'smpte'}}); + const a = P.newClip('tone',p.tracks.find(t=>t.kind==='audio').id,0,250,{name:'Audio di prova',gen:{tone:440}}); + v.link = a.link = 'prova'; p.clips.push(v,a); s.load(p); s.select([v.id,a.id]); + document.getElementById('app').classList.remove('senza-lato','stretto'); + document.dispatchEvent(new CustomEvent('dpv:proprieta')); + }); + await page.waitForTimeout(1000); + const cdp = await page.context().newCDPSession(page); + for (const [w,h,dpr] of [[1920,1080,1],[2560,1440,1],[2560,1440,1.5],[1920,1080,2]]) { + await cdp.send('Emulation.setDeviceMetricsOverride',{width:w,height:h,deviceScaleFactor:dpr,mobile:false}); + await page.setViewportSize({width:w,height:h}); + await page.evaluate(()=>document.querySelector('.pp-scheda[data-scheda=ai]').click()); + await page.locator('.pp-ai-filtri [data-filtro=audio]').click(); + for(const width of [280,384]) { + await page.evaluate(width=>document.getElementById('app').style.setProperty('--lato',width+'px'),width); + await page.waitForTimeout(100); + const ai = await page.locator('.ispettore.banco').evaluate(el=>({ + cards:el.querySelectorAll('.pp-ai').length, + overflow:el.scrollWidth>el.clientWidth, + inner:el.querySelector('.pp-scroll').scrollHeight>el.querySelector('.pp-scroll').clientHeight, + head:el.querySelector('.pp-testa').getBoundingClientRect().height, + font:getComputedStyle(el.querySelector('.pp-ai-peso')).fontFamily + })); + assert.equal(ai.cards,4); assert.equal(ai.overflow,false); assert.equal(ai.inner,false); assert.ok(ai.head<=88); assert.ok(ai.font.includes('Share Tech Mono')); + console.log('AI',w,h,width,ai); + } + if(process.env.DPV_FOTO) { await page.mouse.move(10,10); await page.screenshot({scale:'css',animations:'disabled',timeout:45000,path:`${out}/proprieta-${w}-${dpr}.png`}); } + await page.evaluate(()=>document.dispatchEvent(new CustomEvent('dpv:sezione',{detail:'fxv'}))); + await page.waitForSelector('.editor-clip'); await page.waitForTimeout(200); + assert.equal(Math.round((await page.locator('.editor-clip').boundingBox()).width),1120); + for (const id of ['quadro','movimento','colore','audio','ai','tempo']) { + const btn=page.locator(`.ec-nav [data-sezione=${id}]`); if(!await btn.count())continue; + await btn.click(); + const scelte=page.locator('.ec-scelte button'); const n=await scelte.count(); + for(let i=0;i({id:el.querySelector('.isp-gruppo:not([hidden])')?.dataset.g,x:el.scrollWidth>el.clientWidth,y:el.scrollHeight>el.clientHeight})); + console.log('EDITOR',w,h,id,size); assert.equal(size.x,false); assert.equal(size.y,false); + } + if(process.env.DPV_FOTO && id==='quadro') { await page.mouse.move(10,10); await page.screenshot({scale:'css',animations:'disabled',timeout:45000,path:`${out}/editor-${id}-${w}-${dpr}.png`}); } + } + await page.locator('.ec-nav [data-sezione=quadro]').click(); + const posizione=page.locator('.ec-scelte [data-gruppo=immagine]'); if(await posizione.count()) await posizione.click(); + await page.locator('.editor-clip .pp-tessera').filter({hasText:'Piccola'}).click(); + assert.equal(await page.evaluate(()=>window.__dpv.doc.clips.find(c=>c.kind==='bars').tf.scale),0.5); + await page.keyboard.press('Control+z'); + assert.equal(await page.evaluate(()=>window.__dpv.doc.clips.find(c=>c.kind==='bars').tf.scale),1); + await page.evaluate(()=>document.dispatchEvent(new CustomEvent('dpv:sezione',{detail:'fxv'}))); + assert.equal(await page.locator('.ec-nav [data-sezione=effetti]').getAttribute('aria-pressed'),'true'); + await page.evaluate(()=>document.dispatchEvent(new CustomEvent('dpv:mira'))); await page.waitForSelector('.editor-clip',{state:'detached'}); + } + await cdp.detach(); + assert.deepEqual(errors,[]); console.log('Banco clip: OK'); +} finally { await browser.close(); } + + + diff --git a/test/prove-finale-compatto.mjs b/test/prove-finale-compatto.mjs new file mode 100644 index 0000000..ac0cb5a --- /dev/null +++ b/test/prove-finale-compatto.mjs @@ -0,0 +1,123 @@ +// Ingombri del Finale e coordinate delle curve. Usa il build, chiude sempre Chromium. +// npm run build && node test/prove-finale-compatto.mjs +import assert from 'node:assert/strict'; +import { chromium } from 'playwright'; +import { mkdirSync, writeFileSync } from 'node:fs'; +import path from 'node:path'; +import { servi } from './servi.mjs'; +const out = 'test/.out/finale-compatto'; +mkdirSync(out, { recursive: true }); +const server = process.env.DPV_URL ? null : await servi(path.resolve('dist')); +const url = process.env.DPV_URL ?? `${server.url}/app/`; +const browser = await chromium.launch({ headless: true }); +const risultati = []; +try { + // Gli ultimi due casi sono un display 3840×2160 al 150% e 200%. + for (const [width, height, dpr] of [[1920,1080,1], [2560,1440,1], [2560,1440,1.5], [1920,1080,2]]) { + const ctx = await browser.newContext({ viewport: { width, height }, deviceScaleFactor: dpr }); + try { + const page = await ctx.newPage(); + const errori = []; + page.on('pageerror', e => errori.push(e.message)); + await page.goto(url); + await page.waitForFunction(() => window.__dpvTest?.ui()); + await page.evaluate(async () => { + const { P, importaFile } = window.__dpvTest; + const tela = document.createElement('canvas'); tela.width = 960; tela.height = 540; + const ctx = tela.getContext('2d'), sfondo = ctx.createLinearGradient(0, 0, 960, 540); + sfondo.addColorStop(0, '#183c4b'); sfondo.addColorStop(1, '#ae7459'); + ctx.fillStyle = sfondo; ctx.fillRect(0, 0, 960, 540); + ctx.fillStyle = '#e8dbb5'; ctx.fillRect(180, 120, 250, 300); + ctx.fillStyle = '#264d64'; ctx.beginPath(); ctx.arc(650, 270, 140, 0, Math.PI * 2); ctx.fill(); + const blob = await new Promise(ok => tela.toBlob(ok)); + const [media] = await importaFile([{ name: 'Quadro di prova.png', file: new File([blob], 'Quadro di prova.png', { type: 'image/png' }) }], { chiediFormato: false }); + window.__dpv.edit('Ripresa di prova', p => p.clips.push(P.newClip('media', p.tracks.find(t => t.kind === 'video').id, 0, 500, { name: 'Ripresa di prova', media: media.id }))); + document.dispatchEvent(new CustomEvent('dpv:finale', { detail: 'esporta' })); + }); + await page.evaluate(() => document.fonts.ready); + const controlla = async nome => { + const r = await page.evaluate(() => { + const e = document.querySelector('.fin-corpo'), r = e.getBoundingClientRect(); + const tagliati = [...e.querySelectorAll('button, select, input')].filter(b => { + if (!b.getClientRects().length) return false; + const q = b.getBoundingClientRect(); + return q.bottom > r.bottom + 1 || q.right > r.right + 1 || q.left < r.left - 1; + }).map(b => b.textContent || b.getAttribute('aria-label')); + return { verticale: e.scrollHeight - e.clientHeight, orizzontale: e.scrollWidth - e.clientWidth, body: document.documentElement.scrollWidth - innerWidth, tagliati }; + }); + risultati.push({ width, height, dpr, nome, ...r }); + assert.ok(r.verticale <= 1 && r.orizzontale <= 1 && r.body <= 1 && !r.tagliati.length, `${nome}: ${JSON.stringify(r)}`); + }; + for (const s of ['esporta', 'colore', 'audio', 'sottotitoli', 'logo', 'apertura', 'lingue']) { + await page.click(`.fin-voce[data-s=${s}]`); + await controlla(s); + const navs = page.locator('.fin-pagina > .fin-schede > .fin-schede-nav > button'); + for (let i = 0; i < await navs.count(); i++) { await navs.nth(i).click(); await controlla(`${s}/${i}`); } + } + await page.click('.fin-voce[data-s=esporta]'); + for (const nome of ['Destinazione', 'Volume', 'Formato', 'Opzioni', 'Coda']) { + await page.locator('.es-banco .fin-schede-nav').getByRole('button', { name: nome, exact: true }).click(); + await controlla(`uscita/${nome}`); + } + assert.ok(await page.locator('.fin-piede .fin-vai').isVisible()); + await page.screenshot({ path: `${out}/uscita-${width}-${dpr}.png` }); + await page.click('.fin-voce[data-s=colore]'); + await page.locator('.fin-pagina > .fin-schede > .fin-schede-nav').getByRole('button', { name: 'Montaggio', exact: true }).click(); + for (const nome of ['Automatico', 'Look', 'Ritocchi']) { + await page.locator('.fin-pagina .fin-schede-nav:visible').getByRole('button', { name: nome, exact: true }).click(); + await controlla(`montaggio/${nome}`); + } + await page.locator('.fin-pagina > .fin-schede > .fin-schede-nav').getByRole('button', { name: 'Clip scelta', exact: true }).click(); + for (const nome of ['Look', 'Ruote', 'Curve']) { + await page.locator('.colore-avanzato .fin-schede-nav').getByRole('button', { name: nome, exact: true }).click(); + await controlla(`clip/${nome}`); + } + await page.waitForFunction(() => { const e = document.querySelector('.ca-curva'); return e.width === Math.round(e.clientWidth * devicePixelRatio); }); + const curva = await page.locator('.ca-curva').evaluate(e => ({ w: e.clientWidth, h: e.clientHeight, pixel: e.width })); + assert.ok(Math.abs(curva.w - curva.h) <= 1 && curva.w <= 360); + await page.locator('.ca-curve-strumenti').getByRole('button', { name: 'Aggiungi', exact: true }).click(); + let punti = await page.evaluate(() => { window.__dpv.flushNow(); return window.__dpv.doc.clips[0].fx.colore.curve.master; }); + assert.equal(punti.length, 3); + await page.locator('.ca-curva').waitFor({ state: 'visible' }); + const r = await page.locator('.ca-curva').evaluate(e => { const r = e.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height }; }); + await page.mouse.move(r.x + r.width / 2, r.y + r.height / 2); + await page.mouse.down(); await page.mouse.move(r.x + r.width * .35, r.y + r.height * .35); await page.mouse.up(); + punti = await page.evaluate(() => window.__dpv.doc.clips[0].fx.colore.curve.master); + assert.ok(Math.abs(punti[1].x - .35) < .01 && Math.abs(punti[1].y - .65) < .01, 'Puntatore e curva devono coincidere anche con DPR diverso'); + await page.evaluate(() => { window.__dpv.doUndo(); window.__dpv.flushNow(); }); + assert.equal(await page.evaluate(() => window.__dpv.doc.clips[0].fx.colore.curve.master[1].x), .5); + await page.locator('.ca-curve-strumenti').getByRole('button', { name: 'Togli punto', exact: true }).click(); + assert.equal(await page.evaluate(() => window.__dpv.doc.clips[0].fx.colore.curve.master.length), 2); + await page.screenshot({ path: `${out}/curve-${width}-${dpr}.png` }); + risultati.push({ width, height, dpr, curva }); + // Le altre pagine si misurano a riposo; le anteprime animate di Montage hanno prove dedicate. + await page.evaluate(() => { window.__dpv.edit('Svuota la prova', p => { p.clips = []; p.media = []; }); window.__dpv.flushNow(); }); + // Densità delle altre pagine, senza avviare registrazioni o modelli. + for (const pg of ['live', 'montage', 'montaggio']) { + await page.click(`.pagina-btn[data-p=${pg}]`); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), `${pg}: overflow orizzontale`); + if (pg === 'live') { + const delta = await page.locator('.live-comandi').evaluate(e => e.scrollHeight - e.clientHeight); + assert.ok(delta <= 1, `LIVE: scorrimento ${delta}`); + } + if (pg === 'montage') { + const passi = page.locator('.mt-vai'); + assert.equal(await passi.count(), 4); + for (let i = 0; i < 4; i++) { if (await passi.nth(i).isEnabled()) await passi.nth(i).click(); assert.ok(await passi.nth(i).isVisible()); } + assert.ok(await passi.nth(3).isDisabled(), 'Senza file il quarto passo resta visibile ma disabilitato'); + } + if (pg !== 'montaggio') await page.screenshot({ path: `${out}/${pg}-${width}-${dpr}.png` }); + } + await page.click('.btn-progetti'); + await page.waitForSelector('.home.hm', { state: 'visible' }); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); + await page.screenshot({ path: `${out}/home-${width}-${dpr}.png` }); + assert.deepEqual(errori, []); + } finally { await ctx.close(); } + } +} finally { + await browser.close(); + server?.chiudi(); + writeFileSync(`${out}/misure.json`, JSON.stringify(risultati, null, 2)); +} +console.log(`Finale: ${risultati.length} controlli passati, quattro viewport CSS/DPR; curve, trascinamento, annulla, LIVE, Montage e Home.`); diff --git a/test/prove-nuove.mjs b/test/prove-nuove.mjs index 77df2a0..02a2e1a 100644 --- a/test/prove-nuove.mjs +++ b/test/prove-nuove.mjs @@ -161,7 +161,7 @@ async function proveSfondo({ page, prova, OUT }) { await page.evaluate(() => { const c = window.__dpv.doc.clips.find((x) => x.name === 'Fondale verde'); window.__dpv.select([c.id]); window.__motore.vaiA(10); }); await page.waitForTimeout(300); // nel pannello «Banco» lo sfondo sta nella scheda AI - await page.evaluate(() => document.querySelector('.pp-scheda[data-scheda=ai]')?.click()); + await page.evaluate(() => document.dispatchEvent(new CustomEvent('dpv:sezione', { detail: 'sfondo' }))); await page.waitForTimeout(200); await apriGruppi(page); prova('nelle proprietà c\'è "Togli lo sfondo" con i quadratini dei modi (Off, Colore, Luce, AI)', (await page.locator('.isp-gruppo summary:has-text("Togli lo sfondo")').count()) === 1 && (await page.locator('.isp-gruppo[data-g=sfondo] .pp-tessera[data-modo=ai]').count()) === 1 && (await page.locator('.isp-gruppo[data-g=sfondo] .pp-tessera[data-modo]').count()) >= 4); diff --git a/test/prove-seguito.mjs b/test/prove-seguito.mjs index fff90bc..0c21af9 100644 --- a/test/prove-seguito.mjs +++ b/test/prove-seguito.mjs @@ -204,7 +204,7 @@ export async function proveSeguito({ page: paginaDi, prova, OUT }) { await page.locator('.fin-pagina[data-s=lingue] select').nth(1).selectOption('en'); await page.waitForTimeout(250); await conConfermeAI(page, async () => { - await page.locator('.fin-pagina[data-s=lingue] .ai-vai', { hasText: 'Traduci i sottotitoli' }).click(); + await page.click('[data-ai=traduci]'); await page.waitForFunction(() => window.__dpv.doc.sottotitoli.lingua === 'en', null, { timeout: 15000 }); }); const sott = await page.evaluate(() => ({ testi: window.__dpv.doc.sottotitoli.righe.map((r) => r.testo), tempi: window.__dpv.doc.sottotitoli.righe.map((r) => [r.da, r.a]) })); diff --git a/test/prove.mjs b/test/prove.mjs index 88a8171..fb5644d 100644 --- a/test/prove.mjs +++ b/test/prove.mjs @@ -273,7 +273,7 @@ try { // la durata sta nell'editor della clip (doppio clic): si apre da lì await page.evaluate(() => document.dispatchEvent(new CustomEvent('dpv:sezione', { detail: 'durata' }))); await page.waitForSelector('.editor-clip'); - await page.evaluate(() => document.querySelectorAll('.editor-clip .isp-gruppo:not([open]) > summary').forEach((x) => x.click())); + await page.click('.editor-clip .ec-nav [data-sezione=tempo]'); await page.waitForTimeout(150); await page.click('.editor-clip .isp-pulsanti button:has-text("+5 s")'); await page.keyboard.press('Escape'); @@ -708,8 +708,10 @@ try { { await page.click('.pagina-btn[data-p=finale]'); await page.waitForTimeout(500); - prova('la pagina Finale si apre col riepilogo', await page.isVisible('.finale .fin-riepilogo') && (await page.textContent('.fin-riepilogo')).includes('durata')); + await page.click('.fin-riepilogo-dettagli > summary'); + prova('la pagina Finale espone il riepilogo su richiesta', await page.isVisible('.finale .fin-riepilogo') && (await page.textContent('.fin-riepilogo')).includes('durata')); await page.click('.fin-voce[data-s=colore]'); + await page.locator('.fin-pagina[data-s=colore] .fin-schede-nav').getByRole('button', { name: 'Look', exact: true }).first().click(); await page.locator('.fin-look', { hasText: 'Cinema' }).click(); let dd = await doc(); prova('il look Cinema vale per tutto il montaggio', dd.master?.look === 'cinema'); @@ -729,8 +731,10 @@ try { await page.click('.fin-voce[data-s=sottotitoli]'); await page.waitForTimeout(200); await page.evaluate(() => window.__motore.vaiA(40)); + await page.locator('.fin-pagina[data-s=sottotitoli] > .fin-schede > .fin-schede-nav').getByRole('button', { name: 'Sottotitoli', exact: true }).click(); await page.click('text=+ Riga al cursore'); await page.waitForTimeout(200); + await page.locator('.fin-pagina[data-s=sottotitoli] .fin-schede-nav').getByRole('button', { name: 'Le righe', exact: true }).click(); await page.locator('.sott-testo').first().fill('Ciao da Napoli'); await page.waitForTimeout(600); dd = await doc(); @@ -746,6 +750,7 @@ try { return ids.some((id) => !!mediaRT(id)?.peaks); }); prova('la preparazione manuale produce la forma d\'onda per i dialoghi', forme); + await page.locator('.fin-pagina[data-s=sottotitoli] .fin-schede-nav').getByRole('button', { name: 'Sottotitoli', exact: true }).click(); await page.click('text=Prepara i tempi dai dialoghi'); await page.waitForTimeout(300); dd = await doc(); @@ -769,7 +774,8 @@ try { }, }); }); - await page.click('text=Scrivi i sottotitoli con l\'AI'); + await page.locator('.fin-pagina[data-s=sottotitoli] .fin-schede-nav').getByRole('button', { name: "Scritti dall'AI", exact: true }).click(); + await page.click('[data-ai=sottotitoli]'); await page.waitForTimeout(300); if (await page.getByRole('button', { name: 'Rifalle', exact: true }).isVisible()) await page.getByRole('button', { name: 'Rifalle', exact: true }).click(); await page.getByRole('button', { name: 'Consenti download e avvia', exact: true }).click(); @@ -801,6 +807,7 @@ try { // apertura: il titolo d'apertura sposta avanti tutto di tre secondi await page.click('.fin-voce[data-s=apertura]'); const fine0 = await page.evaluate(() => window.__dpvTest.P.projectEnd(window.__dpv.doc)); + await page.locator('.fin-pagina[data-s=apertura] .fin-schede-nav').getByRole('button', { name: 'Titoli', exact: true }).click(); await page.click('text=Titolo d\'apertura'); const fine1 = await page.evaluate(() => window.__dpvTest.P.projectEnd(window.__dpv.doc)); dd = await doc(); @@ -1328,10 +1335,11 @@ try { await pa.waitForTimeout(400); await pa.click('.fin-voce[data-s=lingue]'); await pa.waitForTimeout(300); - prova('nella pagina Lingue c\'è la Voce AI, con le cinque voci di NVIDIA e il tasto', (await pa.locator('.fin-pagina[data-s=lingue] .chip', { hasText: 'Sofia' }).count()) === 1 && await pa.isVisible('text=Fai parlare i sottotitoli')); + await pa.locator('.fin-pagina[data-s=lingue] .fin-schede-nav').getByRole('button', { name: '2 · Voce', exact: true }).click(); + prova('nella pagina Lingue c\'è la Voce AI, con le cinque voci di NVIDIA e il tasto', (await pa.locator('.fin-pagina[data-s=lingue] .chip', { hasText: 'Sofia' }).count()) === 1 && await pa.isVisible('[data-ai=voce]')); await pa.locator('.fin-pagina[data-s=lingue] .chip', { hasText: 'Sofia' }).click(); const prima = await pa.evaluate(() => structuredClone(window.__dpv.doc)); - await pa.click('text=Fai parlare i sottotitoli'); + await pa.click('[data-ai=voce]'); await pa.waitForSelector('.ai-passi', { state: 'visible' }); prova('Voce AI aspetta il consenso prima di chiamare il motore', await pa.evaluate(() => window.__voceChiamate.length === 0)); await pa.getByRole('button', { name: 'Consenti download e avvia', exact: true }).click();