feat(editor): by default render code iframe for html preview (#12848)

#### PR Dependency Tree


* **PR #12848** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a feature flag to enable or disable web container
functionality for code block previews.
- **Improvements**
- Code block HTML previews now support an alternative rendering method
based on the new feature flag, enhancing flexibility.
- **Chores**
- Updated feature flag settings by removing an obsolete flag and adding
the new web container flag.
- **Tests**
- Simplified code block preview tests for faster and more direct
validation of HTML preview content.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Peng Xiao
2025-06-19 09:12:33 +08:00
committed by GitHub
parent e046260deb
commit ce951ec316
6 changed files with 46 additions and 51 deletions

View File

@@ -273,15 +273,6 @@ export const AFFINE_FLAGS = {
configurable: isBetaBuild || isCanaryBuild,
defaultState: false,
},
enable_code_block_html_preview: {
category: 'affine',
displayName:
'com.affine.settings.workspace.experimental-features.enable-code-block-html-preview.name',
description:
'com.affine.settings.workspace.experimental-features.enable-code-block-html-preview.description',
configurable: isCanaryBuild,
defaultState: isCanaryBuild,
},
enable_adapter_panel: {
category: 'affine',
displayName:
@@ -291,6 +282,14 @@ export const AFFINE_FLAGS = {
configurable: isCanaryBuild,
defaultState: false,
},
enable_web_container: {
category: 'blocksuite',
bsFlag: 'enable_web_container',
displayName: 'Enable Web Container',
description: 'Enable web container for code block preview',
defaultState: false,
configurable: true,
},
} satisfies { [key in string]: FlagInfo };
// oxlint-disable-next-line no-redeclare