Skip to content

refactor(joint-react): align Paper options naming with react-plus#3353

Merged
kumilingus merged 2 commits into
devfrom
refactor/paper-options-naming-dev
Jun 11, 2026
Merged

refactor(joint-react): align Paper options naming with react-plus#3353
kumilingus merged 2 commits into
devfrom
refactor/paper-options-naming-dev

Conversation

@kumilingus

@kumilingus kumilingus commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

Follow-up to #3351. @joint/react-plus names component config consistently — <Component>Options for the raw options escape-hatch type, <Component>SupportedOptions for the curated supported-props base. Core's <Paper> diverged: no named type for the escape hatch (inline options?: dia.Paper.Options), and its base was PortalPaperOptions. This aligns the two packages.

What

  • Add & export PaperOptions = dia.Paper.Options — a named type for the options escape-hatch prop; the options?: field now references it. Mirrors react-plus <Component>Options. Exported from the root barrel under the <Paper/> block.
  • Rename PortalPaperOptionsPaperSupportedOptions (internal — not exported, no external consumer). Matches react-plus <Component>SupportedOptions. Updated the two internal references (PaperProps extends …, and use-create-portal-paper.tsx).
  • Type the defaultLink helper with the public DefaultLink typeuse-create-portal-paper.tsx's createDefaultLinkCallback now takes DefaultLink | undefined (the canonical exported type + explicit optionality, since the prop is optional and the helper handles the absent case) instead of an internal-base reference.

Compatibility

No behavior change. PaperProps unchanged. The renamed base was never public.

Verification

tsc --noEmit on joint-react: 0 errors.

Related

🤖 Generated with Claude Code

Mirror the `@joint/react-plus` convention so the two packages name the
same concepts the same way:
- Add and export `PaperOptions = dia.Paper.Options` — a named type for
  the `options` escape-hatch prop (was an inline type with no public
  name). Symmetric with react-plus `<Component>Options`.
- Rename the supported-props base `PortalPaperOptions` ->
  `PaperSupportedOptions` (internal; not exported), matching
  react-plus `<Component>SupportedOptions`.

No behavior change; `PaperProps` is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use the canonical exported `DefaultLink` type directly (with `| undefined`,
since the `defaultLink` prop is optional and the helper handles the
absent case) instead of the internal `PaperSupportedOptions` base or a
`PaperProps['defaultLink']` indexed access.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kumilingus kumilingus force-pushed the refactor/paper-options-naming-dev branch from 3db0b79 to b90cf93 Compare June 11, 2026 12:40
@kumilingus kumilingus merged commit e0fa8bd into dev Jun 11, 2026
@kumilingus kumilingus deleted the refactor/paper-options-naming-dev branch June 11, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants