@mappedin/react-sdk 6.1.1 → 6.1.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/lib/esm/index.js CHANGED
@@ -32,7 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  var define_process_default;
33
33
  var init_define_process = __esm({
34
34
  "<define:process>"() {
35
- define_process_default = { env: { npm_package_version: "6.1.1" } };
35
+ define_process_default = { env: { npm_package_version: "6.1.2" } };
36
36
  }
37
37
  });
38
38
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["<define:process>", "../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js", "../../src/index.tsx", "../../src/MapDataProvider.tsx", "../../src/hooks/useMapData.tsx", "../../../packages/common/Mappedin.Logger.ts", "../../src/hooks/useMemoDeep.tsx", "../../src/hooks/useMapDataEvent.tsx", "../../src/MapView.tsx", "../../src/hooks/useMapViewEvent.tsx", "../../src/errors.ts", "../../src/hooks/useMapViewExtension.tsx", "../../src/Path.tsx", "../../src/hooks/useUpdateEffect.ts", "../../src/Navigation.tsx", "../../src/Shape.tsx", "../../src/Model.tsx", "../../src/hooks/useMap.tsx", "../../src/Marker.tsx", "../../../packages/common/random-id.ts", "../../src/Label.tsx"],
4
- "sourcesContent": ["{\"env\":{\"npm_package_version\":\"6.1.1\"}}", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "/**\n * @module @mappedin/react-sdk\n */\n// MapData\nexport { MapDataProvider } from './MapDataProvider';\nexport type { MapDataProviderProps } from './MapDataProvider';\nexport { useMapData } from './hooks/useMapData';\nexport { useMapDataEvent } from './hooks/useMapDataEvent';\n\n// MapView\nexport { MapView } from './MapView';\nexport type { MapViewProps } from './MapView';\nexport { useMapViewEvent } from './hooks/useMapViewEvent';\nexport { useMapViewExtension } from './hooks/useMapViewExtension';\nexport { Path } from './Path';\nexport type { PathProps } from './Path';\nexport { Navigation } from './Navigation';\nexport type { NavigationProps } from './Navigation';\nexport { Shape } from './Shape';\nexport type { ShapeProps } from './Shape';\nexport { Model } from './Model';\nexport type { ModelProps } from './Model';\nexport { useMap } from './hooks/useMap';\nexport { Marker, AnimatedMarker } from './Marker';\nexport type { MarkerProps } from './Marker';\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\n// Re-export React types for docs\nimport type * as React from 'react';\nexport type { React };\n", "import type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport type { PropsWithChildren } from 'react';\nimport React, { createContext, useCallback, useMemo, useRef } from 'react';\n\nexport type CachedMapDataEntry = {\n\tmapData: MapData;\n\toptions: TGetMapDataOptions;\n};\n\nexport type MapDataContextType = {\n\tgetCache: () => CachedMapDataEntry | undefined;\n\tsetCache: (entry: CachedMapDataEntry) => void;\n};\n\nexport const MapDataContext = createContext<MapDataContextType>({\n\tgetCache: () => undefined,\n\tsetCache: () => {},\n});\n\nexport type MapDataProviderProps = {\n\tmapData: MapData;\n};\n\nexport function MapDataProvider({ mapData, children }: PropsWithChildren<MapDataProviderProps>) {\n\tconst cachedEntryRef = useRef<CachedMapDataEntry | undefined>(\n\t\tmapData ? { mapData, options: {} as TGetMapDataOptions } : undefined,\n\t);\n\n\tconst getCache = useCallback(() => cachedEntryRef.current, []);\n\tconst setCache = useCallback((entry: CachedMapDataEntry) => {\n\t\tcachedEntryRef.current = entry;\n\t}, []);\n\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tgetCache,\n\t\t\tsetCache,\n\t\t}),\n\t\t[getCache, setCache],\n\t);\n\n\treturn <MapDataContext.Provider value={contextValue}>{children}</MapDataContext.Provider>;\n}\n", "import { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport { getMapData } from '@mappedin/mappedin-js';\nimport equal from 'fast-deep-equal';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataContext } from '../MapDataProvider';\nimport { useMemoDeep } from './useMemoDeep';\n\n/**\n * Hook to get the MapData and handle loading and error states.\n *\n * If used outside of a {@link MapDataProvider} or {@link MapView} component, options are required to fetch the MapData.\n * If used within a {@link MapDataProvider} or {@link MapView} component, options are optional and will use the MapData from the context if available.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, isLoading, error } = useMapData(options);\n * ```\n */\nexport function useMapData(options?: TGetMapDataOptions): {\n\tmapData?: MapData;\n\tisLoading: boolean;\n\terror?: Error;\n} {\n\tconst { getCache, setCache } = useContext(MapDataContext);\n\tconst [mapData, setMapData] = useState<MapData | undefined>(undefined);\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [error, setError] = useState<Error | undefined>(undefined);\n\tconst fetchIdRef = useRef(0);\n\n\tconst memoizedOptions: TGetMapDataOptions | undefined = useMemoDeep(\n\t\t() => options && { ...options, analytics: { context: 'reactsdk', ...options?.analytics } },\n\t\t[options],\n\t);\n\n\tconst fetchMapData = useCallback((options: TGetMapDataOptions) => {\n\t\tconst fetchId = ++fetchIdRef.current;\n\t\tsetIsLoading(true);\n\t\tsetError(undefined);\n\n\t\t// TODO: use abortcontroller signal to cancel the fetch outright\n\t\tgetMapData(options)\n\t\t\t.then(fetchedMapData => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tsetMapData(fetchedMapData);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tLogger.error('Failed to fetch MapData', err);\n\t\t\t\t\tsetError(err);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (fetchIdRef.current === fetchId) setIsLoading(false);\n\t\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\t// If this is used within a context, we can try to get the mapData from context first\n\t\tconst cachedEntry = getCache?.();\n\t\tif (cachedEntry != null) {\n\t\t\tif (\n\t\t\t\t// No options provided, use cached data\n\t\t\t\tmemoizedOptions == null ||\n\t\t\t\t// Options provided and matches cached data\n\t\t\t\t(cachedEntry.mapData.mapId === memoizedOptions.mapId && equal(cachedEntry.options, memoizedOptions))\n\t\t\t) {\n\t\t\t\tsetMapData(cachedEntry.mapData);\n\t\t\t\tsetIsLoading(false);\n\t\t\t\tsetError(undefined);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!memoizedOptions) {\n\t\t\tsetError(new Error('useMapData requires options if not use within a MapDataProvider or MapView component.'));\n\t\t\treturn;\n\t\t}\n\t\t// If all else fails, fetch new data\n\t\tfetchMapData(memoizedOptions);\n\t}, [fetchMapData, getCache, memoizedOptions]);\n\n\tuseEffect(() => {\n\t\tconst cachedEntry = getCache?.();\n\t\tif (mapData != null && (cachedEntry == null || cachedEntry.mapData.mapId === mapData.mapId)) {\n\t\t\t// Only overwrite the context cache with new data if the mapData has the same mapId\n\t\t\t// In this case, we likely refetched due to an option change\n\t\t\tsetCache?.({ mapData, options: memoizedOptions || ({} as TGetMapDataOptions) });\n\t\t}\n\t}, [mapData, memoizedOptions, getCache, setCache]);\n\n\treturn { mapData, isLoading, error };\n}\n", "/* eslint-disable no-console*/\nexport const MI_DEBUG_KEY = 'mi-debug';\nexport const MI_ERROR_LABEL = '[MappedinJS]';\n\nexport enum E_SDK_LOG_LEVEL {\n\tLOG,\n\tWARN,\n\tERROR,\n\tSILENT,\n}\n\nexport function createLogger(name = '', { prefix = MI_ERROR_LABEL } = {}) {\n\tconst label = `${prefix}${name ? `-${name}` : ''}`;\n\n\tconst rnDebug = (type: 'log' | 'warn' | 'error', args: any[]) => {\n\t\tif (typeof window !== 'undefined' && (window as any).rnDebug) {\n\t\t\tconst processed = args.map(arg => {\n\t\t\t\tif (arg instanceof Error && arg.stack) {\n\t\t\t\t\treturn `${arg.message}\\n${arg.stack}`;\n\t\t\t\t}\n\n\t\t\t\treturn arg;\n\t\t\t});\n\t\t\t(window as any).rnDebug(`${name} ${type}: ${processed.join(' ')}`);\n\t\t}\n\t};\n\n\treturn {\n\t\tlogState: process.env.NODE_ENV === 'test' ? E_SDK_LOG_LEVEL.SILENT : E_SDK_LOG_LEVEL.LOG,\n\n\t\tlog(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.LOG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t\trnDebug('log', args);\n\t\t\t}\n\t\t},\n\n\t\twarn(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.WARN) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t\trnDebug('warn', args);\n\t\t\t}\n\t\t},\n\n\t\terror(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.ERROR) {\n\t\t\t\tconsole.error(label, ...args);\n\n\t\t\t\trnDebug('error', args);\n\t\t\t}\n\t\t},\n\n\t\t// It's a bit tricky to prepend [MappedinJs] to assert and time because of how the output is structured in the console, so it is left out for simplicity\n\t\tassert(...args: any[]) {\n\t\t\tconsole.assert(...args);\n\t\t},\n\n\t\ttime(label: string) {\n\t\t\tconsole.time(label);\n\t\t},\n\n\t\ttimeEnd(label: string) {\n\t\t\tconsole.timeEnd(label);\n\t\t},\n\t\tsetLevel(level: E_SDK_LOG_LEVEL) {\n\t\t\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\t\t\tthis.logState = level;\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst Logger = createLogger();\nexport function setLoggerLevel(level: E_SDK_LOG_LEVEL) {\n\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\tLogger.logState = level;\n\t}\n}\n\nexport default Logger;\n", "import { useRef, type DependencyList } from 'react';\nimport equal from 'fast-deep-equal';\n\n/**\n * Deep comparison memoization hook similar to useMemo but with deep equality check\n * @param factory Function that returns the value to memoize\n * @param deps Dependency list to deeply compare for changes\n * @returns Memoized value that only changes when dependencies deeply change\n * @internal\n */\nexport function useMemoDeep<T>(factory: () => T, deps: DependencyList): T {\n\tconst valueRef = useRef<T>();\n\tconst depsRef = useRef<DependencyList>();\n\n\tif (!equal(deps, depsRef.current)) {\n\t\tvalueRef.current = factory();\n\t\tdepsRef.current = deps;\n\t}\n\n\treturn valueRef.current!;\n}\n", "import { useCallback, useContext, useEffect } from 'react';\nimport type { TMapDataEvents } from '@mappedin/mappedin-js';\nimport { MapDataContext } from '../MapDataProvider';\n\n/**\n * Hook to subscribe to an event on the MapData.\n *\n * Must be used within a {@link MapDataProvider} or {@link MapView} component.\n * @throws If used outside of a {@link MapDataProvider} or {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapDataEvent('language-change', event => {\n * console.log(`Map language changed to ${event.name} (${event.code})`);\n * });\n * ```\n */\nexport function useMapDataEvent<T extends keyof TMapDataEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TMapDataEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TMapDataEvents[T]['data']\n\t\t\t: TMapDataEvents[T],\n\t) => void,\n) {\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tconst mapData = getCachedMapData?.()?.mapData;\n\t\tif (mapData == null) {\n\t\t\tthrow new Error('useMapDataEvent must be used within a MapDataProvider or MapView component.');\n\t\t}\n\n\t\tmapData.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapData == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapData.off(event, handleCallback);\n\t\t};\n\t}, [getCachedMapData, event, handleCallback]);\n}\n", "import type { ReactNode } from 'react';\nimport React, {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseImperativeHandle,\n\tcreateContext,\n} from 'react';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { show3dMap } from '@mappedin/mappedin-js';\nimport type { MapView as MapViewJS, MapData, TShow3DMapOptions } from '@mappedin/mappedin-js';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataProvider } from './MapDataProvider';\nimport type { ExtensionRegistry, MapViewExtensionName } from '@packages/internal/common/extensions';\n\ntype MapViewContextType = {\n\tmapView?: MapViewJS;\n\textensions: ExtensionRegistry;\n};\n\nexport const MapViewContext = createContext<MapViewContextType>({\n\tmapView: undefined,\n\textensions: {},\n});\n\nconst DEFAULT_STYLE: React.CSSProperties = {\n\twidth: '100%',\n\theight: '100%',\n\tposition: 'relative',\n};\n\n/**\n * TypeScript can't seem to handle these parameters when wrapped in forwardRef, but it's unlikely\n * that we'll ever add more parameters to show3dMap.\n */\n// type ParamsArray = Parameters<typeof show3dMap>;\n// type StreamAgentParameterNames = ['el', 'mapData', 'options'];\n\n/**\n * @interface\n */\nexport type MapViewProps = {\n\tmapData: MapData;\n\toptions?: TShow3DMapOptions;\n\t/**\n\t * The fallback content to render while the map is loading.\n\t */\n\tfallback?: ReactNode;\n};\n/**\n * MapView component.\n *\n * The root component which renders the map and provides context to the hooks and child components.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const { mapData } = useMapData({ key: '...', secret: '...', mapId: '...' });\n * return (\n * <MapView mapData={mapData}>\n * <Marker target={...} />\n * </MapView>\n * )\n * ```\n */\nexport const MapView = forwardRef<\n\tMapViewJS | undefined,\n\tMapViewProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof MapViewProps>\n>((props, ref) => {\n\tconst { mapData, options, style, fallback, children, ...rest } = props;\n\n\t// Persistent reference across renders\n\tconst thisRef = useRef<{\n\t\tmapView?: MapViewJS;\n\t\textensions: ExtensionRegistry;\n\t}>({\n\t\textensions: {}, // store the extensions in the ref so we don't re-render children when they change\n\t}).current;\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [isMounted, setIsMounted] = useState(false);\n\tconst mapEl = useRef<HTMLDivElement>(null);\n\n\tconst memoizedMapData = useMemo(() => mapData, [mapData]);\n\tconst memoizedOptions = useMemoDeep(() => options, [options]);\n\n\t// Expose the mapView instance via ref\n\tuseImperativeHandle(ref, () => thisRef.mapView);\n\n\tconst contextValue: MapViewContextType = useMemo(() => {\n\t\treturn {\n\t\t\tmapView: thisRef.mapView,\n\t\t\textensions: thisRef.extensions,\n\t\t} satisfies MapViewContextType;\n\t}, [memoizedMapData, thisRef.mapView, thisRef.extensions]);\n\n\tconst cleanUpExtensions = useCallback((extensions: ExtensionRegistry) => {\n\t\ttry {\n\t\t\tconst extensionNames = Object.keys(extensions) as MapViewExtensionName[];\n\t\t\tfor (const extensionName of extensionNames) {\n\t\t\t\tconst extensionEntry = extensions[extensionName];\n\t\t\t\tif (extensionEntry) {\n\t\t\t\t\textensionEntry.onDeregister(extensionEntry.instance);\n\n\t\t\t\t\tdelete extensions[extensionName];\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to clean up extensions', error);\n\t\t}\n\n\t\treturn {};\n\t}, []);\n\n\tconst destroyMapView = useCallback((mapView?: MapViewJS) => {\n\t\tconst mapViewToDestroy = mapView || thisRef.mapView;\n\n\t\ttry {\n\t\t\tmapViewToDestroy?.destroy?.();\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to destroy MapView', error);\n\t\t}\n\n\t\t// Only clear ref and state if destroying the current instance\n\t\tif (!mapView) {\n\t\t\tthisRef.extensions = cleanUpExtensions(thisRef.extensions);\n\t\t\tthisRef.mapView = undefined;\n\t\t\tsetIsMounted(false);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!memoizedMapData || !mapEl.current) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clean up any existing MapView first\n\t\tdestroyMapView();\n\n\t\tlet cancelled = false;\n\t\tsetIsLoading(true);\n\t\tshow3dMap(mapEl.current, memoizedMapData, memoizedOptions)\n\t\t\t.then(mapView => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\t// Just in case extensions were left over from a previous render\n\t\t\t\t\tthisRef.mapView = mapView;\n\t\t\t\t\tsetIsMounted(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Component was unmounted during creation, destroy immediately\n\t\t\t\t\tdestroyMapView(mapView);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tLogger.error('Failed to render MapView', err);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t\t// Destroy the mapView if has already been mounted\n\t\t\tif (thisRef.mapView) {\n\t\t\t\tdestroyMapView();\n\t\t\t}\n\t\t};\n\t}, [memoizedMapData, memoizedOptions, destroyMapView]);\n\n\treturn (\n\t\t<MapDataProvider mapData={memoizedMapData}>\n\t\t\t<MapViewContext.Provider value={contextValue}>\n\t\t\t\t<div data-testid=\"mappedin-map\" ref={mapEl} style={{ ...DEFAULT_STYLE, ...style }} {...rest} />\n\t\t\t\t{isLoading ? <>{fallback}</> : isMounted ? children : null}\n\t\t\t</MapViewContext.Provider>\n\t\t</MapDataProvider>\n\t);\n});\n", "import { useCallback, useContext, useEffect } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { TEvents } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\n\n/**\n * Hook to subscribe to an event on the {@link MapView}.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapViewEvent('click', event => {\n * const { coordinate } = event;\n * const { latitude, longitude } = coordinate;\n * console.log(`Map was clicked at ${latitude}, ${longitude}`);\n * });\n * ```\n */\nexport function useMapViewEvent<T extends keyof TEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TEvents[T]['data']\n\t\t\t: TEvents[T],\n\t) => void,\n) {\n\tconst { mapView } = useContext(MapViewContext);\n\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('useMapViewEvent');\n\t\t}\n\n\t\tmapView.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapView == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.off(event, handleCallback);\n\t\t};\n\t}, [mapView, event, callback]);\n}\n", "export class MapViewNullError extends Error {\n\tconstructor(name: string) {\n\t\tsuper(`${name} must be used within a MapView component.`);\n\t}\n}\n", "import type { MapViewExtension, MapViewExtensionName } from '@packages/internal/common/extensions';\nimport { MapViewContext } from '../MapView';\nimport { useCallback, useContext } from 'react';\n\ntype MapViewExtensionOptions<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Callback to be fired when the extension is registered.\n\t * This will not be called on subsequent calls to register until the extension is deregistered again.\n\t **/\n\tonRegister: () => T;\n\t/**\n\t * Callback to be fired when the extension is deregistered.\n\t * This will not be called if the extension is not registered.\n\t **/\n\tonDeregister: (extension: T) => void;\n};\n\ntype MapViewExtensionResult<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Register the extension or return the existing instance if it is already registered.\n\t */\n\tregister: () => T;\n\t/**\n\t * Deregister the extension.\n\t */\n\tderegister: () => void;\n};\n\n/**\n * @internal\n * Register an extension to the mapView context.\n * @param name - The name of the extension.\n * @returns An object with a register and deregister function.\n */\nexport function useMapViewExtension<T extends MapViewExtension<unknown> = MapViewExtension<unknown>>(\n\tname: MapViewExtensionName,\n\toptions: MapViewExtensionOptions<T>,\n): MapViewExtensionResult<T> {\n\tconst { extensions } = useContext(MapViewContext);\n\n\tif (!options?.onRegister || !options?.onDeregister) {\n\t\tthrow new Error('onRegister and onDeregister are required');\n\t}\n\n\tconst register = useCallback((): T => {\n\t\tconst existingEntry = extensions[name];\n\t\tlet instance = existingEntry?.instance;\n\n\t\tif (!instance) {\n\t\t\tinstance = options.onRegister();\n\t\t\textensions[name] = {\n\t\t\t\tinstance,\n\t\t\t\tonDeregister: options.onDeregister as (extension: MapViewExtension<unknown>) => void,\n\t\t\t};\n\t\t}\n\n\t\treturn instance as T;\n\t}, [extensions, name, options.onRegister]);\n\n\tconst deregister = useCallback(() => {\n\t\tconst extensionEntry = extensions[name];\n\t\tif (extensionEntry) {\n\t\t\textensionEntry.onDeregister(extensionEntry.instance as T);\n\t\t\tdelete extensions[name];\n\t\t}\n\t}, [extensions, name, options.onDeregister]);\n\n\treturn {\n\t\tregister,\n\t\tderegister,\n\t};\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Path as PathJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Paths']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'options'];\n\n/**\n * @interface\n */\nexport type PathProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Path component.\n *\n * A Path indicates a route on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Path coordinate={directions.coordinates} options={{ color: 'blue' }} /> : null;\n * ```\n */\nexport const Path = forwardRef<PathJS | undefined, PathProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst pathRef = useRef<PathJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [pathReady, setPathReady] = useState(false);\n\n\t// Expose the path instance via ref\n\tuseImperativeHandle(ref, () => pathRef.current, [pathReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Path');\n\t\t}\n\n\t\tconst path = mapView.Paths.add(props.coordinate, memoizedOptions);\n\t\tpath.animation.then(() => {\n\t\t\t// TODO: this fires when the path is destroyed before the animation is complete\n\t\t\t// our animation should have a reject/resolve to handle this, or implement the CancelablePromise from animateState\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\tpathRef.current = path;\n\t\tsetPathReady(true);\n\t\treturn () => {\n\t\t\tif (pathRef.current) {\n\t\t\t\tmapView.Paths.remove(pathRef.current);\n\t\t\t}\n\t\t\tsetPathReady(false);\n\t\t};\n\t}, [mapView, props.coordinate]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (pathRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(pathRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\treturn null;\n});\n", "import { useEffect, useRef } from 'react';\n\n/**\n * A custom hook that behaves like useEffect but skips the initial render.\n * This is useful for update effects that should only run when dependencies change,\n * not on the initial mount.\n *\n * @param effect - The effect function to run\n * @param deps - The dependency array\n * @internal\n */\nexport function useUpdateEffect(effect: React.EffectCallback, deps: React.DependencyList): void {\n\tconst isInitialRender = useRef(true);\n\n\tuseEffect(() => {\n\t\tif (isInitialRender.current) {\n\t\t\tisInitialRender.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\treturn effect();\n\t}, deps);\n}\n", "import { useContext, useEffect } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport type { MapView } from '@mappedin/mappedin-js';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Navigation']['draw']>;\n\ntype StreamAgentParameterNames = ['directions', 'options'];\n\n/**\n * @interface\n */\nexport type NavigationProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Navigation component.\n *\n * Navigation draws a route on the map with pre-defined Markers for connections and the start and end points.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Navigation directions={directions} /> : null;\n * ```\n */\nexport function Navigation(props: NavigationProps) {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Navigation');\n\t\t}\n\n\t\tmapView.Navigation.draw(props.directions, memoizedOptions).then(() => {\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\treturn () => {\n\t\t\tmapView.Navigation.clear();\n\t\t};\n\t}, [mapView, props.directions, memoizedOptions]);\n\n\treturn null;\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Shape as ShapeJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Shapes']['add']>;\n\ntype StreamAgentParameterNames = ['geometry', 'style', 'floor'];\n\n/**\n * @interface\n */\nexport type ShapeProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Shape component.\n *\n * A Shape is a custom geometry on the map created from a GeoJSON feature collection.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Shape geometry={geojson} style={{ color: 'blue', height: 2 }} />\n * ```\n */\nexport const Shape = forwardRef<ShapeJS | undefined, ShapeProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst shapeRef = useRef<ShapeJS>();\n\tconst memoizedStyle = useMemoDeep(() => props.style, [props.style]);\n\tconst [shapeReady, setShapeReady] = useState(false);\n\n\t// Expose the shape instance via ref\n\tuseImperativeHandle(ref, () => shapeRef.current, [shapeReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new Error('MapView not initialized');\n\t\t}\n\t\tshapeRef.current = mapView.Shapes.add(props.geometry, props.style, props.floor);\n\t\tsetShapeReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || shapeRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Shapes.remove(shapeRef.current);\n\t\t\tsetShapeReady(false);\n\t\t};\n\t}, [mapView, props.geometry, props.style, props.floor]);\n\n\t// Update style when it changes (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (shapeRef.current && memoizedStyle) {\n\t\t\tmapView?.updateState(shapeRef.current, memoizedStyle);\n\t\t}\n\t}, [memoizedStyle]);\n\n\treturn null;\n});\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Model as ModelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Models']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'url', 'options'];\n\n/**\n * @interface\n */\nexport type ModelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Model component.\n *\n * A Model is a 3D model in GLTF or GLB format anchored to a Coordinate on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Model\n * coordinate={coordinate}\n * url={'/path/to/model.glb'}\n * options={{\n * scale: [0.01, 0.01, 0.01],\n * rotation: [90, 0, 0],\n * opacity: 0.5,\n * }}\n * />\n * ```\n */\nexport const Model = forwardRef<ModelJS | undefined, ModelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst modelRef = useRef<ModelJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [modelReady, setModelReady] = useState(false);\n\n\t// Expose the model instance via ref\n\tuseImperativeHandle(ref, () => modelRef.current, [modelReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Model');\n\t\t}\n\t\tmodelRef.current = mapView.Models.add(props.coordinate, props.url, memoizedOptions);\n\t\tsetModelReady(true);\n\t\treturn () => {\n\t\t\tif (mapView == null || modelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Models.remove(modelRef.current);\n\t\t\tsetModelReady(false);\n\t\t};\n\t}, [mapView, props.url]);\n\n\t// Update coordinate and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (modelRef.current) {\n\t\t\tmapView?.updateState(modelRef.current, {\n\t\t\t\tposition: props.coordinate,\n\t\t\t\t...memoizedOptions,\n\t\t\t});\n\t\t}\n\t}, [props.coordinate, memoizedOptions]);\n\n\treturn null;\n});\n", "import { useContext } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { MapData, MapView } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\nimport { MapDataContext } from '../MapDataProvider';\n/**\n * Hook to get the MapData and MapView from the current MapView context.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, mapView } = useMap();\n * ```\n */\nexport function useMap(): {\n\tmapData: MapData;\n\tmapView: MapView;\n} {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\n\tif (!mapView) {\n\t\tthrow new MapViewNullError('useMap');\n\t}\n\n\treturn { mapData: getCachedMapData?.()?.mapData || mapView.getMapData(), mapView };\n}\n", "import type { PropsWithChildren } from 'react';\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tforwardRef,\n\tuseImperativeHandle,\n\tuseState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { randomId } from '@packages/internal/common/random-id';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, TAnimationOptions, Marker as MarkerJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Markers']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'contentHtml', 'options'];\n\n/**\n * @interface\n */\nexport type MarkerProps = Omit<TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>, 'contentHtml'>;\n\n/**\n * Marker component.\n *\n * A Marker is a 2D component anchored to a position on the map.\n * To animate the Marker when its target changes, see {@link AnimatedMarker}.\n *\n * @example\n * ```tsx\n * <Marker target={mapData.getByType('space')[0]}>\n * <div>Hello, world!</div>\n * </Marker>\n * ```\n *\n * @category Components\n */\nexport const Marker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps>>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst markerRef = useRef<MarkerJS>();\n\tconst [markerReady, setMarkerReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the marker instance via ref\n\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Marker');\n\t\t}\n\t\tmarkerRef.current = mapView.Markers.add(props.target, '', memoizedOptions);\n\t\tsetMarkerReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || markerRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Markers.remove(markerRef.current);\n\t\t\tsetMarkerReady(false);\n\t\t};\n\t}, [mapView, props.target]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (markerRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(markerRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\tif (mapView == null || markerRef.current == null) {\n\t\treturn null;\n\t}\n\n\treturn createPortal(props.children, markerRef.current.contentEl, markerRef.current.id);\n});\n\n/**\n * AnimatedMarker component.\n * @experimental\n *\n * A {@link Marker} component that animates between positions when its target changes.\n *\n * @example\n * ```tsx\n * <AnimatedMarker target={mapData.getByType('space')[0]} duration={1000}>\n * <div>Hello, world!</div>\n * </AnimatedMarker>\n * ```\n *\n * @category Components\n */\nexport const AnimatedMarker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps & TAnimationOptions>>(\n\t(props, ref) => {\n\t\tconst { mapView } = useContext(MapViewContext);\n\t\tconst keyRef = useRef<string>(randomId());\n\t\tconst markerRef = useRef<MarkerJS>();\n\t\tconst [markerReady, setMarkerReady] = useState(false);\n\n\t\t// Store the initial target to avoid re-creating the marker\n\t\tconst initialTarget = useRef(props.target);\n\n\t\t// Forward the ref and also keep a local reference for animations\n\t\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\t\t// Callback ref to track when the marker becomes available\n\t\tconst handleMarkerRef = useCallback((marker: MarkerJS | null) => {\n\t\t\tmarkerRef.current = marker || undefined;\n\t\t\tsetMarkerReady(!!marker);\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (mapView == null) {\n\t\t\t\tthrow new MapViewNullError('Marker');\n\t\t\t}\n\t\t\tif (markerRef.current && markerRef.current.target !== props.target) {\n\t\t\t\tconst { duration = 300, easing = 'linear' } = props;\n\t\t\t\tmapView.Markers.animateTo(markerRef.current, props.target, { duration, easing });\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tsetMarkerReady(false);\n\t\t\t};\n\t\t}, [mapView, props.target]);\n\n\t\tconst propsWithoutAnimation = useMemo(\n\t\t\t() => ({ ...props, duration: undefined, easing: undefined }),\n\t\t\t[props.duration, props.easing],\n\t\t);\n\n\t\treturn (\n\t\t\t<Marker {...propsWithoutAnimation} key={keyRef.current} target={initialTarget.current} ref={handleMarkerRef} />\n\t\t);\n\t},\n);\n", "const SLICE_POSITIONS = [0, 4, 6, 8, 10] as const;\n\n/**\n * Returns a UUIDv4-like ID without relying on a CSPRNG as we don't need it for these purposes.\n * @hidden\n */\nexport const randomId = () => {\n\tconst array: number[] = new Array(16).fill(0);\n\tlet seed = Math.random() * 0x100000000;\n\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (i > 0 && (i & 0x03) === 0) {\n\t\t\tseed = Math.random() * 0x100000000;\n\t\t}\n\t\tarray[i] = (seed >>> ((i & 0x03) << 3)) & 0xff;\n\t}\n\tconst hexArray = array.map(n => n.toString(16).padStart(2, '0'));\n\t// UUID's 3rd segment must start with a 4\n\n\thexArray[6] = '4' + hexArray[6][1];\n\t// UUID's 4th segment (for variant 1) must be an 8, 9, a or b\n\t// (due to needing the leading 2 bits in binary to be 10).\n\thexArray[8] = ['8', '9', 'a', 'b'].includes(hexArray[7][0]) ? hexArray[7] : 'a' + hexArray[7][1];\n\n\treturn SLICE_POSITIONS.map((v, i) =>\n\t\thexArray.slice(v, i === SLICE_POSITIONS.length - 1 ? undefined : SLICE_POSITIONS[i + 1]).join(''),\n\t).join('-');\n};\n\nexport function cyrb53(str: string, seed = 0): number {\n\tlet h1 = 0xdeadbeef ^ seed;\n\tlet h2 = 0x41c6ce57 ^ seed;\n\tfor (let i = 0, ch; i < str.length; i++) {\n\t\tch = str.charCodeAt(i);\n\t\th1 = Math.imul(h1 ^ ch, 2654435761);\n\t\th2 = Math.imul(h2 ^ ch, 1597334677);\n\t}\n\n\th1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n\th2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n\treturn 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\nlet counter = 0;\nexport function shortId() {\n\t// Hybrid ID generation: timestamp base36 + counter\n\tconst base = Date.now().toString(36);\n\treturn `${base}${(++counter).toString(36)}`;\n}\n", "import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Label as LabelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Labels']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'text', 'options'];\n\n/**\n * @interface\n */\nexport type LabelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Label component.\n *\n * A Label is a 2D text label anchored to a position on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Label target={mapData.getByType('space')[0]} text={\"Hello, world!\"} />\n * ```\n */\nexport const Label = forwardRef<LabelJS | undefined, LabelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst labelRef = useRef<LabelJS>();\n\tconst [isLabelReady, setIsLabelReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the label instance via ref\n\tuseImperativeHandle(ref, () => labelRef.current, [isLabelReady]);\n\n\t// Only create/destroy label when target changes\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Label');\n\t\t}\n\t\tlabelRef.current = mapView.Labels.add(props.target, props.text, memoizedOptions);\n\t\tsetIsLabelReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || labelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Labels.remove(labelRef.current);\n\t\t\tsetIsLabelReady(false);\n\t\t};\n\t}, [mapView, props.target]); // Only depend on mapView and target\n\n\t// Update text and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (labelRef.current) {\n\t\t\tmapView?.updateState(labelRef.current, {\n\t\t\t\ttext: props.text,\n\t\t\t\t...memoizedOptions,\n\t\t\t});\n\t\t}\n\t}, [props.text, memoizedOptions]);\n\n\treturn null;\n});\n"],
4
+ "sourcesContent": ["{\"env\":{\"npm_package_version\":\"6.1.2\"}}", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "/**\n * @module @mappedin/react-sdk\n */\n// MapData\nexport { MapDataProvider } from './MapDataProvider';\nexport type { MapDataProviderProps } from './MapDataProvider';\nexport { useMapData } from './hooks/useMapData';\nexport { useMapDataEvent } from './hooks/useMapDataEvent';\n\n// MapView\nexport { MapView } from './MapView';\nexport type { MapViewProps } from './MapView';\nexport { useMapViewEvent } from './hooks/useMapViewEvent';\nexport { useMapViewExtension } from './hooks/useMapViewExtension';\nexport { Path } from './Path';\nexport type { PathProps } from './Path';\nexport { Navigation } from './Navigation';\nexport type { NavigationProps } from './Navigation';\nexport { Shape } from './Shape';\nexport type { ShapeProps } from './Shape';\nexport { Model } from './Model';\nexport type { ModelProps } from './Model';\nexport { useMap } from './hooks/useMap';\nexport { Marker, AnimatedMarker } from './Marker';\nexport type { MarkerProps } from './Marker';\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\n// Re-export React types for docs\nimport type * as React from 'react';\nexport type { React };\n", "import type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport type { PropsWithChildren } from 'react';\nimport React, { createContext, useCallback, useMemo, useRef } from 'react';\n\nexport type CachedMapDataEntry = {\n\tmapData: MapData;\n\toptions: TGetMapDataOptions;\n};\n\nexport type MapDataContextType = {\n\tgetCache: () => CachedMapDataEntry | undefined;\n\tsetCache: (entry: CachedMapDataEntry) => void;\n};\n\nexport const MapDataContext = createContext<MapDataContextType>({\n\tgetCache: () => undefined,\n\tsetCache: () => {},\n});\n\nexport type MapDataProviderProps = {\n\tmapData: MapData;\n};\n\nexport function MapDataProvider({ mapData, children }: PropsWithChildren<MapDataProviderProps>) {\n\tconst cachedEntryRef = useRef<CachedMapDataEntry | undefined>(\n\t\tmapData ? { mapData, options: {} as TGetMapDataOptions } : undefined,\n\t);\n\n\tconst getCache = useCallback(() => cachedEntryRef.current, []);\n\tconst setCache = useCallback((entry: CachedMapDataEntry) => {\n\t\tcachedEntryRef.current = entry;\n\t}, []);\n\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tgetCache,\n\t\t\tsetCache,\n\t\t}),\n\t\t[getCache, setCache],\n\t);\n\n\treturn <MapDataContext.Provider value={contextValue}>{children}</MapDataContext.Provider>;\n}\n", "import { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport { getMapData } from '@mappedin/mappedin-js';\nimport equal from 'fast-deep-equal';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataContext } from '../MapDataProvider';\nimport { useMemoDeep } from './useMemoDeep';\n\n/**\n * Hook to get the MapData and handle loading and error states.\n *\n * If used outside of a {@link MapDataProvider} or {@link MapView} component, options are required to fetch the MapData.\n * If used within a {@link MapDataProvider} or {@link MapView} component, options are optional and will use the MapData from the context if available.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, isLoading, error } = useMapData(options);\n * ```\n */\nexport function useMapData(options?: TGetMapDataOptions): {\n\tmapData?: MapData;\n\tisLoading: boolean;\n\terror?: Error;\n} {\n\tconst { getCache, setCache } = useContext(MapDataContext);\n\tconst [mapData, setMapData] = useState<MapData | undefined>(undefined);\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [error, setError] = useState<Error | undefined>(undefined);\n\tconst fetchIdRef = useRef(0);\n\n\tconst memoizedOptions: TGetMapDataOptions | undefined = useMemoDeep(\n\t\t() => options && { ...options, analytics: { context: 'reactsdk', ...options?.analytics } },\n\t\t[options],\n\t);\n\n\tconst fetchMapData = useCallback((options: TGetMapDataOptions) => {\n\t\tconst fetchId = ++fetchIdRef.current;\n\t\tsetIsLoading(true);\n\t\tsetError(undefined);\n\n\t\t// TODO: use abortcontroller signal to cancel the fetch outright\n\t\tgetMapData(options)\n\t\t\t.then(fetchedMapData => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tsetMapData(fetchedMapData);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tLogger.error('Failed to fetch MapData', err);\n\t\t\t\t\tsetError(err);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (fetchIdRef.current === fetchId) setIsLoading(false);\n\t\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\t// If this is used within a context, we can try to get the mapData from context first\n\t\tconst cachedEntry = getCache?.();\n\t\tif (cachedEntry != null) {\n\t\t\tif (\n\t\t\t\t// No options provided, use cached data\n\t\t\t\tmemoizedOptions == null ||\n\t\t\t\t// Options provided and matches cached data\n\t\t\t\t(cachedEntry.mapData.mapId === memoizedOptions.mapId && equal(cachedEntry.options, memoizedOptions))\n\t\t\t) {\n\t\t\t\tsetMapData(cachedEntry.mapData);\n\t\t\t\tsetIsLoading(false);\n\t\t\t\tsetError(undefined);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!memoizedOptions) {\n\t\t\tsetError(new Error('useMapData requires options if not use within a MapDataProvider or MapView component.'));\n\t\t\treturn;\n\t\t}\n\t\t// If all else fails, fetch new data\n\t\tfetchMapData(memoizedOptions);\n\t}, [fetchMapData, getCache, memoizedOptions]);\n\n\tuseEffect(() => {\n\t\tconst cachedEntry = getCache?.();\n\t\tif (mapData != null && (cachedEntry == null || cachedEntry.mapData.mapId === mapData.mapId)) {\n\t\t\t// Only overwrite the context cache with new data if the mapData has the same mapId\n\t\t\t// In this case, we likely refetched due to an option change\n\t\t\tsetCache?.({ mapData, options: memoizedOptions || ({} as TGetMapDataOptions) });\n\t\t}\n\t}, [mapData, memoizedOptions, getCache, setCache]);\n\n\treturn { mapData, isLoading, error };\n}\n", "/* eslint-disable no-console*/\nexport const MI_DEBUG_KEY = 'mi-debug';\nexport const MI_ERROR_LABEL = '[MappedinJS]';\n\nexport enum E_SDK_LOG_LEVEL {\n\tLOG,\n\tWARN,\n\tERROR,\n\tSILENT,\n}\n\nexport function createLogger(name = '', { prefix = MI_ERROR_LABEL } = {}) {\n\tconst label = `${prefix}${name ? `-${name}` : ''}`;\n\n\tconst rnDebug = (type: 'log' | 'warn' | 'error', args: any[]) => {\n\t\tif (typeof window !== 'undefined' && (window as any).rnDebug) {\n\t\t\tconst processed = args.map(arg => {\n\t\t\t\tif (arg instanceof Error && arg.stack) {\n\t\t\t\t\treturn `${arg.message}\\n${arg.stack}`;\n\t\t\t\t}\n\n\t\t\t\treturn arg;\n\t\t\t});\n\t\t\t(window as any).rnDebug(`${name} ${type}: ${processed.join(' ')}`);\n\t\t}\n\t};\n\n\treturn {\n\t\tlogState: process.env.NODE_ENV === 'test' ? E_SDK_LOG_LEVEL.SILENT : E_SDK_LOG_LEVEL.LOG,\n\n\t\tlog(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.LOG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t\trnDebug('log', args);\n\t\t\t}\n\t\t},\n\n\t\twarn(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.WARN) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t\trnDebug('warn', args);\n\t\t\t}\n\t\t},\n\n\t\terror(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.ERROR) {\n\t\t\t\tconsole.error(label, ...args);\n\n\t\t\t\trnDebug('error', args);\n\t\t\t}\n\t\t},\n\n\t\t// It's a bit tricky to prepend [MappedinJs] to assert and time because of how the output is structured in the console, so it is left out for simplicity\n\t\tassert(...args: any[]) {\n\t\t\tconsole.assert(...args);\n\t\t},\n\n\t\ttime(label: string) {\n\t\t\tconsole.time(label);\n\t\t},\n\n\t\ttimeEnd(label: string) {\n\t\t\tconsole.timeEnd(label);\n\t\t},\n\t\tsetLevel(level: E_SDK_LOG_LEVEL) {\n\t\t\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\t\t\tthis.logState = level;\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst Logger = createLogger();\nexport function setLoggerLevel(level: E_SDK_LOG_LEVEL) {\n\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\tLogger.logState = level;\n\t}\n}\n\nexport default Logger;\n", "import { useRef, type DependencyList } from 'react';\nimport equal from 'fast-deep-equal';\n\n/**\n * Deep comparison memoization hook similar to useMemo but with deep equality check\n * @param factory Function that returns the value to memoize\n * @param deps Dependency list to deeply compare for changes\n * @returns Memoized value that only changes when dependencies deeply change\n * @internal\n */\nexport function useMemoDeep<T>(factory: () => T, deps: DependencyList): T {\n\tconst valueRef = useRef<T>();\n\tconst depsRef = useRef<DependencyList>();\n\n\tif (!equal(deps, depsRef.current)) {\n\t\tvalueRef.current = factory();\n\t\tdepsRef.current = deps;\n\t}\n\n\treturn valueRef.current!;\n}\n", "import { useCallback, useContext, useEffect } from 'react';\nimport type { TMapDataEvents } from '@mappedin/mappedin-js';\nimport { MapDataContext } from '../MapDataProvider';\n\n/**\n * Hook to subscribe to an event on the MapData.\n *\n * Must be used within a {@link MapDataProvider} or {@link MapView} component.\n * @throws If used outside of a {@link MapDataProvider} or {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapDataEvent('language-change', event => {\n * console.log(`Map language changed to ${event.name} (${event.code})`);\n * });\n * ```\n */\nexport function useMapDataEvent<T extends keyof TMapDataEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TMapDataEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TMapDataEvents[T]['data']\n\t\t\t: TMapDataEvents[T],\n\t) => void,\n) {\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tconst mapData = getCachedMapData?.()?.mapData;\n\t\tif (mapData == null) {\n\t\t\tthrow new Error('useMapDataEvent must be used within a MapDataProvider or MapView component.');\n\t\t}\n\n\t\tmapData.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapData == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapData.off(event, handleCallback);\n\t\t};\n\t}, [getCachedMapData, event, handleCallback]);\n}\n", "import type { ReactNode } from 'react';\nimport React, {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseImperativeHandle,\n\tcreateContext,\n} from 'react';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { show3dMap } from '@mappedin/mappedin-js';\nimport type { MapView as MapViewJS, MapData, TShow3DMapOptions } from '@mappedin/mappedin-js';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataProvider } from './MapDataProvider';\nimport type { ExtensionRegistry, MapViewExtensionName } from '@packages/internal/common/extensions';\n\ntype MapViewContextType = {\n\tmapView?: MapViewJS;\n\textensions: ExtensionRegistry;\n};\n\nexport const MapViewContext = createContext<MapViewContextType>({\n\tmapView: undefined,\n\textensions: {},\n});\n\nconst DEFAULT_STYLE: React.CSSProperties = {\n\twidth: '100%',\n\theight: '100%',\n\tposition: 'relative',\n};\n\n/**\n * TypeScript can't seem to handle these parameters when wrapped in forwardRef, but it's unlikely\n * that we'll ever add more parameters to show3dMap.\n */\n// type ParamsArray = Parameters<typeof show3dMap>;\n// type StreamAgentParameterNames = ['el', 'mapData', 'options'];\n\n/**\n * @interface\n */\nexport type MapViewProps = {\n\tmapData: MapData;\n\toptions?: TShow3DMapOptions;\n\t/**\n\t * The fallback content to render while the map is loading.\n\t */\n\tfallback?: ReactNode;\n};\n/**\n * MapView component.\n *\n * The root component which renders the map and provides context to the hooks and child components.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const { mapData } = useMapData({ key: '...', secret: '...', mapId: '...' });\n * return (\n * <MapView mapData={mapData}>\n * <Marker target={...} />\n * </MapView>\n * )\n * ```\n */\nexport const MapView = forwardRef<\n\tMapViewJS | undefined,\n\tMapViewProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof MapViewProps>\n>((props, ref) => {\n\tconst { mapData, options, style, fallback, children, ...rest } = props;\n\n\t// Persistent reference across renders\n\tconst thisRef = useRef<{\n\t\tmapView?: MapViewJS;\n\t\textensions: ExtensionRegistry;\n\t}>({\n\t\textensions: {}, // store the extensions in the ref so we don't re-render children when they change\n\t}).current;\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [isMounted, setIsMounted] = useState(false);\n\tconst mapEl = useRef<HTMLDivElement>(null);\n\n\tconst memoizedMapData = useMemo(() => mapData, [mapData]);\n\tconst memoizedOptions = useMemoDeep(() => options, [options]);\n\n\t// Expose the mapView instance via ref\n\tuseImperativeHandle(ref, () => thisRef.mapView);\n\n\tconst contextValue: MapViewContextType = useMemo(() => {\n\t\treturn {\n\t\t\tmapView: thisRef.mapView,\n\t\t\textensions: thisRef.extensions,\n\t\t} satisfies MapViewContextType;\n\t}, [memoizedMapData, thisRef.mapView, thisRef.extensions]);\n\n\tconst cleanUpExtensions = useCallback((extensions: ExtensionRegistry) => {\n\t\ttry {\n\t\t\tconst extensionNames = Object.keys(extensions) as MapViewExtensionName[];\n\t\t\tfor (const extensionName of extensionNames) {\n\t\t\t\tconst extensionEntry = extensions[extensionName];\n\t\t\t\tif (extensionEntry) {\n\t\t\t\t\textensionEntry.onDeregister(extensionEntry.instance);\n\n\t\t\t\t\tdelete extensions[extensionName];\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to clean up extensions', error);\n\t\t}\n\n\t\treturn {};\n\t}, []);\n\n\tconst destroyMapView = useCallback((mapView?: MapViewJS) => {\n\t\tconst mapViewToDestroy = mapView || thisRef.mapView;\n\n\t\ttry {\n\t\t\tmapViewToDestroy?.destroy?.();\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to destroy MapView', error);\n\t\t}\n\n\t\t// Only clear ref and state if destroying the current instance\n\t\tif (!mapView) {\n\t\t\tthisRef.extensions = cleanUpExtensions(thisRef.extensions);\n\t\t\tthisRef.mapView = undefined;\n\t\t\tsetIsMounted(false);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!memoizedMapData || !mapEl.current) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clean up any existing MapView first\n\t\tdestroyMapView();\n\n\t\tlet cancelled = false;\n\t\tsetIsLoading(true);\n\t\tshow3dMap(mapEl.current, memoizedMapData, memoizedOptions)\n\t\t\t.then(mapView => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\t// Just in case extensions were left over from a previous render\n\t\t\t\t\tthisRef.mapView = mapView;\n\t\t\t\t\tsetIsMounted(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Component was unmounted during creation, destroy immediately\n\t\t\t\t\tdestroyMapView(mapView);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tLogger.error('Failed to render MapView', err);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t\t// Destroy the mapView if has already been mounted\n\t\t\tif (thisRef.mapView) {\n\t\t\t\tdestroyMapView();\n\t\t\t}\n\t\t};\n\t}, [memoizedMapData, memoizedOptions, destroyMapView]);\n\n\treturn (\n\t\t<MapDataProvider mapData={memoizedMapData}>\n\t\t\t<MapViewContext.Provider value={contextValue}>\n\t\t\t\t<div data-testid=\"mappedin-map\" ref={mapEl} style={{ ...DEFAULT_STYLE, ...style }} {...rest} />\n\t\t\t\t{isLoading ? <>{fallback}</> : isMounted ? children : null}\n\t\t\t</MapViewContext.Provider>\n\t\t</MapDataProvider>\n\t);\n});\n", "import { useCallback, useContext, useEffect } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { TEvents } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\n\n/**\n * Hook to subscribe to an event on the {@link MapView}.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapViewEvent('click', event => {\n * const { coordinate } = event;\n * const { latitude, longitude } = coordinate;\n * console.log(`Map was clicked at ${latitude}, ${longitude}`);\n * });\n * ```\n */\nexport function useMapViewEvent<T extends keyof TEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TEvents[T]['data']\n\t\t\t: TEvents[T],\n\t) => void,\n) {\n\tconst { mapView } = useContext(MapViewContext);\n\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('useMapViewEvent');\n\t\t}\n\n\t\tmapView.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapView == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.off(event, handleCallback);\n\t\t};\n\t}, [mapView, event, callback]);\n}\n", "export class MapViewNullError extends Error {\n\tconstructor(name: string) {\n\t\tsuper(`${name} must be used within a MapView component.`);\n\t}\n}\n", "import type { MapViewExtension, MapViewExtensionName } from '@packages/internal/common/extensions';\nimport { MapViewContext } from '../MapView';\nimport { useCallback, useContext } from 'react';\n\ntype MapViewExtensionOptions<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Callback to be fired when the extension is registered.\n\t * This will not be called on subsequent calls to register until the extension is deregistered again.\n\t **/\n\tonRegister: () => T;\n\t/**\n\t * Callback to be fired when the extension is deregistered.\n\t * This will not be called if the extension is not registered.\n\t **/\n\tonDeregister: (extension: T) => void;\n};\n\ntype MapViewExtensionResult<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Register the extension or return the existing instance if it is already registered.\n\t */\n\tregister: () => T;\n\t/**\n\t * Deregister the extension.\n\t */\n\tderegister: () => void;\n};\n\n/**\n * @internal\n * Register an extension to the mapView context.\n * @param name - The name of the extension.\n * @returns An object with a register and deregister function.\n */\nexport function useMapViewExtension<T extends MapViewExtension<unknown> = MapViewExtension<unknown>>(\n\tname: MapViewExtensionName,\n\toptions: MapViewExtensionOptions<T>,\n): MapViewExtensionResult<T> {\n\tconst { extensions } = useContext(MapViewContext);\n\n\tif (!options?.onRegister || !options?.onDeregister) {\n\t\tthrow new Error('onRegister and onDeregister are required');\n\t}\n\n\tconst register = useCallback((): T => {\n\t\tconst existingEntry = extensions[name];\n\t\tlet instance = existingEntry?.instance;\n\n\t\tif (!instance) {\n\t\t\tinstance = options.onRegister();\n\t\t\textensions[name] = {\n\t\t\t\tinstance,\n\t\t\t\tonDeregister: options.onDeregister as (extension: MapViewExtension<unknown>) => void,\n\t\t\t};\n\t\t}\n\n\t\treturn instance as T;\n\t}, [extensions, name, options.onRegister]);\n\n\tconst deregister = useCallback(() => {\n\t\tconst extensionEntry = extensions[name];\n\t\tif (extensionEntry) {\n\t\t\textensionEntry.onDeregister(extensionEntry.instance as T);\n\t\t\tdelete extensions[name];\n\t\t}\n\t}, [extensions, name, options.onDeregister]);\n\n\treturn {\n\t\tregister,\n\t\tderegister,\n\t};\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Path as PathJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Paths']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'options'];\n\n/**\n * @interface\n */\nexport type PathProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Path component.\n *\n * A Path indicates a route on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Path coordinate={directions.coordinates} options={{ color: 'blue' }} /> : null;\n * ```\n */\nexport const Path = forwardRef<PathJS | undefined, PathProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst pathRef = useRef<PathJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [pathReady, setPathReady] = useState(false);\n\n\t// Expose the path instance via ref\n\tuseImperativeHandle(ref, () => pathRef.current, [pathReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Path');\n\t\t}\n\n\t\tconst path = mapView.Paths.add(props.coordinate, memoizedOptions);\n\t\tpath.animation.then(() => {\n\t\t\t// TODO: this fires when the path is destroyed before the animation is complete\n\t\t\t// our animation should have a reject/resolve to handle this, or implement the CancelablePromise from animateState\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\tpathRef.current = path;\n\t\tsetPathReady(true);\n\t\treturn () => {\n\t\t\tif (pathRef.current) {\n\t\t\t\tmapView.Paths.remove(pathRef.current);\n\t\t\t}\n\t\t\tsetPathReady(false);\n\t\t};\n\t}, [mapView, props.coordinate]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (pathRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(pathRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\treturn null;\n});\n", "import { useEffect, useRef } from 'react';\n\n/**\n * A custom hook that behaves like useEffect but skips the initial render.\n * This is useful for update effects that should only run when dependencies change,\n * not on the initial mount.\n *\n * @param effect - The effect function to run\n * @param deps - The dependency array\n * @internal\n */\nexport function useUpdateEffect(effect: React.EffectCallback, deps: React.DependencyList): void {\n\tconst isInitialRender = useRef(true);\n\n\tuseEffect(() => {\n\t\tif (isInitialRender.current) {\n\t\t\tisInitialRender.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\treturn effect();\n\t}, deps);\n}\n", "import { useContext, useEffect } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport type { MapView } from '@mappedin/mappedin-js';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Navigation']['draw']>;\n\ntype StreamAgentParameterNames = ['directions', 'options'];\n\n/**\n * @interface\n */\nexport type NavigationProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Navigation component.\n *\n * Navigation draws a route on the map with pre-defined Markers for connections and the start and end points.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Navigation directions={directions} /> : null;\n * ```\n */\nexport function Navigation(props: NavigationProps) {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Navigation');\n\t\t}\n\n\t\tmapView.Navigation.draw(props.directions, memoizedOptions).then(() => {\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\treturn () => {\n\t\t\tmapView.Navigation.clear();\n\t\t};\n\t}, [mapView, props.directions, memoizedOptions]);\n\n\treturn null;\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Shape as ShapeJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Shapes']['add']>;\n\ntype StreamAgentParameterNames = ['geometry', 'style', 'floor'];\n\n/**\n * @interface\n */\nexport type ShapeProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Shape component.\n *\n * A Shape is a custom geometry on the map created from a GeoJSON feature collection.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Shape geometry={geojson} style={{ color: 'blue', height: 2 }} />\n * ```\n */\nexport const Shape = forwardRef<ShapeJS | undefined, ShapeProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst shapeRef = useRef<ShapeJS>();\n\tconst memoizedStyle = useMemoDeep(() => props.style, [props.style]);\n\tconst [shapeReady, setShapeReady] = useState(false);\n\n\t// Expose the shape instance via ref\n\tuseImperativeHandle(ref, () => shapeRef.current, [shapeReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new Error('MapView not initialized');\n\t\t}\n\t\tshapeRef.current = mapView.Shapes.add(props.geometry, props.style, props.floor);\n\t\tsetShapeReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || shapeRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Shapes.remove(shapeRef.current);\n\t\t\tsetShapeReady(false);\n\t\t};\n\t}, [mapView, props.geometry, props.style, props.floor]);\n\n\t// Update style when it changes (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (shapeRef.current && memoizedStyle) {\n\t\t\tmapView?.updateState(shapeRef.current, memoizedStyle);\n\t\t}\n\t}, [memoizedStyle]);\n\n\treturn null;\n});\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Model as ModelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Models']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'url', 'options'];\n\n/**\n * @interface\n */\nexport type ModelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Model component.\n *\n * A Model is a 3D model in GLTF or GLB format anchored to a Coordinate on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Model\n * coordinate={coordinate}\n * url={'/path/to/model.glb'}\n * options={{\n * scale: [0.01, 0.01, 0.01],\n * rotation: [90, 0, 0],\n * opacity: 0.5,\n * }}\n * />\n * ```\n */\nexport const Model = forwardRef<ModelJS | undefined, ModelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst modelRef = useRef<ModelJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [modelReady, setModelReady] = useState(false);\n\n\t// Expose the model instance via ref\n\tuseImperativeHandle(ref, () => modelRef.current, [modelReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Model');\n\t\t}\n\t\tmodelRef.current = mapView.Models.add(props.coordinate, props.url, memoizedOptions);\n\t\tsetModelReady(true);\n\t\treturn () => {\n\t\t\tif (mapView == null || modelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Models.remove(modelRef.current);\n\t\t\tsetModelReady(false);\n\t\t};\n\t}, [mapView, props.url]);\n\n\t// Update coordinate and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (modelRef.current) {\n\t\t\tmapView?.updateState(modelRef.current, {\n\t\t\t\tposition: props.coordinate,\n\t\t\t\t...memoizedOptions,\n\t\t\t});\n\t\t}\n\t}, [props.coordinate, memoizedOptions]);\n\n\treturn null;\n});\n", "import { useContext } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { MapData, MapView } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\nimport { MapDataContext } from '../MapDataProvider';\n/**\n * Hook to get the MapData and MapView from the current MapView context.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, mapView } = useMap();\n * ```\n */\nexport function useMap(): {\n\tmapData: MapData;\n\tmapView: MapView;\n} {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\n\tif (!mapView) {\n\t\tthrow new MapViewNullError('useMap');\n\t}\n\n\treturn { mapData: getCachedMapData?.()?.mapData || mapView.getMapData(), mapView };\n}\n", "import type { PropsWithChildren } from 'react';\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tforwardRef,\n\tuseImperativeHandle,\n\tuseState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { randomId } from '@packages/internal/common/random-id';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, TAnimationOptions, Marker as MarkerJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Markers']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'contentHtml', 'options'];\n\n/**\n * @interface\n */\nexport type MarkerProps = Omit<TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>, 'contentHtml'>;\n\n/**\n * Marker component.\n *\n * A Marker is a 2D component anchored to a position on the map.\n * To animate the Marker when its target changes, see {@link AnimatedMarker}.\n *\n * @example\n * ```tsx\n * <Marker target={mapData.getByType('space')[0]}>\n * <div>Hello, world!</div>\n * </Marker>\n * ```\n *\n * @category Components\n */\nexport const Marker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps>>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst markerRef = useRef<MarkerJS>();\n\tconst [markerReady, setMarkerReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the marker instance via ref\n\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Marker');\n\t\t}\n\t\tmarkerRef.current = mapView.Markers.add(props.target, '', memoizedOptions);\n\t\tsetMarkerReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || markerRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Markers.remove(markerRef.current);\n\t\t\tsetMarkerReady(false);\n\t\t};\n\t}, [mapView, props.target]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (markerRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(markerRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\tif (mapView == null || markerRef.current == null) {\n\t\treturn null;\n\t}\n\n\treturn createPortal(props.children, markerRef.current.contentEl, markerRef.current.id);\n});\n\n/**\n * AnimatedMarker component.\n * @experimental\n *\n * A {@link Marker} component that animates between positions when its target changes.\n *\n * @example\n * ```tsx\n * <AnimatedMarker target={mapData.getByType('space')[0]} duration={1000}>\n * <div>Hello, world!</div>\n * </AnimatedMarker>\n * ```\n *\n * @category Components\n */\nexport const AnimatedMarker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps & TAnimationOptions>>(\n\t(props, ref) => {\n\t\tconst { mapView } = useContext(MapViewContext);\n\t\tconst keyRef = useRef<string>(randomId());\n\t\tconst markerRef = useRef<MarkerJS>();\n\t\tconst [markerReady, setMarkerReady] = useState(false);\n\n\t\t// Store the initial target to avoid re-creating the marker\n\t\tconst initialTarget = useRef(props.target);\n\n\t\t// Forward the ref and also keep a local reference for animations\n\t\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\t\t// Callback ref to track when the marker becomes available\n\t\tconst handleMarkerRef = useCallback((marker: MarkerJS | null) => {\n\t\t\tmarkerRef.current = marker || undefined;\n\t\t\tsetMarkerReady(!!marker);\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (mapView == null) {\n\t\t\t\tthrow new MapViewNullError('Marker');\n\t\t\t}\n\t\t\tif (markerRef.current && markerRef.current.target !== props.target) {\n\t\t\t\tconst { duration = 300, easing = 'linear' } = props;\n\t\t\t\tmapView.Markers.animateTo(markerRef.current, props.target, { duration, easing });\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tsetMarkerReady(false);\n\t\t\t};\n\t\t}, [mapView, props.target]);\n\n\t\tconst propsWithoutAnimation = useMemo(\n\t\t\t() => ({ ...props, duration: undefined, easing: undefined }),\n\t\t\t[props.duration, props.easing],\n\t\t);\n\n\t\treturn (\n\t\t\t<Marker {...propsWithoutAnimation} key={keyRef.current} target={initialTarget.current} ref={handleMarkerRef} />\n\t\t);\n\t},\n);\n", "const SLICE_POSITIONS = [0, 4, 6, 8, 10] as const;\n\n/**\n * Returns a UUIDv4-like ID without relying on a CSPRNG as we don't need it for these purposes.\n * @hidden\n */\nexport const randomId = () => {\n\tconst array: number[] = new Array(16).fill(0);\n\tlet seed = Math.random() * 0x100000000;\n\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (i > 0 && (i & 0x03) === 0) {\n\t\t\tseed = Math.random() * 0x100000000;\n\t\t}\n\t\tarray[i] = (seed >>> ((i & 0x03) << 3)) & 0xff;\n\t}\n\tconst hexArray = array.map(n => n.toString(16).padStart(2, '0'));\n\t// UUID's 3rd segment must start with a 4\n\n\thexArray[6] = '4' + hexArray[6][1];\n\t// UUID's 4th segment (for variant 1) must be an 8, 9, a or b\n\t// (due to needing the leading 2 bits in binary to be 10).\n\thexArray[8] = ['8', '9', 'a', 'b'].includes(hexArray[7][0]) ? hexArray[7] : 'a' + hexArray[7][1];\n\n\treturn SLICE_POSITIONS.map((v, i) =>\n\t\thexArray.slice(v, i === SLICE_POSITIONS.length - 1 ? undefined : SLICE_POSITIONS[i + 1]).join(''),\n\t).join('-');\n};\n\nexport function cyrb53(str: string, seed = 0): number {\n\tlet h1 = 0xdeadbeef ^ seed;\n\tlet h2 = 0x41c6ce57 ^ seed;\n\tfor (let i = 0, ch; i < str.length; i++) {\n\t\tch = str.charCodeAt(i);\n\t\th1 = Math.imul(h1 ^ ch, 2654435761);\n\t\th2 = Math.imul(h2 ^ ch, 1597334677);\n\t}\n\n\th1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n\th2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n\treturn 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\nlet counter = 0;\nexport function shortId() {\n\t// Hybrid ID generation: timestamp base36 + counter\n\tconst base = Date.now().toString(36);\n\treturn `${base}${(++counter).toString(36)}`;\n}\n", "import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Label as LabelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Labels']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'text', 'options'];\n\n/**\n * @interface\n */\nexport type LabelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Label component.\n *\n * A Label is a 2D text label anchored to a position on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Label target={mapData.getByType('space')[0]} text={\"Hello, world!\"} />\n * ```\n */\nexport const Label = forwardRef<LabelJS | undefined, LabelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst labelRef = useRef<LabelJS>();\n\tconst [isLabelReady, setIsLabelReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the label instance via ref\n\tuseImperativeHandle(ref, () => labelRef.current, [isLabelReady]);\n\n\t// Only create/destroy label when target changes\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Label');\n\t\t}\n\t\tlabelRef.current = mapView.Labels.add(props.target, props.text, memoizedOptions);\n\t\tsetIsLabelReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || labelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Labels.remove(labelRef.current);\n\t\t\tsetIsLabelReady(false);\n\t\t};\n\t}, [mapView, props.target]); // Only depend on mapView and target\n\n\t// Update text and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (labelRef.current) {\n\t\t\tmapView?.updateState(labelRef.current, {\n\t\t\t\ttext: props.text,\n\t\t\t\t...memoizedOptions,\n\t\t\t});\n\t\t}\n\t}, [props.text, memoizedOptions]);\n\n\treturn null;\n});\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAC,KAAM,EAAC,qBAAsB,QAAO,EAAC;AAAA;AAAA;;;ACAtC;AAAA;AAAA;AAAA;AAMA,WAAO,UAAU,gCAASA,OAAM,GAAG,GAAG;AACpC,UAAI,MAAM,EAAG,QAAO;AAEpB,UAAI,KAAK,KAAK,OAAO,KAAK,YAAY,OAAO,KAAK,UAAU;AAC1D,YAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;AAE5C,YAAI,QAAQ,GAAG;A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AA,IACnC;AACA,aAAS,UAAU,QAAQ,OAAO,IAAI,MAAM,QAAQ,MAAM,MAAM,eAAe;AAC/E,oBAAgB,IAAI;AAEpB,WAAO,MAAM;AACZ,UAAI,WAAW,QAAQ,SAAS,WAAW,MAAM;AAChD;AAAA,MACD;AACA,cAAQ,OAAO,OAAO,SAAS,OAAO;AACtC,sBAAgB,KAAK;AAAA,IACtB;AAAA,EACD,GAAG,CAAC,SAAS,MAAM,MAAM,CAAC;AAG1B,kBAAgB,MAAM;AACrB,QAAI,SAAS,SAAS;AACrB,eAAS,YAAY,SAAS,SAAS;AAAA,QACtC,MAAM,MAAM;AAAA,QACZ,GAAG;AAAA,MACJ,CAAC;AAAA,IACF;AAAA,EACD,GAAG,CAAC,MAAM,MAAM,eAAe,CAAC;AAEhC,SAAO;AACR,CAAC;",
6
6
  "names": ["equal", "import_fast_deep_equal", "useCallback", "useRef", "label", "useRef", "useRef", "equal", "useRef", "useCallback", "options", "equal", "useCallback", "useContext", "useEffect", "useContext", "useCallback", "useEffect", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "createContext", "createContext", "useRef", "useState", "useMemo", "useCallback", "useEffect", "React", "useCallback", "useContext", "useEffect", "useContext", "useCallback", "useEffect", "useCallback", "useContext", "useContext", "useCallback", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "useEffect", "useRef", "useRef", "useEffect", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useEffect", "useContext", "useEffect", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useContext", "React", "useCallback", "useContext", "useEffect", "useMemo", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useCallback", "useMemo", "React", "forwardRef", "useContext", "useEffect", "useImperativeHandle", "useRef", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/react-sdk",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "homepage": "https://developer.mappedin.com/",
5
5
  "private": false,
6
6
  "main": "lib/esm/index.js",
@@ -17,7 +17,7 @@
17
17
  "peerDependencies": {
18
18
  "react": ">=16.8.0",
19
19
  "react-dom": ">=16.8.0",
20
- "@mappedin/mappedin-js": "^6.1.1"
20
+ "@mappedin/mappedin-js": "^6.1.2"
21
21
  },
22
22
  "dependencies": {},
23
23
  "devDependencies": {},