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

bugy

v1.0.5

Published

Модуль, добавляющий дополнительную кнопку в приложения типа VK Mini Apps

Downloads

5

Readme

Bugy

Модуль, добавляющий дополнительную кнопку под основные.

Что это даёт, зависит от вашей фантазии. Например вы можете при клике данной кнопки отправить пользователя в личный диалог или же добавить отчёт в ваш продукт.

Установка

Что бы установить данный модуль, откройте папку с вашим проектом и напишите:

$ npm install bugy

Вызов

После установки надо добавить установленный модуль в код и вызвать его:

import { bug, openDialog, bugIconText } from 'bugy';

bug({
  onclick: () => openDialog({ id: 102343170 }),
  text: bugIconText({ text: "Bug" })
});

Поддерживаемые функции

  • bug - создаёт дополнительную кнопку

Параметры:

onclick: any - вызывает переданную функцию

text: any - содержимое кнопки, может быть как элементом HTML, так и обычным текстом.

bug({
  onclick: () => bugCreateReport({ id: 76, title: '[Bugy] ' }),
  text: bugIconText({ text: "Bug" })
})
  • openDialog - открывает диалог внутри VK

Параметры:

id: Number - id пользователя или группы

openDialog({ id: -1 }) // отрицательное значение обозначают группу
  • bugCreateReport - перенаправит пользователя на страницу создания отчёта

Параметры:

id: Number - номер продукта в трекере

title: String - текст заголовка для отчёта

bugCreateReport({ id: 76, title: '[Bugy] Отчёт' })
  • openLink - открывает любую ссылку

Параметры:

String - ссылка

openLink('https://vk.com/')

Основные элементы

  • secondStyle - HTMLStyleElement, содержит в себе используемые стили. Созданный стиль добавляется в <head/>.
  • secondButtonPlace - HTMLDivElement, создающий площадку под кнопку.
  • secondButton - HTMLButtonElement, дополнительная кнопка.

Дополнительные элементы

  • bugIcon - SVGSVGElement, иконка жука.

  • bugIconPath - SVGPathElement, содержимое иконки жука.

  • bugIconText - функция, возвращающая HTMLDivElement с иконкой слева и текстом справа.

Параметры:

icon: any

text: any


Если в bugIconText надо поменять иконку и текст местами, то можно в icon передать текст, а в text саму иконку.

Занятые стили

Стили ниже нужны для отображения дополнительной кнопки. Данные стили указываются в <style/> в <head/>.

.bugySecondButtonPlace{}; /* Задаёт область для дополнительной кнопки */
.bugySecondButton{}; /* Стиль дополнительной кнопки */
.bugyBugIconText{}; /* Стиль для элемента bugIconText */