mirror of
https://github.com/zadam/trilium.git
synced 2025-12-22 07:14:24 +01:00
refactor(script/jsx): "react-widget" -> "preact-widget"
This commit is contained in:
parent
f64de3acca
commit
22a83d9f82
@ -75,7 +75,7 @@ export class WidgetsByParent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add(widget: Widget) {
|
add(widget: Widget) {
|
||||||
if ("type" in widget && widget.type === "react-widget") {
|
if ("type" in widget && widget.type === "preact-widget") {
|
||||||
// React-based script.
|
// React-based script.
|
||||||
const reactWidget = widget as WidgetDefinitionWithType;
|
const reactWidget = widget as WidgetDefinitionWithType;
|
||||||
this.preactWidgets[reactWidget.parent] = this.preactWidgets[reactWidget.parent] || [];
|
this.preactWidgets[reactWidget.parent] = this.preactWidgets[reactWidget.parent] || [];
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export interface WidgetDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface WidgetDefinitionWithType extends WidgetDefinition {
|
export interface WidgetDefinitionWithType extends WidgetDefinition {
|
||||||
type: "react-widget"
|
type: "preact-widget"
|
||||||
}
|
}
|
||||||
|
|
||||||
export const preactAPI = Object.freeze({
|
export const preactAPI = Object.freeze({
|
||||||
@ -24,7 +24,7 @@ export const preactAPI = Object.freeze({
|
|||||||
*/
|
*/
|
||||||
defineWidget(definition: WidgetDefinition) {
|
defineWidget(definition: WidgetDefinition) {
|
||||||
return {
|
return {
|
||||||
type: "react-widget",
|
type: "preact-widget",
|
||||||
...definition
|
...definition
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user