docs: document scriptUrl, the offline options, and the exported types - #54
Open
sidgaikwad wants to merge 1 commit into
Open
docs: document scriptUrl, the offline options, and the exported types#54sidgaikwad wants to merge 1 commit into
sidgaikwad wants to merge 1 commit into
Conversation
`scriptUrl` is fully implemented and tested but was absent from the props table, so the only supported way to pin an embed environment was undiscoverable outside the .d.ts. Add it, along with the doc comment's caveat about one embed winning per page. Also close the gaps around it: - `offline`, `licenseUrl` and `env` were named in the options row but never explained anywhere. Give them a section with a worked example. - Add a TypeScript usage example — every other example was JSX — and a table of the exported types. The TypeScript example is verified to compile against the real source types via the demo's tsconfig.
|
@sidgaikwad is attempting to deploy a commit to the Unlayer Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36.
scriptUrl(the actual bug)scriptUrlis a fully implemented, fully tested prop —loadScript(scriptUrl), part of the remount effect's deps, covered by "forwards a custom scriptUrl to loadScript" and "remounts when scriptUrl changes". But it was absent from the props table, so the only supported way to pin an embed environment was undiscoverable short of reading the.d.ts.Added, along with the caveat already written in its doc comment — the kind of thing people otherwise discover by breaking it:
The related gaps from the issue
Offline / self-hosted assets.
offline,licenseUrlandenvwere named in theoptionsrow and explained nowhere — that's the entire offline and self-hosted-assets story. New section with a table and a worked example, plus a note thatenvis remount-tier.TypeScript. Every example was JSX. Added a
.tsxexample and a table of the five exported types (ImageEditorProps,ImageEditorOptions,ImageEditorRef,ImageEditorInstance,ImageEditorSaveResult).Verification
The TypeScript example isn't hand-waved — I extracted it from the README and compiled it against the real source types through the demo's tsconfig:
Prettier clean.