refactor(script/jsx): "react-widget" -> "preact-widget"

This commit is contained in:
Elian Doran 2025-12-20 21:26:01 +02:00
parent f64de3acca
commit 22a83d9f82
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ export class WidgetsByParent {
}
add(widget: Widget) {
if ("type" in widget && widget.type === "react-widget") {
if ("type" in widget && widget.type === "preact-widget") {
// React-based script.
const reactWidget = widget as WidgetDefinitionWithType;
this.preactWidgets[reactWidget.parent] = this.preactWidgets[reactWidget.parent] || [];

View File

@ -9,7 +9,7 @@ export interface WidgetDefinition {
}
export interface WidgetDefinitionWithType extends WidgetDefinition {
type: "react-widget"
type: "preact-widget"
}
export const preactAPI = Object.freeze({
@ -24,7 +24,7 @@ export const preactAPI = Object.freeze({
*/
defineWidget(definition: WidgetDefinition) {
return {
type: "react-widget",
type: "preact-widget",
...definition
};
},