diff --git a/modules/widgets/src/widgets/html-overlay-item.tsx b/modules/widgets/src/widgets/html-overlay-item.tsx index 9827c7756..21cdfa456 100644 --- a/modules/widgets/src/widgets/html-overlay-item.tsx +++ b/modules/widgets/src/widgets/html-overlay-item.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import type {ComponentChildren, JSX} from 'preact'; diff --git a/modules/widgets/src/widgets/html-overlay-widget.tsx b/modules/widgets/src/widgets/html-overlay-widget.tsx index b2ea63ff2..d080ada53 100644 --- a/modules/widgets/src/widgets/html-overlay-widget.tsx +++ b/modules/widgets/src/widgets/html-overlay-widget.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import { cloneElement, @@ -58,7 +59,6 @@ export class HtmlOverlayWidget< placement: WidgetPlacement = 'fill'; className = 'deck-widget-html-overlay'; - deck?: Deck | null = null; protected viewport: Viewport | null = null; protected overlayRoot: unknown = null; protected overlayRootInitialized = false; @@ -83,7 +83,7 @@ export class HtmlOverlayWidget< } override onRemove(): void { - this.deck = null; + this.deck = undefined; this.viewport = null; this.overlayRoot = null; this.overlayRootInitialized = false; diff --git a/modules/widgets/src/widgets/html-tooltip-widget.tsx b/modules/widgets/src/widgets/html-tooltip-widget.tsx index 9013e39bf..4ffea7945 100644 --- a/modules/widgets/src/widgets/html-tooltip-widget.tsx +++ b/modules/widgets/src/widgets/html-tooltip-widget.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import type {ComponentChildren, VNode} from 'preact'; import type {PickingInfo, WidgetProps, Viewport} from '@deck.gl/core'; diff --git a/modules/widgets/src/widgets/long-press-button.tsx b/modules/widgets/src/widgets/long-press-button.tsx index fc5fb5eca..ffae13c43 100644 --- a/modules/widgets/src/widgets/long-press-button.tsx +++ b/modules/widgets/src/widgets/long-press-button.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import {Component, type ComponentChildren} from 'preact'; diff --git a/modules/widgets/src/widgets/pan-widget.tsx b/modules/widgets/src/widgets/pan-widget.tsx index d712002bd..6f7eb7688 100644 --- a/modules/widgets/src/widgets/pan-widget.tsx +++ b/modules/widgets/src/widgets/pan-widget.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import {render} from 'preact'; import type {JSX} from 'preact'; @@ -60,7 +61,7 @@ export class PanWidget extends Widget { placement: WidgetPlacement = 'top-left'; className = 'deck-widget-pan'; - deck?: Deck | null = null; + step: number; constructor(props: PanWidgetProps = {}) { @@ -91,7 +92,7 @@ export class PanWidget extends Widget { } override onRemove(): void { - this.deck = null; + this.deck = undefined; } override onRenderHTML(rootElement: HTMLElement): void { diff --git a/modules/widgets/src/widgets/view-manager-utils.ts b/modules/widgets/src/widgets/view-manager-utils.ts index eb5a2d7b8..4d9c57112 100644 --- a/modules/widgets/src/widgets/view-manager-utils.ts +++ b/modules/widgets/src/widgets/view-manager-utils.ts @@ -12,7 +12,7 @@ export type DeckWithViewManager = Deck & { }; }; -export function hasViewManager(deck: Deck | null): deck is DeckWithViewManager { +export function hasViewManager(deck: Deck | null | undefined): deck is DeckWithViewManager { return Boolean(deck && typeof deck === 'object' && 'viewManager' in deck); } diff --git a/modules/widgets/src/widgets/zoom-range-widget.tsx b/modules/widgets/src/widgets/zoom-range-widget.tsx index de257c0e6..6a7c055b0 100644 --- a/modules/widgets/src/widgets/zoom-range-widget.tsx +++ b/modules/widgets/src/widgets/zoom-range-widget.tsx @@ -1,6 +1,7 @@ // deck.gl-community // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors +/** @jsxImportSource preact */ import {render} from 'preact'; import type {JSX} from 'preact'; @@ -75,7 +76,7 @@ export class ZoomRangeWidget extends Widget { placement: WidgetPlacement = 'top-left'; className = 'deck-widget-zoom-range'; - deck?: Deck | null = null; + step: number; currentZoom = 0; inferredMinZoom: number | null = null; @@ -109,7 +110,7 @@ export class ZoomRangeWidget extends Widget { } override onRemove(): void { - this.deck = null; + this.deck = undefined; } override onRenderHTML(rootElement: HTMLElement): void {