Skip to content

Conversation

@caio-pizzol
Copy link
Contributor

@caio-pizzol caio-pizzol commented Oct 9, 2025

Note

Adds configurable toolbar support to SuperDocTemplateBuilder and updates export to use the new superdoc.export API; demo and docs updated.

  • Core (src/)
    • Toolbar support:
      • Add toolbar prop to SuperDocTemplateBuilder with boolean | string | ToolbarConfig in types.
      • Implement resolveToolbar and integrate toolbar via modules.toolbar with optional default container (#superdoc-toolbar).
      • Render default toolbar container when needed and pass selector/config to SuperDoc init.
    • Export API:
      • Change exportTemplate to use superdocRef.current.export({ exportType: ["docx"], exportedName }) instead of editor.exportDocx.
  • Demo (demo/src/)
    • Use toolbar={true} in App.tsx.
    • Minor layout tweaks (increase container/header max-widths).
  • Docs (README.md)
    • Document new toolbar prop with examples and configuration options.

Written by Cursor Bugbot for commit b169030. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Oct 9, 2025

SD-526 Add Toolbar Visibility Control Prop to Template Builder

Summary

Add optional prop to SuperDocTemplateBuilder to control toolbar visibility using SuperDoc's native toolbar configuration.

Tasks

  • Review src/index.tsx initialization of SuperDoc to identify where to inject toolbar configuration
  • Add a showToolbar boolean prop to SuperDocTemplateBuilderProps interface
  • Add a toolbar container element to the rendered JSX and reference it with a new ref for the SuperDoc config
  • Update the SuperDoc instantiation to conditionally pass the toolbar selector/ref based on showToolbar prop
  • Test both toolbar visible and hidden states
  • Update component documentation with new prop

Notes

Per SuperDoc documentation (https://docs.superdoc.dev/modules/toolbar), toolbar configuration can be passed via modules.toolbar.selector or the shorthand toolbar property. The toolbar should only render when showToolbar is true. The default behavior should maintain current functionality (showing toolbar). See toolbar configuration at modules/toolbar.mdx in project knowledge.

@caio-pizzol caio-pizzol enabled auto-merge (squash) October 9, 2025 18:28
… into cursor/SD-526-add-toolbar-visibility-control-to-template-builder-83e1
@caio-pizzol caio-pizzol disabled auto-merge October 9, 2025 18:29
@caio-pizzol caio-pizzol merged commit a1ecf7d into main Oct 9, 2025
2 checks passed
@caio-pizzol caio-pizzol deleted the cursor/SD-526-add-toolbar-visibility-control-to-template-builder-83e1 branch October 9, 2025 18:30
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