See this issue.
Directly create and edit Excalidraw images in vscode.
Edit or create a file with .excalidraw
extension.
It embeds a modified version of Excalidraw to edit files.
Excalidraw integration for vscode
Home Page: https://marketplace.visualstudio.com/items?itemName=brijeshb42.vscode-excalidraw
See this issue.
Directly create and edit Excalidraw images in vscode.
Edit or create a file with .excalidraw
extension.
It embeds a modified version of Excalidraw to edit files.
I noticed that libraries are not supported yet, I'd like them to be there.
More info: https://libraries.excalidraw.com/
Like the title, I hope to support the special svg suffix like drawio/vscode-mindmap, which is very friendly for inserting this kind of data in markdown!
Then there are two small suggestions
Read the theme and language of vscode to use the theme and language corresponding to excalidraw
Support the use of some excalidraw settings, such as whether to display the grid
A suggestion on development
Use @excalidraw/excalidraw npm package for finer control
Can you export to png? i'm not seeing a way to do that.
Not sure what else to add. I'm using a Mac.
First of all, awesome work with this! I've been waiting for someone to tackle a VSCode extension for excalidraw.
In the regular app, holding the spacebar while dragging scrolls the scene.
Currently, in the extension, this interaction does not seem to work.
This is a really convenient way to navigate, and it would be great if we could get that working in the VSCode extension as well!
The latest version of Excalidraw has a lot of great new features (such as aligning/grid, etc). I understand that this extension is running a slightly modified version of the tool, so it might be not so trivial to upgrade it.
How difficult would it be to upgrade it? Alternatively, would you mind sharing what are the customisations you have made, so I can try and upgrade it myself?
I can save files, I think, but it never clears the dirty flag for some reason.
Hello ๐ I'm from the VS Code team.
Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.
We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace. Custom editors are special in that if they cannot at least render in an untrusted state then they will be replaced by a lightweight message telling the user to enable trust. This means that users of your extension will not be able to see their editors and there may even be cases of data loss.
You can enable the feature with the following setting security.workspace.trust.enabled
. Once enabled, you will see the following dialog when opening folders in VS Code.
This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt
.
You can follow the development of Workspace Trust and provide feedback in issue #106488.
First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.
The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.
You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces
capability in package.json
.
The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.
"capabilities": {
"untrustedWorkspaces": {
"supported": true
}
}
The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.
"capabilities": {
"untrustedWorkspaces": {
"supported": false
}
}
The third option is to declared limited
support. There are three tools provided to you when you select the limited
option.
First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations
array property in untrustedWorkspaces
object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.
The following example declares the settings that are restricted in untrusted workspaces.
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"restrictedConfigurations": [
"markdown.styles"
]
}
}
Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:
export namespace workspace {
/**
* When true, the user has explicitly trusted the contents of the workspace.
*/
export const isTrusted: boolean;
/**
* Event that fires when the current workspace has been trusted.
*/
export const onDidGrantWorkspaceTrust: Event<void>;
}
Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted
context key in your when clauses.
A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.
We are planning on enabling this by default in the near future (most likely next release). To prepare for that day, we want to work with you to allow your editor to work seamlessly alongside the trusted workspace experience
The main features that should work for custom editors in an untrusted folder is rendering, viewing, and saving (if applicable). After reviewing your codebase, I believe that your extension doesn't rely on user contents in a way that could be taken advantage of if the files were malicious. My initial assessment would be to adopt supported:true
and allow your extension to operate in untrusted workspaces.
Please let me know if you have any question or would like to meet up via voice chat as I would be happy to assist you in getting your extension ready for workspace trust!
Thank you for this great useful tools.
Any keyboard key (movement . copy/paste, etc) not working in the extension
Details:
Error: Unable to open 'test.excalidraw': Assertion Failed: argument is undefined or null.
test.excalidraw:
{
"type": "excalidraw",
"version": 1,
"source": "http://localhost:55951",
"elements": [
{
"id": "gDBuG_S2hF8EivpmfSEDL",
"type": "rectangle",
"x": 317,
"y": 174,
"width": 494,
"height": 287,
"angle": 0,
"strokeColor": "#000000",
"backgroundColor": "transparent",
"fillStyle": "hachure",
"strokeWidth": 1,
"roughness": 1,
"opacity": 100,
"seed": 2083528035,
"version": 20,
"versionNonce": 810323885,
"isDeleted": false
}
],
"appState": {
"viewBackgroundColor": "#ffffff"
}
}
The when
clause for the key binding to the brijeshb42-excalidraw.deleteshape
command is too unspecific. Currently, it is editorIsOpen
, which prevents sometimes the normal delete key functionality in text editors.
Hello, I am the maintainer of https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor.
My extension is based on the excalidraw npm package, so it is quite easy to maintain. However, this was my first javascript project, so the code quality is pretty low.
What do you think of merging the two projects? We can work together on a PR to add the npm package in your extension and deprecate mine. It should resolve #14, #13, and #3.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.