diff --git a/Assets/PluginDocTheme/helpers/index.js b/Assets/PluginDocTheme/helpers/index.js index 1bc3e3d411..c62d0a4cdb 100644 --- a/Assets/PluginDocTheme/helpers/index.js +++ b/Assets/PluginDocTheme/helpers/index.js @@ -23,6 +23,7 @@ module.exports = { return `joplin.${camelCaseToDots(p) .replace(/menu\.items/, 'menuItems') .replace(/toolbar\.buttons/, 'toolbarButtons') + .replace(/note\.list/, 'noteList') .replace(/content\.scripts/, 'contentScripts')}`; }, diff --git a/packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.ts b/packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.ts index 7889b6fe93..f87b9a8fe0 100644 --- a/packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.ts +++ b/packages/app-desktop/gui/NoteListItem/utils/prepareViewProps.ts @@ -1,9 +1,9 @@ -import { ListRendererDepependency } from '@joplin/lib/services/plugins/api/noteListType'; +import { ListRendererDependency } from '@joplin/lib/services/plugins/api/noteListType'; import { NoteEntity, TagEntity } from '@joplin/lib/services/database/types'; import { Size } from '@joplin/utils/types'; import Note from '@joplin/lib/models/Note'; -const prepareViewProps = async (dependencies: ListRendererDepependency[], note: NoteEntity, itemSize: Size, selected: boolean, noteTitleHtml: string, noteIsWatched: boolean, noteTags: TagEntity[]) => { +const prepareViewProps = async (dependencies: ListRendererDependency[], note: NoteEntity, itemSize: Size, selected: boolean, noteTitleHtml: string, noteIsWatched: boolean, noteTags: TagEntity[]) => { const output: any = {}; for (const dep of dependencies) { diff --git a/packages/lib/services/plugins/api/JoplinViewsNoteList.ts b/packages/lib/services/plugins/api/JoplinViewsNoteList.ts index 39010733e6..63e9da9088 100644 --- a/packages/lib/services/plugins/api/JoplinViewsNoteList.ts +++ b/packages/lib/services/plugins/api/JoplinViewsNoteList.ts @@ -11,14 +11,29 @@ import { ListRenderer } from './noteListType'; * * The app provides the required dependencies whenever a note is updated - you * process these dependencies, and return some props, which are then passed to - * your template and rendered. See [[[ListRenderer]]] for a detailed description + * your template and rendered. See [[ListRenderer]] for a detailed description * of each property of the renderer. * - * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/note_list_renderer) + * ## Reference * - * The default list renderer is implemented using the same API, so it worth checking it too: + * * [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/note_list_renderer) + * + * * [Default list renderer](https://github.com/laurent22/joplin/tree/dev/packages/lib/services/noteList/defaultListRenderer.ts) + * + * ## Screenshots: + * + * ### Top to bottom with title, date and body + * + * + * + * ### Left to right with thumbnails + * + * + * + * ### Top to bottom with editable title + * + * * - * [Default list renderer](https://github.com/laurent22/joplin/tree/dev/packages/lib/services/noteList/defaultListRenderer.ts) */ export default class JoplinViewsNoteList { diff --git a/packages/lib/services/plugins/api/noteListType.ts b/packages/lib/services/plugins/api/noteListType.ts index 112999c9ab..7ec4d48463 100644 --- a/packages/lib/services/plugins/api/noteListType.ts +++ b/packages/lib/services/plugins/api/noteListType.ts @@ -42,7 +42,7 @@ export type OnChangeHandler = (event: OnChangeEvent)=> Promise; * `note.isWatched` tells you if the note is currently opened in an external * editor. In which case you would generally display some indicator. */ -export type ListRendererDepependency = +export type ListRendererDependency = ListRendererDatabaseDependency | 'item.size.width' | 'item.size.height' | @@ -96,7 +96,7 @@ export interface ListRenderer { * that you do not add more than what you need since there is a performance * penalty for each property. */ - dependencies: ListRendererDepependency[]; + dependencies: ListRendererDependency[]; /** * This is the HTML template that will be used to render the note list item.