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

netless-iframe-bridge

v1.0.1

Published

> 本项目主要用于转发白板的事件和属性到 `iframe`, 管理 `iframe` 的插入, 以及对白板的视角变化的跟随

Readme

IframeBridge

本项目主要用于转发白板的事件和属性到 iframe, 管理 iframe 的插入, 以及对白板的视角变化的跟随

注意, iframe 只有在教具为 选择工具 时候才能进行交互

example

import {WhiteWebSdk} from "white-react-sdk"
import {IframeBridge, IframeWrapper} from "@netless/iframe-bridge"

const sdk = new WhiteWebSdk({
  // 其他参数
  invisiblePlugins: [IframeBridge],
  wrappedComponents: [IframeWrapper],
})

const room = await sdk.joinRoom()

const bridge = await IframeBridge.insert({
  room: room, // room 实例
  url: "example.com", // iframe 的地址
  width: 1280, // 课件的宽, 单位 px
  height: 720, // 课件的高, 单位 px
})

setIframeSize

bridge.setIframeSize({ width: 1200, height: 700 }) // 修改 iframe 的宽高

attributes

attributes 是会在所有插件中同步的属性, 类似于白板中的 globalState 概念, 但是只是同步在所有的插件中

bridge.attributes

setAttributes

修改 attributes, 并且会触发事件传递 attributesiframe

readOnly 模式下不可用

bridge.setAttributes({ name: "bridge" })

on

监听 iframe``load 事件

import { DomEvents } from "@netless/iframe-bridge"

bridge.on(DomEvents.IframeLoad, (event) => {
    // code
})

destroy

销毁插件

bridge.destroy()

在特定 scene 中使用 H5 课件

  1. 插入 h5 目录和页面至白板
const dir = "/h5" // h5 课件在白板中的目录名称,可以自定义为任意名称,注意不要跟已有目录重复
const scenes = [{name: "第一页"}, { name: "第二页" }] // h5 课件有多少页可以创建多少个, 但并不是严格对应
room.putScenes(dir, scenes)
  1. 切换至 h5 课件目录
room.setScenePath("/h5/第一页") // 设置为课件目录的第一页
  1. 翻页 可以使用 sdk 封装的翻页,也可以自己调用白板的翻页 参考: 白板翻页
// 白板翻页
room.setSceneIndex(room.state.sceneState.index - 1); // 上一页
room.setSceneIndex(room.state.sceneState.index + 1) // 下一页