feat(demo): exercise AI Assistant, corners and custom tool icons - #65
Open
sidgaikwad wants to merge 1 commit into
Open
sidgaikwad wants to merge 1 commit into
sidgaikwad wants to merge 1 commit into
Conversation
|
@sidgaikwad is attempting to deploy a commit to the Unlayer Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Heads-up on an overlap I missed before opening this: #30 by @brenopolanski already adds a dock control to the demo, and predates this PR by two days. The dock portion here duplicates that work. Suggested resolution: merge #30 first and I will rebase this to drop the dock section, keeping the AI Assistant gating, |
Member
|
@sidgaikwad #30 was merged. |
The demo covered theme, locale and the eight tool toggles, leaving several documented options with nothing exercising them. Adds an AI Assistant toggle, gated on a VITE_UNLAYER_PROJECT_ID read from demo/.env.example so the rest of the demo still works without an account; a corners toggle; and a custom icon on the text tool, which demonstrates the object form of a tool entry. Also fixes Snapshot, which fabricated `blob: new Blob()`. The object is shaped like an ImageEditorSaveResult and people read the demo to learn the API, so it should not lie about a field. It now builds the real blob. The dock control originally in this branch is gone: unlayer#30 landed the same control on main first, so this uses main's version and keeps its section wording.
sidgaikwad
force-pushed
the
feat/demo-option-coverage
branch
from
September 12, 2026 17:09
6c4b9b1 to
0b0e185
Compare
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 #40.
The demo is the main thing people try before adopting the component, but several documented options were never wired into it — including the AI Assistant, the README's headline feature.
Added
projectId+features.aiVITE_UNLAYER_PROJECT_ID. When unset, the controls are replaced by a pointer to the newdemo/.env.example, so the demo still works with no Unlayer account.features.imageEditor.docktools.cornersTOOL_NAMESentirely.<svg>markup on the Text tool.Fixed: the snapshot lied about its blob
The Download link worked (it uses
dataUrl), but the object claimed to be anImageEditorSaveResultwhile fabricatingblob— misleading in the file people read to learn the API. It now builds the real blob:The README's own Font Awesome icon example does not work. I started with
icon: 'fa-font', saw no change, and checked properly against the live embed:iconvalue'fa-crop-simple'(the README's example)'fa-star''<svg …>'Filed as #64. This PR uses the raw-
<svg>form, so the demo ships an example that actually does something rather than one that silently no-ops.Verification
Driven against the live CDN embed at 1280×800:
Layout (remounts editor),AI Assistantcornerspresent in the tool togglesleft: 968→left: 0in a 1040px editorprojectIdconfigured in my environment)tsc --noEmit,vite build, root tests and Prettier all clean.Left out deliberately
translations,offline/licenseUrl/envandscriptUrl. Each needs real scaffolding (a translations fixture, a license file, an alternate CDN) that would make this PR much harder to review, and none is as load-bearing as the AI Assistant gap. Happy to follow up.Conflict note
Touches
demo/src/App.tsx,Sidebar.tsxandstyles.css, so it will conflict with #59 (demo responsive/theme).