@danhachuel/thunderbolt 0.2.88 → 0.2.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MANUAL-INSTALACAO.md +2 -2
- package/README.md +2 -2
- package/app/main.py +3 -113
- package/package.json +1 -1
package/MANUAL-INSTALACAO.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Este manual descreve a instalação local da UI Thunderbolt, baseada no MoneyPrinterTurbo, utilizando o pacote npm `@danhachuel/thunderbolt`. O fluxo recomendado instala automaticamente o ambiente Python, as dependências da aplicação, as dependências do MoneyPrinterTurbo, o Streamlit e o suporte FFmpeg através de `imageio-ffmpeg`.
|
|
4
4
|
|
|
5
|
-
> **Versão deste manual:** 0.2.
|
|
5
|
+
> **Versão deste manual:** 0.2.89
|
|
6
6
|
> **Pacote npm:** `@danhachuel/thunderbolt`
|
|
7
7
|
> **Porta padrão da UI:** `localhost:3030`
|
|
8
8
|
> **Repositório:** [github.com/DanHachuel/thunderbolt](https://github.com/DanHachuel/thunderbolt)
|
|
@@ -200,7 +200,7 @@ Todas as subabas internas e o conteúdo das páginas também são traduzidos nos
|
|
|
200
200
|
|
|
201
201
|
### Temas Light e Dark
|
|
202
202
|
|
|
203
|
-
A aplicação usa o mecanismo nativo de temas do Streamlit e é distribuída com `.streamlit/config.toml`, seguindo o padrão de configuração do [MoneyPrinterTurbo](https://github.com/harry0703/MoneyPrinterTurbo). O ficheiro define **Dark** como
|
|
203
|
+
A aplicação usa o mecanismo nativo de temas do Streamlit e é distribuída com `.streamlit/config.toml`, seguindo o padrão de configuração do [MoneyPrinterTurbo](https://github.com/harry0703/MoneyPrinterTurbo). O ficheiro define **Dark** como base inicial. A alternância para **Light** e o regresso a **Dark** ficam exclusivamente no menu nativo de três pontos do Streamlit, no local original do toolbar; não existe um selector Theme dentro da página. Os componentes próprios da UI herdam as cores do tema activo através de `currentColor` e `color-mix`. O toolbar nativo, o indicador de execução, **Deploy** e o menu principal continuam sem sobreposições CSS.
|
|
204
204
|
|
|
205
205
|
## 4. Diagnóstico antes de iniciar
|
|
206
206
|
|
package/README.md
CHANGED
|
@@ -54,9 +54,9 @@ No topo da área principal da aplicação existe o menu nativo de idioma no padr
|
|
|
54
54
|
|
|
55
55
|
## Temas claro e escuro
|
|
56
56
|
|
|
57
|
-
A UI suporta os temas **Dark** e **Light** através
|
|
57
|
+
A UI suporta os temas **Dark** e **Light** através do menu nativo de três pontos do Streamlit, no local original do toolbar. Não existe um selector Theme adicional dentro da página. A configuração distribuída em `.streamlit/config.toml` define **Dark** como base inicial e o menu nativo continua responsável por alternar entre os modos, seguindo o padrão do [MoneyPrinterTurbo](https://github.com/harry0703/MoneyPrinterTurbo). O CSS próprio do Thunderbolt usa cores semânticas, `currentColor` e `color-mix` para acompanhar o tema activo, sem alterar a posição nem a funcionalidade do toolbar, do botão Deploy e do menu principal.
|
|
58
58
|
|
|
59
|
-
## Navegação da UI 0.2.
|
|
59
|
+
## Navegação da UI 0.2.89
|
|
60
60
|
|
|
61
61
|
A barra lateral mantém os níveis principais, nesta ordem: **Início**, **Niche Finder**, **Pipeline**, **Pipeline TikTok**, **Automação**, **Edição**, **AI Influencers** e **Configurações**. **Pipeline** é expansível e contém **Criação de Vídeos**, **Criação de Músicas**, **Roteiros** e **Upload**. **Automação** também é expansível e contém **Automação Youtube**. **Edição** é expansível e contém **Limpador de Metadados**, **Cortes**, **Editor Python** e **Download Mídia**, nessa ordem. **AI Influencers** é expansível e contém **Personagens**, **Redes Sociais**, **Tutorial Meta** e **Tutorial Supabase**, nessa ordem. **Niche Finder** é expansível e contém **Niche Finder Kaggle** e **Niche Finder Apify**. **Configurações** é expansível e contém **Canais Youtube**, **Blueprints Youtube**, **MCP**, **Contas Google**, **Configuração API** e **Notificações**. O Início reúne o dashboard e as filas do Pipeline, sem botões de acções rápidas.
|
|
62
62
|
|
package/app/main.py
CHANGED
|
@@ -144,70 +144,9 @@ BACKGROUND_MUSIC_VOLUME_OPTIONS = ["0%", "10%", "20%", "30%", "50%", "75%", "100
|
|
|
144
144
|
SUBTITLE_FONT_OPTIONS = ["MicrosoftYaHeiBold.ttc", "Arial.ttf", "DejaVuSans.ttf"]
|
|
145
145
|
SUBTITLE_POSITION_OPTIONS = ["Bottom (Recommended)", "Top", "Center"]
|
|
146
146
|
|
|
147
|
-
UI_THEME_VALUES = ("dark", "light")
|
|
148
|
-
UI_THEME_PALETTES = {
|
|
149
|
-
"dark": {
|
|
150
|
-
"background": "#0B1118",
|
|
151
|
-
"sidebar": "#091018",
|
|
152
|
-
"surface": "#121B26",
|
|
153
|
-
"text": "#F4F8FB",
|
|
154
|
-
"muted": "#9CAFBF",
|
|
155
|
-
"border": "#2A4052",
|
|
156
|
-
},
|
|
157
|
-
"light": {
|
|
158
|
-
"background": "#FFFFFF",
|
|
159
|
-
"sidebar": "#F3F6FA",
|
|
160
|
-
"surface": "#FFFFFF",
|
|
161
|
-
"text": "#16202A",
|
|
162
|
-
"muted": "#526273",
|
|
163
|
-
"border": "#C9D2DC",
|
|
164
|
-
},
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def normalize_ui_theme(value: Any) -> str:
|
|
169
|
-
return "light" if str(value or "").strip().casefold() in {"light", "claro", "clara", "浅色", "hell", "sáng", "açık", "светлая", "terang", "chiaro"} else "dark"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
def current_ui_theme() -> str:
|
|
173
|
-
settings = read_json("settings.json", {})
|
|
174
|
-
stored = st.session_state.get("ui_theme")
|
|
175
|
-
if stored is None:
|
|
176
|
-
stored = settings.get("ui_theme")
|
|
177
|
-
normalized = normalize_ui_theme(stored) if stored is not None else "dark"
|
|
178
|
-
st.session_state["ui_theme"] = normalized
|
|
179
|
-
return normalized
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def save_ui_theme(value: str) -> str:
|
|
184
|
-
normalized = normalize_ui_theme(value)
|
|
185
|
-
settings = read_json("settings.json", {})
|
|
186
|
-
settings["ui_theme"] = normalized
|
|
187
|
-
write_json("settings.json", settings)
|
|
188
|
-
st.session_state["ui_theme"] = normalized
|
|
189
|
-
return normalized
|
|
190
|
-
|
|
191
|
-
|
|
192
147
|
ensure_storage()
|
|
193
148
|
st.set_page_config(page_title="Thunderbolt", page_icon="T", layout="wide", initial_sidebar_state="expanded")
|
|
194
149
|
|
|
195
|
-
ui_theme = current_ui_theme()
|
|
196
|
-
theme_palette = UI_THEME_PALETTES[ui_theme]
|
|
197
|
-
st.markdown(
|
|
198
|
-
f"""<style>
|
|
199
|
-
:root {{
|
|
200
|
-
--tb-theme-background: {theme_palette["background"]};
|
|
201
|
-
--tb-theme-sidebar: {theme_palette["sidebar"]};
|
|
202
|
-
--tb-theme-surface: {theme_palette["surface"]};
|
|
203
|
-
--tb-theme-text: {theme_palette["text"]};
|
|
204
|
-
--tb-theme-muted: {theme_palette["muted"]};
|
|
205
|
-
--tb-theme-border: {theme_palette["border"]};
|
|
206
|
-
color-scheme: {ui_theme};
|
|
207
|
-
}}
|
|
208
|
-
</style>""",
|
|
209
|
-
unsafe_allow_html=True,
|
|
210
|
-
)
|
|
211
150
|
st.markdown("""
|
|
212
151
|
<style>
|
|
213
152
|
/*
|
|
@@ -216,32 +155,8 @@ st.markdown("""
|
|
|
216
155
|
currentColor/color-mix e nunca uma paleta escura fixa.
|
|
217
156
|
*/
|
|
218
157
|
:root { --tb-accent:#35a7ff; --tb-gold:#c59b55; }
|
|
219
|
-
|
|
220
|
-
[data-testid="
|
|
221
|
-
[data-testid="stHeader"] { background:var(--tb-theme-background); }
|
|
222
|
-
[data-testid="stAppViewContainer"] { background:var(--tb-theme-background); color:var(--tb-theme-text); }
|
|
223
|
-
[data-testid="stSidebar"] { background:var(--tb-theme-sidebar); color:var(--tb-theme-text); border-right:1px solid var(--tb-theme-border); }
|
|
224
|
-
[data-testid="stTextInput"] input,
|
|
225
|
-
[data-testid="stTextArea"] textarea,
|
|
226
|
-
[data-testid="stNumberInput"] input,
|
|
227
|
-
[data-testid="stDateInput"] input,
|
|
228
|
-
[data-testid="stTimeInput"] input,
|
|
229
|
-
[data-testid="stSelectbox"] [data-baseweb="select"] > div,
|
|
230
|
-
[data-testid="stMultiSelect"] [data-baseweb="select"] > div,
|
|
231
|
-
[data-testid="stColorPicker"] input { color:var(--tb-theme-text) !important; background:var(--tb-theme-surface) !important; border-color:var(--tb-theme-border) !important; }
|
|
232
|
-
[data-testid="stFileUploader"] section,
|
|
233
|
-
[data-testid="stAlert"],
|
|
234
|
-
[data-testid="stDataFrame"],
|
|
235
|
-
[data-testid="stTable"],
|
|
236
|
-
[data-testid="stExpander"] details { color:var(--tb-theme-text); background:var(--tb-theme-surface); border-color:var(--tb-theme-border); }
|
|
237
|
-
[data-testid="stButton"] button,
|
|
238
|
-
[data-testid="stFormSubmitButton"] button { color:var(--tb-theme-text); background:var(--tb-theme-surface); border-color:var(--tb-theme-border); }
|
|
239
|
-
[data-testid="stButton"] button:hover,
|
|
240
|
-
[data-testid="stFormSubmitButton"] button:hover { color:var(--tb-theme-text); background:color-mix(in srgb, var(--tb-theme-text) 9%, var(--tb-theme-surface)); border-color:var(--tb-accent); }
|
|
241
|
-
[data-testid="stTabs"] [data-baseweb="tab"],
|
|
242
|
-
[data-testid="stTabs"] button { color:var(--tb-theme-text); }
|
|
243
|
-
[data-testid="stSidebar"] [data-testid="stTextInput"] input,
|
|
244
|
-
[data-testid="stSidebar"] [data-testid="stSelectbox"] [data-baseweb="select"] > div { background:var(--tb-theme-surface) !important; }
|
|
158
|
+
[data-testid="stAppViewContainer"] { background:transparent; color:inherit; }
|
|
159
|
+
[data-testid="stSidebar"] { background:color-mix(in srgb, currentColor 4%, transparent); border-right:1px solid color-mix(in srgb, currentColor 16%, transparent); }
|
|
245
160
|
[data-testid="stSidebar"] .block-container { padding-top:0.28rem; padding-bottom:0.45rem; }
|
|
246
161
|
[data-testid="stSidebar"] > div:first-child { padding-top:0.28rem; }
|
|
247
162
|
[data-testid="stSidebar"] .tb-brand { display:flex; align-items:baseline; gap:0.42rem; margin:0 0 0.68rem 0; white-space:nowrap; }
|
|
@@ -368,29 +283,6 @@ def render_localized_tabs(labels: list[str], language: str | None = None):
|
|
|
368
283
|
return st.tabs(localized_tab_labels(labels, language))
|
|
369
284
|
|
|
370
285
|
|
|
371
|
-
def ui_theme_label(value: str, language: str | None = None) -> str:
|
|
372
|
-
normalized = normalize_ui_theme(value)
|
|
373
|
-
selected_language = language_code(language or current_ui_language())
|
|
374
|
-
return ui_text("Dark" if normalized == "dark" else "Light", selected_language)
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
def render_ui_theme_picker(language: str) -> None:
|
|
378
|
-
"""Render an explicit, persistent Light/Dark selector with Dark as the default."""
|
|
379
|
-
selected_language = language_code(language)
|
|
380
|
-
current = current_ui_theme()
|
|
381
|
-
selected = st.radio(
|
|
382
|
-
ui_text("Theme", selected_language),
|
|
383
|
-
list(UI_THEME_VALUES),
|
|
384
|
-
index=list(UI_THEME_VALUES).index(current),
|
|
385
|
-
format_func=lambda value: ui_theme_label(value, selected_language),
|
|
386
|
-
horizontal=True,
|
|
387
|
-
key="top_ui_theme_selector",
|
|
388
|
-
)
|
|
389
|
-
if selected != current:
|
|
390
|
-
save_ui_theme(selected)
|
|
391
|
-
st.rerun()
|
|
392
|
-
|
|
393
|
-
|
|
394
286
|
def save_ui_language(value: str) -> str:
|
|
395
287
|
normalized = language_code(value)
|
|
396
288
|
settings = read_json("settings.json", {})
|
|
@@ -435,9 +327,7 @@ def render_ui_language_picker(language: str) -> None:
|
|
|
435
327
|
</style>''',
|
|
436
328
|
unsafe_allow_html=True,
|
|
437
329
|
)
|
|
438
|
-
_spacer,
|
|
439
|
-
with theme_col:
|
|
440
|
-
render_ui_theme_picker(language)
|
|
330
|
+
_spacer, language_col = st.columns([5.2, 1.5])
|
|
441
331
|
with language_col:
|
|
442
332
|
selected = st.selectbox(
|
|
443
333
|
"Language",
|
package/package.json
CHANGED