Deng Liu та dengliu
85cbc6bacd
feat(mdx): add side-by-side MDX preview with opt-in sandboxed JSX execution ( #6881 )
...
Adds Editor Only / Editor and Preview / Preview Only layouts for .mdx files.
- Safe Static Mode on open: frontmatter, GFM, math, Mermaid, MDX comments and documentation tags (Steps, CardGroup, Note, Tabs, Accordion) render through the sanitized Markdown pipeline with scroll sync and no script execution.
- Run JSX (or Trust Project in Restricted Mode) lazy-loads @mdx-js/mdx and sucrase and evaluates JSX, workspace/tsconfig/node_modules imports, .mdx transclusions, stylesheets, assets and custom layouts inside an opaque-origin sandboxed iframe with its own CSP, no network and no IPC.
- The host-guest bridge is a per-document MessagePort; image, media, module and link resolution stay inside the window's project roots, checked lexically and after canonicalization (new fs_canonicalize command, which rejects parent traversal).
- Execution requires a current, affirmative trust result for the file's owning project, including attached workspace members, whose trust changes now emit ProjectTrustChanged.
- External links open only from a real click on an anchor in the frame and always go through a confirmation dialog showing the parsed destination.
- Settings > Languages & Frameworks > Markdown adds MDX component execution (Ask before running / Run automatically in trusted projects / Disabled), a user-only setting that project settings cannot enable.
Closes #6876
Co-authored-by: dengliu <[email protected] >
2026-12-02 08:39:22 +08:00
..
2026-11-11 21:23:38 +08:00
2026-12-02 04:56:12 +08:00
2026-12-02 08:39:22 +08:00
2026-11-26 23:24:02 +08:00
2026-12-01 22:57:35 +08:00
2026-12-02 08:39:22 +08:00
2026-11-27 08:59:33 +08:00
2026-11-27 08:59:33 +08:00
2026-11-23 22:32:58 +08:00
2026-11-23 22:32:58 +08:00
2026-11-18 21:25:58 +08:00
2026-11-09 17:05:20 +08:00
2026-11-20 13:45:47 +08:00
2026-12-02 04:19:59 +08:00
2026-11-29 14:03:48 +08:00
2026-11-29 14:03:48 +08:00
2026-11-01 12:23:08 +08:00
2026-11-01 12:23:08 +08:00
2026-11-26 23:00:28 +08:00
2026-11-01 15:04:28 +08:00
2026-11-01 15:04:28 +08:00
2026-12-01 15:10:49 +08:00
2026-11-26 16:42:19 +08:00
2026-11-26 23:00:28 +08:00
2026-11-13 22:29:59 +08:00
2026-11-01 19:02:00 +08:00
2026-11-27 19:09:20 +08:00
2026-11-28 05:55:03 +08:00
2026-11-06 14:24:59 +08:00
2026-12-02 07:27:18 +08:00
2026-11-25 17:09:51 +08:00
2026-11-25 17:09:51 +08:00
2026-11-17 04:09:12 +08:00
2026-11-19 21:40:05 +08:00
2026-11-27 14:19:24 +08:00
2026-11-06 23:02:34 +08:00
2026-11-06 23:02:34 +08:00
2026-11-25 15:38:15 +08:00
2026-11-25 15:38:15 +08:00
2026-11-12 22:42:10 +08:00
2026-11-12 22:42:10 +08:00
2026-11-27 05:09:25 +08:00
2026-11-27 05:09:25 +08:00
2026-11-12 03:27:33 +08:00
2026-11-23 23:22:47 +08:00
2026-11-27 23:53:40 +08:00
2026-11-29 12:29:38 +08:00
2026-11-29 12:29:38 +08:00
2026-11-11 19:30:15 +08:00
2026-11-26 23:00:28 +08:00
2026-11-28 20:31:33 +08:00
2026-11-28 20:31:33 +08:00
2026-11-09 17:17:27 +08:00
2026-11-25 14:17:57 +08:00
2026-11-09 17:17:27 +08:00
2026-11-03 22:34:29 +08:00
2026-11-03 22:34:29 +08:00
2026-11-20 22:10:02 +08:00
2026-11-26 23:00:28 +08:00
2026-11-29 11:08:19 +08:00
2026-11-30 23:50:27 +08:00
2026-11-04 06:51:41 +08:00
2026-11-04 06:51:41 +08:00
2026-11-16 09:36:14 +08:00
2026-11-12 02:38:45 +08:00
2026-11-26 23:00:28 +08:00
2026-11-25 14:17:57 +08:00
2026-11-14 01:17:26 +08:00
2026-11-18 16:14:32 +08:00
2026-11-30 18:25:17 +08:00
2026-11-30 18:25:17 +08:00
2026-10-25 21:24:00 +08:00
2026-11-27 06:21:21 +08:00
2026-11-29 15:45:38 +08:00
2026-11-05 23:09:55 +08:00
2026-11-05 23:09:55 +08:00
2026-11-19 22:42:00 +08:00
2026-11-19 22:42:00 +08:00
2026-12-01 22:57:35 +08:00
2026-11-25 01:38:09 +08:00
2026-11-28 05:55:03 +08:00
2026-11-28 05:55:03 +08:00
2026-11-24 20:52:43 +08:00
2026-11-24 20:52:43 +08:00
2026-11-20 16:26:23 +08:00
2026-11-04 14:22:38 +08:00
2026-12-02 04:56:12 +08:00
2026-11-30 18:14:01 +08:00
2026-11-30 18:14:01 +08:00
2026-11-20 09:13:29 +08:00
2026-11-20 09:13:29 +08:00
2026-11-10 03:14:20 +08:00
2026-11-28 08:16:39 +08:00
2026-11-27 20:20:12 +08:00
2026-11-27 20:20:12 +08:00
2026-11-28 07:07:06 +08:00
2026-11-28 07:07:06 +08:00
2026-11-20 05:41:29 +08:00
2026-11-23 23:22:47 +08:00
2026-11-25 14:17:57 +08:00
2026-11-25 20:01:26 +08:00
2026-10-27 12:09:51 +08:00
2026-10-27 18:56:54 +08:00
2026-11-26 21:31:11 +08:00
2026-12-01 23:05:50 +08:00
2026-11-30 07:40:26 +08:00
2026-11-04 02:54:31 +08:00
2026-12-02 08:39:22 +08:00
2026-11-08 00:05:41 +08:00
2026-11-12 02:09:24 +08:00
2026-11-12 02:09:24 +08:00
2026-11-12 02:09:24 +08:00
2026-11-16 03:32:43 +08:00
2026-11-14 10:28:39 +08:00
2026-11-14 10:28:39 +08:00
2026-11-19 23:07:13 +08:00
2026-11-20 02:49:08 +08:00
2026-11-26 01:42:42 +08:00
2026-11-26 01:42:42 +08:00
2026-11-01 00:14:56 +08:00
2026-11-01 00:14:56 +08:00
2026-11-12 02:09:24 +08:00
2026-11-12 02:09:24 +08:00
2026-11-21 19:33:15 +08:00
2026-11-26 23:00:28 +08:00
2026-11-25 22:37:36 +08:00
2026-11-25 22:37:36 +08:00
2026-11-11 22:18:48 +08:00
2026-11-25 15:38:15 +08:00
2026-11-23 22:24:23 +08:00
2026-11-26 23:00:28 +08:00
2026-11-09 08:40:40 +08:00
2026-11-04 20:44:19 +08:00
2026-11-04 20:44:19 +08:00
2026-11-30 20:24:55 +08:00
2026-11-30 20:24:55 +08:00
2026-11-25 16:29:24 +08:00
2026-11-25 16:29:24 +08:00
2026-10-31 20:58:45 +08:00
2026-11-22 00:13:04 +08:00
2026-11-01 16:58:49 +08:00
2026-10-29 10:43:30 +08:00
2026-10-29 10:43:30 +08:00
2026-11-24 06:40:00 +08:00
2026-11-26 16:57:59 +08:00
2026-11-26 16:57:59 +08:00
2026-11-28 07:57:17 +08:00
2026-11-27 16:16:20 +08:00
2026-11-26 18:00:44 +08:00
2026-11-24 11:42:00 +08:00
2026-11-29 15:15:42 +08:00
2026-12-01 02:21:28 +08:00
2026-11-05 13:33:35 +08:00
2026-11-05 13:33:35 +08:00
2026-11-09 08:40:40 +08:00
2026-12-02 08:39:22 +08:00
2026-11-27 07:56:28 +08:00
2026-11-27 07:56:28 +08:00
2026-11-23 22:24:23 +08:00
2026-11-23 22:24:23 +08:00
2026-11-27 07:56:28 +08:00
2026-11-25 16:23:06 +08:00
2026-11-08 00:21:42 +08:00
2026-11-18 21:25:58 +08:00
2026-11-25 14:17:57 +08:00
2026-11-17 09:33:49 +08:00
2026-11-26 23:00:28 +08:00
2026-11-07 10:56:59 +08:00
2026-11-05 21:38:12 +08:00
2026-11-12 22:42:10 +08:00
2026-11-12 22:42:10 +08:00
2026-11-04 02:54:31 +08:00
2026-11-25 00:45:06 +08:00
2026-11-22 21:57:30 +08:00
2026-11-21 12:25:12 +08:00
2026-12-01 02:00:34 +08:00
2026-12-01 02:00:34 +08:00
2026-11-26 23:00:28 +08:00
2026-11-26 23:00:28 +08:00
2026-11-22 05:23:22 +08:00
2026-11-22 05:23:22 +08:00
2026-10-29 15:01:01 +08:00
2026-11-17 21:15:20 +08:00
2026-11-17 21:15:20 +08:00
2026-10-30 22:45:42 +08:00
2026-11-28 05:38:40 +08:00
2026-12-01 22:57:35 +08:00
2026-12-01 22:57:35 +08:00
2026-10-31 22:38:16 +08:00