add html to canvas download utils for using in mini-editor - #679
add html to canvas download utils for using in mini-editor#679vvineett wants to merge 22 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
There was a problem hiding this comment.
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
e1f5a23 to
c58bc84
Compare
There was a problem hiding this comment.
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
7e839c2 to
11007f0
Compare
| // Placeholder handlers — real edit/share behavior (deep-link to the | ||
| // Express editor and Web Share API) is follow-up work. | ||
| topActions: [ | ||
| { type: 'edit', onClick: () => console.info('mini-editor: edit action not yet implemented') }, |
There was a problem hiding this comment.
Unexpected console statement.
| // Express editor and Web Share API) is follow-up work. | ||
| topActions: [ | ||
| { type: 'edit', onClick: () => console.info('mini-editor: edit action not yet implemented') }, | ||
| { type: 'share', onClick: () => console.info('mini-editor: share action not yet implemented') }, |
There was a problem hiding this comment.
Unexpected console statement.
There was a problem hiding this comment.
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
There was a problem hiding this comment.
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.
Summary
Added a generic "capture an
HTMLElementand download it as an image" utility, vendoringhtml2canvasper this repo's existing convention (no CDN, no bare npm imports).New files:
express/code/scripts/utils/download-utils.js—captureElementAsImage()/downloadElementAsImage()express/code/libs/deps/html2canvas.js+html2canvas-all.min.js— esbuild-bundled vendored dep (same pattern asdelta-e/lit)test/scripts/utils/download-utils.test.js— unit tests (sinon-stubbedHtml2CanvasLoader)Modified:
package.json— addedhtml2canvasdevDependencyexpress/code/libs/deps/README.md— documented thehtml2canvasvendoringexpress/code/scripts/utils/README.md— documented the new utility's APIKey decisions:
dom-to-image-style libs, since.browserslistrcrequires Safari ≥15 (unreliableforeignObjectsupport there)loadScript— matches repo convention for npm packages that need real ES importscaptureElementAsImagesplit into a sync wrapper (validates element, throws immediately) + async inner function (rest of the work), so misuse doesn't surface as an unhandled promise rejectionJira Ticket
Resolves: MWPW-NUMBER
Test URLs
Verification Steps
Potential Regressions
Additional Notes
(If applicable) Add context, related PRs, or known issues here.