@whdigitalbuild/excalidraw
v1.0.10
Published
Wohhup Digital's customized Excalidraw as a React component
Downloads
318
Readme
@whdigitalbuild/excalidraw
Wohhup Digital's customized Excalidraw - A modified version of Excalidraw exported as a React component to directly embed in your projects.
Installation
You can use npm
npm install react react-dom @whdigitalbuild/excalidrawor via yarn
yarn add react react-dom @whdigitalbuild/excalidrawNote: This is a private package. You need to authenticate with npm and have access to the @whdigitalbuild organization scope.
After installation you will see a folder excalidraw-assets and excalidraw-assets-dev in dist directory which contains the assets needed for this app in prod and dev mode respectively.
Move the folder excalidraw-assets and excalidraw-assets-dev to the path where your assets are served.
By default it will try to load the files from https://unpkg.com/@whdigitalbuild/excalidraw/dist/
If you want to load assets from a different path you can set a variable window.EXCALIDRAW_ASSET_PATH depending on environment (for example if you have different URL's for dev and prod) to the url from where you want to load the assets.
Dimensions of Excalidraw
Excalidraw takes 100% of width and height of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.
Demo
Integration
This package follows the same API as the original Excalidraw. You can refer to the official Excalidraw documentation for integration details.
API
See the official Excalidraw API documentation for available props and methods.
Custom Features
This customized version includes additional features and modifications:
- Custom import functionality for Revit JSON format
- Enhanced Properties Panel with grouping and inline editing
- Additional UI controls and customization options
Building and Publishing
Build Package
From the root directory:
yarn build:excalidrawOr from the package directory:
cd excalidraw-source/src/packages/excalidraw
yarn build:umdTest Local Build
Create a tarball to test locally:
yarn pack:excalidrawThis creates a .tgz file that can be installed locally:
npm install ./whdigitalbuild-excalidraw-0.17.3.tgzPublish to npm
Before publishing:
Ensure you're logged into npm with an account that has access to
@whdigitalbuildscope:npm login npm whoami # VerifyTest with dry-run first:
yarn publish:excalidraw:dry-runPublish:
yarn publish:excalidraw
Version Management:
- Update version in
excalidraw-source/src/packages/excalidraw/package.jsonbefore publishing - Follow semantic versioning (major.minor.patch)
- Consider using
npm versioncommand for version bumps
Repository
License
MIT
