feat(superdoc): support fixed-height container embedding with contained mode (SD-2242)#2423
Conversation
There was a problem hiding this comment.
💡 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".
a1ced4d to
811b739
Compare
38114f0 to
db00ec5
Compare
…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
e471b03 to
3eabe3d
Compare
|
🎉 This PR is included in @superdoc-dev/create v0.1.0-next.4 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v1.1.0-next.52 |
|
🎉 This PR is included in @superdoc-dev/react v1.0.0-next.10 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.2.0-next.10 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.3.0-next.9 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.24.0-next.49 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.49 |
|
🎉 This PR is included in superdoc-cli v0.5.0-next.49 The release is available on GitHub release |
Add
containedoption that enables SuperDoc to scroll within a fixed-height parent container. Whencontained: true, height propagates through the DOM chain and.super-editor-containerbecomes the scroll container withoverflow: auto.Key changes:
containedboolean in Config type and React props