mirror of
https://github.com/zadam/trilium.git
synced 2025-12-22 08:09:55 +01:00
chore(script/jsx): get widgets to be interpreted
This commit is contained in:
@@ -480,6 +480,10 @@ export interface WidgetDefinition {
|
||||
render: () => VNode
|
||||
}
|
||||
|
||||
export interface WidgetDefinitionWithType extends WidgetDefinition {
|
||||
type: "react-widget"
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>This is the main frontend API interface for scripts. All the properties and methods are published in the "api" object
|
||||
* available in the JS frontend notes. You can use e.g. <code>api.showMessage(api.startNote.title);</code></p>
|
||||
@@ -736,7 +740,10 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig
|
||||
this.logSpacedUpdates[noteId].scheduleUpdate();
|
||||
};
|
||||
this.defineWidget = (definition) => {
|
||||
return definition;
|
||||
return {
|
||||
type: "react-widget",
|
||||
...definition
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user