-
-
Notifications
You must be signed in to change notification settings - Fork 915
feat: Add Iconify support #1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: Add Iconify support #1731
Conversation
✅ Deploy Preview for mermaidjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
* develop: fix: mermaid-js#1766 hide external buttons if env var is not set chore: Rename layout to ts fix(deps): update dependency mermaid to ^11.9.0 feat: Add Treemap support (mermaid 11.8.1) chore: Update text-size Chore: Update banner ad
I've added a script to generate new json schema for live editor, and use that instead of the mermaid schema. I've also moved the live-editor specific config into a |
…mermaid-live-editor into pr/VanceVisarisTenenbaum/1731 * 'pr-branch' of https://github.com/vancevisaristenenbaum/mermaid-live-editor: chore: Run tests on merge queue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Iconify support to the live editor, allowing users to configure and use icon packages from Iconify in their Mermaid diagrams through configuration settings.
- Extends MermaidConfig with a new
liveEditor.icons
configuration section - Implements icon package loading from npmjs via jsdelivr CDN or direct URLs
- Adds validation for package version specifications and error handling for icon fetching
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/lib/util/state.ts | Updates state management to use ExtendedMermaidConfig and includes default icon configuration |
src/lib/util/mermaid.ts | Core implementation of Iconify support with icon loading, validation, and registration |
src/lib/util/mermaid.test.ts | Comprehensive test suite for package version validation |
src/lib/components/View.svelte | Updates render call to pass config parameter and use ExtendedMermaidConfig |
src/lib/components/DesktopEditor.svelte | Changes schema URI to use local schema file |
package.json | Adds schema generation step to build process |
.vscode/settings.json | Adds "Iconify" to spell check dictionary |
I synced my fork with the latest changes, and since It is the same branch I used for the PR, this message appeared, hope there is no issue with it, im still learning git. Also, I saw the changes, since the review was requested to a mermaid dev I assume I have to to nothing else here. Sorry for the inconvenience with this little update. |
No issues. |
📑 Summary
Iconify support added to the live editor.
Resolves #1566
📏 Design Decisions
In config tab you have this by default.
Now you can add your icons from iconify like this.
Using the example from architecture docs your config should be:
The icons are downloaded from jsdelivr, or the provided URL
📋 Tasks
Make sure you
develop
branchAdditional notes
I already tried to add icons using an extension a long time ago. Now I have tried directly using the live editor.
There is some small issue in the editor, that it tells you that "icons" is not a property from MermaidConfig (which is true) and rn idk how to solve, but I would like some feedback from devs for this.