npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wovvmap-webview-bridge

v1.0.28

Published

A typed bridge between React Native and a WebView for Wovvmap maps. It provides: - WebViewScreen wrapper for React Native WebView - BridgeService helpers to send events to the WebView - Zustand store (useBridgeStorage) that keeps incoming state in sync -

Readme

wovvmap-webview-bridge

A typed bridge between React Native and a WebView for Wovvmap maps. It provides:

  • WebViewScreen wrapper for React Native WebView
  • BridgeService helpers to send events to the WebView
  • Zustand store (useBridgeStorage) that keeps incoming state in sync
  • Strongly typed message contracts

Installation

npm install react-native-webview zustand
# or
yarn add react-native-webview zustand

Quick start

Web (React TS) usage

Use the web entrypoint so you don't need react-native or react-native-webview in your web app.

import React from "react";
import { WebIframeScreen } from "wovvmap-webview-bridge/web";

export default function App() {
  return (
    <WebIframeScreen
      url="https://your-map-app-url.com"
      origin="https://your-map-app-url.com"
      onload={() => console.log("iframe loaded")}
      style={{ width: "100%", height: "100vh" }}
    />
  );
}

You can also attach to your own iframe ref:

import React, { useEffect, useRef } from "react";
import {
  attachIframeBridge,
  registerBridgeHandler,
  sendStartPointToBridge,
} from "wovvmap-webview-bridge/web";

export default function App() {
  const iframeRef = useRef<HTMLIFrameElement>(null);

  useEffect(() => {
    if (!iframeRef.current) return;

    const cleanup = attachIframeBridge({
      iframe: iframeRef.current,
      origin: "https://your-map-app-url.com",
      onLoad: () => sendStartPointToBridge("A1"),
    });

    registerBridgeHandler("isSceneClick", (payload) => {
      console.log("Scene clicked", payload);
    });

    return cleanup;
  }, []);

  return (
    <iframe
      ref={iframeRef}
      src="https://your-map-app-url.com"
      style={{ width: "100%", height: "100%", border: 0 }}
      title="Wovv Map"
    />
  );
}

1) Render the WebView

import React from "react";
import { WebViewScreen } from "wovvmap-webview-bridge";

export default function App() {
  return <WebViewScreen url="https://your-map-app-url.com" />;
}

2) Send events to the WebView (RN -> Web)

import {
  sendStartPointToBridge,
  sendEndPointToBridge,
  sendActiveFloorToBridge,
  sendPathNextBtnClick,
  sendPathPreBtnClick,
  sendPathFinishBtnClick,
  sendSelectCategory,
  sendZoomIn,
  sendZoomOut,
  sendClearStartAndEndPoint,
  sendPathFilter,
  sendGetDirectionToBridge,
  sendNavigateToBridge,
  sendMapThemeToBridge,
} from "wovvmap-webview-bridge";

sendStartPointToBridge("A1");
sendEndPointToBridge("B5");
sendActiveFloorToBridge(2);
sendPathNextBtnClick();
sendPathPreBtnClick();
sendPathFinishBtnClick();
sendSelectCategory(["Food", "Fashion"]);
sendZoomIn();
sendZoomOut();
sendClearStartAndEndPoint();
sendPathFilter();
sendGetDirectionToBridge();
sendNavigateToBridge("map-id-123");
sendMapThemeToBridge({ "theme-path-color": "#00AAFF" });

3) Handle events from the WebView (Web -> RN)

You can register handlers for click events. All other events are stored in the Zustand store.

import { registerBridgeHandler } from "wovvmap-webview-bridge";

registerBridgeHandler("isSceneClick", (payload) => {
  console.log("Scene clicked", payload);
});

registerBridgeHandler("isShapeClick", (payload) => {
  console.log("Shape clicked", payload.value);
});

4) Read synced state from the store

import { useBridgeStorage } from "wovvmap-webview-bridge";

const state = useBridgeStorage((s) => ({
  isBridgeLoaded: s.isBridgeLoaded,
  isMapLoaded: s.isMapLoaded,
  searchablePoints: s.searchablePoints,
  amenities: s.amenities,
  allOffers: s.allOffers,
  activeFloor: s.activeFloor,
  stepByStepList: s.stepByStepList,
  pathSummary: s.pathSummary,
  categories: s.categories,
  subCategories: s.subCategories,
}));

Store fields:

  • isBridgeLoaded
  • isMapLoaded
  • searchablePoints
  • amenities
  • allOffers
  • activeFloor
  • elevator, escalator
  • floorImages
  • stepByStepList
  • pathSummary
  • nextPreState
  • pointsByKey
  • categories
  • subCategories
  • cameraControllerState

Bridge message contracts

IncomingMessage (Web -> RN)

Keys and payloads:

  • pong: boolean
  • isConnection: boolean
  • mapLoaded: boolean
  • _searchablePoints: NodePoint[]
  • _allAmenities: AmenityWithNodePoint[]
  • _allOffers: string[]
  • _activeFloor: number
  • FloorImg: FloorImage[]
  • categories: Record<ExternalId, Category>
  • subCategories: Record<ExternalId, SubCategory>
  • isSceneClick: no value
  • isShapeClick: NodePoint
  • stepByStepList: StepByStepResult
  • pathNextPreState: NavState
  • cameraControllerState: { cameraPosition: CameraPosition; controlsPosition: ControlsPosition }

OutgoingMessage (RN -> Web)

Keys and payloads:

  • applyCSS: { selector: string; style: Partial }
  • ping: boolean
  • setEndPoint: string
  • setStartPoint: string
  • setActiveFloor: number
  • pathNextBtnClick: no value
  • pathPreBtnClick: no value
  • pathFinishBtnClick: no value
  • setSelectCategory: string | string[] | null
  • zoomIn: no value
  • zoomOut: no value
  • clearStartAndEndPoint: no value
  • setPathFilter: filterPath
  • getDirection: no value
  • setMapTheme: Theme | null
  • navigateTo: string
  • editableView: MapApiResponse
  • pathHighlightByStepIndex: number

Exported API

Components

  • WebViewScreen
  • WebIframeScreen (web only)

Bridge helpers

  • sendStartPointToBridge
  • sendEndPointToBridge
  • sendActiveFloorToBridge
  • sendPathNextBtnClick
  • sendPathPreBtnClick
  • sendPathFinishBtnClick
  • sendSelectCategory
  • sendZoomIn
  • sendZoomOut
  • sendClearStartAndEndPoint
  • sendGetDirectionToBridge
  • sendPathFilter
  • sendNavigateToBridge
  • sendMapThemeToBridge

Handlers

  • registerBridgeHandler

Store

  • useBridgeStorage (Zustand)

Types

  • IncomingMessage, OutgoingMessage
  • NodePoint
  • AmenityWithNodePoint
  • Category, SubCategory, ExternalId
  • Environment, DayHours, WeeklyHours
  • NodePointOffer, BrandInfo
  • MapExportContext, GeometryFloor, GeometryNodePoint, GeometryLayer
  • NodeMetadata, AssetPayloads
  • FloorImage
  • StepInstruction, PathSummary, StepByStepResult
  • NavState
  • filterPath
  • Theme
  • CameraPosition, ControlsPosition
  • MapApiResponse, MapDataExport

File structure

src/
  index.ts
  webviewBridge/
    WebViewScreen.tsx
    BridgeService.ts
    BridgeStorage.ts
    WebViewBridgeRef.ts
  handlers/
    WebBridgeHandlers.ts
  types/
    types.ts

License

MIT