feat(demo): exercise AI Assistant, dock, corners and custom icons - #65
Open
sidgaikwad wants to merge 1 commit into
Open
feat(demo): exercise AI Assistant, dock, corners and custom icons#65sidgaikwad wants to merge 1 commit into
sidgaikwad wants to merge 1 commit into
Conversation
The demo is what people try before adopting the component, but several documented options were never wired into it — including the AI Assistant, which is the README's headline feature. - AI Assistant, gated on VITE_UNLAYER_PROJECT_ID. The controls are replaced by a pointer to demo/.env.example when it is unset, so the demo still works without an Unlayer account. - features.imageEditor.dock, as a Left/Right tool rail selector. - tools.corners, which was missing from TOOL_NAMES entirely — it is configured like any other tool but is the rounded-corners control inside Crop. - A custom tool icon, using raw <svg> markup. Not the Font Awesome name form the README shows: that is silently ignored (unlayer#64). Also fix snapshot(), which fabricated `blob: new Blob()`. The download link worked because it uses dataUrl, but the object claimed to be an ImageEditorSaveResult while lying about `blob` — misleading in the file people read to learn the API. It now builds the real blob.
|
@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, |
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).