Commit Graph

376 Commits

Author SHA1 Message Date
Baptiste Arnaud
512c988951
👌 Add camera capture options to file uploads (#2560)
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Workflows (Fly.io) / deploy (push) Has been cancelled
## What changed

- add an optional Capture setting for image-only File Upload blocks with
None, Back camera, and Front camera choices
- persist the standard `environment` and `user` values and apply them
through the runtime file input `capture` attribute
- preserve existing behavior when capture is unset, including the legacy
Android accept workaround
- normalize extension-based image allowlists for capture while keeping
server-side validation fail-closed
- update schemas, generated OpenAPI specs, embed package versions, and
focused tests
- install Playwright Chromium during Codex worktree setup and ignore
local Revue session state

## Validation

- pre-commit affected format, lint, link, test, and OpenAPI targets:
passed
- affected tests across 14 projects under `.env.dev.example`: passed
- typecheck for builder, viewer, JS embed, File Input, input schemas,
lib, and bot engine: passed
- targeted Viewer Playwright file-upload capture test: passed (2 tests)
- targeted schema, allowlist, runtime helper, and upload validation
suites: passed

## Browser behavior

The standard capture attribute is a browser hint. Supported mobile
browsers may open the selected camera directly; desktop and unsupported
browsers may continue to show a regular file chooser.
2026-07-15 18:53:17 +02:00
Baptiste Arnaud
e7be877bc1
🐛 Fix Android camera for image extension uploads (#2558)
## What changed

- Detect image extensions in file upload allowlists using the shared
`extensionFromMimeType` table.
- Add the corresponding image MIME hints while preserving the original
extensions and the existing `capture=camera` Android workaround.
- Normalize casing and leading dots, deduplicate equivalent entries, and
prefer valid dotted extensions regardless of input order.
- Add focused unit coverage for image-only, mixed, non-image, duplicate,
and casing scenarios.
- Bump the JavaScript and React embed packages to `0.10.6` and ignore
local Revue comments.

## Why

The Android camera workaround was only enabled when the configured
allowlist already contained an `image/*` MIME type. Bots configured with
image extensions such as `.jpg`, `.jpeg`, and `.png` therefore never
received the workaround.

## Impact

Android users can access the existing camera option when a file upload
block is configured with image extensions. Browser hints are enriched
only on the client; server-side validation remains based on the block's
original options.

The `capture=camera` token remains a non-standard Android-specific
workaround and may continue to vary across browsers.

## Validation

- `bunx nx test @typebot.io/js` — 7 tests passed
- `bunx nx typecheck @typebot.io/js`
- `bunx nx format-and-lint`
- `git diff --check`

The repository-wide pre-commit affected test suite could not complete
locally because unrelated packages required missing environment
variables and existing SSRF tests failed. The targeted package tests,
typecheck, and repository formatting checks passed.
2026-07-13 11:35:47 +02:00
Baptiste Arnaud
9224f4f770
🐛 Fix embed video overlay in preview (#2532)
## Summary
- Keeps video bubbles above the absolute typing/background layer in the
embedded chat renderer.
- Applies the same stacking approach to direct video URLs and embedded
video iframes.
- Bumps `@typebot.io/js` and `@typebot.io/react` from `0.10.4` to
`0.10.5`.

## Root cause
Chrome could place the full-size absolute `bubble-typing` layer over
video bubbles because the media content shared the same stacking level.
That made the overlay sit above the HTML video element in builder embed
preview.

## Validation
- `bunx nx typecheck @typebot.io/react`
- `bunx nx build @typebot.io/react --configuration=development`
- `bunx nx format-and-lint`
- Commit hook: `nx affected -t
format-and-lint,lint-repo,check-broken-links,test --parallel=4`

Note: I could not visually verify the exact provided local typebot URL
in this workspace because it returns `Typebot not found` locally.
2026-06-18 16:50:13 +02:00
Baptiste Arnaud
c82ac4324a
🐛 Fix embedded audio uploads (#2523)
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Workflows (Fly.io) / deploy (push) Has been cancelled
- Keep CORS headers on upload proxy error responses.
- Surface failed audio/file uploads as Typebot errors instead of leaving
the recorder stuck.
- Prevent recorded-audio Send clicks from submitting the host page form
in embedded bots.
- Prevent duplicate embed uploads while an upload is already in flight.
- Disable recorder abort while recorded audio is being processed or
uploaded.
- Bump @typebot.io/js and @typebot.io/react to 0.10.4.
2026-06-08 15:52:56 +02:00
マーティンズJR
53e90c497d
fix the button position close in modal (#2476)
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
Deploy Workflows (Fly.io) / deploy (push) Has been cancelled
Monthly job / clean (push) Has been cancelled
When clicking on an image in the chat preview/runtime, the X button to
close the modal appeared misplaced outside the correct area. This
happened because the button was positioned with `position: fixed`,
remaining stuck to the entire page viewport instead of being inside the
modal/chat container.

before:
<img width="490" height="542" alt="image"
src="https://github.com/user-attachments/assets/ed17cf29-6397-46c7-9779-01aec89c3c5b"
/>

after:
<img width="502" height="523" alt="image"
src="https://github.com/user-attachments/assets/8ac64782-6af4-4417-bad1-971450e0f66c"
/>

---------

Co-authored-by: Baptiste Arnaud <baptiste@typebot.io>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:58:46 +00:00
Baptiste Arnaud
d3c15f32c8
🐛 Handle GA script load failure to prevent bot from hanging (#2446)
## Summary
- Add `script.onerror` handler in `initGoogleAnalytics` so the promise
resolves even when the GA script fails to load (ad blockers, network
errors), preventing the bot from hanging indefinitely.
- Bump `@typebot.io/js` and `@typebot.io/react` versions to `0.10.2`.

## Test plan
- [ ] Enable a Google Analytics integration block in a bot
- [ ] Block `googletagmanager.com` (e.g. via ad blocker) and verify the
bot still loads
- [ ] Check that `"Failed to load Google Analytics script"` appears in
the console

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:18:57 +02:00
Baptiste Arnaud
2c3fc7267a
🐛 Fix stored XSS via javascript: URI in bubble links (GHSA-hqmv-v56g-4m47) (#2435)
## Summary
- Fix stored XSS vulnerability where `javascript:` URIs in text bubble
links, image click links, and toast popup links could execute arbitrary
JS in visitors' browsers
- Add `sanitizeUrl` utility that allowlists only `http:`, `https:`,
`mailto:`, and `tel:` protocols
- Add explicit `typecheck` Nx targets for `builder` and `viewer`
(Next.js projects don't get one inferred by `@nx/js/typescript`)
- Bump `@typebot.io/js` and `@typebot.io/react` to `0.10.1`

## Test plan
- [ ] Create a bot with a text bubble link set to `javascript:alert(1)`
and verify it renders as `#`
- [ ] Same test with an image click link
- [ ] Verify normal `https://` links still work
- [ ] Run `bunx nx typecheck builder` and `bunx nx typecheck viewer`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 17:46:09 +02:00
Baptiste Arnaud
cc9839f2e7
🔧 Migrate S3 uploads from presigned POST to presigned PUT (#2429)
## Changes

- **Presigned POST → PUT**: Replace `generatePresignedPostPolicy` with
`generatePresignedPutUrl` across all upload endpoints (builder + viewer
v1/v2/v3). This makes uploads compatible with Cloudflare R2 which
doesn't support the S3 POST Object API. Frontend consumers now use `PUT`
with raw file body + `Content-Type`/`Cache-Control` headers instead of
`POST` with FormData.
- **XSS mitigation**: Block dangerous content types (SVG, HTML, XML, JS)
in the builder `generateUploadUrl` endpoint. Restrict frontend `accept`
attributes from `image/*` to an explicit list of safe raster types
(`png, jpeg, gif, webp, avif, bmp, tiff`). Addresses
GHSA-jj87-c343-26vp.
- **Fix file upload URL validation**: `isURL` with `require_tld: true`
rejected `localhost` and `NEXTAUTH_URL` proxy URLs for private files.
Now uses a trusted host allowlist (`localhost`, `NEXTAUTH_URL`,
`S3_PUBLIC_CUSTOM_DOMAIN`) to skip TLD requirement.
- **Docs**: Update S3 CORS policy from `POST` to `PUT`, add Cloudflare
R2 to supported providers list.
- **Bump**: `@typebot.io/js` and `@typebot.io/react` → `0.10.0`

## Verification

- Tested avatar upload on builder with R2 bucket (PUT succeeds, image
displays)
- Verified CORS preflight passes after R2 bucket config
- Confirmed `generateUploadUrl` rejects `image/svg+xml` with 400
- All unit tests pass (`nx affected -t test`)
- Typecheck passes on all affected packages

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 15:34:35 +02:00
Baptiste Arnaud
acd2f2971b
🔧 Remove "baseUrl": "." from tsconfigs 2026-03-25 16:40:12 +01:00
Baptiste Arnaud
62e5bf639d
🐛 Fix builder preview AI streaming 2026-03-25 08:51:43 +01:00
Baptiste Arnaud
ece99ba625
♻️ Move editable components to shared UI package 2026-03-24 16:48:49 +01:00
Baptiste Arnaud
78da6fa4d3
🐛 Fix embeds crash (importing external modules) 2026-03-24 15:16:46 +01:00
Baptiste Arnaud
474ecbf46b
🐛 Fix XSS possible on Rating and file upload inputs 2026-03-23 18:08:08 +01:00
Baptiste Arnaud
c2b251c7e5
♻️ Migrate to NX (#2418) 2026-03-18 15:29:32 +00:00
Baptiste Arnaud
d1e2781caf
🔧 Migrate biome rules: interactive semantics checks 2026-03-17 14:50:16 +01:00
Baptiste Arnaud
7c519587f0
🔧 Bump embeds package versions to 0.9.20 2026-02-16 15:56:55 +01:00
Baptiste Arnaud
5e0de89911
🔧 Add forward WA errors and campaign statuses option 2026-02-11 16:46:35 +01:00
Baptiste Arnaud
e3a310e014
🐛 Fix BubbleButton color resolution
Closes #2378
2026-01-29 16:53:09 +01:00
Baptiste Arnaud
1fb2ab3ede
🐛 Fix typing bubble animation transform value
Fixed incorrect translateY value in chat bubble animation that was causing visual glitches in the typing indicator. Fixes #2331
2026-01-05 11:31:32 +01:00
Baptiste Arnaud
0b14a21b37
⬆️ Upgrade Next.js and react 2025-12-12 10:28:27 +01:00
Baptiste Arnaud
7014069f5f
⬆️ Upgrade Next.js and react 2025-12-07 08:58:27 +01:00
Baptiste Arnaud
6a02a5b919
⬆️ Upgrade to React 19
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-12-01 16:42:23 +01:00
Baptiste Arnaud
d48c9b458e
💄 (bot) Add border to cards 2025-11-28 09:43:55 +01:00
Baptiste Arnaud
dd82c4d318
♻️ Migrate to Bun test 2025-11-27 12:08:31 +01:00
Baptiste Arnaud
a68f0c9179
🔒️ Restrict client code execution on imported bot 2025-11-18 17:54:19 +01:00
Baptiste Arnaud
c823aba3db
🚑️ (embed) fix scroll issue on some Safari version
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-11-14 18:25:23 +01:00
Baptiste Arnaud
d3347cb346
🐛 (embed) Fix button border thickness
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-11-13 17:17:23 +01:00
Baptiste Arnaud
adbeb85c03
🐛 (embed) Fix size issues for custom html font-size 2025-11-13 12:03:25 +01:00
Baptiste Arnaud
fb57698b94
🐛 (embed) Fix tailwind variables not applied to shadow DOM 2025-11-12 17:16:10 +01:00
Baptiste Arnaud
d3f91195a8
🐛 Fix transcript compute stopping at Cards input 2025-11-12 16:16:05 +01:00
Baptiste Arnaud
0250ff8b64
💄(embed) fix button cursor
Closes #2306
2025-11-12 09:14:05 +01:00
Baptiste Arnaud
8a95e2821d
🚑️ Fix invalid chat container class names 2025-11-12 09:07:50 +01:00
Baptiste Arnaud
2f88749043
💄 (embed) Fix popup overlay color transparency 2025-11-12 08:54:38 +01:00
Baptiste Arnaud
e1f75652b2
🚑️ Fix opacity-1 invalid className 2025-10-30 08:51:56 +01:00
Baptiste Arnaud
3d397601f7
♻️ Upgrade to Tailwind v4 2025-10-29 19:04:59 +01:00
Baptiste Arnaud
489493b376
🐛 (bot) Fix crash when continue message richText is empty 2025-10-06 14:44:21 +02:00
Baptiste Arnaud
9688a297ad
🔧 Revert to carret version pinning 2025-10-03 10:51:27 +02:00
Baptiste Arnaud
5ed6051099
🐛 (bot) fix some emojis that were not detected for avatar 2025-10-02 09:53:52 +02:00
Baptiste Arnaud
70e6f4d5c7
🐛 Fix link not showing in Text bubble
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-09-22 11:06:59 +02:00
Baptiste Arnaud
b52bb39352
🐛 Include submitInput in Typebot global 2025-09-22 10:37:39 +02:00
Baptiste Arnaud
eb28b0b51c
Add submitInput embed command
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-09-18 10:08:08 +02:00
Baptiste Arnaud
282e4bdab7
🐛 Fix bot crash on second load in builder 2025-09-15 11:24:16 +02:00
Baptiste Arnaud
f8f9710bbd
🐛 Fix bot standard not initially loading 2025-09-15 10:48:33 +02:00
Baptiste Arnaud
765c4b2f8c
⬆️ Upgrade Plate
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-09-12 13:11:11 +02:00
Baptiste Arnaud
6ad0ad26c7
️ Revert sessionId reset on remembered state
Some checks failed
Create Tag / create-tag (push) Has been cancelled
Deploy Partykit server / deploy (push) Has been cancelled
2025-09-09 15:15:12 +02:00
Baptiste Arnaud
e928987623
⬆️ Upgrade tooling
TS v5.9, Biome v2 + fixes
2025-09-09 10:32:38 +02:00
Baptiste Arnaud
f876415309
🧑‍💻 Add reset typebot embed command 2025-09-02 14:02:40 +02:00
Baptiste Arnaud
39c9033c69
🐛 Attempt to fix no camera option on file upload for Android users 2025-09-02 09:56:50 +02:00
Baptiste Arnaud
72a61047be
🐛 Update sessionId if user is remembered 2025-08-19 12:17:00 +02:00
Baptiste Arnaud
b8a487b92e
🐛 Fix embed continue chat and client log queries not following allowed origins config
Closes #2263
2025-08-18 11:06:27 +02:00