feat(joint-react): set sensible Paper defaults and refine theme#3245
Merged
kumilingus merged 5 commits intoclientIO:devfrom Mar 25, 2026
Merged
feat(joint-react): set sensible Paper defaults and refine theme#3245kumilingus merged 5 commits intoclientIO:devfrom
kumilingus merged 5 commits intoclientIO:devfrom
Conversation
Set overridable defaults for Paper: linkPinning=false, gridSize=10,
clickThreshold=5, snapLinks={radius:15}, markAvailable=true. Simplify
highlighting merge logic. Update theme CSS with port availability
styling and link wrapper defaults.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
samuelgja
reviewed
Mar 25, 2026
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.
Summary
Paper defaults via
PresetPaperbase classPresetPaperclass (dia.Paper.extend(...)) thatPortalPapernow extendsasync,sorting,frozen,autoFreeze,viewManagementlinkPinning=false,gridSize=10,clickThreshold=5,snapLinks={radius:15},markAvailable=true,drawGrid=true,preventDefaultBlankAction=false,defaultConnectionPoint,measureNodePaperStoreconstructor — it now just passespaperOptionsthrough--jr-paper-grid-colorCSS custom property into all built-in grid patternsHighlighting presets
PaperStoretoPresetPaperasDEFAULT_HIGHLIGHTINGstrokehighlighter with--jr-paper-highlight-coloraddClasshighlighter (jr-available-magnet,jr-available-element) instead ofstroke— enables CSS-only themingTheme CSS updates
0→10(clickable hit area)stroke-linecapfallback ('butt'), removestroke-linejoin(handled by markup)transparent/0→#EFF2F5/2(visible outline).jr-port-body.jr-available-magnetrule with--jr-port-available-color.jr-available-element .jr-elementrule with--jr-element-available-borderPortal link markup cleanup
stroke: 'transparent'andstrokeLinecap: 'round'from wrapper markup — now handled by CSS themeConsolidate duplicated data mappers
flatMapDataToElementAttributes/flatMapLinkAttributesToData(internal) now delegate toflatElementDataToAttributes/flatAttributesToElementData(public), eliminating ~150 lines of copy-pasted logicid(forward) or default-value filtering (reverse)attrs.root.magnet: falsefor ports is now applied consistently (was missing in internal mapper)debuggerstatementMinor cleanup
createPortDefaults→createPortGroupsDefaultimport { dia, mvc }→import type { dia }in portal-paper (remove unusedmvc)(keyof T)[]→Array<keyof T>, rename abbreviated variables inuseFlatElementDataStorybook: dark theme demo
with-default-elementstorydark-theme.csswith CSS variable overrides demonstrating full theme customizationTest plan
paperOptionsoverrides still take effect (e.g.gridSize={1})highlighting={false}still disables all highlightingattrs.root.magnet: falseset consistentlywith-default-elementstorybookdata-mapper.test.tsanduse-flat-link-data.test.tspass🤖 Generated with Claude Code