@danhachuel/thunderbolt 0.4.96 → 0.4.98

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/app/main.py CHANGED
@@ -7193,7 +7193,8 @@ def _render_media_provider_card(settings: dict[str, Any], cards: list[dict[str,
7193
7193
  if not has_credentials:
7194
7194
  st.info("Preencha Client Id, Client Secret e Redirect Uri para iniciar a autorização.")
7195
7195
  else:
7196
- if st.button("Iniciar autorização", key=f"media_card_{card_id}_authorize"):
7196
+ authorize_clicked = st.form_submit_button("Iniciar autorização", use_container_width=True, key=f"media_card_{card_id}_authorize") if embedded else st.button("Iniciar autorização", key=f"media_card_{card_id}_authorize")
7197
+ if authorize_clicked:
7197
7198
  verifier, challenge = create_pkce_pair()
7198
7199
  state = create_state()
7199
7200
  st.session_state[f"canva_verifier_{card_id}"] = verifier
@@ -7201,7 +7202,7 @@ def _render_media_provider_card(settings: dict[str, Any], cards: list[dict[str,
7201
7202
  st.session_state[f"canva_authorization_url_{card_id}"] = authorization_url(client_id, redirect_uri, "design:content:read design:content:write", state, challenge)
7202
7203
  authorization_link = str(st.session_state.get(f"canva_authorization_url_{card_id}") or "")
7203
7204
  if authorization_link:
7204
- st.link_button("Abrir autorização Canva", authorization_link, use_container_width=True)
7205
+ st.markdown(f"[Abrir autorização Canva]({authorization_link})")
7205
7206
  with st.expander("Opções de exportação e dimensões", expanded=False):
7206
7207
  export_quality = st.selectbox("Export Quality", ["High", "Medium", "Low"], index=["high", "medium", "low"].index(str(card.get("export_quality") or "medium").lower()), key=f"media_card_{card_id}_export_quality")
7207
7208
  export_format = st.selectbox("Export Format", ["PNG", "JPG", "PDF"], index=["png", "jpg", "pdf"].index(str(card.get("export_format") or "png").lower()), key=f"media_card_{card_id}_export_format")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.96",
3
+ "version": "0.4.98",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
package/scripts/cli.mjs CHANGED
@@ -201,7 +201,16 @@ const proxy = http.createServer((request, response) => {
201
201
  path: `${requestUrl.pathname}${requestUrl.search}`,
202
202
  headers: { ...request.headers, host: `127.0.0.1:${backendPort}` },
203
203
  }, (upstreamResponse) => {
204
- response.writeHead(upstreamResponse.statusCode || 502, upstreamResponse.headers);
204
+ const responseHeaders = { ...upstreamResponse.headers };
205
+ // Streamlit entrega HTML/JS de uma instância local que pode mudar após
206
+ // uma atualização via npx. Não permitir que o browser reaproveite uma
207
+ // página ou bundle da instância anterior.
208
+ delete responseHeaders.etag;
209
+ delete responseHeaders["last-modified"];
210
+ responseHeaders["cache-control"] = "no-store, no-cache, must-revalidate, max-age=0";
211
+ responseHeaders.pragma = "no-cache";
212
+ responseHeaders.expires = "0";
213
+ response.writeHead(upstreamResponse.statusCode || 502, responseHeaders);
205
214
  upstreamResponse.pipe(response);
206
215
  });
207
216
  upstream.on("error", (error) => {