Skip to content

feat(superdoc): support fixed-height container embedding with contained mode (SD-2242)#2423

Merged
caio-pizzol merged 14 commits intomainfrom
caio/sd-2242-support-fixed-height-container-embedding-with-scrolling
Mar 31, 2026
Merged

feat(superdoc): support fixed-height container embedding with contained mode (SD-2242)#2423
caio-pizzol merged 14 commits intomainfrom
caio/sd-2242-support-fixed-height-container-embedding-with-scrolling

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Add contained option that enables SuperDoc to scroll within a fixed-height parent container. When contained: true, height propagates through the DOM chain and .super-editor-container becomes the scroll container with overflow: auto.

Key changes:

  • New contained boolean in Config type and React props
  • CSS height chain: .superdoc--contained → layers → document → sub-document
  • .super-editor-container.contained becomes scroll container (overflow: auto)
  • .super-editor overflow changed from hidden to visible in contained mode
  • CommentsLayer switched to position: absolute with pointer-events: none in contained mode to avoid blocking scroll and taking flow space
  • React wrapper conditionally sets height: 100% on editor container

@linear
Copy link
Copy Markdown

linear bot commented Mar 17, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e2b4498c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@caio-pizzol caio-pizzol force-pushed the caio/sd-2242-support-fixed-height-container-embedding-with-scrolling branch from a1ced4d to 811b739 Compare March 18, 2026 09:42
@caio-pizzol caio-pizzol force-pushed the caio/sd-2242-support-fixed-height-container-embedding-with-scrolling branch 2 times, most recently from 38114f0 to db00ec5 Compare March 31, 2026 00:00
…ed mode

SD-2242: Add `contained` option that enables SuperDoc to scroll within a
fixed-height parent container. When `contained: true`, height propagates
through the DOM chain and `.super-editor-container` becomes the scroll
container with `overflow: auto`.

Key changes:
- New `contained` boolean in Config type and React props
- CSS height chain: .superdoc--contained → layers → document → sub-document
- .super-editor-container.contained becomes scroll container (overflow: auto)
- .super-editor overflow changed from hidden to visible in contained mode
- CommentsLayer switched to position: absolute with pointer-events: none
  in contained mode to avoid blocking scroll and taking flow space
- React wrapper conditionally sets height: 100% on editor container
Document the new `contained` option in both the vanilla SuperDoc
configuration page and the React component configuration page,
with usage examples showing fixed-height container embedding.
When contained mode is active with a visible toolbar, height: 100%
on the editor container would overflow. Switch to flex layout so
toolbar and editor share the fixed-height wrapper properly.
…ewers

The sub-document container gets overflow: auto in contained mode so
PDF and HTML documents scroll within fixed-height containers, not
just DOCX. SuperEditor already manages its own scroll container.
The contained property is defined via JSDoc in superdoc's types and
may not appear in generated .d.ts files. Use a type assertion instead
of accessing restProps.contained directly.
… mode

The comments layer has pointer-events: none in contained mode to let
scroll events pass through, but this also disables comment highlight
clicks. Re-enable pointer-events on .sd-comment-anchor so comments
remain interactive.
Add contained mode section to AGENTS.md for AI agent consumers.
Simplify the docs embed component by replacing manual CSS height/
overflow hacks with contained: true.
Instead of accessing contained through restProps with an unsafe cast,
add it to ReactProps interface and destructure it like hideToolbar.
This gives TypeScript users autocomplete and removes the cast.
The root node_modules/@types/minimatch is an empty shell with no .d.ts
files. TypeScript auto-discovers all @types/* packages and fails on it.
Set explicit types in tsconfig to only include react and react-dom.
- Pass contained unconditionally (always boolean, no need for spread)
- Add contained to useEffect dep array so toggling triggers rebuild
@caio-pizzol caio-pizzol force-pushed the caio/sd-2242-support-fixed-height-container-embedding-with-scrolling branch from e471b03 to 3eabe3d Compare March 31, 2026 00:21
@caio-pizzol caio-pizzol merged commit 91feebf into main Mar 31, 2026
45 checks passed
@caio-pizzol caio-pizzol deleted the caio/sd-2242-support-fixed-height-container-embedding-with-scrolling branch March 31, 2026 00:25
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in @superdoc-dev/create v0.1.0-next.4

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in vscode-ext v1.1.0-next.52

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in @superdoc-dev/react v1.0.0-next.10

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in esign v2.2.0-next.10

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in template-builder v1.3.0-next.9

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in superdoc v1.24.0-next.49

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in superdoc-sdk v1.3.0-next.49

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Mar 31, 2026

🎉 This PR is included in superdoc-cli v0.5.0-next.49

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant