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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-window-package

v0.5.0-alpha3

Published

react components for using react as xaml

Downloads

14

Readme

说明

React-Windows

Scene组件

三层容器组件,前景,内容,背景
其中

  • 前景背景没有鼠标事件
  • 内容接受鼠标事件
  • 三层都是单一的Element,通过属性指定
  • 通过Window组件(对Scene的封装)可编写语义化代码 通过以下方式使用:
<Scene 
height={400} 
width={400} 
FrontLayer={<div></div>} 
BackLayer={<div></div>} 
Content={<div></div>}>

</Scene>

Scene可允许指定上中下三层的画布结构

ChildContext组件

可使用以下方式对目标组件的属性进行赋值:

    <ChildContext packComponent={
    <Scene height={400} width={400} FrontLayer={<div></div>} BackLayer={<div></div>} Content={<div></div>}></Scene>
  }>
    <Child name="Content">
      <div style={{background:"rgba(100,0,100,0.2)"}}>hello world</div>
    </Child>
    <Child name="BackLayer">
      <div style={{height:"100%",width:"100%",background:"green"}}>
        测试
      </div>
    </Child>
  </ChildContext>

以上代码中 Scene组件的三个属性会被顶掉,packComponent中直接创建组件实例以允许提供默认值
通过ChildContext和Child组件可以对一些可以接受多个children slot的组件进行赋值,组件本身只需要声明几个类型为ReactElement的属性即可

Window组件

Scene的封装,通过如下方式使用:

  <Window height={400} width={400}>
    <BackLayer>
      <div style={{ height: "100%", width: "100%",background:"green"}}></div>
    </BackLayer>
    <Content>
      <div>fafasdfas</div>
    </Content>
    <FrontLayer>
      <div style={{height: "100%", width: "100%",background:"rgba(0,0,100,0.5)"}}></div>
    </FrontLayer>
  </Window>

前景背景都没有鼠标事件,而内容有,通过这一方法和在Content中的多重嵌套可实现丰富效果