-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notes): allow attaching notes everywhere
- Loading branch information
1 parent
1d320a6
commit 6a05099
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/default-packages/unigraph.notes/entities/add_note_context_menu.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": { "unigraph.id": "$/schema/context_menu_item" }, | ||
"name": "Attach note to object", | ||
"item_type": {"unigraph.id": "$/schema/any"}, | ||
"on_click": {"unigraph.id": "$/package/unigraph.notes/0.0.1/executable/attach-note"}, | ||
"icon": "%3Csvg xmlns='http://www.w3.org/2000/svg' style='width:24px;height:24px' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M5 19V5H12V12H19V13C19.7 13 20.37 13.13 21 13.35V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H13.35C13.13 20.37 13 19.7 13 19H5M14 4.5L19.5 10H14V4.5M23 18V20H20V23H18V20H15V18H18V15H20V18H23Z' /%3E%3C/svg%3E" | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/default-packages/unigraph.notes/executables/attachNote.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { uid } = context.params; | ||
|
||
const newNote = (await unigraph.addObject({ | ||
text: { | ||
_value: '', | ||
type: { 'unigraph.id': '$/schema/markdown' }, | ||
}, | ||
}, '$/schema/note_block'))[0]; | ||
unigraph.runExecutable('$/executable/add-item-to-list', { where: uid, item: newNote }); | ||
window?.wsnavigator?.(`/library/object?uid=${newNote}&viewer=${'dynamic-view-detailed'}&type=$/schema/note_block`); |
This file contains 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
This file contains 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
This file contains 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