From d34d265d014d9d366652ffb04931ed5f7b8d8487 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 7 Apr 2020 19:19:20 +0200 Subject: [PATCH] API docs update --- docs/backend_api/ApiToken.html | 2 +- docs/backend_api/Attribute.html | 6 +- docs/backend_api/BackendScriptApi.html | 153 ++++--- docs/backend_api/Branch.html | 109 ++++- docs/backend_api/Entity.html | 2 +- docs/backend_api/Note.html | 130 +++--- docs/backend_api/NoteRevision.html | 4 +- docs/backend_api/Option.html | 2 +- docs/backend_api/RecentNote.html | 2 +- docs/backend_api/entities_api_token.js.html | 2 +- docs/backend_api/entities_attribute.js.html | 14 +- docs/backend_api/entities_branch.js.html | 11 +- docs/backend_api/entities_entity.js.html | 2 +- docs/backend_api/entities_note.js.html | 25 +- .../entities_note_revision.js.html | 19 +- docs/backend_api/entities_option.js.html | 2 +- docs/backend_api/entities_recent_note.js.html | 2 +- docs/backend_api/global.html | 2 +- docs/backend_api/index.html | 2 +- .../services_backend_script_api.js.html | 10 +- docs/frontend_api/Branch.html | 2 +- docs/frontend_api/FrontendScriptApi.html | 422 +++++++++++++++--- docs/frontend_api/NoteComplement.html | 2 +- docs/frontend_api/NoteShort.html | 58 +-- docs/frontend_api/entities_attribute.js.html | 11 +- docs/frontend_api/entities_branch.js.html | 2 +- .../entities_note_complement.js.html | 2 +- docs/frontend_api/entities_note_short.js.html | 7 +- docs/frontend_api/global.html | 4 +- docs/frontend_api/index.html | 2 +- .../services_frontend_script_api.js.html | 20 +- package-lock.json | 114 +++-- package.json | 6 +- 33 files changed, 806 insertions(+), 347 deletions(-) diff --git a/docs/backend_api/ApiToken.html b/docs/backend_api/ApiToken.html index 5c512b555..41b156f6e 100644 --- a/docs/backend_api/ApiToken.html +++ b/docs/backend_api/ApiToken.html @@ -293,7 +293,7 @@
diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html index b77a8819d..f07079d7a 100644 --- a/docs/backend_api/Attribute.html +++ b/docs/backend_api/Attribute.html @@ -595,7 +595,7 @@
Source:
@@ -697,7 +697,7 @@
Source:
@@ -767,7 +767,7 @@
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html index c4a1e9e57..64c41cef3 100644 --- a/docs/backend_api/BackendScriptApi.html +++ b/docs/backend_api/BackendScriptApi.html @@ -351,69 +351,6 @@ -

refreshTree

- - - - -
- Trigger tree refresh in all connected clients. This is required when some tree change happens in -the backend. -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - -

startNote

@@ -1817,7 +1754,7 @@ JSON MIME type. See also createNewNote() for more options.
Source:
@@ -4321,6 +4258,92 @@ if some action needs to happen on only one specific instance. + + + + + + +

refreshTree()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • - this is now no-op since all the changes should be gracefully handled per widget
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -5376,7 +5399,7 @@ transactional by default.
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html index 59f845dc4..e77403c78 100644 --- a/docs/backend_api/Branch.html +++ b/docs/backend_api/Branch.html @@ -423,7 +423,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in -

(async) getNote() → {Note|null}

+

(async) getNote() → {Promise.<(Note|null)>}

@@ -507,10 +507,109 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
-Note -| +Promise.<(Note|null)> -null + +
+ + + + + + + + + + + + + + +

