Open
Conversation
|
@njesenberger is attempting to deploy a commit to the Benji Taylor's Projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate toolbar to Shadow DOM for style isolation
This PR moves the toolbar into a Shadow DOM host, preventing CSS from leaking between the toolbar and the host page in either direction.
What changed
Shadow DOM encapsulation
The toolbar's React tree is now rendered inside a shadow root via a new
ShadowRootcomponent. All stylesheets are collected as raw CSS strings and injected as a single<style>tag inside the shadow root, replacing the previous approach of scattering individual<style>tags acrossdocument.head. A newreset.scssprovides baseline normalization scoped to:hostso host-page resets can't bleed in.Build pipeline refactor
The
scssModulesPluginintsup.config.tshas been simplified. Each SCSS file previously generated runtime code that appended style elements todocument.head— now CSS modules export a namedcssstring alongside the default class-name map, and plain.scssfiles export only acssstring. The component concatenates these into one<style>tag rendered inside the shadow root.scss.d.tsis updated to match, andesbuildis now an explicit dev dependency rather than a transitive one.Color token CSS
The
injectAgentationColorTokensfunction that imperatively wrote todocument.headat module load time has been replaced with a static CSS string using:hostselectors, injected alongside the other styles inside the shadow root.CSS fixes for Shadow DOM compatibility
Two
:has()selectors that don't work reliably across shadow boundaries have been replaced with explicitdata-checkedattribute checks inCheckboxandSwitch. Both components now setdata-checkedon their wrapper div and use.container[data-checked]in their stylesheets instead.Bug fixes
portalWrapperRef.current(inside the shadow DOM) rather thandocument.body, so it picks up shadow-scoped styles correctlyRearrangeOverlaynow queries its own shadow root for[data-rearrange-section]elements instead ofdocument, preventing potential mismatches:not([data-agentation-root] *)exclusion since the toolbar is naturally isolated inside its shadow rootwebkit-user-select: noneadded throughout for Safari compatibilityCleanup
Removed dead CSS from
styles.module.scss: unused.canvasPurpose*blocks and.customCheckbox,.toggleLabel,.toggleSwitch,.toggleSlider, which are superseded by theCheckboxandSwitchcomponents.