Skip to content

[feat] Add shared hooks to handle DOM manipulation for CCv2#12752

Merged
sfc-gh-bnisco merged 1 commit intodevelopfrom
bnisco/ccv2-stack-28
Oct 24, 2025
Merged

[feat] Add shared hooks to handle DOM manipulation for CCv2#12752
sfc-gh-bnisco merged 1 commit intodevelopfrom
bnisco/ccv2-stack-28

Conversation

@sfc-gh-bnisco
Copy link
Copy Markdown
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco commented Oct 10, 2025

Describe your changes

Added two new hooks for CCv2 to handle HTML, CSS, and JavaScript content from the user's component:

  1. useHandleHtmlAndCssContent: Safely injects HTML content (including script tags) and CSS into the component container. It supports both inline CSS and external CSS files.
  2. useHandleJsContent: Manages JavaScript content execution for CCv2. It supports both inline JS and external JS files, and provides proper lifecycle management with cleanup functions.

These hooks provide a clean separation of concerns for handling different types of content in BidiComponents, with proper error handling and resource cleanup.

GitHub Issue Link (if applicable)

Testing Plan


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Oct 10, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 10, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12752/streamlit-1.50.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-12752.streamlit.app (☁️ Deploy here if not accessible)

Copy link
Copy Markdown
Collaborator Author

sfc-gh-bnisco commented Oct 10, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-28 branch 2 times, most recently from 3818d55 to f533766 Compare October 24, 2025 18:14
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-27 branch 2 times, most recently from 0e5330d to 8dc20d9 Compare October 24, 2025 18:16
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-28 branch 2 times, most recently from ad9f15b to e7f2b9f Compare October 24, 2025 19:07
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-27 branch 2 times, most recently from 27fc90e to 771c9cf Compare October 24, 2025 19:08
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-27 branch 2 times, most recently from 82c5d00 to e32bf13 Compare October 24, 2025 21:13
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the bnisco/ccv2-stack-28 branch 2 times, most recently from 352530d to f2f1b79 Compare October 24, 2025 21:17
@sfc-gh-bnisco sfc-gh-bnisco changed the base branch from bnisco/ccv2-stack-27 to graphite-base/12752 October 24, 2025 22:00
@graphite-app graphite-app bot changed the base branch from graphite-base/12752 to develop October 24, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants