@deck.gl/react 9.1.12 → 9.2.0-alpha.1

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.
Files changed (57) hide show
  1. package/dist/index.cjs +72 -0
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.d.ts +10 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +9 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/utils/use-widget.d.ts +4 -4
  8. package/dist/utils/use-widget.d.ts.map +1 -1
  9. package/dist/utils/use-widget.js.map +1 -1
  10. package/dist/widgets/context-menu-widget.d.ts +6 -0
  11. package/dist/widgets/context-menu-widget.d.ts.map +1 -0
  12. package/dist/widgets/context-menu-widget.js +10 -0
  13. package/dist/widgets/context-menu-widget.js.map +1 -0
  14. package/dist/widgets/geocoder-widget.d.ts +6 -0
  15. package/dist/widgets/geocoder-widget.d.ts.map +1 -0
  16. package/dist/widgets/geocoder-widget.js +13 -0
  17. package/dist/widgets/geocoder-widget.js.map +1 -0
  18. package/dist/widgets/info-widget.d.ts +6 -0
  19. package/dist/widgets/info-widget.d.ts.map +1 -0
  20. package/dist/widgets/info-widget.js +13 -0
  21. package/dist/widgets/info-widget.js.map +1 -0
  22. package/dist/widgets/loading-widget.d.ts +6 -0
  23. package/dist/widgets/loading-widget.d.ts.map +1 -0
  24. package/dist/widgets/loading-widget.js +13 -0
  25. package/dist/widgets/loading-widget.js.map +1 -0
  26. package/dist/widgets/reset-view-widget.d.ts +6 -0
  27. package/dist/widgets/reset-view-widget.d.ts.map +1 -0
  28. package/dist/widgets/reset-view-widget.js +13 -0
  29. package/dist/widgets/reset-view-widget.js.map +1 -0
  30. package/dist/widgets/scale-widget.d.ts +6 -0
  31. package/dist/widgets/scale-widget.d.ts.map +1 -0
  32. package/dist/widgets/scale-widget.js +13 -0
  33. package/dist/widgets/scale-widget.js.map +1 -0
  34. package/dist/widgets/screenshot-widget.d.ts +6 -0
  35. package/dist/widgets/screenshot-widget.d.ts.map +1 -0
  36. package/dist/widgets/screenshot-widget.js +13 -0
  37. package/dist/widgets/screenshot-widget.js.map +1 -0
  38. package/dist/widgets/splitter-widget.d.ts +6 -0
  39. package/dist/widgets/splitter-widget.d.ts.map +1 -0
  40. package/dist/widgets/splitter-widget.js +13 -0
  41. package/dist/widgets/splitter-widget.js.map +1 -0
  42. package/dist/widgets/theme-widget.d.ts +6 -0
  43. package/dist/widgets/theme-widget.d.ts.map +1 -0
  44. package/dist/widgets/theme-widget.js +13 -0
  45. package/dist/widgets/theme-widget.js.map +1 -0
  46. package/package.json +2 -2
  47. package/src/index.ts +10 -0
  48. package/src/utils/use-widget.ts +5 -5
  49. package/src/widgets/context-menu-widget.tsx +11 -0
  50. package/src/widgets/geocoder-widget.tsx +15 -0
  51. package/src/widgets/info-widget.tsx +15 -0
  52. package/src/widgets/loading-widget.tsx +15 -0
  53. package/src/widgets/reset-view-widget.tsx +15 -0
  54. package/src/widgets/scale-widget.tsx +15 -0
  55. package/src/widgets/screenshot-widget.tsx +15 -0
  56. package/src/widgets/splitter-widget.tsx +15 -0
  57. package/src/widgets/theme-widget.tsx +15 -0
package/dist/index.cjs CHANGED
@@ -34,6 +34,15 @@ __export(dist_exports, {
34
34
  DeckGL: () => deckgl_default,
35
35
  FullscreenWidget: () => FullscreenWidget,
36
36
  ZoomWidget: () => ZoomWidget,
37
+ _ContextMenuWidget: () => ContextMenuWidget,
38
+ _GeocoderWidget: () => GeocoderWidget,
39
+ _InfoWidget: () => InfoWidget,
40
+ _LoadingWidget: () => LoadingWidget,
41
+ _ResetViewWidget: () => ResetViewWidget,
42
+ _ScaleWidget: () => ScaleWidget,
43
+ _ScreenshotWidget: () => ScreenshotWidget,
44
+ _SplitterWidget: () => SplitterWidget,
45
+ _ThemeWidget: () => ThemeWidget,
37
46
  default: () => deckgl_default,
38
47
  useWidget: () => useWidget
39
48
  });
@@ -455,4 +464,67 @@ var ZoomWidget = (props = {}) => {
455
464
  useWidget(import_widgets3.ZoomWidget, props);
456
465
  return null;
457
466
  };
467
+
468
+ // dist/widgets/geocoder-widget.js
469
+ var import_widgets4 = require("@deck.gl/widgets");
470
+ var GeocoderWidget = (props = {}) => {
471
+ useWidget(import_widgets4._GeocoderWidget, props);
472
+ return null;
473
+ };
474
+
475
+ // dist/widgets/info-widget.js
476
+ var import_widgets5 = require("@deck.gl/widgets");
477
+ var InfoWidget = (props) => {
478
+ useWidget(import_widgets5._InfoWidget, props);
479
+ return null;
480
+ };
481
+
482
+ // dist/widgets/context-menu-widget.js
483
+ var import_widgets6 = require("@deck.gl/widgets");
484
+ var ContextMenuWidget = (props) => {
485
+ useWidget(import_widgets6._ContextMenuWidget, props);
486
+ return null;
487
+ };
488
+
489
+ // dist/widgets/loading-widget.js
490
+ var import_widgets7 = require("@deck.gl/widgets");
491
+ var LoadingWidget = (props = {}) => {
492
+ useWidget(import_widgets7._LoadingWidget, props);
493
+ return null;
494
+ };
495
+
496
+ // dist/widgets/reset-view-widget.js
497
+ var import_widgets8 = require("@deck.gl/widgets");
498
+ var ResetViewWidget = (props = {}) => {
499
+ useWidget(import_widgets8.ResetViewWidget, props);
500
+ return null;
501
+ };
502
+
503
+ // dist/widgets/scale-widget.js
504
+ var import_widgets9 = require("@deck.gl/widgets");
505
+ var ScaleWidget = (props = {}) => {
506
+ useWidget(import_widgets9._ScaleWidget, props);
507
+ return null;
508
+ };
509
+
510
+ // dist/widgets/screenshot-widget.js
511
+ var import_widgets10 = require("@deck.gl/widgets");
512
+ var ScreenshotWidget = (props = {}) => {
513
+ useWidget(import_widgets10.ScreenshotWidget, props);
514
+ return null;
515
+ };
516
+
517
+ // dist/widgets/splitter-widget.js
518
+ var import_widgets11 = require("@deck.gl/widgets");
519
+ var SplitterWidget = (props) => {
520
+ useWidget(import_widgets11._SplitterWidget, props);
521
+ return null;
522
+ };
523
+
524
+ // dist/widgets/theme-widget.js
525
+ var import_widgets12 = require("@deck.gl/widgets");
526
+ var ThemeWidget = (props = {}) => {
527
+ useWidget(import_widgets12._ThemeWidget, props);
528
+ return null;
529
+ };
458
530
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts", "../src/deckgl.ts", "../src/utils/use-isomorphic-layout-effect.ts", "../src/utils/extract-jsx-layers.ts", "../src/utils/inherits-from.ts", "../src/utils/evaluate-children.ts", "../src/utils/position-children-under-views.ts", "../src/utils/deckgl-context.ts", "../src/utils/extract-styles.ts", "../src/widgets/compass-widget.tsx", "../src/utils/use-widget.ts", "../src/widgets/fullscreen-widget.tsx", "../src/widgets/zoom-widget.tsx"],
4
- "sourcesContent": ["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {default as DeckGL} from './deckgl';\nexport {default} from './deckgl';\n\n// Widgets\nexport {CompassWidget} from './widgets/compass-widget';\nexport {FullscreenWidget} from './widgets/fullscreen-widget';\nexport {ZoomWidget} from './widgets/zoom-widget';\nexport {useWidget} from './utils/use-widget';\n\n// Types\nexport type {DeckGLContextValue} from './utils/deckgl-context';\nexport type {DeckGLRef, DeckGLProps} from './deckgl';\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement, useRef, useState, useMemo, useEffect, useImperativeHandle} from 'react';\nimport {Deck} from '@deck.gl/core';\nimport useIsomorphicLayoutEffect from './utils/use-isomorphic-layout-effect';\n\nimport extractJSXLayers, {DeckGLRenderCallback} from './utils/extract-jsx-layers';\nimport positionChildrenUnderViews from './utils/position-children-under-views';\nimport extractStyles from './utils/extract-styles';\n\nimport type {DeckGLContextValue} from './utils/deckgl-context';\nimport type {DeckProps, View, Viewport} from '@deck.gl/core';\n\nexport type ViewOrViews = View | View[] | null;\n\n/* eslint-disable max-statements, accessor-pairs */\ntype DeckInstanceRef<ViewsT extends ViewOrViews> = {\n deck?: Deck<ViewsT>;\n redrawReason?: string | null;\n lastRenderedViewports?: Viewport[];\n viewStateUpdateRequested?: any;\n interactionStateUpdateRequested?: any;\n forceUpdate: () => void;\n version: number;\n control: React.ReactHTMLElement<HTMLElement> | null;\n};\n\n// Remove prop types in the base Deck class that support externally supplied canvas/WebGLContext\n/** DeckGL React component props */\nexport type DeckGLProps<ViewsT extends ViewOrViews = null> = Omit<\n DeckProps<ViewsT>,\n 'width' | 'height' | 'gl' | 'parent' | 'canvas' | '_customRender'\n> & {\n Deck?: typeof Deck;\n width?: string | number;\n height?: string | number;\n children?: React.ReactNode | DeckGLRenderCallback;\n ref?: React.Ref<DeckGLRef<ViewsT>>;\n ContextProvider?: React.Context<DeckGLContextValue>['Provider'];\n};\n\nexport type DeckGLRef<ViewsT extends ViewOrViews = null> = {\n deck?: Deck<ViewsT>;\n pickObject: Deck['pickObject'];\n pickObjects: Deck['pickObjects'];\n pickMultipleObjects: Deck['pickMultipleObjects'];\n};\n\nfunction getRefHandles<ViewsT extends ViewOrViews>(\n thisRef: DeckInstanceRef<ViewsT>\n): DeckGLRef<ViewsT> {\n return {\n get deck() {\n return thisRef.deck;\n },\n // The following method can only be called after ref is available, by which point deck is defined in useEffect\n pickObject: opts => thisRef.deck!.pickObject(opts),\n pickMultipleObjects: opts => thisRef.deck!.pickMultipleObjects(opts),\n pickObjects: opts => thisRef.deck!.pickObjects(opts)\n };\n}\n\nfunction redrawDeck(thisRef: DeckInstanceRef<any>) {\n if (thisRef.redrawReason) {\n // Only redraw if we have received a dirty flag\n // @ts-expect-error accessing protected method\n thisRef.deck._drawLayers(thisRef.redrawReason);\n thisRef.redrawReason = null;\n }\n}\n\nfunction createDeckInstance<ViewsT extends ViewOrViews>(\n thisRef: DeckInstanceRef<ViewsT>,\n DeckClass: typeof Deck,\n props: DeckProps<ViewsT>\n): Deck<ViewsT> {\n const deck = new DeckClass({\n ...props,\n // The Deck's animation loop is independent from React's render cycle, causing potential\n // synchronization issues. We provide this custom render function to make sure that React\n // and Deck update on the same schedule.\n // TODO(ibgreen) - Hack to enable WebGPU as it needs to render quickly to avoid CanvasContext texture from going stale\n _customRender:\n props.deviceProps?.adapters?.[0]?.type === 'webgpu'\n ? undefined\n : redrawReason => {\n // Save the dirty flag for later\n thisRef.redrawReason = redrawReason;\n\n // Viewport/view state is passed to child components as props.\n // If they have changed, we need to trigger a React rerender to update children props.\n const viewports = deck.getViewports();\n if (thisRef.lastRenderedViewports !== viewports) {\n // Viewports have changed, update children props first.\n // This will delay the Deck canvas redraw till after React update (in useLayoutEffect)\n // so that the canvas does not get rendered before the child components update.\n thisRef.forceUpdate();\n } else {\n redrawDeck(thisRef);\n }\n }\n });\n return deck;\n}\n\nfunction DeckGLWithRef<ViewsT extends ViewOrViews = null>(\n props: DeckGLProps<ViewsT>,\n ref: React.Ref<DeckGLRef<ViewsT>>\n) {\n // A mechanism to force redraw\n const [version, setVersion] = useState(0);\n // A reference to persistent states\n const _thisRef = useRef<DeckInstanceRef<ViewsT>>({\n control: null,\n version,\n forceUpdate: () => setVersion(v => v + 1)\n });\n const thisRef = _thisRef.current;\n // DOM refs\n const containerRef = useRef(null);\n const canvasRef = useRef(null);\n\n // extract any deck.gl layers masquerading as react elements from props.children\n const jsxProps = useMemo(\n () => extractJSXLayers(props),\n [props.layers, props.views, props.children]\n );\n\n // Callbacks\n let inRender = true;\n\n const handleViewStateChange: DeckProps<ViewsT>['onViewStateChange'] = params => {\n if (inRender && props.viewState) {\n // Callback may invoke a state update. Defer callback to after render() to avoid React error\n // In React StrictMode, render is executed twice and useEffect/useLayoutEffect is executed once\n // Store deferred parameters in ref so that we can access it in another render\n thisRef.viewStateUpdateRequested = params;\n return null;\n }\n thisRef.viewStateUpdateRequested = null;\n return props.onViewStateChange?.(params);\n };\n\n const handleInteractionStateChange: DeckProps<ViewsT>['onInteractionStateChange'] = params => {\n if (inRender) {\n // Callback may invoke a state update. Defer callback to after render() to avoid React error\n // In React StrictMode, render is executed twice and useEffect/useLayoutEffect is executed once\n // Store deferred parameters in ref so that we can access it in another render\n thisRef.interactionStateUpdateRequested = params;\n } else {\n thisRef.interactionStateUpdateRequested = null;\n props.onInteractionStateChange?.(params);\n }\n };\n\n // Update Deck's props. If Deck needs redraw, this will trigger a call to `_customRender` in\n // the next animation frame.\n // Needs to be called both from initial mount, and when new props are received\n const deckProps = useMemo(() => {\n const forwardProps: DeckProps<ViewsT> = {\n widgets: [],\n ...props,\n // Override user styling props. We will set the canvas style in render()\n style: null,\n width: '100%',\n height: '100%',\n parent: containerRef.current,\n canvas: canvasRef.current,\n layers: jsxProps.layers,\n views: jsxProps.views as ViewsT,\n onViewStateChange: handleViewStateChange,\n onInteractionStateChange: handleInteractionStateChange\n };\n\n // The defaultValue for _customRender is null, which would overwrite the definition\n // of _customRender. Remove to avoid frequently redeclaring the method here.\n delete forwardProps._customRender;\n\n if (thisRef.deck) {\n thisRef.deck.setProps(forwardProps);\n }\n\n return forwardProps;\n }, [props]);\n\n useEffect(() => {\n const DeckClass = props.Deck || Deck;\n\n thisRef.deck = createDeckInstance(thisRef, DeckClass, {\n ...deckProps,\n parent: containerRef.current,\n canvas: canvasRef.current\n });\n\n return () => thisRef.deck?.finalize();\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n // render has just been called. The children are positioned based on the current view state.\n // Redraw Deck canvas immediately, if necessary, using the current view state, so that it\n // matches the child components.\n redrawDeck(thisRef);\n\n // Execute deferred callbacks\n const {viewStateUpdateRequested, interactionStateUpdateRequested} = thisRef;\n if (viewStateUpdateRequested) {\n handleViewStateChange(viewStateUpdateRequested);\n }\n if (interactionStateUpdateRequested) {\n handleInteractionStateChange(interactionStateUpdateRequested);\n }\n });\n\n useImperativeHandle(ref, () => getRefHandles(thisRef), []);\n\n const currentViewports =\n thisRef.deck && thisRef.deck.isInitialized ? thisRef.deck.getViewports() : undefined;\n\n const {ContextProvider, width = '100%', height = '100%', id, style} = props;\n\n const {containerStyle, canvasStyle} = useMemo(\n () => extractStyles({width, height, style}),\n [width, height, style]\n );\n\n // Props changes may lead to 3 types of updates:\n // 1. Only the WebGL canvas - updated in Deck's render cycle (next animation frame)\n // 2. Only the DOM - updated in React's lifecycle (now)\n // 3. Both the WebGL canvas and the DOM - defer React rerender to next animation frame just\n // before Deck redraw to ensure perfect synchronization & avoid excessive redraw\n // This is because multiple changes may happen to Deck between two frames e.g. transition\n if (\n (!thisRef.viewStateUpdateRequested && thisRef.lastRenderedViewports === currentViewports) || // case 2\n thisRef.version !== version // case 3 just before deck redraws\n ) {\n thisRef.lastRenderedViewports = currentViewports;\n thisRef.version = version;\n\n // Render the background elements (typically react-map-gl instances)\n // using the view descriptors\n const childrenUnderViews = positionChildrenUnderViews({\n children: jsxProps.children,\n deck: thisRef.deck,\n ContextProvider\n });\n\n const canvas = createElement('canvas', {\n key: 'canvas',\n id: id || 'deckgl-overlay',\n ref: canvasRef,\n style: canvasStyle\n });\n\n // Render deck.gl as the last child\n thisRef.control = createElement(\n 'div',\n {id: `${id || 'deckgl'}-wrapper`, ref: containerRef, style: containerStyle},\n [canvas, childrenUnderViews]\n );\n }\n\n inRender = false;\n return thisRef.control;\n}\n\nconst DeckGL = React.forwardRef(DeckGLWithRef) as <ViewsT extends ViewOrViews>(\n props: DeckGLProps<ViewsT>\n) => React.ReactElement;\n\nexport default DeckGL;\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport {useEffect, useLayoutEffect} from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement} from 'react';\nimport {inheritsFrom} from './inherits-from';\nimport {Layer, View} from '@deck.gl/core';\nimport {isComponent} from './evaluate-children';\nimport type {LayersList, Viewport} from '@deck.gl/core';\n\nexport type DeckGLRenderCallbackArgs = {\n /**\n * the left offset of the current view, in pixels\n */\n x: number;\n /**\n * the top offset of the current view, in pixels\n */\n y: number;\n /**\n * the width of the current view, in pixels\n */\n width: number;\n /**\n * the height of the current view, in pixels\n */\n height: number;\n /**\n * the view state of the current view\n */\n viewState: any;\n /**\n * the `Viewport` instance of the current view\n */\n viewport: Viewport;\n};\n\nexport type DeckGLRenderCallback = (args: DeckGLRenderCallbackArgs) => React.ReactNode;\n\n// recursively wrap render callbacks in `View`\nfunction wrapInView(node: React.ReactNode | DeckGLRenderCallback): React.ReactNode {\n if (typeof node === 'function') {\n // React.Children does not traverse functions.\n // All render callbacks must be protected under a <View>\n // @ts-expect-error View is not a ReactJSXElement constructor. Only used as a temporary wrapper and will be removed in extractJSXLayers\n return createElement(View, {}, node);\n }\n if (Array.isArray(node)) {\n return node.map(wrapInView);\n }\n if (isComponent(node)) {\n if (node.type === React.Fragment) {\n return wrapInView(node.props.children);\n }\n if (inheritsFrom(node.type, View)) {\n return node;\n }\n }\n return node;\n}\n\n// extracts any deck.gl layers masquerading as react elements from props.children\nexport default function extractJSXLayers({\n children,\n layers = [],\n views = null\n}: {\n children?: React.ReactNode | DeckGLRenderCallback;\n layers?: LayersList;\n views?: View | View[] | null;\n}): {\n children: React.ReactNode[];\n layers: LayersList;\n views: View | View[] | null;\n} {\n const reactChildren: React.ReactNode[] = []; // extract real react elements (i.e. not deck.gl layers)\n const jsxLayers: LayersList = []; // extracted layer from react children, will add to deck.gl layer array\n const jsxViews: Record<string, View> = {};\n\n // React.children\n React.Children.forEach(wrapInView(children), reactElement => {\n if (isComponent(reactElement)) {\n // For some reason Children.forEach doesn't filter out `null`s\n const ElementType = reactElement.type;\n if (inheritsFrom(ElementType, Layer)) {\n const layer = createLayer(ElementType, reactElement.props);\n jsxLayers.push(layer);\n } else {\n reactChildren.push(reactElement);\n }\n\n // empty id => default view\n if (inheritsFrom(ElementType, View) && ElementType !== View && reactElement.props.id) {\n // @ts-ignore Cannot instantiate an abstract class (View)\n const view = new ElementType(reactElement.props);\n jsxViews[view.id] = view;\n }\n } else if (reactElement) {\n reactChildren.push(reactElement);\n }\n });\n\n // Avoid modifying views if no JSX views were found\n if (Object.keys(jsxViews).length > 0) {\n // If a view is specified in both views prop and JSX, use the one in views\n if (Array.isArray(views)) {\n views.forEach(view => {\n jsxViews[view.id] = view;\n });\n } else if (views) {\n jsxViews[views.id] = views;\n }\n views = Object.values(jsxViews);\n }\n\n // Avoid modifying layers array if no JSX layers were found\n layers = jsxLayers.length > 0 ? [...jsxLayers, ...layers] : layers;\n\n return {layers, children: reactChildren, views};\n}\n\nfunction createLayer(LayerType: typeof Layer, reactProps: any): Layer {\n const props = {};\n // Layer.defaultProps is treated as ReactElement.defaultProps and merged into react props\n // Remove them\n const defaultProps = LayerType.defaultProps || {};\n for (const key in reactProps) {\n if (defaultProps[key] !== reactProps[key]) {\n props[key] = reactProps[key];\n }\n }\n // @ts-ignore Cannot instantiate an abstract class (Layer)\n return new LayerType(props);\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Check if one JavaScript class inherits from another\nexport function inheritsFrom<T>(Type: any, ParentType: T): Type is T {\n while (Type) {\n if (Type === ParentType) {\n return true;\n }\n Type = Object.getPrototypeOf(Type);\n }\n return false;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {cloneElement} from 'react';\n\nconst MAP_STYLE = {position: 'absolute', zIndex: -1};\n\nexport default function evaluateChildren(\n children: React.ReactNode | Function,\n childProps: any\n): React.ReactNode {\n if (typeof children === 'function') {\n return children(childProps);\n }\n if (Array.isArray(children)) {\n return children.map(child => evaluateChildren(child, childProps));\n }\n if (isComponent(children)) {\n // Special treatment for react-map-gl's Map component\n // to support shorthand use case <DeckGL><StaticMap /></DeckGL>\n if (isReactMap(children)) {\n // Place map under the canvas\n childProps.style = MAP_STYLE;\n return cloneElement(children, childProps);\n }\n if (needsDeckGLViewProps(children)) {\n return cloneElement(children, childProps);\n }\n }\n\n return children;\n}\n\nexport function isComponent(child: React.ReactNode): child is React.ReactElement {\n return (child && typeof child === 'object' && 'type' in child) || false;\n}\n\nfunction isReactMap(child: React.ReactElement): boolean {\n return child.props?.mapStyle;\n}\n\nfunction needsDeckGLViewProps(child: React.ReactElement): boolean {\n const componentClass = child.type;\n // @ts-expect-error deckGLViewProps is a custom hack defined on the constructor (nebula.gl)\n return componentClass && componentClass.deckGLViewProps;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement} from 'react';\nimport {View} from '@deck.gl/core';\nimport {inheritsFrom} from './inherits-from';\nimport evaluateChildren, {isComponent} from './evaluate-children';\n\nimport type {ViewOrViews} from '../deckgl';\nimport type {Deck, Viewport} from '@deck.gl/core';\nimport {DeckGlContext, type DeckGLContextValue} from './deckgl-context';\n\n// Iterate over views and reposition children associated with views\n// TODO - Can we supply a similar function for the non-React case?\nexport default function positionChildrenUnderViews<ViewsT extends ViewOrViews>({\n children,\n deck,\n ContextProvider = DeckGlContext.Provider\n}: {\n children: React.ReactNode[];\n deck?: Deck<ViewsT>;\n ContextProvider?: React.Context<DeckGLContextValue>['Provider'];\n}): React.ReactNode[] {\n // @ts-expect-error accessing protected property\n const {viewManager} = deck || {};\n\n if (!viewManager || !viewManager.views.length) {\n return [];\n }\n\n const views: Record<\n string,\n {\n viewport: Viewport;\n children: React.ReactNode[];\n }\n > = {};\n const defaultViewId = (viewManager.views[0] as View).id;\n\n // Sort children by view id\n for (const child of children) {\n // Unless child is a View, position / render as part of the default view\n let viewId = defaultViewId;\n let viewChildren = child;\n\n if (isComponent(child) && inheritsFrom(child.type, View)) {\n viewId = child.props.id || defaultViewId;\n viewChildren = child.props.children;\n }\n\n const viewport = viewManager.getViewport(viewId) as Viewport;\n const viewState = viewManager.getViewState(viewId);\n\n // Drop (auto-hide) elements with viewId that are not matched by any current view\n if (viewport) {\n viewState.padding = viewport.padding;\n const {x, y, width, height} = viewport;\n // Resolve potentially relative dimensions using the deck.gl container size\n viewChildren = evaluateChildren(viewChildren, {\n x,\n y,\n width,\n height,\n viewport,\n viewState\n });\n\n if (!views[viewId]) {\n views[viewId] = {\n viewport,\n children: []\n };\n }\n views[viewId].children.push(viewChildren);\n }\n }\n\n // Render views\n return Object.keys(views).map(viewId => {\n const {viewport, children: viewChildren} = views[viewId];\n const {x, y, width, height} = viewport;\n const style = {\n position: 'absolute',\n left: x,\n top: y,\n width,\n height\n };\n\n const key = `view-${viewId}`;\n // If children is passed as an array, React will throw the \"each element in a list needs\n // a key\" warning. Sending each child as separate arguments removes this requirement.\n const viewElement = createElement('div', {key, id: key, style}, ...viewChildren);\n\n const contextValue: DeckGLContextValue = {\n deck,\n viewport,\n // @ts-expect-error accessing protected property\n container: deck.canvas.offsetParent,\n // @ts-expect-error accessing protected property\n eventManager: deck.eventManager,\n onViewStateChange: params => {\n params.viewId = viewId;\n // @ts-expect-error accessing protected method\n deck._onViewStateChange(params);\n },\n widgets: []\n };\n const providerKey = `view-${viewId}-context`;\n return createElement(ContextProvider, {key: providerKey, value: contextValue}, viewElement);\n });\n}\n", "import {createContext} from 'react';\nimport type {EventManager} from 'mjolnir.js';\nimport type {Deck, DeckProps, Viewport, Widget} from '@deck.gl/core';\n\nexport type DeckGLContextValue = {\n viewport: Viewport;\n container: HTMLElement;\n eventManager: EventManager;\n onViewStateChange: DeckProps['onViewStateChange'];\n deck?: Deck<any>;\n widgets?: Widget[];\n};\n\n// @ts-ignore\nexport const DeckGlContext = createContext<DeckGLContextValue>();\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\n\nconst CANVAS_ONLY_STYLES = {\n mixBlendMode: null\n};\n\nexport default function extractStyles({\n width,\n height,\n style\n}: {\n width?: string | number;\n height?: string | number;\n style?: Partial<CSSStyleDeclaration> | null;\n}): {\n containerStyle: React.CSSProperties;\n canvasStyle: React.CSSProperties;\n} {\n // This styling is enforced for correct positioning with children\n const containerStyle: React.CSSProperties = {\n position: 'absolute',\n zIndex: 0,\n left: 0,\n top: 0,\n width,\n height\n };\n\n // Fill the container\n const canvasStyle: React.CSSProperties = {\n left: 0,\n top: 0\n };\n\n if (style) {\n for (const key in style) {\n if (key in CANVAS_ONLY_STYLES) {\n // apply style to the canvas, but not deck's children, e.g. mix-blend-mode\n canvasStyle[key] = style[key];\n } else {\n // apply style to the container, e.g. position/flow settings\n containerStyle[key] = style[key];\n }\n }\n }\n\n return {containerStyle, canvasStyle};\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompassWidget as _CompassWidget} from '@deck.gl/widgets';\nimport type {CompassWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const CompassWidget = (props: CompassWidgetProps = {}) => {\n useWidget(_CompassWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {useContext, useMemo, useEffect} from 'react';\nimport {DeckGlContext} from './deckgl-context';\nimport {log, type Widget, _deepEqual as deepEqual} from '@deck.gl/core';\n\nexport function useWidget<T extends Widget<PropsT>, PropsT extends {}>(\n WidgetClass: {new (props_: PropsT): T},\n props: PropsT\n): T {\n const context = useContext(DeckGlContext);\n const {widgets, deck} = context;\n useEffect(() => {\n // warn if the user supplied a pure-js widget, since it will be ignored\n // NOTE: This effect runs once per widget. Context widgets and deck widget props are synced after first effect runs.\n const internalWidgets = deck?.props.widgets;\n if (widgets?.length && internalWidgets?.length && !deepEqual(internalWidgets, widgets, 1)) {\n log.warn('\"widgets\" prop will be ignored because React widgets are in use.')();\n }\n\n return () => {\n // Remove widget from context when it is unmounted\n const index = widgets?.indexOf(widget);\n if (index && index !== -1) {\n widgets?.splice(index, 1);\n deck?.setProps({widgets});\n }\n };\n }, []);\n const widget = useMemo(() => new WidgetClass(props), [WidgetClass]);\n\n // Hook rebuilds widgets on every render: [] then [FirstWidget] then [FirstWidget, SecondWidget]\n widgets?.push(widget);\n widget.setProps(props);\n\n useEffect(() => {\n deck?.setProps({widgets});\n }, [widgets]);\n\n return widget;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {FullscreenWidget as _FullscreenWidget} from '@deck.gl/widgets';\nimport type {FullscreenWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const FullscreenWidget = (props: FullscreenWidgetProps = {}) => {\n useWidget(_FullscreenWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ZoomWidget as _ZoomWidget} from '@deck.gl/widgets';\nimport type {ZoomWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const ZoomWidget = (props: ZoomWidgetProps = {}) => {\n useWidget(_ZoomWidget, props);\n return null;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACIA,IAAAA,SAAuB;AACvB,IAAAC,gBAAuF;AACvF,IAAAC,eAAmB;;;ACAnB,mBAAyC;AAEzC,IAAM,4BAA4B,OAAO,WAAW,cAAc,+BAAkB;AAEpF,IAAA,uCAAe;;;ACNf,YAAuB;AACvB,IAAAC,gBAA4B;;;ACAtB,SAAU,aAAgB,MAAW,YAAa;AACtD,SAAO,MAAM;AACX,QAAI,SAAS,YAAY;AACvB,aAAO;IACT;AACA,WAAO,OAAO,eAAe,IAAI;EACnC;AACA,SAAO;AACT;;;ADNA,kBAA0B;;;AEF1B,IAAAC,gBAA2B;AAE3B,IAAM,YAAY,EAAC,UAAU,YAAY,QAAQ,GAAE;AAErC,SAAP,iBACL,UACA,YAAe;AAEf,MAAI,OAAO,aAAa,YAAY;AAClC,WAAO,SAAS,UAAU;EAC5B;AACA,MAAI,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F,uBAAI,KAAK,kEAAkE,EAAC;IAC9E;AAEA,WAAO,MAAK;AAEV,YAAM,QAAQ,mCAAS,QAAQ;AAC/B,UAAI,SAAS,UAAU,IAAI;AACzB,2CAAS,OAAO,OAAO;AACvB,qCAAM,SAAS,EAAC,QAAO;MACzB;IACF;EACF,GAAG,CAAA,CAAE;AACL,QAAM,aAAS,uBAAQ,MAAM,IAAI,YAAY,KAAK,GAAG,CAAC,WAAW,CAAC;AAGlE,qCAAS,KAAK;AACd,SAAO,SAAS,KAAK;AAErB,+BAAU,MAAK;AACb,iCAAM,SAAS,EAAC,QAAO;EACzB,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO;AACT;;;ADlCO,IAAM,gBAAgB,CAAC,QAA4B,CAAA,MAAM;AAC9D,YAAU,eAAAC,eAAgB,KAAK;AAC/B,SAAO;AACT;;;AEPA,IAAAC,kBAAoD;AAI7C,IAAM,mBAAmB,CAAC,QAA+B,CAAA,MAAM;AACpE,YAAU,gBAAAC,kBAAmB,KAAK;AAClC,SAAO;AACT;;;ACPA,IAAAC,kBAAwC;AAIjC,IAAM,aAAa,CAAC,QAAyB,CAAA,MAAM;AACxD,YAAU,gBAAAC,YAAa,KAAK;AAC5B,SAAO;AACT;",
6
- "names": ["React", "import_react", "import_core", "import_react", "import_react", "import_react", "import_core", "import_react", "import_react", "import_core", "deepEqual", "_CompassWidget", "import_widgets", "_FullscreenWidget", "import_widgets", "_ZoomWidget"]
3
+ "sources": ["../src/index.ts", "../src/deckgl.ts", "../src/utils/use-isomorphic-layout-effect.ts", "../src/utils/extract-jsx-layers.ts", "../src/utils/inherits-from.ts", "../src/utils/evaluate-children.ts", "../src/utils/position-children-under-views.ts", "../src/utils/deckgl-context.ts", "../src/utils/extract-styles.ts", "../src/widgets/compass-widget.tsx", "../src/utils/use-widget.ts", "../src/widgets/fullscreen-widget.tsx", "../src/widgets/zoom-widget.tsx", "../src/widgets/geocoder-widget.tsx", "../src/widgets/info-widget.tsx", "../src/widgets/context-menu-widget.tsx", "../src/widgets/loading-widget.tsx", "../src/widgets/reset-view-widget.tsx", "../src/widgets/scale-widget.tsx", "../src/widgets/screenshot-widget.tsx", "../src/widgets/splitter-widget.tsx", "../src/widgets/theme-widget.tsx"],
4
+ "sourcesContent": ["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {default as DeckGL} from './deckgl';\nexport {default} from './deckgl';\n\n// Widgets\nexport {CompassWidget} from './widgets/compass-widget';\nexport {FullscreenWidget} from './widgets/fullscreen-widget';\nexport {ZoomWidget} from './widgets/zoom-widget';\nexport {GeocoderWidget as _GeocoderWidget} from './widgets/geocoder-widget';\nexport {InfoWidget as _InfoWidget} from './widgets/info-widget';\nexport {ContextMenuWidget as _ContextMenuWidget} from './widgets/context-menu-widget';\nexport {LoadingWidget as _LoadingWidget} from './widgets/loading-widget';\nexport {ResetViewWidget as _ResetViewWidget} from './widgets/reset-view-widget';\nexport {ScaleWidget as _ScaleWidget} from './widgets/scale-widget';\nexport {ScreenshotWidget as _ScreenshotWidget} from './widgets/screenshot-widget';\nexport {SplitterWidget as _SplitterWidget} from './widgets/splitter-widget';\nexport {ThemeWidget as _ThemeWidget} from './widgets/theme-widget';\nexport {useWidget} from './utils/use-widget';\nexport type {ContextMenuWidgetProps} from '@deck.gl/widgets';\n\n// Types\nexport type {DeckGLContextValue} from './utils/deckgl-context';\nexport type {DeckGLRef, DeckGLProps} from './deckgl';\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement, useRef, useState, useMemo, useEffect, useImperativeHandle} from 'react';\nimport {Deck} from '@deck.gl/core';\nimport useIsomorphicLayoutEffect from './utils/use-isomorphic-layout-effect';\n\nimport extractJSXLayers, {DeckGLRenderCallback} from './utils/extract-jsx-layers';\nimport positionChildrenUnderViews from './utils/position-children-under-views';\nimport extractStyles from './utils/extract-styles';\n\nimport type {DeckGLContextValue} from './utils/deckgl-context';\nimport type {DeckProps, View, Viewport} from '@deck.gl/core';\n\nexport type ViewOrViews = View | View[] | null;\n\n/* eslint-disable max-statements, accessor-pairs */\ntype DeckInstanceRef<ViewsT extends ViewOrViews> = {\n deck?: Deck<ViewsT>;\n redrawReason?: string | null;\n lastRenderedViewports?: Viewport[];\n viewStateUpdateRequested?: any;\n interactionStateUpdateRequested?: any;\n forceUpdate: () => void;\n version: number;\n control: React.ReactHTMLElement<HTMLElement> | null;\n};\n\n// Remove prop types in the base Deck class that support externally supplied canvas/WebGLContext\n/** DeckGL React component props */\nexport type DeckGLProps<ViewsT extends ViewOrViews = null> = Omit<\n DeckProps<ViewsT>,\n 'width' | 'height' | 'gl' | 'parent' | 'canvas' | '_customRender'\n> & {\n Deck?: typeof Deck;\n width?: string | number;\n height?: string | number;\n children?: React.ReactNode | DeckGLRenderCallback;\n ref?: React.Ref<DeckGLRef<ViewsT>>;\n ContextProvider?: React.Context<DeckGLContextValue>['Provider'];\n};\n\nexport type DeckGLRef<ViewsT extends ViewOrViews = null> = {\n deck?: Deck<ViewsT>;\n pickObject: Deck['pickObject'];\n pickObjects: Deck['pickObjects'];\n pickMultipleObjects: Deck['pickMultipleObjects'];\n};\n\nfunction getRefHandles<ViewsT extends ViewOrViews>(\n thisRef: DeckInstanceRef<ViewsT>\n): DeckGLRef<ViewsT> {\n return {\n get deck() {\n return thisRef.deck;\n },\n // The following method can only be called after ref is available, by which point deck is defined in useEffect\n pickObject: opts => thisRef.deck!.pickObject(opts),\n pickMultipleObjects: opts => thisRef.deck!.pickMultipleObjects(opts),\n pickObjects: opts => thisRef.deck!.pickObjects(opts)\n };\n}\n\nfunction redrawDeck(thisRef: DeckInstanceRef<any>) {\n if (thisRef.redrawReason) {\n // Only redraw if we have received a dirty flag\n // @ts-expect-error accessing protected method\n thisRef.deck._drawLayers(thisRef.redrawReason);\n thisRef.redrawReason = null;\n }\n}\n\nfunction createDeckInstance<ViewsT extends ViewOrViews>(\n thisRef: DeckInstanceRef<ViewsT>,\n DeckClass: typeof Deck,\n props: DeckProps<ViewsT>\n): Deck<ViewsT> {\n const deck = new DeckClass({\n ...props,\n // The Deck's animation loop is independent from React's render cycle, causing potential\n // synchronization issues. We provide this custom render function to make sure that React\n // and Deck update on the same schedule.\n // TODO(ibgreen) - Hack to enable WebGPU as it needs to render quickly to avoid CanvasContext texture from going stale\n _customRender:\n props.deviceProps?.adapters?.[0]?.type === 'webgpu'\n ? undefined\n : redrawReason => {\n // Save the dirty flag for later\n thisRef.redrawReason = redrawReason;\n\n // Viewport/view state is passed to child components as props.\n // If they have changed, we need to trigger a React rerender to update children props.\n const viewports = deck.getViewports();\n if (thisRef.lastRenderedViewports !== viewports) {\n // Viewports have changed, update children props first.\n // This will delay the Deck canvas redraw till after React update (in useLayoutEffect)\n // so that the canvas does not get rendered before the child components update.\n thisRef.forceUpdate();\n } else {\n redrawDeck(thisRef);\n }\n }\n });\n return deck;\n}\n\nfunction DeckGLWithRef<ViewsT extends ViewOrViews = null>(\n props: DeckGLProps<ViewsT>,\n ref: React.Ref<DeckGLRef<ViewsT>>\n) {\n // A mechanism to force redraw\n const [version, setVersion] = useState(0);\n // A reference to persistent states\n const _thisRef = useRef<DeckInstanceRef<ViewsT>>({\n control: null,\n version,\n forceUpdate: () => setVersion(v => v + 1)\n });\n const thisRef = _thisRef.current;\n // DOM refs\n const containerRef = useRef(null);\n const canvasRef = useRef(null);\n\n // extract any deck.gl layers masquerading as react elements from props.children\n const jsxProps = useMemo(\n () => extractJSXLayers(props),\n [props.layers, props.views, props.children]\n );\n\n // Callbacks\n let inRender = true;\n\n const handleViewStateChange: DeckProps<ViewsT>['onViewStateChange'] = params => {\n if (inRender && props.viewState) {\n // Callback may invoke a state update. Defer callback to after render() to avoid React error\n // In React StrictMode, render is executed twice and useEffect/useLayoutEffect is executed once\n // Store deferred parameters in ref so that we can access it in another render\n thisRef.viewStateUpdateRequested = params;\n return null;\n }\n thisRef.viewStateUpdateRequested = null;\n return props.onViewStateChange?.(params);\n };\n\n const handleInteractionStateChange: DeckProps<ViewsT>['onInteractionStateChange'] = params => {\n if (inRender) {\n // Callback may invoke a state update. Defer callback to after render() to avoid React error\n // In React StrictMode, render is executed twice and useEffect/useLayoutEffect is executed once\n // Store deferred parameters in ref so that we can access it in another render\n thisRef.interactionStateUpdateRequested = params;\n } else {\n thisRef.interactionStateUpdateRequested = null;\n props.onInteractionStateChange?.(params);\n }\n };\n\n // Update Deck's props. If Deck needs redraw, this will trigger a call to `_customRender` in\n // the next animation frame.\n // Needs to be called both from initial mount, and when new props are received\n const deckProps = useMemo(() => {\n const forwardProps: DeckProps<ViewsT> = {\n widgets: [],\n ...props,\n // Override user styling props. We will set the canvas style in render()\n style: null,\n width: '100%',\n height: '100%',\n parent: containerRef.current,\n canvas: canvasRef.current,\n layers: jsxProps.layers,\n views: jsxProps.views as ViewsT,\n onViewStateChange: handleViewStateChange,\n onInteractionStateChange: handleInteractionStateChange\n };\n\n // The defaultValue for _customRender is null, which would overwrite the definition\n // of _customRender. Remove to avoid frequently redeclaring the method here.\n delete forwardProps._customRender;\n\n if (thisRef.deck) {\n thisRef.deck.setProps(forwardProps);\n }\n\n return forwardProps;\n }, [props]);\n\n useEffect(() => {\n const DeckClass = props.Deck || Deck;\n\n thisRef.deck = createDeckInstance(thisRef, DeckClass, {\n ...deckProps,\n parent: containerRef.current,\n canvas: canvasRef.current\n });\n\n return () => thisRef.deck?.finalize();\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n // render has just been called. The children are positioned based on the current view state.\n // Redraw Deck canvas immediately, if necessary, using the current view state, so that it\n // matches the child components.\n redrawDeck(thisRef);\n\n // Execute deferred callbacks\n const {viewStateUpdateRequested, interactionStateUpdateRequested} = thisRef;\n if (viewStateUpdateRequested) {\n handleViewStateChange(viewStateUpdateRequested);\n }\n if (interactionStateUpdateRequested) {\n handleInteractionStateChange(interactionStateUpdateRequested);\n }\n });\n\n useImperativeHandle(ref, () => getRefHandles(thisRef), []);\n\n const currentViewports =\n thisRef.deck && thisRef.deck.isInitialized ? thisRef.deck.getViewports() : undefined;\n\n const {ContextProvider, width = '100%', height = '100%', id, style} = props;\n\n const {containerStyle, canvasStyle} = useMemo(\n () => extractStyles({width, height, style}),\n [width, height, style]\n );\n\n // Props changes may lead to 3 types of updates:\n // 1. Only the WebGL canvas - updated in Deck's render cycle (next animation frame)\n // 2. Only the DOM - updated in React's lifecycle (now)\n // 3. Both the WebGL canvas and the DOM - defer React rerender to next animation frame just\n // before Deck redraw to ensure perfect synchronization & avoid excessive redraw\n // This is because multiple changes may happen to Deck between two frames e.g. transition\n if (\n (!thisRef.viewStateUpdateRequested && thisRef.lastRenderedViewports === currentViewports) || // case 2\n thisRef.version !== version // case 3 just before deck redraws\n ) {\n thisRef.lastRenderedViewports = currentViewports;\n thisRef.version = version;\n\n // Render the background elements (typically react-map-gl instances)\n // using the view descriptors\n const childrenUnderViews = positionChildrenUnderViews({\n children: jsxProps.children,\n deck: thisRef.deck,\n ContextProvider\n });\n\n const canvas = createElement('canvas', {\n key: 'canvas',\n id: id || 'deckgl-overlay',\n ref: canvasRef,\n style: canvasStyle\n });\n\n // Render deck.gl as the last child\n thisRef.control = createElement(\n 'div',\n {id: `${id || 'deckgl'}-wrapper`, ref: containerRef, style: containerStyle},\n [canvas, childrenUnderViews]\n );\n }\n\n inRender = false;\n return thisRef.control;\n}\n\nconst DeckGL = React.forwardRef(DeckGLWithRef) as <ViewsT extends ViewOrViews>(\n props: DeckGLProps<ViewsT>\n) => React.ReactElement;\n\nexport default DeckGL;\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport {useEffect, useLayoutEffect} from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement} from 'react';\nimport {inheritsFrom} from './inherits-from';\nimport {Layer, View} from '@deck.gl/core';\nimport {isComponent} from './evaluate-children';\nimport type {LayersList, Viewport} from '@deck.gl/core';\n\nexport type DeckGLRenderCallbackArgs = {\n /**\n * the left offset of the current view, in pixels\n */\n x: number;\n /**\n * the top offset of the current view, in pixels\n */\n y: number;\n /**\n * the width of the current view, in pixels\n */\n width: number;\n /**\n * the height of the current view, in pixels\n */\n height: number;\n /**\n * the view state of the current view\n */\n viewState: any;\n /**\n * the `Viewport` instance of the current view\n */\n viewport: Viewport;\n};\n\nexport type DeckGLRenderCallback = (args: DeckGLRenderCallbackArgs) => React.ReactNode;\n\n// recursively wrap render callbacks in `View`\nfunction wrapInView(node: React.ReactNode | DeckGLRenderCallback): React.ReactNode {\n if (typeof node === 'function') {\n // React.Children does not traverse functions.\n // All render callbacks must be protected under a <View>\n // @ts-expect-error View is not a ReactJSXElement constructor. Only used as a temporary wrapper and will be removed in extractJSXLayers\n return createElement(View, {}, node);\n }\n if (Array.isArray(node)) {\n return node.map(wrapInView);\n }\n if (isComponent(node)) {\n if (node.type === React.Fragment) {\n return wrapInView(node.props.children);\n }\n if (inheritsFrom(node.type, View)) {\n return node;\n }\n }\n return node;\n}\n\n// extracts any deck.gl layers masquerading as react elements from props.children\nexport default function extractJSXLayers({\n children,\n layers = [],\n views = null\n}: {\n children?: React.ReactNode | DeckGLRenderCallback;\n layers?: LayersList;\n views?: View | View[] | null;\n}): {\n children: React.ReactNode[];\n layers: LayersList;\n views: View | View[] | null;\n} {\n const reactChildren: React.ReactNode[] = []; // extract real react elements (i.e. not deck.gl layers)\n const jsxLayers: LayersList = []; // extracted layer from react children, will add to deck.gl layer array\n const jsxViews: Record<string, View> = {};\n\n // React.children\n React.Children.forEach(wrapInView(children), reactElement => {\n if (isComponent(reactElement)) {\n // For some reason Children.forEach doesn't filter out `null`s\n const ElementType = reactElement.type;\n if (inheritsFrom(ElementType, Layer)) {\n const layer = createLayer(ElementType, reactElement.props);\n jsxLayers.push(layer);\n } else {\n reactChildren.push(reactElement);\n }\n\n // empty id => default view\n if (inheritsFrom(ElementType, View) && ElementType !== View && reactElement.props.id) {\n // @ts-ignore Cannot instantiate an abstract class (View)\n const view = new ElementType(reactElement.props);\n jsxViews[view.id] = view;\n }\n } else if (reactElement) {\n reactChildren.push(reactElement);\n }\n });\n\n // Avoid modifying views if no JSX views were found\n if (Object.keys(jsxViews).length > 0) {\n // If a view is specified in both views prop and JSX, use the one in views\n if (Array.isArray(views)) {\n views.forEach(view => {\n jsxViews[view.id] = view;\n });\n } else if (views) {\n jsxViews[views.id] = views;\n }\n views = Object.values(jsxViews);\n }\n\n // Avoid modifying layers array if no JSX layers were found\n layers = jsxLayers.length > 0 ? [...jsxLayers, ...layers] : layers;\n\n return {layers, children: reactChildren, views};\n}\n\nfunction createLayer(LayerType: typeof Layer, reactProps: any): Layer {\n const props = {};\n // Layer.defaultProps is treated as ReactElement.defaultProps and merged into react props\n // Remove them\n const defaultProps = LayerType.defaultProps || {};\n for (const key in reactProps) {\n if (defaultProps[key] !== reactProps[key]) {\n props[key] = reactProps[key];\n }\n }\n // @ts-ignore Cannot instantiate an abstract class (Layer)\n return new LayerType(props);\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Check if one JavaScript class inherits from another\nexport function inheritsFrom<T>(Type: any, ParentType: T): Type is T {\n while (Type) {\n if (Type === ParentType) {\n return true;\n }\n Type = Object.getPrototypeOf(Type);\n }\n return false;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {cloneElement} from 'react';\n\nconst MAP_STYLE = {position: 'absolute', zIndex: -1};\n\nexport default function evaluateChildren(\n children: React.ReactNode | Function,\n childProps: any\n): React.ReactNode {\n if (typeof children === 'function') {\n return children(childProps);\n }\n if (Array.isArray(children)) {\n return children.map(child => evaluateChildren(child, childProps));\n }\n if (isComponent(children)) {\n // Special treatment for react-map-gl's Map component\n // to support shorthand use case <DeckGL><StaticMap /></DeckGL>\n if (isReactMap(children)) {\n // Place map under the canvas\n childProps.style = MAP_STYLE;\n return cloneElement(children, childProps);\n }\n if (needsDeckGLViewProps(children)) {\n return cloneElement(children, childProps);\n }\n }\n\n return children;\n}\n\nexport function isComponent(child: React.ReactNode): child is React.ReactElement {\n return (child && typeof child === 'object' && 'type' in child) || false;\n}\n\nfunction isReactMap(child: React.ReactElement): boolean {\n return child.props?.mapStyle;\n}\n\nfunction needsDeckGLViewProps(child: React.ReactElement): boolean {\n const componentClass = child.type;\n // @ts-expect-error deckGLViewProps is a custom hack defined on the constructor (nebula.gl)\n return componentClass && componentClass.deckGLViewProps;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\nimport {createElement} from 'react';\nimport {View} from '@deck.gl/core';\nimport {inheritsFrom} from './inherits-from';\nimport evaluateChildren, {isComponent} from './evaluate-children';\n\nimport type {ViewOrViews} from '../deckgl';\nimport type {Deck, Viewport} from '@deck.gl/core';\nimport {DeckGlContext, type DeckGLContextValue} from './deckgl-context';\n\n// Iterate over views and reposition children associated with views\n// TODO - Can we supply a similar function for the non-React case?\nexport default function positionChildrenUnderViews<ViewsT extends ViewOrViews>({\n children,\n deck,\n ContextProvider = DeckGlContext.Provider\n}: {\n children: React.ReactNode[];\n deck?: Deck<ViewsT>;\n ContextProvider?: React.Context<DeckGLContextValue>['Provider'];\n}): React.ReactNode[] {\n // @ts-expect-error accessing protected property\n const {viewManager} = deck || {};\n\n if (!viewManager || !viewManager.views.length) {\n return [];\n }\n\n const views: Record<\n string,\n {\n viewport: Viewport;\n children: React.ReactNode[];\n }\n > = {};\n const defaultViewId = (viewManager.views[0] as View).id;\n\n // Sort children by view id\n for (const child of children) {\n // Unless child is a View, position / render as part of the default view\n let viewId = defaultViewId;\n let viewChildren = child;\n\n if (isComponent(child) && inheritsFrom(child.type, View)) {\n viewId = child.props.id || defaultViewId;\n viewChildren = child.props.children;\n }\n\n const viewport = viewManager.getViewport(viewId) as Viewport;\n const viewState = viewManager.getViewState(viewId);\n\n // Drop (auto-hide) elements with viewId that are not matched by any current view\n if (viewport) {\n viewState.padding = viewport.padding;\n const {x, y, width, height} = viewport;\n // Resolve potentially relative dimensions using the deck.gl container size\n viewChildren = evaluateChildren(viewChildren, {\n x,\n y,\n width,\n height,\n viewport,\n viewState\n });\n\n if (!views[viewId]) {\n views[viewId] = {\n viewport,\n children: []\n };\n }\n views[viewId].children.push(viewChildren);\n }\n }\n\n // Render views\n return Object.keys(views).map(viewId => {\n const {viewport, children: viewChildren} = views[viewId];\n const {x, y, width, height} = viewport;\n const style = {\n position: 'absolute',\n left: x,\n top: y,\n width,\n height\n };\n\n const key = `view-${viewId}`;\n // If children is passed as an array, React will throw the \"each element in a list needs\n // a key\" warning. Sending each child as separate arguments removes this requirement.\n const viewElement = createElement('div', {key, id: key, style}, ...viewChildren);\n\n const contextValue: DeckGLContextValue = {\n deck,\n viewport,\n // @ts-expect-error accessing protected property\n container: deck.canvas.offsetParent,\n // @ts-expect-error accessing protected property\n eventManager: deck.eventManager,\n onViewStateChange: params => {\n params.viewId = viewId;\n // @ts-expect-error accessing protected method\n deck._onViewStateChange(params);\n },\n widgets: []\n };\n const providerKey = `view-${viewId}-context`;\n return createElement(ContextProvider, {key: providerKey, value: contextValue}, viewElement);\n });\n}\n", "import {createContext} from 'react';\nimport type {EventManager} from 'mjolnir.js';\nimport type {Deck, DeckProps, Viewport, Widget} from '@deck.gl/core';\n\nexport type DeckGLContextValue = {\n viewport: Viewport;\n container: HTMLElement;\n eventManager: EventManager;\n onViewStateChange: DeckProps['onViewStateChange'];\n deck?: Deck<any>;\n widgets?: Widget[];\n};\n\n// @ts-ignore\nexport const DeckGlContext = createContext<DeckGLContextValue>();\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as React from 'react';\n\nconst CANVAS_ONLY_STYLES = {\n mixBlendMode: null\n};\n\nexport default function extractStyles({\n width,\n height,\n style\n}: {\n width?: string | number;\n height?: string | number;\n style?: Partial<CSSStyleDeclaration> | null;\n}): {\n containerStyle: React.CSSProperties;\n canvasStyle: React.CSSProperties;\n} {\n // This styling is enforced for correct positioning with children\n const containerStyle: React.CSSProperties = {\n position: 'absolute',\n zIndex: 0,\n left: 0,\n top: 0,\n width,\n height\n };\n\n // Fill the container\n const canvasStyle: React.CSSProperties = {\n left: 0,\n top: 0\n };\n\n if (style) {\n for (const key in style) {\n if (key in CANVAS_ONLY_STYLES) {\n // apply style to the canvas, but not deck's children, e.g. mix-blend-mode\n canvasStyle[key] = style[key];\n } else {\n // apply style to the container, e.g. position/flow settings\n containerStyle[key] = style[key];\n }\n }\n }\n\n return {containerStyle, canvasStyle};\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompassWidget as _CompassWidget} from '@deck.gl/widgets';\nimport type {CompassWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const CompassWidget = (props: CompassWidgetProps = {}) => {\n useWidget(_CompassWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {useContext, useMemo, useEffect} from 'react';\nimport {DeckGlContext} from './deckgl-context';\nimport {log, Widget, type WidgetProps, _deepEqual as deepEqual} from '@deck.gl/core';\n\nexport function useWidget<WidgetT extends Widget, WidgetPropsT extends WidgetProps>(\n WidgetClass: {new (props_: WidgetPropsT): WidgetT},\n props: WidgetPropsT\n): WidgetT {\n const context = useContext(DeckGlContext);\n const {widgets, deck} = context;\n useEffect(() => {\n // warn if the user supplied a pure-js widget, since it will be ignored\n // NOTE: This effect runs once per widget. Context widgets and deck widget props are synced after first effect runs.\n const internalWidgets = deck?.props.widgets;\n if (widgets?.length && internalWidgets?.length && !deepEqual(internalWidgets, widgets, 1)) {\n log.warn('\"widgets\" prop will be ignored because React widgets are in use.')();\n }\n\n return () => {\n // Remove widget from context when it is unmounted\n const index = widgets?.indexOf(widget);\n if (index && index !== -1) {\n widgets?.splice(index, 1);\n deck?.setProps({widgets});\n }\n };\n }, []);\n const widget = useMemo(() => new WidgetClass(props), [WidgetClass]);\n\n // Hook rebuilds widgets on every render: [] then [FirstWidget] then [FirstWidget, SecondWidget]\n widgets?.push(widget);\n widget.setProps(props);\n\n useEffect(() => {\n deck?.setProps({widgets});\n }, [widgets]);\n\n return widget;\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {FullscreenWidget as _FullscreenWidget} from '@deck.gl/widgets';\nimport type {FullscreenWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const FullscreenWidget = (props: FullscreenWidgetProps = {}) => {\n useWidget(_FullscreenWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ZoomWidget as _ZoomWidget} from '@deck.gl/widgets';\nimport type {ZoomWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\nexport const ZoomWidget = (props: ZoomWidgetProps = {}) => {\n useWidget(_ZoomWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_GeocoderWidget} from '@deck.gl/widgets';\nimport type {GeocoderWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the GeocoderWidget.\n */\nexport const GeocoderWidget = (props: GeocoderWidgetProps = {}) => {\n useWidget(_GeocoderWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_InfoWidget} from '@deck.gl/widgets';\nimport type {InfoWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the InfoWidget.\n */\nexport const InfoWidget = (props: InfoWidgetProps) => {\n useWidget(_InfoWidget, props);\n return null;\n};\n", "import {_ContextMenuWidget} from '@deck.gl/widgets';\nimport type {ContextMenuWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the ContextMenuWidget.\n */\nexport const ContextMenuWidget = (props: ContextMenuWidgetProps) => {\n useWidget(_ContextMenuWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_LoadingWidget} from '@deck.gl/widgets';\nimport type {LoadingWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the LoadingWidget.\n */\nexport const LoadingWidget = (props: LoadingWidgetProps = {}) => {\n useWidget(_LoadingWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ResetViewWidget as _ResetViewWidget} from '@deck.gl/widgets';\nimport type {ResetViewWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the ResetViewWidget.\n */\nexport const ResetViewWidget = (props: ResetViewWidgetProps = {}) => {\n useWidget(_ResetViewWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_ScaleWidget} from '@deck.gl/widgets';\nimport type {ScaleWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the ScaleWidget.\n */\nexport const ScaleWidget = (props: ScaleWidgetProps = {}) => {\n useWidget(_ScaleWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {ScreenshotWidget as _ScreenshotWidget} from '@deck.gl/widgets';\nimport type {ScreenshotWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the ScreenshotWidget.\n */\nexport const ScreenshotWidget = (props: ScreenshotWidgetProps = {}) => {\n useWidget(_ScreenshotWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_SplitterWidget} from '@deck.gl/widgets';\nimport type {SplitterWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the SplitterWidget.\n */\nexport const SplitterWidget = (props: SplitterWidgetProps) => {\n useWidget(_SplitterWidget, props);\n return null;\n};\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {_ThemeWidget} from '@deck.gl/widgets';\nimport type {ThemeWidgetProps} from '@deck.gl/widgets';\nimport {useWidget} from '../utils/use-widget';\n\n/**\n * React wrapper for the ThemeWidget.\n */\nexport const ThemeWidget = (props: ThemeWidgetProps = {}) => {\n useWidget(_ThemeWidget, props);\n return null;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;ACIA,IAAAA,SAAuB;AACvB,IAAAC,gBAAuF;AACvF,IAAAC,eAAmB;;;ACAnB,mBAAyC;AAEzC,IAAM,4BAA4B,OAAO,WAAW,cAAc,+BAAkB;AAEpF,IAAA,uCAAe;;;ACNf,YAAuB;AACvB,IAAAC,gBAA4B;;;ACAtB,SAAU,aAAgB,MAAW,YAAa;AACtD,SAAO,MAAM;AACX,QAAI,SAAS,YAAY;AACvB,aAAO;IACT;AACA,WAAO,OAAO,eAAe,IAAI;EACnC;AACA,SAAO;AACT;;;ADNA,kBAA0B;;;AEF1B,IAAAC,gBAA2B;AAE3B,IAAM,YAAY,EAAC,UAAU,YAAY,QAAQ,GAAE;AAErC,SAAP,iBACL,UACA,YAAe;AAEf,MAAI,OAAO,aAAa,YAAY;AAClC,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AO;AACT;;;ACVA,IAAAC,kBAAkD;AAO3C,IAAM,kBAAkB,CAAC,QAA8B,CAAA,MAAM;AAClE,YAAU,gBAAAC,iBAAkB,KAAK;AACjC,SAAO;AACT;;;ACVA,IAAAC,kBAA2B;AAOpB,IAAM,cAAc,CAAC,QAA0B,CAAA,MAAM;AAC1D,YAAU,8BAAc,KAAK;AAC7B,SAAO;AACT;;;ACVA,IAAAC,mBAAoD;AAO7C,IAAM,mBAAmB,CAAC,QAA+B,CAAA,MAAM;AACpE,YAAU,iBAAAC,kBAAmB,KAAK;AAClC,SAAO;AACT;;;ACVA,IAAAC,mBAA8B;AAOvB,IAAM,iBAAiB,CAAC,UAA8B;AAC3D,YAAU,kCAAiB,KAAK;AAChC,SAAO;AACT;;;ACVA,IAAAC,mBAA2B;AAOpB,IAAM,cAAc,CAAC,QAA0B,CAAA,MAAM;AAC1D,YAAU,+BAAc,KAAK;AAC7B,SAAO;AACT;",
6
+ "names": ["React", "import_react", "import_core", "import_react", "import_react", "import_react", "import_core", "import_react", "import_react", "import_core", "deepEqual", "_CompassWidget", "import_widgets", "_FullscreenWidget", "import_widgets", "_ZoomWidget", "import_widgets", "import_widgets", "import_widgets", "import_widgets", "import_widgets", "_ResetViewWidget", "import_widgets", "import_widgets", "_ScreenshotWidget", "import_widgets", "import_widgets"]
7
7
  }
package/dist/index.d.ts CHANGED
@@ -3,7 +3,17 @@ export { default } from "./deckgl.js";
3
3
  export { CompassWidget } from "./widgets/compass-widget.js";
4
4
  export { FullscreenWidget } from "./widgets/fullscreen-widget.js";
5
5
  export { ZoomWidget } from "./widgets/zoom-widget.js";
6
+ export { GeocoderWidget as _GeocoderWidget } from "./widgets/geocoder-widget.js";
7
+ export { InfoWidget as _InfoWidget } from "./widgets/info-widget.js";
8
+ export { ContextMenuWidget as _ContextMenuWidget } from "./widgets/context-menu-widget.js";
9
+ export { LoadingWidget as _LoadingWidget } from "./widgets/loading-widget.js";
10
+ export { ResetViewWidget as _ResetViewWidget } from "./widgets/reset-view-widget.js";
11
+ export { ScaleWidget as _ScaleWidget } from "./widgets/scale-widget.js";
12
+ export { ScreenshotWidget as _ScreenshotWidget } from "./widgets/screenshot-widget.js";
13
+ export { SplitterWidget as _SplitterWidget } from "./widgets/splitter-widget.js";
14
+ export { ThemeWidget as _ThemeWidget } from "./widgets/theme-widget.js";
6
15
  export { useWidget } from "./utils/use-widget.js";
16
+ export type { ContextMenuWidgetProps } from '@deck.gl/widgets';
7
17
  export type { DeckGLContextValue } from "./utils/deckgl-context.js";
8
18
  export type { DeckGLRef, DeckGLProps } from "./deckgl.js";
9
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,oBAAiB;AAC3C,OAAO,EAAC,OAAO,EAAC,oBAAiB;AAGjC,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,OAAO,EAAC,gBAAgB,EAAC,uCAAoC;AAC7D,OAAO,EAAC,UAAU,EAAC,iCAA8B;AACjD,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAG7C,YAAY,EAAC,kBAAkB,EAAC,kCAA+B;AAC/D,YAAY,EAAC,SAAS,EAAE,WAAW,EAAC,oBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,oBAAiB;AAC3C,OAAO,EAAC,OAAO,EAAC,oBAAiB;AAGjC,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,OAAO,EAAC,gBAAgB,EAAC,uCAAoC;AAC7D,OAAO,EAAC,UAAU,EAAC,iCAA8B;AACjD,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,qCAAkC;AAC5E,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,iCAA8B;AAChE,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,yCAAsC;AACtF,OAAO,EAAC,aAAa,IAAI,cAAc,EAAC,oCAAiC;AACzE,OAAO,EAAC,eAAe,IAAI,gBAAgB,EAAC,uCAAoC;AAChF,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,kCAA+B;AACnE,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,uCAAoC;AAClF,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,qCAAkC;AAC5E,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,kCAA+B;AACnE,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAC7C,YAAY,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAG7D,YAAY,EAAC,kBAAkB,EAAC,kCAA+B;AAC/D,YAAY,EAAC,SAAS,EAAE,WAAW,EAAC,oBAAiB"}
package/dist/index.js CHANGED
@@ -7,5 +7,14 @@ export { default } from "./deckgl.js";
7
7
  export { CompassWidget } from "./widgets/compass-widget.js";
8
8
  export { FullscreenWidget } from "./widgets/fullscreen-widget.js";
9
9
  export { ZoomWidget } from "./widgets/zoom-widget.js";
10
+ export { GeocoderWidget as _GeocoderWidget } from "./widgets/geocoder-widget.js";
11
+ export { InfoWidget as _InfoWidget } from "./widgets/info-widget.js";
12
+ export { ContextMenuWidget as _ContextMenuWidget } from "./widgets/context-menu-widget.js";
13
+ export { LoadingWidget as _LoadingWidget } from "./widgets/loading-widget.js";
14
+ export { ResetViewWidget as _ResetViewWidget } from "./widgets/reset-view-widget.js";
15
+ export { ScaleWidget as _ScaleWidget } from "./widgets/scale-widget.js";
16
+ export { ScreenshotWidget as _ScreenshotWidget } from "./widgets/screenshot-widget.js";
17
+ export { SplitterWidget as _SplitterWidget } from "./widgets/splitter-widget.js";
18
+ export { ThemeWidget as _ThemeWidget } from "./widgets/theme-widget.js";
10
19
  export { useWidget } from "./utils/use-widget.js";
11
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,oBAAiB;AAC3C,OAAO,EAAC,OAAO,EAAC,oBAAiB;AAEjC,UAAU;AACV,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,OAAO,EAAC,gBAAgB,EAAC,uCAAoC;AAC7D,OAAO,EAAC,UAAU,EAAC,iCAA8B;AACjD,OAAO,EAAC,SAAS,EAAC,8BAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,oBAAiB;AAC3C,OAAO,EAAC,OAAO,EAAC,oBAAiB;AAEjC,UAAU;AACV,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,OAAO,EAAC,gBAAgB,EAAC,uCAAoC;AAC7D,OAAO,EAAC,UAAU,EAAC,iCAA8B;AACjD,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,qCAAkC;AAC5E,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,iCAA8B;AAChE,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,yCAAsC;AACtF,OAAO,EAAC,aAAa,IAAI,cAAc,EAAC,oCAAiC;AACzE,OAAO,EAAC,eAAe,IAAI,gBAAgB,EAAC,uCAAoC;AAChF,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,kCAA+B;AACnE,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,uCAAoC;AAClF,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,qCAAkC;AAC5E,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,kCAA+B;AACnE,OAAO,EAAC,SAAS,EAAC,8BAA2B"}
@@ -1,5 +1,5 @@
1
- import { type Widget } from '@deck.gl/core';
2
- export declare function useWidget<T extends Widget<PropsT>, PropsT extends {}>(WidgetClass: {
3
- new (props_: PropsT): T;
4
- }, props: PropsT): T;
1
+ import { Widget, type WidgetProps } from '@deck.gl/core';
2
+ export declare function useWidget<WidgetT extends Widget, WidgetPropsT extends WidgetProps>(WidgetClass: {
3
+ new (props_: WidgetPropsT): WidgetT;
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,KAAK,MAAM,EAA0B,MAAM,eAAe,CAAC;AAExE,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,SAAS,EAAE,EACnE,WAAW,EAAE;IAAC,KAAK,MAAM,EAAE,MAAM,GAAG,CAAC,CAAA;CAAC,EACtC,KAAK,EAAE,MAAM,GACZ,CAAC,CA+BH"}
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,CAAC,OAAO,SAAS,MAAM,EAAE,YAAY,SAAS,WAAW,EAChF,WAAW,EAAE;IAAC,KAAK,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA;CAAC,EAClD,KAAK,EAAE,YAAY,GAClB,OAAO,CA+BT"}
@@ -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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AAO,CAAC,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"}
@@ -0,0 +1,6 @@
1
+ import type { ContextMenuWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the ContextMenuWidget.
4
+ */
5
+ export declare const ContextMenuWidget: (props: ContextMenuWidgetProps) => null;
6
+ //# sourceMappingURL=context-menu-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/context-menu-widget.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AAG7D;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,SAG9D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { _ContextMenuWidget } from '@deck.gl/widgets';
2
+ import { useWidget } from "../utils/use-widget.js";
3
+ /**
4
+ * React wrapper for the ContextMenuWidget.
5
+ */
6
+ export const ContextMenuWidget = (props) => {
7
+ useWidget(_ContextMenuWidget, props);
8
+ return null;
9
+ };
10
+ //# sourceMappingURL=context-menu-widget.js.map
@@ -0,0 +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;AAEpD,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,6 @@
1
+ import type { GeocoderWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the GeocoderWidget.
4
+ */
5
+ export declare const GeocoderWidget: (props?: GeocoderWidgetProps) => null;
6
+ //# sourceMappingURL=geocoder-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geocoder-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/geocoder-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAG1D;;GAEG;AACH,eAAO,MAAM,cAAc,WAAW,mBAAmB,SAGxD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _GeocoderWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the GeocoderWidget.
8
+ */
9
+ export const GeocoderWidget = (props = {}) => {
10
+ useWidget(_GeocoderWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=geocoder-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geocoder-widget.js","sourceRoot":"","sources":["../../src/widgets/geocoder-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;;GAEG;AACH,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,6 @@
1
+ import type { InfoWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the InfoWidget.
4
+ */
5
+ export declare const InfoWidget: (props: InfoWidgetProps) => null;
6
+ //# sourceMappingURL=info-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/info-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAGtD;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW,eAAe,SAGhD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _InfoWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the InfoWidget.
8
+ */
9
+ export const InfoWidget = (props) => {
10
+ useWidget(_InfoWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=info-widget.js.map
@@ -0,0 +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;AAE7C,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"}
@@ -0,0 +1,6 @@
1
+ import type { LoadingWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the LoadingWidget.
4
+ */
5
+ export declare const LoadingWidget: (props?: LoadingWidgetProps) => null;
6
+ //# sourceMappingURL=loading-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/loading-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAGzD;;GAEG;AACH,eAAO,MAAM,aAAa,WAAW,kBAAkB,SAGtD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _LoadingWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the LoadingWidget.
8
+ */
9
+ export const LoadingWidget = (props = {}) => {
10
+ useWidget(_LoadingWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=loading-widget.js.map
@@ -0,0 +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;AAEhD,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,6 @@
1
+ import type { ResetViewWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the ResetViewWidget.
4
+ */
5
+ export declare const ResetViewWidget: (props?: ResetViewWidgetProps) => null;
6
+ //# sourceMappingURL=reset-view-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-view-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/reset-view-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAG3D;;GAEG;AACH,eAAO,MAAM,eAAe,WAAW,oBAAoB,SAG1D,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ResetViewWidget as _ResetViewWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the ResetViewWidget.
8
+ */
9
+ export const ResetViewWidget = (props = {}) => {
10
+ useWidget(_ResetViewWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=reset-view-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-view-widget.js","sourceRoot":"","sources":["../../src/widgets/reset-view-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;;GAEG;AACH,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,6 @@
1
+ import type { ScaleWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the ScaleWidget.
4
+ */
5
+ export declare const ScaleWidget: (props?: ScaleWidgetProps) => null;
6
+ //# sourceMappingURL=scale-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/scale-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD;;GAEG;AACH,eAAO,MAAM,WAAW,WAAW,gBAAgB,SAGlD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _ScaleWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the ScaleWidget.
8
+ */
9
+ export const ScaleWidget = (props = {}) => {
10
+ useWidget(_ScaleWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=scale-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-widget.js","sourceRoot":"","sources":["../../src/widgets/scale-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;;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,6 @@
1
+ import type { ScreenshotWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the ScreenshotWidget.
4
+ */
5
+ export declare const ScreenshotWidget: (props?: ScreenshotWidgetProps) => null;
6
+ //# sourceMappingURL=screenshot-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/screenshot-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAG5D;;GAEG;AACH,eAAO,MAAM,gBAAgB,WAAW,qBAAqB,SAG5D,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ScreenshotWidget as _ScreenshotWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the ScreenshotWidget.
8
+ */
9
+ export const ScreenshotWidget = (props = {}) => {
10
+ useWidget(_ScreenshotWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=screenshot-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot-widget.js","sourceRoot":"","sources":["../../src/widgets/screenshot-widget.tsx"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA+B,EAAE,EAAE,EAAE;IACpE,SAAS,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { SplitterWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the SplitterWidget.
4
+ */
5
+ export declare const SplitterWidget: (props: SplitterWidgetProps) => null;
6
+ //# sourceMappingURL=splitter-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitter-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/splitter-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAG1D;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,mBAAmB,SAGxD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _SplitterWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the SplitterWidget.
8
+ */
9
+ export const SplitterWidget = (props) => {
10
+ useWidget(_SplitterWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=splitter-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitter-widget.js","sourceRoot":"","sources":["../../src/widgets/splitter-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;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAC3D,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ThemeWidgetProps } from '@deck.gl/widgets';
2
+ /**
3
+ * React wrapper for the ThemeWidget.
4
+ */
5
+ export declare const ThemeWidget: (props?: ThemeWidgetProps) => null;
6
+ //# sourceMappingURL=theme-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-widget.d.ts","sourceRoot":"","sources":["../../src/widgets/theme-widget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAGvD;;GAEG;AACH,eAAO,MAAM,WAAW,WAAW,gBAAgB,SAGlD,CAAC"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _ThemeWidget } from '@deck.gl/widgets';
5
+ import { useWidget } from "../utils/use-widget.js";
6
+ /**
7
+ * React wrapper for the ThemeWidget.
8
+ */
9
+ export const ThemeWidget = (props = {}) => {
10
+ useWidget(_ThemeWidget, props);
11
+ return null;
12
+ };
13
+ //# sourceMappingURL=theme-widget.js.map
@@ -0,0 +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;AAE9C,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"}
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.1.12",
6
+ "version": "9.2.0-alpha.1",
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": "ed876a5eee0f612cd876244b0b2835ab871733ac"
47
+ "gitHead": "630b2d2cb555c01bd73f258442755794aa5e5acc"
48
48
  }
package/src/index.ts CHANGED
@@ -9,7 +9,17 @@ 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 {GeocoderWidget as _GeocoderWidget} from './widgets/geocoder-widget';
13
+ export {InfoWidget as _InfoWidget} from './widgets/info-widget';
14
+ export {ContextMenuWidget as _ContextMenuWidget} from './widgets/context-menu-widget';
15
+ export {LoadingWidget as _LoadingWidget} from './widgets/loading-widget';
16
+ export {ResetViewWidget as _ResetViewWidget} from './widgets/reset-view-widget';
17
+ export {ScaleWidget as _ScaleWidget} from './widgets/scale-widget';
18
+ export {ScreenshotWidget as _ScreenshotWidget} from './widgets/screenshot-widget';
19
+ export {SplitterWidget as _SplitterWidget} from './widgets/splitter-widget';
20
+ export {ThemeWidget as _ThemeWidget} from './widgets/theme-widget';
12
21
  export {useWidget} from './utils/use-widget';
22
+ export type {ContextMenuWidgetProps} from '@deck.gl/widgets';
13
23
 
14
24
  // Types
15
25
  export type {DeckGLContextValue} from './utils/deckgl-context';
@@ -4,12 +4,12 @@
4
4
 
5
5
  import {useContext, useMemo, useEffect} from 'react';
6
6
  import {DeckGlContext} from './deckgl-context';
7
- import {log, type Widget, _deepEqual as deepEqual} from '@deck.gl/core';
7
+ import {log, Widget, type WidgetProps, _deepEqual as deepEqual} from '@deck.gl/core';
8
8
 
9
- export function useWidget<T extends Widget<PropsT>, PropsT extends {}>(
10
- WidgetClass: {new (props_: PropsT): T},
11
- props: PropsT
12
- ): T {
9
+ export function useWidget<WidgetT extends Widget, WidgetPropsT extends WidgetProps>(
10
+ WidgetClass: {new (props_: WidgetPropsT): WidgetT},
11
+ props: WidgetPropsT
12
+ ): WidgetT {
13
13
  const context = useContext(DeckGlContext);
14
14
  const {widgets, deck} = context;
15
15
  useEffect(() => {
@@ -0,0 +1,11 @@
1
+ import {_ContextMenuWidget} from '@deck.gl/widgets';
2
+ import type {ContextMenuWidgetProps} from '@deck.gl/widgets';
3
+ import {useWidget} from '../utils/use-widget';
4
+
5
+ /**
6
+ * React wrapper for the ContextMenuWidget.
7
+ */
8
+ export const ContextMenuWidget = (props: ContextMenuWidgetProps) => {
9
+ useWidget(_ContextMenuWidget, props);
10
+ return null;
11
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_GeocoderWidget} from '@deck.gl/widgets';
6
+ import type {GeocoderWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the GeocoderWidget.
11
+ */
12
+ export const GeocoderWidget = (props: GeocoderWidgetProps = {}) => {
13
+ useWidget(_GeocoderWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_InfoWidget} from '@deck.gl/widgets';
6
+ import type {InfoWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the InfoWidget.
11
+ */
12
+ export const InfoWidget = (props: InfoWidgetProps) => {
13
+ useWidget(_InfoWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_LoadingWidget} from '@deck.gl/widgets';
6
+ import type {LoadingWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the LoadingWidget.
11
+ */
12
+ export const LoadingWidget = (props: LoadingWidgetProps = {}) => {
13
+ useWidget(_LoadingWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {ResetViewWidget as _ResetViewWidget} from '@deck.gl/widgets';
6
+ import type {ResetViewWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the ResetViewWidget.
11
+ */
12
+ export const ResetViewWidget = (props: ResetViewWidgetProps = {}) => {
13
+ useWidget(_ResetViewWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_ScaleWidget} from '@deck.gl/widgets';
6
+ import type {ScaleWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the ScaleWidget.
11
+ */
12
+ export const ScaleWidget = (props: ScaleWidgetProps = {}) => {
13
+ useWidget(_ScaleWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {ScreenshotWidget as _ScreenshotWidget} from '@deck.gl/widgets';
6
+ import type {ScreenshotWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the ScreenshotWidget.
11
+ */
12
+ export const ScreenshotWidget = (props: ScreenshotWidgetProps = {}) => {
13
+ useWidget(_ScreenshotWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_SplitterWidget} from '@deck.gl/widgets';
6
+ import type {SplitterWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the SplitterWidget.
11
+ */
12
+ export const SplitterWidget = (props: SplitterWidgetProps) => {
13
+ useWidget(_SplitterWidget, props);
14
+ return null;
15
+ };
@@ -0,0 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {_ThemeWidget} from '@deck.gl/widgets';
6
+ import type {ThemeWidgetProps} from '@deck.gl/widgets';
7
+ import {useWidget} from '../utils/use-widget';
8
+
9
+ /**
10
+ * React wrapper for the ThemeWidget.
11
+ */
12
+ export const ThemeWidget = (props: ThemeWidgetProps = {}) => {
13
+ useWidget(_ThemeWidget, props);
14
+ return null;
15
+ };