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

bsign-customization-full

v0.0.41

Published

Віджет конструктора табличок, який можна вбудувати на будь-яку сторінку через `mountConstructorWidget(...)`.

Downloads

1,367

Readme

bsign-customization-full

Віджет конструктора табличок, який можна вбудувати на будь-яку сторінку через mountConstructorWidget(...).

Віджет рендериться в Shadow DOM, тому зовнішні стилі сторінки не конфліктують з його UI. Для картинок, шрифтів і шаблонів потрібно передати assetBaseUrl з посиланням на папку dist/.

Швидкий старт

  1. Збери проєкт через npm run build або опублікуй готовий вміст dist/.
  2. Додай контейнер на сторінку.
  3. Підключи sign-constructor.iife.js.
  4. Виклич mountConstructorWidget(...) і передай assetBaseUrl.

Приклад підключення через CDN

У прикладі використано @latest. Для продакшену краще зафіксувати конкретну версію пакета.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Bsign Widget Example</title>
  </head>
  <body>
    <div id="bsign-widget"></div>

    <script src="https://cdn.jsdelivr.net/npm/bsign-customization-full@latest/dist/sign-constructor.iife.js"></script>
    <script>
      AppDemo2.mountConstructorWidget("#bsign-widget", {
        assetBaseUrl: "https://cdn.jsdelivr.net/npm/bsign-customization-full@latest/dist/",
        templateId: "wave",
        previewAppUrl: "https://preview.example.com/",
        openButton: {
          label: "Open constructor",
          className: "bsign-open-button",
          buttonProps: {
            "aria-label": "Open sign constructor"
          }
        },
        widgetCss: `
          .bsign-open-button {
            border: 1px solid #1c1d1d;
            border-radius: 10px;
            padding: 10px 16px;
            font-weight: 600;
            background: #ffffff;
            cursor: pointer;
          }

          .bsign-open-button:hover {
            background: #f5f5f5;
          }
        `
      });
    </script>
  </body>
</html>

Приклад для Vite / React

import { useEffect } from "react";
import { mountConstructorWidget } from "bsign-customization-full/dist/sign-constructor.es.js";

export function BsignWidgetExample() {
  useEffect(() => {
    mountConstructorWidget("#bsign-widget", {
      assetBaseUrl: "https://cdn.jsdelivr.net/npm/bsign-customization-full@latest/dist/",
      templateId: "modern",
      previewAppUrl: "https://preview.example.com/",
      openButton: {
        label: "Customize sign",
        className: "bsign-open-button",
      },
      widgetCss: `
        .bsign-open-button {
          padding: 12px 18px;
          border: 0;
          border-radius: 999px;
          background: #111111;
          color: #ffffff;
          cursor: pointer;
        }
      `,
    });
  }, []);

  return <div id="bsign-widget" />;
}

API

mountConstructorWidget(target, props)

target

  • CSS-селектор, наприклад "#bsign-widget", або HTMLElement.

props

  • assetBaseUrl: string — обов'язковий URL до папки dist/, з якої підтягуються templates, colors, fonts та інші assets.
  • templateId?: string — стартовий шаблон. Доступні значення: modern, wave. За замовчуванням використовується modern.
  • productId?: number — Shopify variant ID, який додається до кошика.
  • previewAppUrl?: string — URL статичного Bsign preview-app. Конфігурація таблички передається в URL fragment і генерується при відкритті посилання.
  • openButton?: { label?, className?, style?, buttonProps? } — налаштування кнопки відкриття віджета.
  • widgetCss?: string | string[] — додаткові стилі, які інжектяться всередину Shadow DOM. Зручно для кастомізації кнопки та локальних перевизначень.

Практичні нотатки

  • assetBaseUrl має вказувати саме на папку, де лежать файли збірки та статичні ресурси віджета.
  • Зовнішній CSS сторінки не стилізує внутрішній UI віджета, тому для кастомізації використовуй widgetCss або openButton.style.
  • Якщо передати невідомий templateId, віджет автоматично повернеться до дефолтного шаблону.
  • Мінімальний робочий приклад також є у test/preview.html.

Розробка

npm install
npm run dev
npm run build