Skip to content
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

Feature/excalidraw #50

Merged
merged 19 commits into from
Nov 25, 2024
Merged

Feature/excalidraw #50

merged 19 commits into from
Nov 25, 2024

Conversation

lebalz
Copy link
Contributor

@lebalz lebalz commented Nov 15, 2024

Excalidraw

Adds the type Excalidoc which contains the scene data of an excalidraw document. Excalidraw is a react library that is handy for quick drawings with simple geometries, pencils, text and images.

👉 https://deploy-preview-50--teaching-dev.netlify.app/docs/komponentengalerie/excalidoc/

Stuff to do:

  • Props for the default dimensions
  • Possibility to provide a default scene as props
  • save a preview image that is shown, when the editor is loaded or the component is not active...

Copy link

netlify bot commented Nov 15, 2024

Deploy Preview for teaching-dev ready!

Name Link
🔨 Latest commit b5804dc
🔍 Latest deploy log https://app.netlify.com/sites/teaching-dev/deploys/6744fad88db5dd0008d5052d
😎 Deploy Preview https://deploy-preview-50--teaching-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lebalz lebalz marked this pull request as draft November 15, 2024 10:49
@lebalz lebalz marked this pull request as ready for review November 17, 2024 12:43
@lebalz lebalz requested a review from SilasBerger November 24, 2024 23:07
@@ -214,20 +214,26 @@ abstract class iDocument<Type extends DocumentType> {
}

@action
_save() {
_save(onBeforeSave: () => Promise<void> = () => Promise.resolve()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new concept - if work needs to be done before saving (as generating the preview-image of excalidraw), a Promise can be passet to model.save and it will be called only when the debounced _save is called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍 I could see this become useful in other future scenarios.

Copy link
Contributor

@SilasBerger SilasBerger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, and I tested it on Netlify: it seems to work flawlessly 🥳 Thanks, very cool addition!

@@ -214,20 +214,26 @@ abstract class iDocument<Type extends DocumentType> {
}

@action
_save() {
_save(onBeforeSave: () => Promise<void> = () => Promise.resolve()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍 I could see this become useful in other future scenarios.

@lebalz lebalz merged commit 8099848 into main Nov 25, 2024
5 checks passed
@lebalz lebalz deleted the feature/excalidraw branch November 25, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants