New plugin: Canvas View — support obsidian like .canvas files inside NotePlan - #785
Open
lifeplayer67 wants to merge 8 commits into
Open
lifeplayer67 wants to merge 8 commits into
lifeplayer67 wants to merge 8 commits into
Conversation
…nside NotePlan New plugin: opens JSON Canvas files in an HTML window with full editing — create/move/resize/color cards, draw edges, labels, multi-select, undo/redo. File cards render the linked note's content and edit it inline (creating the note on first save); styling follows the user's NotePlan theme.
… new-card palette - Fix groups being unclickable: the edges SVG layer sits above groups and was swallowing their mouse events; it is now pointer-events: none (edge hit paths re-enable them), so groups select, drag, resize and rename normally. - Group creation: Cmd+G wraps the selection in a group; the selection toolbar gained a group button; the palette can create an empty group. - Obsidian-style selection: plain drag on the background draws a rubber-band selection (Shift+drag pans; scroll/trackpad pans as before). - New-card palette (text / note / group) that opens the matching editor right after creating the card. - Render markdown checkboxes in cards.
…d, note picker, media, split view Groups (0.5.0): - Fix groups being unclickable: the edges SVG layer sat above groups and swallowed their mouse events; now pointer-events: none with edge hit paths re-enabling them, so groups select, drag, resize and rename normally. - Cmd+G wraps the selection in a group; toolbar gained a group button. - Obsidian-style rubber-band selection on background drag (Shift+drag pans). Obsidian parity (0.6.x): - Drag-to-add palette: drop a text/note/group button where the card should go. - Note picker with autocomplete over all NotePlan notes for file cards. - Images (png/jpg/gif/webp/svg) render inside file cards via data URIs. - Link cards embed website previews (iframe; X-Frame-Options limits apply). - Canvas opens in a split pane inside the main window (setting to revert); one window/sidebar entry per canvas. - /open canvas with no argument lists all indexed .canvas files to pick from. - loadCanvas auto-repairs fold-ellipsis corruption written when a .canvas is opened and folded in the NotePlan text editor; fit() waits for a restored split pane to gain size before laying out. - README documents platform limitations / API wishlist for upstream.
- An unselected group's interior behaves like the background: rubber-band its children (enables nested groups), double-click creates a card inside; the group activates only by its frame (~14px, zoom-independent) or label. - A selected group drags from anywhere inside its bounds. - Starting any background action drops the old selection immediately; a rubber band that fully encloses a group selects the group as well (containment, not intersection, so bands drawn inside a group don't grab it).
… selection - Cmd+C puts the selection (cards + edges between them) on the system clipboard as a JSON Canvas snippet; Cmd+V pastes at the view center with fresh ids — works across canvases and with snippets copied from Obsidian. - File cards re-pull their note content when the pointer enters the canvas pane (window focus is unreliable in the embedded split view), throttled to 2s and never interrupting an open editor or an in-flight drag. - File card bodies scroll (wheel over a card scrolls it instead of panning), so long notes are readable without resizing the card. - F zooms to the selection; with nothing selected it fits the whole canvas.
…E polish - New command '/new canvas': creates an empty .canvas (Canvas folder setting or Canvases/ by default, folder prefix in the name supported) and opens it; openCanvas refactored so both commands share showCanvasWindow(). - All UI strings in English for the community release; README gains an editor cheat-sheet and updated command docs. - Flow errors fixed (nullable split().pop(), no param reassignment).
…side the canvas, editor polish - Note cards render through the repo's shared converter (getNoteContentAsHTML / showdown): full lists, GFM tables, tasklists, emoji, NotePlan hashtags, mentions and highlights; local images embed as data URIs (the webview cannot read files outside the plugin folder). Text cards use the same showdown build shipped as a requiredFile, with a thin post-pass for wikilinks, target=_blank and relative image paths — the hand-rolled renderer is gone. - Both card types map strong/em to the theme's 'p b' / 'p emph' selectors and share one content stylesheet, so bold/italic colors, bullets and tables look identical everywhere. - /new canvas command creates an empty canvas and opens it; English UI strings. - Notes open BESIDE the canvas (split view by default; setting offers new window or main editor) instead of replacing the pane. - Editor polish: double-click places the caret at the clicked spot (rendered point mapped back to the markdown source) and scrolls it into view; wheel over an editor scrolls the editor; card bodies scroll only when the card is selected (Obsidian behaviour), otherwise the canvas pans. - Fold-ellipsis auto-repair on load; Flow clean; 13 Jest tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! First of all, thanks for the great app and flexible plugin system. I migrated to it from Obsidian. I like its native integration with Apple infra and all my calendars. A few things I was missing:
Sorry for doing all of that without discussion. I have ADHD and I would never finish it any other way. It implements almost all canvas features (I list what it doesn't below):
What it doesn't support:
{in the notes list. In addition, I cannot assign the canvas view as the default one for those files, so NotePlan opens the JSON content. This one is critical in my opinion. It would be great to support it natively.I hope you will like it. Let me know if you have any questions or requests.