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

react-pe-utilities

v0.1.25

Published

Библиотека для [ProtopiaEcosystem React Client](https://protopiahome-public.gitlab.io/protopia-ecosystem/cra-template-pe/)

Downloads

45

Readme

ProtopiaEcosystem utilities

Библиотека для ProtopiaEcosystem React Client

Данный пакет автоматически устанавливается в Create-react-app приложение и предоставляет разработчикам сторонних модулей необходимый набор утилит.

Визуальные Компоненты

Loading

Простой компонент визуализации процесса загрузки. Вращающаяся "подковка"

import React from "react"
import { Loading } from "react-pe-utilities"

const App = props => {
    return <Loading />
} 
export default App

Переводчик

translitterate

Транслиттерация кириллического текста

import React from "react"
import { translitterate } from "react-pe-utilities"

const App = props => {
    const text = translitterate('ru').transform("строка").toLowerCase()
    return <> { text } </>
} 
export default App

__

Перевод строки (или идентификатора) из словаря, зарегистрированного командой initDictionary на текущий язык.

import React from "react"
import { __ } from "react-pe-utilities"

const App = props => {
    const text = __( "Loading" )
    return <> { text } </>
} 
export default App

sprintf

Подстановка подстрок в строку, указанную первым аргументом. Заменяет подстроки вида %s на слудующие за первым аргументы: первое вхождение подстроки %s заменяется на второй строковый аргумент, второе вхождение — на третий аргумент итд.

import React from "react"
import { __, sprintf } from "react-pe-utilities"

const App = props => {
    const url = "http://ux.protopia-home.ru/"
    const text = sprintf( __( "see url: %s" ), url)
    return <> { text } </>
} 
export default App

initDictionary

Инициализация словаря в формате json. Указываем в аргументах:

  1. идентификатор языка (стока в формате i18n)

  2. JSON (в формате i18n)

import React, { useEffect } from "react"
import { __, initDictionary } from "react-pe-utilities"

const App = props => {
    useEffect(() =>
    {
        initDictionary('ru', props.dictionary)
    }, [])
    return <> { __( "Title" ) } </>
} 
export default App

Структурные

importAll


getWidgets

Массив Компонентов Виджетов, доступных в данном Приложении

initWidgets

Регистрируем виджеты сторонних модулей

getWidget

Получаем Компонент Виждета по строке...

initArea

Монтируем в BABEL-код гнездо визуальных Виджетов из списка доступных в приложении гнёзд (предоставляются Модулями)

initDataArea

Монтируем в BABEL-код гнездо Виджетов Данных из списка доступных в приложении гнёзд (предоставляются Модулями)

widgetAreas

Список гнёзд Виджетов данного приложения

Утилиты текущего Пользователя

isLoggedPage

Возвращает булевое значение. Есть ли в Карте сайта страница входа Пользователя

userModel

Возвращает тип данных «Пользователь» приложения

userModelField

Возвращает список полей Типа данных «Пользователь» приложения

userModelKeys

Возвращает список названий (ключей) полей Типа данных «Пользователь» приложения

isCapability

Возвращает булевое значение. Доступно ли текущему Пользователю указанное право?

isRole

Возвращает булевое значение. Есть ли указанная Роль у текущего Пользователя?

Навигационные

scrollToElement

scrollToElementByJQuery