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

@open-feishu-card/store

v0.1.2

Published

把卡片运行时 state 封印进空分栏 action.multi_url(deflate + base64url),支持 DSL / RAW 回读

Readme

@open-feishu-card/store

把卡片运行时数据封印进卡片本身:空分栏 column_set 的 action.multi_url.url,载荷为 deflate → base64url。本包解决「卡片 JSON 里自带一小段可回读数据」。

宿主形态(DSL)

{
  "tag": "column_set",
  "element_id": "card_state",
  "action": {
    "multi_url": {
      "url": "lark://msgcard/unsupported_action#s1.<base64url>"
    }
  },
  "margin": "-8px 0 0 0",
  "columns": [{ "tag": "column", "width": "auto", "elements": [] }]
}

空分栏不放内容。真机仍会在它前面留下正文的纵向间距,所以 margin 的上边距写成这段间距的负数。间距按客户端纵向枚举算(default 8 / medium 12 / large 16,与 packages/renderer 同源);未写 vertical_spacing 时按默认 8px。正文横向排列(body.direction: 'horizontal')时宿主前面是列间距,不写 margin。URL 只写一份,避免四端复制吃额度。

安装

pnpm add @open-feishu-card/store

用法

import {
  sealCardState,
  readCardState,
  unsealCardState,
  encodeStateUrl,
  decodeStateUrl,
} from '@open-feishu-card/store'

const card = {
  schema: '2.0',
  body: { elements: [{ tag: 'markdown', content: 'hi' }] },
}

sealCardState(card, { step: 1, selected: ['a'] })
const state = readCardState<{ step: number }>(card)
unsealCardState(card) // 读出并移除宿主

编解码也可单独用:

const url = encodeStateUrl({ ok: true })
const data = decodeStateUrl(url)

回读注意

  • 请走 raw_card_content(或等价 RAW)。user_card_content 会丢掉 URL,解不出 state。
  • adapter 可能投影成 actions[];readCardState 已兼容 DSL / adapter / RAW 几种形态。
  • 封印(sealCardState)针对 DSL 卡片:宿主追加在 body.elements 末尾。
  • 卡片总大小有上限(约 153KB 量级,以官方为准);封印大对象前先估体积。

相关包