Skip to content

Conversation

@caio-pizzol
Copy link
Contributor

This commit updates the exportTemplate method to support a new ExportConfig interface, allowing users to specify a custom filename and control whether the download is triggered automatically or if the template is returned as a Blob for manual handling. Additionally, the README has been updated to reflect these changes, providing clear examples for both download and Blob modes.

This commit updates the exportTemplate method to support a new ExportConfig interface, allowing users to specify a custom filename and control whether the download is triggered automatically or if the template is returned as a Blob for manual handling. Additionally, the README has been updated to reflect these changes, providing clear examples for both download and Blob modes.
@linear
Copy link

linear bot commented Nov 13, 2025

SD-882 Make exportTemplate download optional

Summary

Add method to export template as docx with option to receive instead of auto-download

Tasks

  • Add new export method for docx format
  • Implement option for user to receive file instead of forced download

Notes

Added triggerDownload option to exportTemplate:

  • true (default) - downloads file
  • false - returns Blob for database storage

@caio-pizzol
Copy link
Contributor Author

@codex

@chatgpt-codex-connector
Copy link

To use Codex here, create an environment for this repo.

@caio-pizzol
Copy link
Contributor Author

@codex

Copy link
Contributor Author

@codex

@chatgpt-codex-connector
Copy link

Summary

  • Sanitized exported filenames by stripping any trailing .docx extension before delegating to SuperDoc, avoiding duplicate extensions when downloads are triggered manually or automatically. src/index.tsxL590-L606
  • Documented the filename sanitization behavior and clarified that the .docx extension is optional in both download and Blob-mode examples of exportTemplate usage. README.mdL211-L271 src/types.tsL82-L96

Testing

  • pnpm run type-check

View task →

@caio-pizzol caio-pizzol merged commit 7e2a03d into main Nov 13, 2025
1 check passed
@caio-pizzol caio-pizzol deleted the caio/sd-882-make-exporttemplate-download-optional branch November 13, 2025 22:31
@superdoc-bot
Copy link

superdoc-bot bot commented Nov 13, 2025

🎉 This PR is included in version 0.2.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

superdoc-bot bot pushed a commit that referenced this pull request Nov 13, 2025
# [0.2.0](v0.1.0...v0.2.0) (2025-11-13)

### Bug Fixes

* force pre-release ([f752754](f752754))
* improve cleanup logic ([#11](#11)) ([01f0bf9](01f0bf9))
* update field ID type and improve field handling ([#14](#14)) ([e0e6d31](e0e6d31))
* update field IDs and categories in README and App component ([61a473d](61a473d))

### Features

* add import functionality for .docx files in the template builder ([#15](#15)) ([42faccc](42faccc))
* enhance exportTemplate functionality with configurable options ([#17](#17)) ([7e2a03d](7e2a03d))
* enhance field handling with mode support in template builder ([#16](#16)) ([d46ab5d](d46ab5d))
* implement viewport clamping for menu positioning in SuperDocTemplateBuilder ([#10](#10)) ([09e82ee](09e82ee))
@superdoc-bot
Copy link

superdoc-bot bot commented Nov 13, 2025

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants