@deck.gl/react 9.2.11 → 9.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deckgl.d.ts.map +1 -1
- package/dist/deckgl.js +13 -2
- package/dist/deckgl.js.map +1 -1
- package/dist/index.cjs +101 -26
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +13 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/extract-jsx-layers.d.ts +4 -4
- package/dist/utils/extract-jsx-layers.d.ts.map +1 -1
- package/dist/utils/extract-jsx-layers.js +2 -2
- package/dist/utils/extract-jsx-layers.js.map +1 -1
- package/dist/utils/use-widget.d.ts +1 -1
- package/dist/utils/use-widget.d.ts.map +1 -1
- package/dist/utils/use-widget.js.map +1 -1
- package/dist/widgets/context-menu-widget.js +1 -1
- package/dist/widgets/context-menu-widget.js.map +1 -1
- package/dist/widgets/gimbal-widget.d.ts +3 -0
- package/dist/widgets/gimbal-widget.d.ts.map +1 -0
- package/dist/widgets/gimbal-widget.js +10 -0
- package/dist/widgets/gimbal-widget.js.map +1 -0
- package/dist/widgets/icon-widget.d.ts +3 -0
- package/dist/widgets/icon-widget.d.ts.map +1 -0
- package/dist/widgets/icon-widget.js +10 -0
- package/dist/widgets/icon-widget.js.map +1 -0
- package/dist/widgets/info-widget.js +1 -1
- package/dist/widgets/info-widget.js.map +1 -1
- package/dist/widgets/loading-widget.js +1 -1
- package/dist/widgets/loading-widget.js.map +1 -1
- package/dist/widgets/popup-widget.d.ts +3 -0
- package/dist/widgets/popup-widget.d.ts.map +1 -0
- package/dist/widgets/popup-widget.js +10 -0
- package/dist/widgets/popup-widget.js.map +1 -0
- package/dist/widgets/scrollbar-widget.d.ts +3 -0
- package/dist/widgets/scrollbar-widget.d.ts.map +1 -0
- package/dist/widgets/scrollbar-widget.js +10 -0
- package/dist/widgets/scrollbar-widget.js.map +1 -0
- package/dist/widgets/selector-widget.d.ts +3 -0
- package/dist/widgets/selector-widget.d.ts.map +1 -0
- package/dist/widgets/selector-widget.js +10 -0
- package/dist/widgets/selector-widget.js.map +1 -0
- package/dist/widgets/stats-widget.d.ts +3 -0
- package/dist/widgets/stats-widget.d.ts.map +1 -0
- package/dist/widgets/stats-widget.js +10 -0
- package/dist/widgets/stats-widget.js.map +1 -0
- package/dist/widgets/theme-widget.js +1 -1
- package/dist/widgets/theme-widget.js.map +1 -1
- package/dist/widgets/timeline-widget.d.ts +3 -0
- package/dist/widgets/timeline-widget.d.ts.map +1 -0
- package/dist/widgets/timeline-widget.js +10 -0
- package/dist/widgets/timeline-widget.js.map +1 -0
- package/dist/widgets/toggle-widget.d.ts +3 -0
- package/dist/widgets/toggle-widget.d.ts.map +1 -0
- package/dist/widgets/toggle-widget.js +10 -0
- package/dist/widgets/toggle-widget.js.map +1 -0
- package/package.json +2 -2
- package/src/deckgl.ts +20 -2
- package/src/index.ts +34 -5
- package/src/utils/extract-jsx-layers.ts +7 -6
- package/src/utils/use-widget.ts +4 -4
- package/src/widgets/context-menu-widget.tsx +1 -1
- package/src/widgets/gimbal-widget.tsx +12 -0
- package/src/widgets/icon-widget.tsx +12 -0
- package/src/widgets/info-widget.tsx +1 -1
- package/src/widgets/loading-widget.tsx +1 -1
- package/src/widgets/popup-widget.tsx +12 -0
- package/src/widgets/scrollbar-widget.tsx +12 -0
- package/src/widgets/selector-widget.tsx +15 -0
- package/src/widgets/stats-widget.tsx +12 -0
- package/src/widgets/theme-widget.tsx +1 -1
- package/src/widgets/timeline-widget.tsx +12 -0
- package/src/widgets/toggle-widget.tsx +12 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { View } from '@deck.gl/core';
|
|
3
2
|
import type { LayersList, Viewport } from '@deck.gl/core';
|
|
3
|
+
import type { ViewOrViews } from "../deckgl.js";
|
|
4
4
|
export type DeckGLRenderCallbackArgs = {
|
|
5
5
|
/**
|
|
6
6
|
* the left offset of the current view, in pixels
|
|
@@ -28,13 +28,13 @@ export type DeckGLRenderCallbackArgs = {
|
|
|
28
28
|
viewport: Viewport;
|
|
29
29
|
};
|
|
30
30
|
export type DeckGLRenderCallback = (args: DeckGLRenderCallbackArgs) => React.ReactNode;
|
|
31
|
-
export default function extractJSXLayers({ children, layers, views }: {
|
|
31
|
+
export default function extractJSXLayers<ViewsT extends ViewOrViews>({ children, layers, views }: {
|
|
32
32
|
children?: React.ReactNode | DeckGLRenderCallback;
|
|
33
33
|
layers?: LayersList;
|
|
34
|
-
views?:
|
|
34
|
+
views?: ViewsT;
|
|
35
35
|
}): {
|
|
36
36
|
children: React.ReactNode[];
|
|
37
37
|
layers: LayersList;
|
|
38
|
-
views:
|
|
38
|
+
views: ViewsT | undefined;
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=extract-jsx-layers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-jsx-layers.d.ts","sourceRoot":"","sources":["../../src/utils/extract-jsx-layers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"extract-jsx-layers.d.ts","sourceRoot":"","sources":["../../src/utils/extract-jsx-layers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,qBAAkB;AAE3C,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,wBAAwB,KAAK,KAAK,CAAC,SAAS,CAAC;AAyBvF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,MAAM,SAAS,WAAW,EAAE,EACnE,QAAQ,EACR,MAAW,EACX,KAAK,EACN,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,oBAAoB,CAAC;IAClD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CA6CA"}
|
|
@@ -28,7 +28,7 @@ function wrapInView(node) {
|
|
|
28
28
|
return node;
|
|
29
29
|
}
|
|
30
30
|
// extracts any deck.gl layers masquerading as react elements from props.children
|
|
31
|
-
export default function extractJSXLayers({ children, layers = [], views
|
|
31
|
+
export default function extractJSXLayers({ children, layers = [], views }) {
|
|
32
32
|
const reactChildren = []; // extract real react elements (i.e. not deck.gl layers)
|
|
33
33
|
const jsxLayers = []; // extracted layer from react children, will add to deck.gl layer array
|
|
34
34
|
const jsxViews = {};
|
|
@@ -69,7 +69,7 @@ export default function extractJSXLayers({ children, layers = [], views = null }
|
|
|
69
69
|
views = Object.values(jsxViews);
|
|
70
70
|
}
|
|
71
71
|
// Avoid modifying layers array if no JSX layers were found
|
|
72
|
-
layers = jsxLayers.length > 0 ? [
|
|
72
|
+
layers = jsxLayers.length > 0 ? [jsxLayers, layers] : layers;
|
|
73
73
|
return { layers, children: reactChildren, views };
|
|
74
74
|
}
|
|
75
75
|
function createLayer(LayerType, reactProps) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-jsx-layers.js","sourceRoot":"","sources":["../../src/utils/extract-jsx-layers.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,+BAA4B;
|
|
1
|
+
{"version":3,"file":"extract-jsx-layers.js","sourceRoot":"","sources":["../../src/utils/extract-jsx-layers.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,+BAA4B;AAiChD,8CAA8C;AAC9C,SAAS,UAAU,CAAC,IAA4C;IAC9D,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,8CAA8C;QAC9C,wDAAwD;QACxD,uIAAuI;QACvI,OAAO,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,QAAQ,EAAE,CAAC;YACjC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,YAAY,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KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Widget, type WidgetProps } from '@deck.gl/core';
|
|
2
|
-
export declare function useWidget<WidgetT extends Widget, WidgetPropsT extends WidgetProps>(WidgetClass: {
|
|
2
|
+
export declare function useWidget<WidgetT extends Widget<WidgetProps, any>, WidgetPropsT extends WidgetProps>(WidgetClass: {
|
|
3
3
|
new (props_: WidgetPropsT): WidgetT;
|
|
4
4
|
}, props: WidgetPropsT): WidgetT;
|
|
5
5
|
//# sourceMappingURL=use-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-widget.d.ts","sourceRoot":"","sources":["../../src/utils/use-widget.ts"],"names":[],"mappings":"AAMA,OAAO,EAAM,MAAM,EAAE,KAAK,WAAW,EAA0B,MAAM,eAAe,CAAC;AAErF,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"use-widget.d.ts","sourceRoot":"","sources":["../../src/utils/use-widget.ts"],"names":[],"mappings":"AAMA,OAAO,EAAM,MAAM,EAAE,KAAK,WAAW,EAA0B,MAAM,eAAe,CAAC;AAErF,wBAAgB,SAAS,CACvB,OAAO,SAAS,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EACxC,YAAY,SAAS,WAAW,EAChC,WAAW,EAAE;IAAC,KAAK,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA;CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CA+BlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-widget.js","sourceRoot":"","sources":["../../src/utils/use-widget.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAC/C,OAAO,EAAC,GAAG,EAA4B,UAAU,IAAI,SA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,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAEpE,gGAAgG;IAChG,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEvB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,EAAE,QAAQ,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu-widget.js","sourceRoot":"","sources":["../../src/widgets/context-menu-widget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"context-menu-widget.js","sourceRoot":"","sources":["../../src/widgets/context-menu-widget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gimbal-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/gimbal-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAGxD,eAAO,MAAM,YAAY,WAAW,iBAAiB,SAGpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { GimbalWidget as _GimbalWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const GimbalWidget = (props = {}) => {
|
|
7
|
+
useWidget(_GimbalWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=gimbal-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gimbal-widget.js","sourceRoot":"","sources":["../../src/widgets/gimbal-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAA2B,EAAE,EAAE,EAAE;IAC5D,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/icon-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,UAAU,UAAW,eAAe,SAGhD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { IconWidget as _IconWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const IconWidget = (props) => {
|
|
7
|
+
useWidget(_IconWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=icon-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-widget.js","sourceRoot":"","sources":["../../src/widgets/icon-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IACnD,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deck.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { _InfoWidget } from '@deck.gl/widgets';
|
|
4
|
+
import { InfoWidget as _InfoWidget } from '@deck.gl/widgets';
|
|
5
5
|
import { useWidget } from "../utils/use-widget.js";
|
|
6
6
|
/**
|
|
7
7
|
* React wrapper for the InfoWidget.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-widget.js","sourceRoot":"","sources":["../../src/widgets/info-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"info-widget.js","sourceRoot":"","sources":["../../src/widgets/info-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IACnD,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deck.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { _LoadingWidget } from '@deck.gl/widgets';
|
|
4
|
+
import { LoadingWidget as _LoadingWidget } from '@deck.gl/widgets';
|
|
5
5
|
import { useWidget } from "../utils/use-widget.js";
|
|
6
6
|
/**
|
|
7
7
|
* React wrapper for the LoadingWidget.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-widget.js","sourceRoot":"","sources":["../../src/widgets/loading-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"loading-widget.js","sourceRoot":"","sources":["../../src/widgets/loading-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,aAAa,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA4B,EAAE,EAAE,EAAE;IAC9D,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/popup-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,WAAW,UAAW,gBAAgB,SAGlD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { PopupWidget as _PopupWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const PopupWidget = (props) => {
|
|
7
|
+
useWidget(_PopupWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=popup-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup-widget.js","sourceRoot":"","sources":["../../src/widgets/popup-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACrD,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollbar-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/scrollbar-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAG3D,eAAO,MAAM,eAAe,WAAW,oBAAoB,SAG1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ScrollbarWidget as _ScrollbarWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const ScrollbarWidget = (props = {}) => {
|
|
7
|
+
useWidget(_ScrollbarWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=scrollbar-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollbar-widget.js","sourceRoot":"","sources":["../../src/widgets/scrollbar-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,IAAI,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA8B,EAAE,EAAE,EAAE;IAClE,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/selector-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,cAAc,GAAI,MAAM,kBAAmB,mBAAmB,CAAC,MAAM,CAAC,SAMlF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { SelectorWidget as _SelectorWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const SelectorWidget = (props) => {
|
|
7
|
+
useWidget(_SelectorWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=selector-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-widget.js","sourceRoot":"","sources":["../../src/widgets/selector-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEnE,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAmB,KAAkC,EAAE,EAAE;IACrF,SAAS,CACP,eAAuF,EACvF,KAAK,CACN,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/stats-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,WAAW,WAAW,gBAAgB,SAGlD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { _StatsWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const StatsWidget = (props = {}) => {
|
|
7
|
+
useWidget(_StatsWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=stats-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-widget.js","sourceRoot":"","sources":["../../src/widgets/stats-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA0B,EAAE,EAAE,EAAE;IAC1D,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deck.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { _ThemeWidget } from '@deck.gl/widgets';
|
|
4
|
+
import { ThemeWidget as _ThemeWidget } from '@deck.gl/widgets';
|
|
5
5
|
import { useWidget } from "../utils/use-widget.js";
|
|
6
6
|
/**
|
|
7
7
|
* React wrapper for the ThemeWidget.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-widget.js","sourceRoot":"","sources":["../../src/widgets/theme-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme-widget.js","sourceRoot":"","sources":["../../src/widgets/theme-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA0B,EAAE,EAAE,EAAE;IAC1D,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/timeline-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,cAAc,WAAW,mBAAmB,SAGxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { _TimelineWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const TimelineWidget = (props = {}) => {
|
|
7
|
+
useWidget(_TimelineWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=timeline-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-widget.js","sourceRoot":"","sources":["../../src/widgets/timeline-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA6B,EAAE,EAAE,EAAE;IAChE,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/toggle-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAGxD,eAAO,MAAM,YAAY,UAAW,iBAAiB,SAGpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { ToggleWidget as _ToggleWidget } from '@deck.gl/widgets';
|
|
5
|
+
import { useWidget } from "../utils/use-widget.js";
|
|
6
|
+
export const ToggleWidget = (props) => {
|
|
7
|
+
useWidget(_ToggleWidget, props);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=toggle-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-widget.js","sourceRoot":"","sources":["../../src/widgets/toggle-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACvD,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React Components for deck.gl",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.2
|
|
6
|
+
"version": "9.3.0-alpha.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": "^18.2.0",
|
|
45
45
|
"react-dom": "^18.2.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "135d329f4a4b596ae2c16e4eb801eda30252f3bc"
|
|
48
48
|
}
|
package/src/deckgl.ts
CHANGED
|
@@ -170,11 +170,14 @@ function DeckGLWithRef<ViewsT extends ViewOrViews = null>(
|
|
|
170
170
|
parent: containerRef.current,
|
|
171
171
|
canvas: canvasRef.current,
|
|
172
172
|
layers: jsxProps.layers,
|
|
173
|
-
views: jsxProps.views as ViewsT,
|
|
174
173
|
onViewStateChange: handleViewStateChange,
|
|
175
174
|
onInteractionStateChange: handleInteractionStateChange
|
|
176
175
|
};
|
|
177
176
|
|
|
177
|
+
if (jsxProps.views) {
|
|
178
|
+
forwardProps.views = jsxProps.views;
|
|
179
|
+
}
|
|
180
|
+
|
|
178
181
|
// The defaultValue for _customRender is null, which would overwrite the definition
|
|
179
182
|
// of _customRender. Remove to avoid frequently redeclaring the method here.
|
|
180
183
|
delete forwardProps._customRender;
|
|
@@ -259,11 +262,26 @@ function DeckGLWithRef<ViewsT extends ViewOrViews = null>(
|
|
|
259
262
|
style: canvasStyle
|
|
260
263
|
});
|
|
261
264
|
|
|
265
|
+
const eventRoot = createElement(
|
|
266
|
+
'div',
|
|
267
|
+
{
|
|
268
|
+
key: 'deck-events-root',
|
|
269
|
+
className: 'deck-events-root',
|
|
270
|
+
style: {width, height}
|
|
271
|
+
},
|
|
272
|
+
[canvas, childrenUnderViews]
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
const widgetRoot = createElement('div', {
|
|
276
|
+
key: 'deck-widgets-root',
|
|
277
|
+
className: 'deck-widgets-root'
|
|
278
|
+
});
|
|
279
|
+
|
|
262
280
|
// Render deck.gl as the last child
|
|
263
281
|
thisRef.control = createElement(
|
|
264
282
|
'div',
|
|
265
283
|
{id: `${id || 'deckgl'}-wrapper`, ref: containerRef, style: containerStyle},
|
|
266
|
-
[
|
|
284
|
+
[eventRoot, widgetRoot]
|
|
267
285
|
);
|
|
268
286
|
}
|
|
269
287
|
|
package/src/index.ts
CHANGED
|
@@ -9,17 +9,46 @@ export {default} from './deckgl';
|
|
|
9
9
|
export {CompassWidget} from './widgets/compass-widget';
|
|
10
10
|
export {FullscreenWidget} from './widgets/fullscreen-widget';
|
|
11
11
|
export {ZoomWidget} from './widgets/zoom-widget';
|
|
12
|
+
export {GimbalWidget} from './widgets/gimbal-widget';
|
|
12
13
|
export {GeocoderWidget as _GeocoderWidget} from './widgets/geocoder-widget';
|
|
13
|
-
export {InfoWidget
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
14
|
+
export {InfoWidget} from './widgets/info-widget';
|
|
15
|
+
export {PopupWidget} from './widgets/popup-widget';
|
|
16
|
+
export {ContextMenuWidget} from './widgets/context-menu-widget';
|
|
17
|
+
export {ScrollbarWidget} from './widgets/scrollbar-widget';
|
|
18
|
+
export {IconWidget} from './widgets/icon-widget';
|
|
19
|
+
export {ToggleWidget} from './widgets/toggle-widget';
|
|
20
|
+
export {SelectorWidget} from './widgets/selector-widget';
|
|
21
|
+
export {LoadingWidget} from './widgets/loading-widget';
|
|
16
22
|
export {ResetViewWidget as _ResetViewWidget} from './widgets/reset-view-widget';
|
|
17
23
|
export {ScaleWidget as _ScaleWidget} from './widgets/scale-widget';
|
|
18
24
|
export {ScreenshotWidget as _ScreenshotWidget} from './widgets/screenshot-widget';
|
|
19
25
|
export {SplitterWidget as _SplitterWidget} from './widgets/splitter-widget';
|
|
20
|
-
export {ThemeWidget
|
|
26
|
+
export {ThemeWidget} from './widgets/theme-widget';
|
|
27
|
+
export {TimelineWidget as _TimelineWidget} from './widgets/timeline-widget';
|
|
28
|
+
export {StatsWidget as _StatsWidget} from './widgets/stats-widget';
|
|
21
29
|
export {useWidget} from './utils/use-widget';
|
|
22
|
-
export type {
|
|
30
|
+
export type {
|
|
31
|
+
CompassWidgetProps,
|
|
32
|
+
FullscreenWidgetProps,
|
|
33
|
+
ZoomWidgetProps,
|
|
34
|
+
GimbalWidgetProps,
|
|
35
|
+
GeocoderWidgetProps,
|
|
36
|
+
InfoWidgetProps,
|
|
37
|
+
PopupWidgetProps,
|
|
38
|
+
ContextMenuWidgetProps,
|
|
39
|
+
ScrollbarWidgetProps,
|
|
40
|
+
IconWidgetProps,
|
|
41
|
+
ToggleWidgetProps,
|
|
42
|
+
SelectorWidgetProps,
|
|
43
|
+
LoadingWidgetProps,
|
|
44
|
+
ResetViewWidgetProps,
|
|
45
|
+
ScaleWidgetProps,
|
|
46
|
+
ScreenshotWidgetProps,
|
|
47
|
+
SplitterWidgetProps,
|
|
48
|
+
ThemeWidgetProps,
|
|
49
|
+
TimelineWidgetProps,
|
|
50
|
+
StatsWidgetProps
|
|
51
|
+
} from '@deck.gl/widgets';
|
|
23
52
|
|
|
24
53
|
// Types
|
|
25
54
|
export type {DeckGLContextValue} from './utils/deckgl-context';
|
|
@@ -8,6 +8,7 @@ import {inheritsFrom} from './inherits-from';
|
|
|
8
8
|
import {Layer, View} from '@deck.gl/core';
|
|
9
9
|
import {isComponent} from './evaluate-children';
|
|
10
10
|
import type {LayersList, Viewport} from '@deck.gl/core';
|
|
11
|
+
import type {ViewOrViews} from '../deckgl';
|
|
11
12
|
|
|
12
13
|
export type DeckGLRenderCallbackArgs = {
|
|
13
14
|
/**
|
|
@@ -61,18 +62,18 @@ function wrapInView(node: React.ReactNode | DeckGLRenderCallback): React.ReactNo
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
// extracts any deck.gl layers masquerading as react elements from props.children
|
|
64
|
-
export default function extractJSXLayers({
|
|
65
|
+
export default function extractJSXLayers<ViewsT extends ViewOrViews>({
|
|
65
66
|
children,
|
|
66
67
|
layers = [],
|
|
67
|
-
views
|
|
68
|
+
views
|
|
68
69
|
}: {
|
|
69
70
|
children?: React.ReactNode | DeckGLRenderCallback;
|
|
70
71
|
layers?: LayersList;
|
|
71
|
-
views?:
|
|
72
|
+
views?: ViewsT;
|
|
72
73
|
}): {
|
|
73
74
|
children: React.ReactNode[];
|
|
74
75
|
layers: LayersList;
|
|
75
|
-
views:
|
|
76
|
+
views: ViewsT | undefined;
|
|
76
77
|
} {
|
|
77
78
|
const reactChildren: React.ReactNode[] = []; // extract real react elements (i.e. not deck.gl layers)
|
|
78
79
|
const jsxLayers: LayersList = []; // extracted layer from react children, will add to deck.gl layer array
|
|
@@ -111,11 +112,11 @@ export default function extractJSXLayers({
|
|
|
111
112
|
} else if (views) {
|
|
112
113
|
jsxViews[views.id] = views;
|
|
113
114
|
}
|
|
114
|
-
views = Object.values(jsxViews);
|
|
115
|
+
views = Object.values(jsxViews) as ViewsT;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
// Avoid modifying layers array if no JSX layers were found
|
|
118
|
-
layers = jsxLayers.length > 0 ? [
|
|
119
|
+
layers = jsxLayers.length > 0 ? [jsxLayers, layers] : layers;
|
|
119
120
|
|
|
120
121
|
return {layers, children: reactChildren, views};
|
|
121
122
|
}
|
package/src/utils/use-widget.ts
CHANGED
|
@@ -6,10 +6,10 @@ import {useContext, useMemo, useEffect} from 'react';
|
|
|
6
6
|
import {DeckGlContext} from './deckgl-context';
|
|
7
7
|
import {log, Widget, type WidgetProps, _deepEqual as deepEqual} from '@deck.gl/core';
|
|
8
8
|
|
|
9
|
-
export function useWidget<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
): WidgetT {
|
|
9
|
+
export function useWidget<
|
|
10
|
+
WidgetT extends Widget<WidgetProps, any>,
|
|
11
|
+
WidgetPropsT extends WidgetProps
|
|
12
|
+
>(WidgetClass: {new (props_: WidgetPropsT): WidgetT}, props: WidgetPropsT): WidgetT {
|
|
13
13
|
const context = useContext(DeckGlContext);
|
|
14
14
|
const {widgets, deck} = context;
|
|
15
15
|
useEffect(() => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {GimbalWidget as _GimbalWidget} from '@deck.gl/widgets';
|
|
6
|
+
import type {GimbalWidgetProps} from '@deck.gl/widgets';
|
|
7
|
+
import {useWidget} from '../utils/use-widget';
|
|
8
|
+
|
|
9
|
+
export const GimbalWidget = (props: GimbalWidgetProps = {}) => {
|
|
10
|
+
useWidget(_GimbalWidget, props);
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {IconWidget as _IconWidget} from '@deck.gl/widgets';
|
|
6
|
+
import type {IconWidgetProps} from '@deck.gl/widgets';
|
|
7
|
+
import {useWidget} from '../utils/use-widget';
|
|
8
|
+
|
|
9
|
+
export const IconWidget = (props: IconWidgetProps) => {
|
|
10
|
+
useWidget(_IconWidget, props);
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {_InfoWidget} from '@deck.gl/widgets';
|
|
5
|
+
import {InfoWidget as _InfoWidget} from '@deck.gl/widgets';
|
|
6
6
|
import type {InfoWidgetProps} from '@deck.gl/widgets';
|
|
7
7
|
import {useWidget} from '../utils/use-widget';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {_LoadingWidget} from '@deck.gl/widgets';
|
|
5
|
+
import {LoadingWidget as _LoadingWidget} from '@deck.gl/widgets';
|
|
6
6
|
import type {LoadingWidgetProps} from '@deck.gl/widgets';
|
|
7
7
|
import {useWidget} from '../utils/use-widget';
|
|
8
8
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {PopupWidget as _PopupWidget} from '@deck.gl/widgets';
|
|
6
|
+
import type {PopupWidgetProps} from '@deck.gl/widgets';
|
|
7
|
+
import {useWidget} from '../utils/use-widget';
|
|
8
|
+
|
|
9
|
+
export const PopupWidget = (props: PopupWidgetProps) => {
|
|
10
|
+
useWidget(_PopupWidget, props);
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {ScrollbarWidget as _ScrollbarWidget} from '@deck.gl/widgets';
|
|
6
|
+
import type {ScrollbarWidgetProps} from '@deck.gl/widgets';
|
|
7
|
+
import {useWidget} from '../utils/use-widget';
|
|
8
|
+
|
|
9
|
+
export const ScrollbarWidget = (props: ScrollbarWidgetProps = {}) => {
|
|
10
|
+
useWidget(_ScrollbarWidget, props);
|
|
11
|
+
return null;
|
|
12
|
+
};
|