(async) getParentNote() → {Promise.<(Note|null)>}

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<(Note|null)>
@@ -544,7 +643,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
diff --git a/docs/backend_api/Entity.html b/docs/backend_api/Entity.html index 6e3118974..e3697bba1 100644 --- a/docs/backend_api/Entity.html +++ b/docs/backend_api/Entity.html @@ -218,7 +218,7 @@
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index 23591433e..e3e3c2a14 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -583,7 +583,7 @@
Source:
@@ -685,7 +685,7 @@
Source:
@@ -863,7 +863,7 @@
Source:
@@ -1063,7 +1063,7 @@
Source:
@@ -1241,7 +1241,7 @@
Source:
@@ -1347,7 +1347,7 @@
Source:
@@ -1449,7 +1449,7 @@
Source:
@@ -1555,7 +1555,7 @@
Source:
@@ -1763,7 +1763,7 @@
Source:
@@ -1996,7 +1996,7 @@
Source:
@@ -2194,7 +2194,7 @@
Source:
@@ -2392,7 +2392,7 @@
Source:
@@ -2494,7 +2494,7 @@
Source:
@@ -2645,7 +2645,7 @@
Source:
@@ -2812,7 +2812,7 @@
Source:
@@ -2979,7 +2979,7 @@
Source:
@@ -3134,7 +3134,7 @@
Source:
@@ -3246,7 +3246,7 @@
Source:
@@ -3348,7 +3348,7 @@
Source:
@@ -3555,7 +3555,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -3733,7 +3733,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -3888,7 +3888,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4055,7 +4055,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4210,7 +4210,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4365,7 +4365,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4532,7 +4532,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4687,7 +4687,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4845,7 +4845,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -4951,7 +4951,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5106,7 +5106,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5273,7 +5273,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5440,7 +5440,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5595,7 +5595,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5765,7 +5765,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -5916,7 +5916,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6026,7 +6026,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6128,7 +6128,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6234,7 +6234,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6412,7 +6412,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6518,7 +6518,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6673,7 +6673,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -6851,7 +6851,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -7006,7 +7006,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -7161,7 +7161,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -7316,7 +7316,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
Source:
@@ -7427,7 +7427,7 @@ Cache is note instance scoped.
Source:
@@ -7555,7 +7555,7 @@ Cache is note instance scoped.
Source:
@@ -7661,7 +7661,7 @@ Cache is note instance scoped.
Source:
@@ -7767,7 +7767,7 @@ Cache is note instance scoped.
Source:
@@ -7873,7 +7873,7 @@ Cache is note instance scoped.
Source:
@@ -7979,7 +7979,7 @@ Cache is note instance scoped.
Source:
@@ -8085,7 +8085,7 @@ Cache is note instance scoped.
Source:
@@ -8191,7 +8191,7 @@ Cache is note instance scoped.
Source:
@@ -8420,7 +8420,7 @@ Cache is note instance scoped.
Source:
@@ -8618,7 +8618,7 @@ Cache is note instance scoped.
Source:
@@ -8816,7 +8816,7 @@ Cache is note instance scoped.
Source:
@@ -9045,7 +9045,7 @@ Cache is note instance scoped.
Source:
@@ -9147,7 +9147,7 @@ Cache is note instance scoped.
Source:
@@ -9249,7 +9249,7 @@ Cache is note instance scoped.
Source:
@@ -9447,7 +9447,7 @@ Cache is note instance scoped.
Source:
@@ -9645,7 +9645,7 @@ Cache is note instance scoped.
Source:
@@ -9905,7 +9905,7 @@ Cache is note instance scoped.
Source:
@@ -10134,7 +10134,7 @@ Cache is note instance scoped.
Source:
@@ -10363,7 +10363,7 @@ Cache is note instance scoped.
Source:
@@ -10433,7 +10433,7 @@ Cache is note instance scoped.
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html index 232710773..e75e06cde 100644 --- a/docs/backend_api/NoteRevision.html +++ b/docs/backend_api/NoteRevision.html @@ -744,7 +744,7 @@
Source:
@@ -814,7 +814,7 @@
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html index 8bde36791..c314ec75b 100644 --- a/docs/backend_api/Option.html +++ b/docs/backend_api/Option.html @@ -316,7 +316,7 @@
diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html index 756a21c9d..5691dac95 100644 --- a/docs/backend_api/RecentNote.html +++ b/docs/backend_api/RecentNote.html @@ -293,7 +293,7 @@
diff --git a/docs/backend_api/entities_api_token.js.html b/docs/backend_api/entities_api_token.js.html index 5d835d2e3..989b211a9 100644 --- a/docs/backend_api/entities_api_token.js.html +++ b/docs/backend_api/entities_api_token.js.html @@ -75,7 +75,7 @@ module.exports = ApiToken;
diff --git a/docs/backend_api/entities_attribute.js.html b/docs/backend_api/entities_attribute.js.html index 0b77893ce..031da57b1 100644 --- a/docs/backend_api/entities_attribute.js.html +++ b/docs/backend_api/entities_attribute.js.html @@ -73,11 +73,7 @@ class Attribute extends Entity { * @returns {Promise<Note|null>} */ async getNote() { - if (!this.__note) { - this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]); - } - - return this.__note; + return await repository.getNote(this.noteId); } /** @@ -92,11 +88,7 @@ class Attribute extends Entity { return null; } - if (!this.__targetNote) { - this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]); - } - - return this.__targetNote; + return await repository.getNote(this.value); } /** @@ -176,7 +168,7 @@ module.exports = Attribute;
diff --git a/docs/backend_api/entities_branch.js.html b/docs/backend_api/entities_branch.js.html index 3f2783289..0974e918b 100644 --- a/docs/backend_api/entities_branch.js.html +++ b/docs/backend_api/entities_branch.js.html @@ -56,9 +56,14 @@ class Branch extends Entity { // notePosition is not part of hash because it would produce a lot of updates in case of reordering static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; } - /** @returns {Note|null} */ + /** @returns {Promise<Note|null>} */ async getNote() { - return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]); + return await repository.getNote(this.noteId); + } + + /** @returns {Promise<Note|null>} */ + async getParentNote() { + return await repository.getNote(this.parentNoteId); } async beforeSaving() { @@ -116,7 +121,7 @@ module.exports = Branch;
diff --git a/docs/backend_api/entities_entity.js.html b/docs/backend_api/entities_entity.js.html index 53740aec6..a51e29a00 100644 --- a/docs/backend_api/entities_entity.js.html +++ b/docs/backend_api/entities_entity.js.html @@ -102,7 +102,7 @@ module.exports = Entity;
diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html index 484b0a84b..eb01e6e38 100644 --- a/docs/backend_api/entities_note.js.html +++ b/docs/backend_api/entities_note.js.html @@ -123,15 +123,16 @@ class Note extends Entity { this.content = ""; } } - - if (this.isStringNote()) { - this.content = this.content === null - ? "" - : this.content.toString("UTF-8"); - } } - return this.content; + if (this.isStringNote()) { + return this.content === null + ? "" + : this.content.toString("UTF-8"); + } + else { + return this.content; + } } /** @returns {Promise<*>} */ @@ -838,11 +839,9 @@ class Note extends Entity { SELECT * FROM attributes WHERE noteId = ? AND - isDeleted = 0 AND - ((type = 'relation' AND - name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink')) - OR - (type = 'label' AND name = 'externalLink'))`, [this.noteId]); + isDeleted = 0 AND + type = 'relation' AND + name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink')`, [this.noteId]); } /** @@ -991,7 +990,7 @@ module.exports = Note;
diff --git a/docs/backend_api/entities_note_revision.js.html b/docs/backend_api/entities_note_revision.js.html index 8557348d0..3fddcc676 100644 --- a/docs/backend_api/entities_note_revision.js.html +++ b/docs/backend_api/entities_note_revision.js.html @@ -76,7 +76,7 @@ class NoteRevision extends Entity { } async getNote() { - return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]); + return await repository.getNote(this.noteId); } /** @returns {boolean} true if the note has string content (not binary) */ @@ -117,15 +117,16 @@ class NoteRevision extends Entity { this.content = ""; } } - - if (this.isStringNote()) { - this.content = this.content === null - ? "" - : this.content.toString("UTF-8"); - } } - return this.content; + if (this.isStringNote()) { + return this.content === null + ? "" + : this.content.toString("UTF-8"); + } + else { + return this.content; + } } /** @returns {Promise} */ @@ -198,7 +199,7 @@ module.exports = NoteRevision;
diff --git a/docs/backend_api/entities_option.js.html b/docs/backend_api/entities_option.js.html index 7b658bfdd..b8f1dbd93 100644 --- a/docs/backend_api/entities_option.js.html +++ b/docs/backend_api/entities_option.js.html @@ -82,7 +82,7 @@ module.exports = Option;
diff --git a/docs/backend_api/entities_recent_note.js.html b/docs/backend_api/entities_recent_note.js.html index b820fdced..510c9a666 100644 --- a/docs/backend_api/entities_recent_note.js.html +++ b/docs/backend_api/entities_recent_note.js.html @@ -75,7 +75,7 @@ module.exports = RecentNote;
diff --git a/docs/backend_api/global.html b/docs/backend_api/global.html index 7f36be767..a060ec36e 100644 --- a/docs/backend_api/global.html +++ b/docs/backend_api/global.html @@ -1089,7 +1089,7 @@
diff --git a/docs/backend_api/index.html b/docs/backend_api/index.html index 62ed0511a..df34aab26 100644 --- a/docs/backend_api/index.html +++ b/docs/backend_api/index.html @@ -56,7 +56,7 @@
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index 480a977cd..caa3973a9 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -415,12 +415,10 @@ function BackendScriptApi(currentNote, apiParams) { this.sql = sql; /** - * Trigger tree refresh in all connected clients. This is required when some tree change happens in - * the backend. - * - * @returns {Promise<void>} + * @method + * @deprecated - this is now no-op since all the changes should be gracefully handled per widget */ - this.refreshTree = ws.refreshTree; + this.refreshTree = () => {}; /** * @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version @@ -445,7 +443,7 @@ module.exports = BackendScriptApi;
diff --git a/docs/frontend_api/Branch.html b/docs/frontend_api/Branch.html index a6c630ea5..e4d6a52e8 100644 --- a/docs/frontend_api/Branch.html +++ b/docs/frontend_api/Branch.html @@ -885,7 +885,7 @@
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index 503b92f67..bf5e6142f 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -81,7 +81,7 @@
Source:
@@ -223,7 +223,113 @@
Source:
+ + + + + + + +
+ + + + + + + + +

BasicWidget

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +BasicWidget + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -329,7 +435,7 @@
Source:
@@ -439,7 +545,7 @@
Source:
@@ -552,7 +658,7 @@
Source:
@@ -662,7 +768,219 @@
Source:
+ + + + + + + +
+ + + + + + + + +

TabAwareWidget

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +TabAwareWidget + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

TabCachingWidget

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + +TabCachingWidget + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -791,7 +1109,7 @@
Source:
@@ -946,7 +1264,7 @@
Source:
@@ -1101,7 +1419,7 @@
Source:
@@ -1238,7 +1556,7 @@
Source:
@@ -1394,7 +1712,7 @@
Source:
@@ -1574,7 +1892,7 @@
Source:
@@ -1707,7 +2025,7 @@
Source:
@@ -1813,7 +2131,7 @@
Source:
@@ -1919,7 +2237,7 @@
Source:
@@ -2073,7 +2391,7 @@
Source:
@@ -2210,7 +2528,7 @@
Source:
@@ -2317,7 +2635,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2472,7 +2790,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2628,7 +2946,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2829,7 +3147,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -2935,7 +3253,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3090,7 +3408,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3241,7 +3559,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3349,7 +3667,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3505,7 +3823,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3661,7 +3979,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3697,17 +4015,13 @@ otherwise (by e.g. createNoteLink()) -

refreshTree() → {Promise.<void>}

+

refreshTree()

-
- Refresh tree -
- @@ -3737,6 +4051,8 @@ otherwise (by e.g. createNoteLink()) +
Deprecated:
  • - this is now no-op since all the changes should be gracefully handled per widget
+ @@ -3749,7 +4065,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3774,24 +4090,6 @@ otherwise (by e.g. createNoteLink()) -
Returns:
- - - - -
-
- Type -
-
- -Promise.<void> - - -
-
- - @@ -3904,7 +4202,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -4065,7 +4363,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4173,7 +4471,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4311,7 +4609,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4467,7 +4765,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4622,7 +4920,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4773,7 +5071,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4910,7 +5208,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -5047,7 +5345,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -5139,7 +5437,7 @@ Typical use case is when new note has been created, we should wait until it is s
Source:
@@ -5191,7 +5489,7 @@ Typical use case is when new note has been created, we should wait until it is s
diff --git a/docs/frontend_api/NoteComplement.html b/docs/frontend_api/NoteComplement.html index dedca732a..02e7ea197 100644 --- a/docs/frontend_api/NoteComplement.html +++ b/docs/frontend_api/NoteComplement.html @@ -513,7 +513,7 @@
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html index 19c7b6425..d3c633784 100644 --- a/docs/frontend_api/NoteShort.html +++ b/docs/frontend_api/NoteShort.html @@ -1159,7 +1159,7 @@
Source:
@@ -1537,7 +1537,7 @@
Source:
@@ -2202,7 +2202,7 @@
Source:
@@ -2369,7 +2369,7 @@
Source:
@@ -2536,7 +2536,7 @@
Source:
@@ -2691,7 +2691,7 @@
Source:
@@ -2869,7 +2869,7 @@
Source:
@@ -3247,7 +3247,7 @@
Source:
@@ -3402,7 +3402,7 @@
Source:
@@ -3569,7 +3569,7 @@
Source:
@@ -3724,7 +3724,7 @@
Source:
@@ -3879,7 +3879,7 @@
Source:
@@ -4046,7 +4046,7 @@
Source:
@@ -4201,7 +4201,7 @@
Source:
@@ -4560,7 +4560,7 @@
Source:
@@ -4727,7 +4727,7 @@
Source:
@@ -4894,7 +4894,7 @@
Source:
@@ -5049,7 +5049,7 @@
Source:
@@ -5219,7 +5219,7 @@
Source:
@@ -5370,7 +5370,7 @@
Source:
@@ -5480,7 +5480,7 @@
Source:
@@ -5654,7 +5654,7 @@
Source:
@@ -5911,7 +5911,7 @@
Source:
@@ -6089,7 +6089,7 @@
Source:
@@ -6244,7 +6244,7 @@
Source:
@@ -6399,7 +6399,7 @@
Source:
@@ -6554,7 +6554,7 @@
Source:
@@ -6665,7 +6665,7 @@ Cache is note instance scoped.
Source:
@@ -6819,7 +6819,7 @@ Cache is note instance scoped.
diff --git a/docs/frontend_api/entities_attribute.js.html b/docs/frontend_api/entities_attribute.js.html index 5b9095b62..6c73abfce 100644 --- a/docs/frontend_api/entities_attribute.js.html +++ b/docs/frontend_api/entities_attribute.js.html @@ -55,6 +55,15 @@ return await this.treeCache.getNote(this.noteId); } + get jsonValue() { + try { + return JSON.parse(this.value); + } + catch (e) { + return null; + } + } + get toString() { return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`; } @@ -76,7 +85,7 @@ export default Attribute;
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html index aecc310ae..1c60b1af3 100644 --- a/docs/frontend_api/entities_branch.js.html +++ b/docs/frontend_api/entities_branch.js.html @@ -87,7 +87,7 @@ export default Branch;
diff --git a/docs/frontend_api/entities_note_complement.js.html b/docs/frontend_api/entities_note_complement.js.html index 03e78d1b5..5e85d7b9a 100644 --- a/docs/frontend_api/entities_note_complement.js.html +++ b/docs/frontend_api/entities_note_complement.js.html @@ -67,7 +67,7 @@ export default NoteComplement;
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html index bffc5366b..34a9d0e20 100644 --- a/docs/frontend_api/entities_note_short.js.html +++ b/docs/frontend_api/entities_note_short.js.html @@ -211,7 +211,10 @@ class NoteShort { if (this.noteId !== 'root') { for (const parentNote of this.getParentNotes()) { - attrArrs.push(parentNote.getInheritableAttributes()); + // these virtual parent-child relationships are also loaded into frontend tree cache + if (parentNote.type !== 'search') { + attrArrs.push(parentNote.getInheritableAttributes()); + } } } @@ -496,7 +499,7 @@ export default NoteShort;
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html index 665c91fe5..1d2eca868 100644 --- a/docs/frontend_api/global.html +++ b/docs/frontend_api/global.html @@ -303,7 +303,7 @@
Source:
@@ -339,7 +339,7 @@
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html index cb160592e..73c03637b 100644 --- a/docs/frontend_api/index.html +++ b/docs/frontend_api/index.html @@ -56,7 +56,7 @@
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index b026ce913..4dcfd43e9 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -39,6 +39,9 @@ import CollapsibleWidget from '../widgets/collapsible_widget.js'; import ws from "./ws.js"; import hoistedNoteService from "./hoisted_note.js"; import appContext from "./app_context.js"; +import TabAwareWidget from "../widgets/tab_aware_widget.js"; +import TabCachingWidget from "../widgets/tab_caching_widget.js"; +import BasicWidget from "../widgets/basic_widget.js"; /** * This is the main frontend API interface for scripts. It's published in the local "api" object. @@ -65,6 +68,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain /** @property {CollapsibleWidget} */ this.CollapsibleWidget = CollapsibleWidget; + /** @property {TabAwareWidget} */ + this.TabAwareWidget = TabAwareWidget; + + /** @property {TabCachingWidget} */ + this.TabCachingWidget = TabCachingWidget; + + /** @property {BasicWidget} */ + this.BasicWidget = BasicWidget; + /** * Activates note in the tree and in the note detail. * @@ -282,12 +294,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain this.showError = toastService.showError; /** - * Refresh tree - * * @method - * @returns {Promise<void>} + * @deprecated - this is now no-op since all the changes should be gracefully handled per widget */ - this.refreshTree = treeService.reload; + this.refreshTree = () => {}; /** * Create note link (jQuery object) for given note. @@ -439,7 +449,7 @@ export default FrontendScriptApi;
diff --git a/package-lock.json b/package-lock.json index f4cf8aa98..07250f8c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "dev": true }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", "dev": true }, "@babel/runtime": { @@ -1015,9 +1015,12 @@ } }, "async-mutex": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.1.4.tgz", - "integrity": "sha512-zVWTmAnxxHaeB2B1te84oecI8zTDJ/8G49aVBblRX6be0oq6pAybNcUSxwfgVOmOjSCvN4aYZAqwtyNI8e1YGw==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.2.1.tgz", + "integrity": "sha512-8GAyGD9/Fr4TgMigfCAXsyjvPturIqHDDw7Mim6DtNRbwxY2ul/D4b4CF1qjaMvomd/SJs/8EM23M+RGDEpaKA==", + "requires": { + "tslib": "^1.11.1" + } }, "asynckit": { "version": "0.4.0", @@ -5409,12 +5412,12 @@ } }, "js2xmlparser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", - "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", "dev": true, "requires": { - "xmlcreate": "^2.0.0" + "xmlcreate": "^2.0.3" } }, "jsbn": { @@ -5423,37 +5426,49 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jsdoc": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.3.tgz", - "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz", + "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==", "dev": true, "requires": { - "@babel/parser": "^7.4.4", - "bluebird": "^3.5.4", + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", "catharsis": "^0.8.11", "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.0", + "js2xmlparser": "^4.0.1", "klaw": "^3.0.0", - "markdown-it": "^8.4.2", - "markdown-it-anchor": "^5.0.2", - "marked": "^0.7.0", - "mkdirp": "^0.5.1", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^0.8.2", + "mkdirp": "^1.0.4", "requizzle": "^0.2.3", - "strip-json-comments": "^3.0.1", + "strip-json-comments": "^3.1.0", "taffydb": "2.6.2", - "underscore": "~1.9.1" + "underscore": "~1.10.2" }, "dependencies": { + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, "escape-string-regexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true } } @@ -6025,28 +6040,36 @@ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" }, "markdown-it": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", - "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", "dev": true, "requires": { "argparse": "^1.0.7", - "entities": "~1.1.1", + "entities": "~2.0.0", "linkify-it": "^2.0.0", "mdurl": "^1.0.1", "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + } } }, "markdown-it-anchor": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.4.tgz", - "integrity": "sha512-n8zCGjxA3T+Mx1pG8HEgbJbkB8JFUuRkeTZQuIM8iPY6oQ8sWOPRZJDFC9a/pNg2QkHEjjGkhBEl/RSyzaDZ3A==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.7.tgz", + "integrity": "sha512-REFmIaSS6szaD1bye80DMbp7ePwsPNvLTR5HunsUcZ0SG0rWJQ+Pz24R4UlTKtjKBPhxo0v0tOBDYjZQQknW8Q==", "dev": true }, "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", "dev": true }, "matcher": { @@ -8817,9 +8840,9 @@ } }, "semver": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", - "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==" + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.2.1.tgz", + "integrity": "sha512-aHhm1pD02jXXkyIpq25qBZjr3CQgg8KST8uX0OWXch3xE6jw+1bfbWnCjzMwojsTquroUmKFHNzU6x26mEiRxw==" }, "semver-compare": { "version": "1.0.0", @@ -9663,8 +9686,7 @@ "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" }, "tsscmp": { "version": "1.0.6", @@ -9760,9 +9782,9 @@ } }, "underscore": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", - "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", "dev": true }, "unescape": { @@ -10338,9 +10360,9 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, "xmlcreate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", - "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", "dev": true }, "xmldom": { diff --git a/package.json b/package.json index 40ce85d31..d78e97b52 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build-docs": "npm run build-backend-docs && npm run build-frontend-docs" }, "dependencies": { - "async-mutex": "0.1.4", + "async-mutex": "0.2.1", "axios": "0.19.2", "body-parser": "1.19.0", "cls-hooked": "4.2.2", @@ -61,7 +61,7 @@ "rimraf": "3.0.2", "sanitize-filename": "1.6.3", "sax": "1.2.4", - "semver": "7.1.3", + "semver": "7.2.1", "serve-favicon": "2.5.0", "session-file-store": "1.4.0", "simple-node-logger": "18.12.24", @@ -81,7 +81,7 @@ "electron-builder": "22.4.1", "electron-packager": "14.2.1", "electron-rebuild": "1.10.1", - "jsdoc": "3.6.3", + "jsdoc": "3.6.4", "lorem-ipsum": "2.0.3" }, "optionalDependencies": {