You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Desktop: Resolves ##5389: Add support for note list plugins (#8897)
This commit is contained in:
@ -4,6 +4,7 @@ import JoplinViewsMenuItems from './JoplinViewsMenuItems';
|
||||
import JoplinViewsMenus from './JoplinViewsMenus';
|
||||
import JoplinViewsToolbarButtons from './JoplinViewsToolbarButtons';
|
||||
import JoplinViewsPanels from './JoplinViewsPanels';
|
||||
import JoplinViewsNoteList from './JoplinViewsNoteList';
|
||||
/**
|
||||
* This namespace provides access to view-related services.
|
||||
*
|
||||
@ -13,11 +14,12 @@ import JoplinViewsPanels from './JoplinViewsPanels';
|
||||
export default class JoplinViews {
|
||||
private store;
|
||||
private plugin;
|
||||
private dialogs_;
|
||||
private panels_;
|
||||
private menuItems_;
|
||||
private menus_;
|
||||
private toolbarButtons_;
|
||||
private dialogs_;
|
||||
private noteList_;
|
||||
private implementation_;
|
||||
constructor(implementation: any, plugin: Plugin, store: any);
|
||||
get dialogs(): JoplinViewsDialogs;
|
||||
@ -25,4 +27,5 @@ export default class JoplinViews {
|
||||
get menuItems(): JoplinViewsMenuItems;
|
||||
get menus(): JoplinViewsMenus;
|
||||
get toolbarButtons(): JoplinViewsToolbarButtons;
|
||||
get noteList(): JoplinViewsNoteList;
|
||||
}
|
||||
|
9
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsNoteList.d.ts
vendored
Normal file
9
packages/app-cli/tests/support/plugins/nativeModule/api/JoplinViewsNoteList.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { Store } from 'redux';
|
||||
import Plugin from '../Plugin';
|
||||
import { ListRenderer } from './noteListType';
|
||||
export default class JoplinViewsNoteList {
|
||||
private plugin_;
|
||||
private store_;
|
||||
constructor(plugin: Plugin, store: Store);
|
||||
registerRenderer(renderer: ListRenderer): Promise<void>;
|
||||
}
|
27
packages/app-cli/tests/support/plugins/nativeModule/api/noteListType.d.ts
vendored
Normal file
27
packages/app-cli/tests/support/plugins/nativeModule/api/noteListType.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
import { Size } from './types';
|
||||
type ListRendererDatabaseDependency = 'folder.created_time' | 'folder.encryption_applied' | 'folder.encryption_cipher_text' | 'folder.icon' | 'folder.id' | 'folder.is_shared' | 'folder.master_key_id' | 'folder.parent_id' | 'folder.share_id' | 'folder.title' | 'folder.updated_time' | 'folder.user_created_time' | 'folder.user_updated_time' | 'folder.type_' | 'note.altitude' | 'note.application_data' | 'note.author' | 'note.body' | 'note.conflict_original_id' | 'note.created_time' | 'note.encryption_applied' | 'note.encryption_cipher_text' | 'note.id' | 'note.is_conflict' | 'note.is_shared' | 'note.is_todo' | 'note.latitude' | 'note.longitude' | 'note.markup_language' | 'note.master_key_id' | 'note.order' | 'note.parent_id' | 'note.share_id' | 'note.source' | 'note.source_application' | 'note.source_url' | 'note.title' | 'note.todo_completed' | 'note.todo_due' | 'note.updated_time' | 'note.user_created_time' | 'note.user_data' | 'note.user_updated_time' | 'note.type_';
|
||||
export declare enum ItemFlow {
|
||||
TopToBottom = "topToBottom",
|
||||
LeftToRight = "leftToRight"
|
||||
}
|
||||
export type RenderNoteView = Record<string, any>;
|
||||
export interface OnChangeEvent {
|
||||
elementId: string;
|
||||
value: any;
|
||||
noteId: string;
|
||||
}
|
||||
export type OnRenderNoteHandler = (props: any) => Promise<RenderNoteView>;
|
||||
export type OnChangeHandler = (event: OnChangeEvent) => Promise<void>;
|
||||
export type ListRendererDepependency = ListRendererDatabaseDependency | 'item.size.width' | 'item.size.height' | 'item.selected' | 'note.titleHtml' | 'note.isWatched' | 'note.tags';
|
||||
export interface ListRenderer {
|
||||
id: string;
|
||||
flow: ItemFlow;
|
||||
itemSize: Size;
|
||||
itemCss?: string;
|
||||
dependencies: ListRendererDepependency[];
|
||||
itemTemplate: string;
|
||||
label: () => Promise<string>;
|
||||
onRenderNote: OnRenderNoteHandler;
|
||||
onChange?: OnChangeHandler;
|
||||
}
|
||||
export {};
|
@ -0,0 +1,42 @@
|
||||
import { Size } from './types';
|
||||
|
||||
// AUTO-GENERATED by generate-database-type
|
||||
type ListRendererDatabaseDependency = 'folder.created_time' | 'folder.encryption_applied' | 'folder.encryption_cipher_text' | 'folder.icon' | 'folder.id' | 'folder.is_shared' | 'folder.master_key_id' | 'folder.parent_id' | 'folder.share_id' | 'folder.title' | 'folder.updated_time' | 'folder.user_created_time' | 'folder.user_updated_time' | 'folder.type_' | 'note.altitude' | 'note.application_data' | 'note.author' | 'note.body' | 'note.conflict_original_id' | 'note.created_time' | 'note.encryption_applied' | 'note.encryption_cipher_text' | 'note.id' | 'note.is_conflict' | 'note.is_shared' | 'note.is_todo' | 'note.latitude' | 'note.longitude' | 'note.markup_language' | 'note.master_key_id' | 'note.order' | 'note.parent_id' | 'note.share_id' | 'note.source' | 'note.source_application' | 'note.source_url' | 'note.title' | 'note.todo_completed' | 'note.todo_due' | 'note.updated_time' | 'note.user_created_time' | 'note.user_data' | 'note.user_updated_time' | 'note.type_';
|
||||
// AUTO-GENERATED by generate-database-type
|
||||
|
||||
export enum ItemFlow {
|
||||
TopToBottom = 'topToBottom',
|
||||
LeftToRight = 'leftToRight',
|
||||
}
|
||||
|
||||
export type RenderNoteView = Record<string, any>;
|
||||
|
||||
export interface OnChangeEvent {
|
||||
elementId: string;
|
||||
value: any;
|
||||
noteId: string;
|
||||
}
|
||||
|
||||
export type OnRenderNoteHandler = (props: any)=> Promise<RenderNoteView>;
|
||||
export type OnChangeHandler = (event: OnChangeEvent)=> Promise<void>;
|
||||
|
||||
export type ListRendererDepependency =
|
||||
ListRendererDatabaseDependency |
|
||||
'item.size.width' |
|
||||
'item.size.height' |
|
||||
'item.selected' |
|
||||
'note.titleHtml' |
|
||||
'note.isWatched' |
|
||||
'note.tags';
|
||||
|
||||
export interface ListRenderer {
|
||||
id: string;
|
||||
flow: ItemFlow;
|
||||
itemSize: Size;
|
||||
itemCss?: string;
|
||||
dependencies: ListRendererDepependency[];
|
||||
itemTemplate: string;
|
||||
label: ()=> Promise<string>;
|
||||
onRenderNote: OnRenderNoteHandler;
|
||||
onChange?: OnChangeHandler;
|
||||
}
|
@ -359,6 +359,11 @@ export interface DialogResult {
|
||||
formData?: any;
|
||||
}
|
||||
|
||||
export interface Size {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface Rectangle {
|
||||
x?: number;
|
||||
y?: number;
|
||||
|
Reference in New Issue
Block a user