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

@alicloud/console-base-rc-attention-seeker

v1.5.10

Published

ConsoleBase 组件 - 寻求用户关注

Downloads

31

Readme

@alicloud/console-base-rc-attention-seeker

Usage

一般不建议直接用组件的形式调用,而是通过 append、prepend、refresh、clear 等方法。

建议对需要提示用户关注的地方单独写一个组件,如下,注意 ref 必须是 HTML 元素。

import React, {
  useRef,
  useEffect
} from 'react';

import {
  append
} from '@alicloud/console-base-rc-attention-seeker';

export default function PickMe(): JSX.Element {
  const refSpan = useRef<HTMLSpanElement | null>(null);
  
  useEffect(() => {
    if (refSpan.current) {
      return append(refSpan.current);
    }
  }, []);
  
  return <span ref={refSpan}>and i will get the attention</span>;
}

API

TODO 目前没有上一个下一个...

default export - 组件

基本用不到

append(element: HTMLElement, options?: IAttentionSeekerOptions): () => void;

将元素添加到元素列表,返回解除的无参回调函数可用于 useEffect。

prepend(element: HTMLElement, options?: IAttentionSeekerOptions): () => void

将元素添加到元素列表(如果希望添加后立即高亮,用它),返回解除的无参回调函数可用于 useEffect。

clear(): void

清除所有元素。

refresh(): void

刷新(基本应该用不到了)。

关于背投

我们要达到这样的效果:

  1. 有背投
  2. 关注元素需要跳出背投

简言之,便是需要有「镂空」背投。

最早的设计是这样的:

  1. 背投为实心的 div,绝对定位,占满全屏,以高 z-index 压住页面
  2. 镂空的实现是将关注元素的 z-index 调整为高于背投的 z-index 让它「浮」上来

问题 I

但这有个问题:当关注元素的祖先节点有「生效的」z-index 的时候,变无法上提,这里有个 Stacking Context 的概念。

这个问题的解法比较恶心,但可行,就是逐个把含 z-index 的祖先的 z-index 设置为 auto !important,当然后边会还原。

问题 II

解决了问题 I 之后,发现了另外一个问题:虽然祖先节点的 z-index 都已实现救赎,但还是有些元素无法浮上来:祖先元素的定位为 stickyfixed 的时候,甚至会因为去掉了 z-index,而导致这些祖先元素中的其他节点无法展示。

这个问题的原因我没有细究,也不想细究。

最终解法

于是想到了 牧羊人,它的解法很简单,背投用的是 SVG,代码参考