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

mbt-puzzle-preview-lb

v1.0.194

Published

`puzzle-view` is the source package for `mbt-puzzle-preview-lb`. It exports the core puzzle runtime and web-ready wrappers used by MOBA Trainer web surfaces.

Readme

mbt-puzzle-preview-lb

puzzle-view is the source package for mbt-puzzle-preview-lb. It exports the core puzzle runtime and web-ready wrappers used by MOBA Trainer web surfaces.

Main Exports

PuzzlePreview

Default export. This is the raw puzzle runtime.

Use it when the host application fully owns the surrounding viewport, fullscreen behavior, orientation handling, and layout chrome.

import PuzzlePreview from 'mbt-puzzle-preview-lb';

<PuzzlePreview
  puzzle={puzzle}
  onQuitPuzzle={handleQuitPuzzle}
  onFinishPuzzle={handleFinishPuzzle}
  isNextPuzzleAvailable={false}
  isWebVersion
  openExternalLink={handleOpenExternalLink}
/>;

PuzzlePreviewWebEmbed

Named export. This is the recommended component for web and Electron consumers. It renders the same puzzle runtime, but adds reusable browser/mobile embedding behavior around it.

Desktop and Electron behavior is pass-through by default: no body lock, no fixed layout, no orientation screen, and no mobile resizing unless a real mobile browser is detected.

import { PuzzlePreviewWebEmbed } from 'mbt-puzzle-preview-lb';

<PuzzlePreviewWebEmbed
  puzzle={puzzle}
  onQuitPuzzle={handleQuitPuzzle}
  onFinishPuzzle={handleFinishPuzzle}
  isNextPuzzleAvailable={false}
  isWebVersion
  openExternalLink={handleOpenExternalLink}
/>;

On mobile browsers, PuzzlePreviewWebEmbed handles:

  • portrait orientation warning
  • landscape immersive layout
  • visible viewport height via visualViewport
  • safe-area padding
  • 16:9 stage fitting
  • body scroll locking while immersive
  • inline video behavior through the underlying puzzle runtime

PuzzlePreviewWebEmbed Props

PuzzlePreviewWebEmbed accepts all PuzzlePreview props plus:

type TPuzzlePreviewWebEmbedProps = TProps & {
  mobileImmersive?: 'auto' | 'off' | 'force';
  onImmersiveChange?: (isImmersive: boolean) => void;
  renderPortraitWarning?: () => React.ReactNode;
  renderLoading?: () => React.ReactNode;
  className?: string;
  stageClassName?: string;
};

Defaults:

  • mobileImmersive = 'auto'
  • renderPortraitWarning uses the built-in rotate-device screen
  • renderLoading uses the built-in loading state

Use mobileImmersive="off" if the host wants to fully control mobile layout. Use mobileImmersive="force" only for testing or a custom kiosk-style flow.

Host Chrome Integration

The library does not know how a host app implements navbars, footers, cookie banners, or route shells. Use onImmersiveChange to bridge that part:

<PuzzlePreviewWebEmbed
  puzzle={puzzle}
  onQuitPuzzle={handleQuitPuzzle}
  onFinishPuzzle={handleFinishPuzzle}
  isNextPuzzleAvailable={false}
  isWebVersion
  onImmersiveChange={setHostChromeHidden}
/>;

When isImmersive is true, the host should hide UI that would cover the puzzle. When it becomes false, the host should restore its normal shell.

Electron Usage

For Electron, use PuzzlePreviewWebEmbed with default props. Electron is treated as desktop by default, even when the window is small, so existing desktop puzzle behavior stays unchanged.

<PuzzlePreviewWebEmbed
  puzzle={puzzle}
  onQuitPuzzle={handleQuitPuzzle}
  onFinishPuzzle={handleFinishPuzzle}
  isNextPuzzleAvailable={false}
/>;

Local Development With web

Run the library build watcher in one terminal:

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/puzzle-view
npm run watch

Run the web app against the linked local library in another terminal:

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/web
npm run dev:local-lib

In dev:local-lib, the web dev server watches the linked library output and restarts Next automatically when puzzle-view/dist/index.js changes.

If local linking has not been set up yet, run this once:

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/puzzle-view
npm run link:local-lib

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/web
npm run link:local-lib

Then open the /puzzle-of-the-day URL printed by the web dev server.

Verification

Before publishing or handing off changes that affect web, run:

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/puzzle-view
npm run build

cd /Users/levpotapov/Documents/projects/puzzle-view-fixing/web
npm run lint
npm run type-check
npm run build