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

kun-wu

v0.0.6

Published

kun-wu

Downloads

4

Readme

React + TypeScript + Vite

yarn add kun-wu

Driver

export type Config = {
    steps?: DriveStep[];
    /**@name 是否启用动画 */
    animate?: boolean;
    /**@name 覆盖层颜色 */
    overlayColor?: string;
    /**@name 覆盖层透明度 */
    overlayOpacity?: number;
    /**@name 是否启用平滑滚动 */
    smoothScroll?: boolean;
    /**@name 是否允许关闭 */
    allowClose?: boolean;
    /**@name 舞台区域的内边距 */
    stagePadding?: number;
    /**@name 舞台区域的圆角大小 */
    stageRadius?: number;
    /**@name 是否禁用主动交互*/
    disableActiveInteraction?: boolean;
    /**@name 是否允许键盘控制*/
    allowKeyboardControl?: boolean;
    /**@name Popover的CSS类 */
    popoverClass?: string;
    /**@name Popover 相对于目标元素的偏移量 */
    popoverOffset?: number;
    /**@name 显示的按钮类型 */
    showButtons?: AllowedButtons[];
    /**@name 禁用的按钮类型*/
    disableButtons?: AllowedButtons[];
    /**@name 是否显示进度 */
    showProgress?: boolean;
    /**@name 进度文本 */
    progressText?: string;
    /**@name 下一步按钮文本 */
    nextBtnText?: string;
    /**@name 上一步按钮文本*/
    prevBtnText?: string;
    /**@name 完成按钮文本 */
    doneBtnText?: string;
    /**
     * @name Popover 渲染后的回调
     * @param popover
     * @param opts
     * @returns
     */
    onPopoverRender?: (popover: PopoverDOM, opts: {
        config: Config;
        state: State;
    }) => void;
    /** @name 高亮开始时 */
    onHighlightStarted?: DriverHook;
    /**@name  高亮时*/
    onHighlighted?: DriverHook;
    /**@name  取消高亮时*/
    onDeselected?: DriverHook;
    /**@name  销毁开始时 */
    onDestroyStarted?: DriverHook;
    /**@name 销毁时 */
    onDestroyed?: DriverHook;
    /**@name 下一步按钮点击时 */
    onNextClick?: DriverHook;
    /**@name 上一步按钮点击时 */
    onPrevClick?: DriverHook;
    /**@name 关闭按钮点击时 */
    onCloseClick?: DriverHook;
};

export type DriverHook = (element: Element | undefined, step: DriveStep, opts: {
    config: Config;
    state: State;
}) => void;

export type DriveStep = {
    /**@name 高亮步骤关联的元素选择器字符串或DOM元素 */
    element?: string | Element;
    /**@name 开始高亮步骤时的处理钩子 */
    onHighlightStarted?: DriverHook;
    /**@name 步骤已被高亮时的处理钩子 */
    onHighlighted?: DriverHook;
    /**@name 步骤被取消高亮时的处理钩子 */
    onDeselected?: DriverHook;
    /**@name 与该步骤关联的弹出窗口配置 */
    popover?: Popover;
};

export type Side = "top" | "right" | "bottom" | "left" | "over";
export type Alignment = "start" | "center" | "end";
export type AllowedButtons = "next" | "previous" | "close";

export type Popover = {
  /**@name 弹出窗口标题 */
  title?: string | JSX.Element | Element;

  /**@name 弹出窗口描述内容 */
  description?: string | JSX.Element | Element;

  /**@name 弹出窗口相对于触发元素的位置(如:上、下、左、右) */
  side?: Side;Ï

  /**@name 弹出窗口在所选侧边内的对齐方式(如:开始、中间、结束) */
  align?: Alignment;

  /**@name 显示哪些操作按钮(如:前进、后退、关闭) */
  showButtons?: AllowedButtons[];

  /**@name 是否显示进度条 */
  showProgress?: boolean;

  /**@name 禁用哪些操作按钮 */
  disableButtons?: AllowedButtons[];

  /**@name 自定义弹出窗口类名 */
  popoverClass?: string;

  /**@name 进度文本(用于显示在进度条附近) */
  progressText?: string;

  /**@name 完成按钮文本 */
  doneBtnText?: string;

  /**@name 下一步按钮文本 */
  nextBtnText?: string;

  /**@name 上一步按钮文本 */
  prevBtnText?: string;

  /**@name 弹出窗口渲染完成后回调函数,接收弹出窗口DOM对象及配置和状态参数 */
  onPopoverRender?: (popover: PopoverDOM, opts: { config: Config; state: State }) => void;

  /**@name 下一步按钮点击时的处理钩子 */
  onNextClick?: DriverHook;

  /**@name 上一步按钮点击时的处理钩子 */
  onPrevClick?: DriverHook;

  /**@name 关闭按钮点击时的处理钩子 */
  onCloseClick?: DriverHook;
};