open-index/open-npm huggingface dataset:
npm package: @nrg-ui/core
Description: Design system for Ember.js built on top of Bootstrap
Author: Knoxville Utilities Board
Latest version: 0.58.3

# @nrg-ui/core

Opinionated UI addon based on how KUB scaffolds web applications

## Compatibility

- Ember.js v6.4 or above
- Embroider or ember-auto-import v2

## Installation

```sh
ember install @nrg-ui/core
```

## Usage

Ember NRG UI is an opinionated UI addon based on how KUB scaffolds web applications. The addon provides the skeleton of an Ember app so that a developer can immediately start solving a business problem. It includes an application shell with sidebar navigation and typical UI components to get you started.

## Embroider Configuration

The following values are available to be set via the `@nrg-ui/core` configuration object in your `ember-cli-build.js` file:

```ts
interface EmbroiderConfig {
  appVersion: string; // Intended to be used with @nrg-ui/version
}
```

## Contributing

See the [Contributing](../../CONTRIBUTING.md) guide for details.

## License

This project is licensed under the [MIT License](../../LICENSE).
npm package: @nrg-ui/css
Description: Bootstrap-based CSS framework
Author: Knoxville Utilities Board
Latest version: 0.28.4

<!-- markdownlint-disable-file MD033 -->

# @nrg-ui/css

This design system is built on top of [Bootstrap](https://getbootstrap.com/). Note that this is not a full-fledged design system, but rather a collection of raw CSS that can be used in any web application. The [Ember addon](../ember-core/) provides a more integrated experience for Ember applications.

## Installation

<details>
  <summary>npm</summary>
  
```sh
npm install @nrg-ui/css
```

</details>

<details>
  <summary>yarn</summary>
  
```sh
yarn add @nrg-ui/css
```

</details>

<details>
  <summary>pnpm</summary>
  
```sh
pnpm add @nrg-ui/css
```

</details>

## Usage

To use the CSS in a non-Ember application, include the CSS in your project. The CSS is available in the `dist` directory of the package. You can include the CSS in your project using a `<link>` tag in your HTML file.

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My App</title>
    <link rel="stylesheet" href="node_modules/@nrg-ui/css/dist/main.css" />
  </head>

  <body>
    <h1>Hello, world!</h1>
  </body>
</html>
```

## Disabling Default Body Styling

By default, the `body` tag includes styling to prevent a scrolling issue caused by native elements in mobile browsers.
If this creates undesirable behavior, add the custom data attribute of `data-nrg-ignore` to the `body` tag to clear the styling.

## Contributing

See the [Contributing](../../CONTRIBUTING.md) guide for details.

## License

This project is licensed under the [MIT License](../../LICENSE).
npm package: @nrg-ui/showcase
Description: Build documentation and samples in Ember.js
Author: Knoxville Utilities Board
Latest version: 0.11.1

# @nrg-ui/showcase

This Ember.js addon allows developers to quickly build interactive API documentation for their Ember.js addons. It provides a structured way to view components, helpers, and other functionalities, making it easier for users to understand how to use the addon effectively.

## Compatibility

- Ember.js v6.4 or above
- Embroider or ember-auto-import v2

## Installation

See the [Installation](../../README.md#installation) section of the main README for details.

## Usage

### TypeScript

This addon is written in TypeScript. If a consuming application is also using TypeScript, type hints will be provided.

## License

This project is licensed under the [MIT License](../../LICENSE).

<!-- Link references -->
npm package: @nrg-ui/theme-generator
Description: Theme generator for @nrg-ui/css
Author: Knoxville Utilities Board
Latest version: 0.3.5

# theme-generator

This package is used to generate a theme for the `@nrg-ui/css` package.

## Usage

### Setup

A `.nrg` folder is required in the root of your repository.
This folder can contain any number of `.scss` files that will be used to generate themes.
These sass files should contain variable declarations that will be used to override the default bootstrap variables.
Each sass file will be compiled into a css file with the same name and stored in `app/styles`.

### Generation

Run `npx @nrg-ui/theme-generator` to generate the theme(s).
npm package: @nrg-ui/version
Description: Get application version from different sources
Author: Knoxville Utilities Board
Latest version: 0.5.1

# @nrg-ui/version

A small Node package to synchronously fetch the current version of an application or library.

## Compatibility

- Node.js v14 or above

## Installation

```bash
npm install @nrg-ui/version
```

## Usage

Since this module is compiled as CommonJS, it can be used in both ESM and CommonJS environments.

```js
// CommonJS
const { getVersion } = require('@nrg-ui/version');

const version = getVersion();
console.log(version);
```

```js
// ESM
import { getVersion } from '@nrg-ui/version';

const version = getVersion();
console.log(version);
```

### Output

By default, the output of `getVersion()` is defined by this sequence:

1. The current git tag
   1. If a tag is found in the history with additional commits, it will append the shortest commit hash to the tag
2. The current git branch name
3. The current git commit hash

If a particular output is desired, the following functions are available:

```ts
declare module '@nrg-ui/version' {
  export function getVersion(): string;

  export function getTag(options?: TagOptions): TagInfo | null;
  export function getBranch(): string | null;
  export function getCommitHash(): string | null;
}
```

The arguments to those functions can be found at the top of the [source file](./src/index.ts).
npm package: @nrgyjs/ditox
Description: The library for reactive programming with MVC/MVVM patterns
Author: Mikhail Nasyrov
Latest version: 1.0.3

# Пакет @nrgyjs/ditox

## Назначение пакета

Пакет `@nrgyjs/ditox` интегрирует декларации контроллеров Nrgy.js с
DI-контейнером `ditox`.

## Общая информация

Пакет добавляет extensions, которые делают контейнер `ditox` доступным внутри
контроллеров и view-model. Также он предоставляет helper для адаптации
контроллеров с injections к конфигурации DI.

## Установка пакета

```bash
npm install @nrgyjs/core @nrgyjs/ditox ditox
```

```bash
yarn add @nrgyjs/core @nrgyjs/ditox ditox
```

```bash
pnpm add @nrgyjs/core @nrgyjs/ditox ditox
```

## Концептуальная архитектура

Пакет намеренно небольшой и целиком построен на extension-механизме из
`@nrgyjs/core`.

1. `withContainer()` добавляет активный `ditox`-контейнер в контекст
   контроллера.
2. `withInjections()` резолвит карту токенов из контейнера и публикует
   результат как `deps` в контексте контроллера.
3. `applyInjections()` адаптирует декларацию контроллера к функции, удобной
   для использования в DI-конфигурации.

## Документация по функционалу

- [applyInjections](./src/applyInjections.ru.md): адаптер из декларации
  контроллера в container-aware фабрику.
- [withContainer](./src/withContainer.ru.md): extension для передачи
  `ditox`-контейнера.
- [withInjections](./src/withInjections.ru.md): extension для резолва токенов в
  `deps`.

## Примеры использования

```ts
import { declareController } from '@nrgyjs/core';
import { withInjections } from '@nrgyjs/ditox';
import { token } from 'ditox';

const LOGGER = token<(message: string) => void>();

const LoggerController = declareController()
  .extend(withInjections({ log: LOGGER }))
  .apply(({ deps }) => ({
    write: (message: string) => deps.log(message),
  }));
```
npm package: @nrgyjs/ditox-react
Description: The library for reactive programming with MVC/MVVM patterns
Author: Mikhail Nasyrov
Latest version: 1.0.3

# Пакет @nrgyjs/ditox-react

## Назначение пакета

Пакет `@nrgyjs/ditox-react` связывает React-ориентированные контроллеры и
view-model Nrgy с контейнером зависимостей `ditox-react`.

## Общая информация

Пакет предоставляет React-компонент-расширение, который читает активный
контейнер из `ditox-react` и передает его в создание контроллеров Nrgy через
`@nrgyjs/react`.

## Установка пакета

```bash
npm install @nrgyjs/core @nrgyjs/ditox @nrgyjs/react @nrgyjs/ditox-react ditox ditox-react react
```

```bash
yarn add @nrgyjs/core @nrgyjs/ditox @nrgyjs/react @nrgyjs/ditox-react ditox ditox-react react
```

```bash
pnpm add @nrgyjs/core @nrgyjs/ditox @nrgyjs/react @nrgyjs/ditox-react ditox ditox-react react
```

## Концептуальная архитектура

Пакет намеренно сосредоточен вокруг одного компонента:

1. `useDependencyContainer()` читает активный DI-контейнер из React Context.
2. `provideDependencyContainer()` превращает контейнер в Nrgy
   extension-provider.
3. `NrgyControllerExtension` внедряет provider в поддерево, чтобы
   `useController()` мог создавать контроллеры и view-model с поддержкой DI.

## Документация по функционалу

- [DitoxNrgyExtension](./src/DitoxNrgyExtension.ru.md): React-мост между
  `ditox-react` и созданием контроллеров Nrgy.

## Примеры использования

```tsx
import React from 'react';
import { DitoxNrgyExtension } from '@nrgyjs/ditox-react';

export function App() {
  return (
    <DitoxNrgyExtension>
      <FeatureRoot />
    </DitoxNrgyExtension>
  );
}
```
npm package: @nrgyjs/rx-effects
Description: The library for reactive programming with MVC/MVVM patterns
Author: Mikhail Nasyrov
Latest version: 1.0.3

# Пакет @nrgyjs/rx-effects

## Назначение пакета

Интеграция Nrgy.js с библиотекой `rx-effects`.

## Общая информация

Пакет `@nrgyjs/rx-effects` предоставляет инструменты для взаимодействия между
атомами Nrgy и объектами `Query` из библиотеки `rx-effects`. Это позволяет
оборачивать атомы как запросы (`Query`) и наоборот, обеспечивая плавную
интеграцию между двумя реактивными системами.

## Установка пакета

```bash
npm install @nrgyjs/core @nrgyjs/rx-effects @nrgyjs/rxjs rx-effects rxjs
```

## Концептуальная архитектура

Пакет ориентирован на интерфейс `Query` из `rx-effects`, который состоит из
синхронного геттера (`get()`) и асинхронного потока изменений (`value$`).

1. **Атом в Query**: текущее значение атома доступно через `get()`, а его
   изменения передаются в `value$` с использованием интеграции `@nrgyjs/rxjs`.
2. **Query в Атом**: создается подписка на `value$` запроса, и последние
   значения или ошибки сохраняются во внутреннем атоме, который затем
   экспонируется как вычисляемый атом (`compute`).

## Документация по функционалу (Functional Documentation)

- [**toQuery(atom)**](./src/query.ru.md): Превращает Nrgy Atom в `rx-effects`
  Query.
- [**fromQuery(query)**](./src/query.ru.md): Превращает `rx-effects` Query в
  Nrgy Atom.

## Примеры использования (Usage Examples)

```typescript
import { atom } from '@nrgyjs/core';
import { toQuery, fromQuery } from '@nrgyjs/rx-effects';

// 1. Атом в Query
const count = atom(0);
const countQuery = toQuery(count);

console.log(countQuery.get()); // 0

// 2. Query в Атом
const anotherAtom = fromQuery(countQuery);
console.log(anotherAtom()); // 0
```
npm package: @nrgyjs/rxjs
Description: The library for reactive programming with MVC/MVVM patterns
Author: Mikhail Nasyrov
Latest version: 1.0.3

# Пакет @nrgyjs/rxjs

## Назначение пакета

Интеграция Nrgy.js с библиотекой RxJS для работы с реактивными потоками данных.

## Общая информация

Пакет `@nrgyjs/rxjs` предоставляет мост между атомами Nrgy и потоками (
Observables) RxJS. Это позволяет использовать мощные операторы RxJS для
обработки данных, хранящихся в атомах, и наоборот — транслировать данные из
внешних потоков в реактивные атомы.

## Установка пакета

```bash
npm install @nrgyjs/core @nrgyjs/rxjs rxjs
```

## Концептуальная архитектура

Архитектура пакета строится на двух встречных преобразованиях:

1. **Atom -> Observable**: Реакция на изменения атома порождает события в потоке
   RxJS.
2. **Observable -> Atom**: Подписка на поток RxJS обновляет значение атома.

## Документация по функционалу

### Преобразования

- [**observe(atom, options?)**](./src/observe.ru.md): Создает `Observable`,
  который выдает текущее
  значение атома и все последующие изменения.
- [**fromObservable(observable, initialValue?)**](./src/fromObservable.ru.md):
  Создает `Atom`, который
  подписывается на `observable` и обновляет свое значение.

## Примеры использования

```typescript
import { atom } from '@nrgyjs/core';
import { observe, fromObservable } from '@nrgyjs/rxjs';
import { filter, interval } from 'rxjs';

// 1. Атом в Observable с фильтрацией
const count = atom(0);
const evenCount$ = observe(count).pipe(filter(v => v % 2 === 0));

// 2. Observable в Атом
const time = fromObservable(interval(1000), 0);

count.set(1); // evenCount$ проигнорирует
count.set(2); // evenCount$ выдаст 2
```
npm package: @nrhacker/hardhat-log-remover
Description: Remove Hardhat console.log imports and calls from Solidity source files
Author: Nick Barry
Latest version: 2.0.2

# Hardhat Log Remover

Remove Hardhat `console.log` imports and calls from Solidity source code.

This plugin is intended in part to keep version-controlled code free of log statements.  To remove logs from compiled contracts while preserving them in source code, see [hardhat-preprocessor](https://github.com/wighawag/hardhat-preprocessor).

> Versions of this plugin prior to `2.0.0` were released as `buidler-log-remover`.

## Installation

```bash
yarn add --dev hardhat-log-remover
```

## Usage

Load plugin in Hardhat config:

```javascript
require('hardhat-log-remover');
```

Run the Hardhat task manually:

```bash
yarn run hardhat remove-logs
```

Before removing logs, the plugin will ensure that all contracts can be compiled successfully.

## Testing

Run the unit tests with Mocha:

```bash
yarn run mocha
```
npm package: @nrjwolf/color-log
Description: Colorize your logs
Author: nrjwolf
Latest version: 1.0.4

# Color Log

Helps you to colorize you logs

<img width="446" alt="Screenshot 2022-06-06 at 22 24 32" src="https://user-images.githubusercontent.com/10683971/172180636-e63ad174-3d81-4d60-924c-2ef060ed1a73.png">

## Installation and usage

In terminal/console type:

```
yarn add @nrjwolf/color-log
```

or

```
npm install @nrjwolf/color-log
```

Somewhere early in code use:

```typescript
import 'nrjwolf/color-log'
```

Finally in code:

```typescript
console.log('Hello World'.white())
console.log('Hello World'.yellow())
console.log('Hello World'.red())
console.log('Hello World'.green())
console.log('Hello World'.blue())
console.log('Hello World'.cyan())

console.log('Hello World'.redBg())
console.log('Hello World'.greenBg())
console.log('Hello World'.yellowBg())
console.log('Hello World'.blueBg())
console.log('Hello World'.purpleBg())
console.log('Hello World'.cyanBg())
```
npm package: @nrjwolf/introspect-it
Description: introspect-it coverts Postgres schemas into typescript types
Author: David Shekunts
Latest version: 1.2.31

# introspect-it

> Convert Postgres schemas into TypeScript types

# Usage

```bash
# to infer an entire schema
$ npx introspec-it postgresql://postgres@localhost:5433/db?currentSchema=public

# to infer a specific table
$ npx introspec-it postgresql://postgres@localhost:5433/db?currentSchema=public table_name

# to infer an entire schema with envs
$ DATABASE_URL=postgresql://postgres@localhost:5433/db?currentSchema=public npx introspec-it

# to infer a specific table with envs
$ DATABASE_URL=postgresql://postgres@localhost:5433/db?currentSchema=public TABLE_NAME=table_name npx introspec-it
```

tip: You can pipe the output of introspec-it into a file with `npx introspec-it <args> > schema.ts`

## Demo

For the following SQL schema:

```sql
CREATE TABLE account (
  username VARCHAR (50) UNIQUE NOT NULL,
  password VARCHAR (50) NOT NULL,
  email VARCHAR (355) UNIQUE NOT NULL,
  created_on TIMESTAMP NOT NULL,
  last_login TIMESTAMP
)
```

run:

```bash
$ npx introspec-it postgresql://postgres@localhost:5433/db?currentSchema=public
```

```typescript
export type Account = {
  username: string
  password: string
  email: string
  created_on: Date
  last_login: Date | null
}
```

## Using `introspec-it` programatically

```typescript
import { inferSchema, inferTable } from 'introspec-it'

await inferSchema(connectionString)
await inferTable(connectionString, tableName)
```

## Design

introspec-it is inpired by the awesome [schemats](https://github.com/SweetIQ/schemats) library.
But takes a simpler, more blunt, and configuration free approach:

- Simpler defaults
- Postgres support only
- Inline enums
- No support for namespaces

## License (MIT)

```
WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|
```

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
npm package: @nrjwolf/telegram-logger
Description: Log to telegram
Author: nrjwolf
Latest version: 1.0.5

# Telegramm Logger

Log your app using Telegramm. 

## Installation and usage

In terminal/console type:

```
yarn add @nrjwolf/telegram-logger
```

or

```
npm install @nrjwolf/telegram-logger
```

## Usage 

```typescript
import { TelegramLogger } from '@nrjwolf/telegram-logger'
const tgLogger = new TelegramLogger('bot:token', 'chat_id', 'log prefix text')
tgLogger.sendMessage('message text')
```
npm package: @nrk/core-css
Description: Core CSS layer for web services.
Author: NRK
Latest version: 1.14.6

# @nrk/core-css ![Release](https://img.shields.io/github/release/nrkno/core-css.svg)
> Base styling and utilities for all NRK projects.
> `@nrk/core-css` exposes a set of class names and mixins to ease creating backwards compatible layouts and standard NRK styling. The code is built on BEM-conventions and is namespaced `nrk-` to play nice with existing projects.

## Documentation
https://static.nrk.no/core-css/latest/

## Installation

### Using NPM

```sh
npm install @nrk/core-css
```

then import it into your stylesheet:

```css

@import '@nrk/core-css/core-css.css'                // css
@import '@nrk/core-css/core-css.scss'               // sass
@import '@nrk/core-css/core-css.less'               // less
@import 'node_modules/@nrk/core-css/core-css.styl'  // stylus
```

### Using static

Recommended only for prototyping.

```html
<link rel="stylesheet" href="https://static.nrk.no/core-css/major/1/core-css.min.css">
```

## Local development
First clone `@nrk/core-css` and install dependencies:

```bash
git clone git@github.com:nrkno/core-css.git
cd core-css
npm install
npm start # Your browser will open documentation with hot reloading
```

### Building and committing
After having applied changes, remember to build the CSS, SVG and fonts before pushing the changes upstream.

```bash
git checkout -b feature/my-changes
# update the source code
npm run build
git commit -am "Add my changes"
git push origin feature/my-changes
# then make PR to the master branch,
# and assign a CSS developer to review your code
```

> NOTE! Please also make sure to keep commits small, clean and that the commit message actually refers to the updated files. Formally, make sure the message is **Capitalized** and **starts with a verb**.
npm package: @nrk/core-design-tokens
Description: Core Design tokens - Design tokens for the NRK design program
Author: NRK
Latest version: 0.7.2

# Design tokens for NRK core-design

This repo serves as a single source of truth for NRKs design program.

> Design token: The single source of truth to name and store a design decision, distributed so teams can use it across design tools and coding languages. - [DTCG Glossary](https://www.designtokens.org/glossary)

## Docs

https://static.nrk.no/core-design/latest/

## Format

We follow the [Design Tokens Format Module](https://design-tokens.github.io/community-group/format/) provided by the [W3C Design Tokens Community Group](https://www.designtokens.org/)

## Static hosting

The latest design token files are also available through our static service

```
All tokens
https://static.nrk.no/core-design/latest/tokens/nrk.tokens.json
Color tokens
https://static.nrk.no/core-design/latest/tokens/color/nrk-color.tokens.json
Motion tokens
https://static.nrk.no/core-design/latest/tokens/motion/nrk-motion.tokens.json
```
npm package: @nrk/core-docs
Description: Core documentation
Author: NRK
Latest version: 4.0.5

# @nrk/core-docs

> `@nrk/core-docs` makes it easy to write documentation for your project in [markdown](https://github.com/markedjs/marked) and 
render it beautifully.

## Documentation

https://static.nrk.no/core-docs/latest/

## Getting started

core-docs can parse and render all markdown files you put in your repository. The only requirement is an `index.html` file which declares the menu as a `<ul>` and loads the core-docs script. Link to your markdown files using their relative path, prepended with `?`. Example:

```html
<!doctype html>
<head>
  <meta charset="utf-8">
</head>
<ul>
  <li><a href="?readme.md">Core Docs</a></li>
  <li><a href="?example/readme.md">Nested</a></li>
  <li><a href="?example/thing.md">More Docs</a></li>
  <li><br><a href="https://github.com/nrkno/core-docs">View on Github</a></li>
  <li><a href="https://github.com/nrkno/core-docs/releases">View changelog</a></li>
  <li><a href="#" download>Download example</a></li>
</ul>
<script src="https://static.nrk.no/core-docs/major/4/core-docs.min.js" charset="utf-8"></script>
```
## Local development
First clone `@nrk/core-docs` and install its dependencies:

```bash
git clone git@github.com:nrkno/core-docs.git
cd core-docs
npm install
npm start # Your browser will open documentation with hot reloading
```

## Building and committing
After having applied changes, remember to build before pushing the changes upstream.

```bash
git checkout -b feature/my-changes
# update the source code
npm run build
git commit -am "Add my changes"
git push origin feature/my-changes
# then make a PR to the master branch,
# and assign another developer to review your code
```

> NOTE! Please also make sure to keep commits small and clean (that the commit message actually refers to the updated files).  
> Stylistically, make sure the commit message is **Capitalized** and **starts with a verb in the present tense** (for example `Add minification support`).
npm package: @nrk/custom-element-to-react
Description: Convert custom element to React component
Author: NRK
Latest version: 1.1.1

# @nrk/custom-element-to-react 

> Converts a [custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) to a React component, with props and events.

## Installation

```
npm install @nrk/custom-element-to-react
```

## Usage

Given a custom element:

```js
// my-element.js
export default class MyElement extends HTMLElement { /* ... */ }
```

convert it to React component by passing in its class definition and a list of props and custom event names:
```js
import React from 'react'
import ReactDOM from 'react-dom'
import customElementToReact from '@nrk/custom-element-to-react'
import element from './my-element.js'

const MyElement = customElementToReact(element, {
  props: ['prop1', 'prop2'],            // Optional. Prop names to register in React
  customEvents: ['event1', 'event2'],   // Optional. Custom events names to register in React
  suffix: '123'                         // Optional. Adds a suffix to inner custom element tag name before registering. Use to control tag name of custom element. Default: 'react'
})

ReactDOM.render(<MyElement />, document.getElementById('div'))
```

## forwardRef

`forwardRef` provides access to the underlying CustomElement (DOM) itself instead of the React component.
```jsx
<MyElement
  ref={(comp) => console.log('MyElement React Component:', comp)}
  forwardRef={(node) => console.log('MyElement actual DOM Element:', node)}
/>
```

## Server side

If you're going to use this module to render a component in NodeJS, you should
 mock `HTMLElement` globally in order to make `MyElement extends HTMLElement` valid:

```js
if (typeof window !== 'undefined' && !global.HTMLElement) {
  global.HTMLElement = class {}
}
```

## Local development
First clone `@nrk/custom-element-to-react` and install its dependencies:

```bash
git clone git@github.com:nrkno/custom-element-to-react.git
cd custom-element-to-react
npm install # Installs dependencies for all packages
npm start # Your browser will open documentation with hot reloading
```

## Building and committing
After having applied changes, remember to build before pushing the changes upstream.

```bash
git checkout -b feature/my-changes
# update the source code
npm run build # Builds all the packages
git commit -am "Add my changes"
git push origin feature/my-changes
# then make a PR to the master branch,
# and assign another developer to review your code
```
npm package: @nrk/expect-openapi
Description: Expect objects to match OpenAPI documents
Author: NRK
Latest version: 2.6.0

# expect-openapi [![npm](https://img.shields.io/npm/v/@nrk/expect-openapi.svg)](https://www.npmjs.com/package/@nrk/expect-openapi)

> Expect objects to match OpenAPI documents

## Setup

```sh
yarn add -D @nrk/expect-openapi
# or
npm add --dev @nrk/expect-openapi
```

`jest.setup.ts`:

```ts
import { toMatchApiResponse, toMatchRef$ } from "@nrk/expect-openapi";
import expect from "expect";
expect.extend({ toMatchApiResponse, toMatchRef$ });
```

update the jest config:

```json
setupFiles: ["<rootDir>/jest.setup.ts"],
```

## Expect response to match OpenAPI path

```ts
import superagent from "superagent";
import openapi from "./openapi.json"; // OpenAPI 3 schema

describe("my api", () => {
  it("should have valid /fantastic response, according to spec", async () => {
    const url = `http://paspi.nrk.no/some/fantastic/path`;
    const response = await superagent.get(url).accept("application/json");
    // Asserts that:
    // - mime-type matches
    // - response code exists (or default)
    // - the schema matches the response body (assumes it is JSON)
    await expect(response).toMatchApiResponse(openapi, "get", "/fantastic");
  });
});
```

## Expect object to match a part of a OpenAPI document

```ts
import openapi from "./openapi.json"; // OpenAPI 3 schema

describe("my complex api", () => {
  it("should match SimpleLink", async () => {
    const myLink = { href: "/my/fantastic/link" };
    // Asserts that:
    // - the reference can be resolved
    // - the resolved schema matches expected value
    await expect(myLink).toMatchRef$(
      openapi,
      "#/components/schemas/SimpleLink"
    );
  });
});
```
npm package: @nrk/nrkno-sanity-react-utils
Description: Various React related utility functions and libs used by nrkno-sanity.
Latest version: 1.1.1

# @nrk/nrkno-sanity-react-utils

Various React related utility functions and libs used by nrkno-sanity.

# Installation

`npm install --save @nrk/nrkno-sanity-react-utils`

# Usage

## useSetRefs

Callback that sets all provided refs. Useful when you need multiple reference handles to the same component.

For instance, a ref for your local state and for forwarded Sanity ref in custom input component.

```tsx
function SomeComponent(props: any, forwardRef: ForwardedRef<HTMLDivElement>) {
  const ref = useRef<HTMLDivElement | null>(null)
  const setRefs = useSetRefs(ref, forwardRef);
  return <div ref={setRefs} />;
}
```

## useResizeObserver

Get a callback whenever an observed element changes size.

```tsx
function SomeComponent() {
 //useState and NOT useRef
  const [ref, setRef] = useState<HTMLDivElement | null>(null);

  const onResize= useCallback((domRect: DOMRect) => {
      // invoked whenever the div is resized
    }, [])
    
  useResizeObserver(onResize, ref);
  return <div ref={setRef} />;
}
```

## useDebouncedEffect

Takes an effect callback and dependency array (same arguments as React.useEffect),
and a debounce delay.

When dependencies change (including component mount, ala useEffect),
the effect will be invoked after <delay> milliseconds.

The effect is debounced:
Delay restarts whenever dependencies change, and only the last
change to dependencies will be used.

```ts
function SomeComponent({prop}: {prop: string}) {
    useDebouncedEffect(() => {
        // delays invoking this func until after 500 milliseconds have elapsed 
        // since the last time dependencies changed
    }, [prop], 500)
    return null;
}
```
npm package: @nrk/valg-valgomat-algoritme
Description: The algorithm used to calculate distance between sets of positions for NRKs Valgomat
Author: NRK
Latest version: 5.0.0

# Valgomat algorithm

> Calculate the proximity of two sets of positions.

Calculates the proximity of two sets of positions. Mostly used to calculate the proximity of various party positions and a voter position.

## Usage

The simple case is comparing to sets of positions.

```js
import { proximity } from '@nrk/valg-valgomat-algoritme'

let partyPositions = {
  id1: 1,
  id2: -1
}

let voterPositions = {
  id1: -2,
  id2: 2
}

let p = proximity(partyPositions, voterPositions)
// => 0.25
```

The module also comes with a function to compare many positions to one position.

```js
import { proximityMap } from '@nrk/valg-valgomat-algoritme'

let partyAPositions = {
  id1: 1,
  id2: -1
}

let partyBPositions = {
  id1: 2,
  id2: -2
}

let partyPostitions = {
  partyA: partyAPositions,
  partyB: partyBPositions
}

let voterPositions = {
  id1: null,
  id2: -2
}

let proximities = proximityMap(voterPositions, partyPositions)
// => { "partyA": 0.75, "partyB": 1.0 }
```

## API

```js
import { proximity, proximityMap } from '@nrk/valg-valgomat-algoritme'
```

### let d = proximity(positionsA, positionsB);

Accepts two sets of positions and returns the proximity between them.

Positions are given in the form of sets:

```ts
{
  [statement: string]: -2 | -1 | 1 | -2 | null
}
```

Output will be a number in the interval `[0.0, 1.0]` where `0.0` is the furthest away and `1.0` is the closest possible proximity (iow. identical).

If we are unable to determine a proximity, the output will be `null`. This happens if we are comparing a pair of vectors where one of the vectors are empty or there are no overlapping statements.

### let proximities = proximityMap(positionsA, positionsMap);

Accepts a set of positions and a map of many sets of positions and returns a map of the proximities between a position in the position map and the first position.

This is useful if you want to calculate the proximity of one set of positions and many sets of positions. For instance between all parties and a single voter.

Output will be a map from the keys in the positionsMap and the proximity to the given position.

## Installation

```sh
npm install @nrk/valg-valgomat-algoritme
```

## Glossary

- Position = Standpunkt
- Statement = Påstand
- Party = Parti
- Voter = Velger
npm package: @nrkn/act
Description: Read and write Adobe Color Table files
Author: Nik Coughlin
Latest version: 0.1.1

# act

Read and write Adobe Color Table files

`npm install @nrkn/act`

```js
const { fromAct, toAct } = require( '@nrkn/act' )
```

```js
import { fromAct, toAct } from '@nrkn/act'
```

## fromAct

Reads an Adobe Color Table .ACT file from an ArrayLike<number> 
(eg `Buffer`, `Uint8Array`, `[1,2,3]`, etc ) and returns a Palette object

```ts
type Palette = {
  palette: [ number, number, number ][]
  transparent?: number
}
```

With no transparency:

```js
const act = readFileSync( 'palette.act' )

const pal = fromAct( act )

// { palette: [ [ 0, 0, 0 ], [ 255, 255, 255 ] ] } 
console.log( pal )
```

With transparency:

```js
const act = readFileSync( 'palette-with-transparency.act' )

const pal = fromAct( act )

// { palette: [ [ 0, 0, 0 ], [ 255, 255, 255 ] ], transparent: 1 } 
console.log( pal )
```

## toAct

Takes a Palette (see above) and returns an Adobe Color Table .ACT file encoded as a Uint8ClampedArray

With no transparency:

```js
const pal = { palette: [ [ 0, 0, 0 ], [ 255, 255, 255 ] ] }

const act = toAct( pal )

writeFileSync( 'palette.act', act )
```

With transparency:

```js
const pal = { 
  palette: [ [ 0, 0, 0 ], [ 255, 255, 255 ] ],
  transparent: 1
}

const act = toAct( pal )

writeFileSync( 'palette-with-transparency.act', act )
```

## license

MIT License

Copyright (c) 2022 Nik Coughlin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @nrkn/create-bitmap-font
Description: Create a bitmap sprite font
Author: Nik Coughlin
Latest version: 0.1.2

# create-bitmap-font
 
Create a bitmap sprite font in node

`npm install @nrkn/create-bitmap-font`

In the example we create a bitmap font and then use it to draw some text:

```js
import { promises } from 'fs'
import { createBitmapFont, drawText } from '@nrkn/create-bitmap-font'

const { readFile, writeFile } = promises

// colors - 4 bytes in rgba order
const fill = [0xff, 0xc2, 0x0e, 0xff]
const bg = [ 0, 0, 0, 0 ]

const start = async () => {
  // let's just use the printable chars from 7-bit ascii
  // eg [ 33, 34, ...etc ]
  const codes = createSeq(95, i => i + 33)

  // otf or ttf buffer
  const font = await readFile('some-font.otf')

  const bitmapFont = createBitmapFont(font, 32, { fill, bg, codes })

  const { offsets, pngBuffer } = bitmapFont

  // save the bitmap font and the text metrics
  await writeFile( 'some-font.png', pngBuffer )
  await writeFile( 'some-font.json', JSON.stringify( offsets, null, 2 ), 'utf8' )

  // create text drawing function
  const draw = drawText( bitmapFont.canvas, bitmapFont.offsets )

  // first we will create a round trip and see if it matches the font bitmap

  const text = codes.map( c => String.fromCharCode( c ) ).join( '' )

  // returns a canvas
  const roundTrip = draw( text )

  // turn it into a PNG
  const roundPng = roundTrip.toBuffer('image/png')

  // should be the same as the pngBuffer created by createBitmapFont
  await writeFile( 'test-round.png', roundPng )

  // now write some arbitrary text

  const testText = 'Hello, world'

  const testDraw = draw( testText )

  const testPng = testDraw.toBuffer( 'image/png' )

  await writeFile( 'test-out.png', testPng )
}

const createSeq = (length, cb) =>
  Array.from({ length }, (_v, k) => cb(k))

start().catch(console.error)
```

## todo

Should be able to use in browser too, especially as we are using a canvas
compatible module in node - add a factory function that takes deps like canvas
etc and returns a create bitmap font function

## license

MIT License

Copyright (c) 2022 Nik Coughlin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @nrkn/server-app
Description: Express, passport, db etc for web apps
Latest version: 0.1.0

# server-app

Express, passport, db etc for web apps

## license

MIT License

Copyright (c) 2021 Nik Coughlin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @nrkn/wad
Description: Work with the Doom WAD format
Author: Nik Coughlin
Latest version: 0.0.2

# wad

Work with the Doom WAD format

`npm install @nrkn/wad`

```javascript
const { readFileSync, writeFileSync } = require( 'fs' )
const {
  readWad, writeWad, readLumpData, createObjectModel
} = require( '@nrkn/wad' )

// read a wad
const wad = readWad( readFileSync( 'example.wad' ) )

// write a wad
const newLump = {
  name: 'NEWLUMP',
  data: new Uint8Array( [ 1, 2, 3 ] )
}

wad.lumps.push( newLump )

writeFileSync( 'new.wad', writeWad( wad ) )

// read lump data
const playpalLump = wad.lumps.find( lump => lump.name === 'PLAYPAL' )

const palettes = readLumpData( playpalLump, 'PLAYPAL' )

// create an object model
const doomObjectModel = createObjectModel( wad )

const { levels } = doomObjectModel

const e1m1 = levels.find( level => level.name === 'E1M1' )

e1m1.vertexes.forEach( v => console.log( v.x, v.y ) )

// etc.
```

## todo

- `writeLumpData`
- `createWad( doomObjectModel )`

## license

MIT License

Copyright (c) 2019 Nik Coughlin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
npm package: @nrksolusi/core
Description: Navya Raksha Karya Core Library
Author: navya raksha karya
Latest version: 1.4.3

# @nrksolusi/core

## Overview

`@nrksolusi/core` is a core library for all of [@navyarakshakarya](https://github.com/navyarakshakarya) project, providing essential utilities for environment configuration and logging. This library aims to simplify the management of environment variables and enhance logging capabilities across the application.

## Features

- Load environment variables from a `.env` file.
- Get environment variable values as strings, integers, or booleans.
- Integration with `winston` for advanced logging capabilities.

## Installation

To install the library, run the following command:

```bash
npm add @nrksolusi/core
npm package: @nrl-demo/koa-jsonrpc
Description: Spec compliant JSON-RPC 2.0 server middleware for Koa
Latest version: 1.1.7


@nrl-demo/koa-jsonrpc
====================

*Build status: [![CircleCI](https://circleci.com/gh/steemit/koa-jsonrpc.svg?style=svg)](https://circleci.com/gh/steemit/koa-jsonrpc)*

Spec compliant JSON RPC Server middleware for Koa


```javascript
const Koa = require('koa')
const {JsonRpc} = require('@nrl-demo/koa-jsonrpc')

const rpc = new JsonRpc()
rpc.register('my_method', async (foo, bar) => {
    return foo + bar
})

const app = new Koa()
app.use(rpc.middleware)
app.listen(8080)

```

```
$ curl -X POST -d '{"id":1,"jsonrpc":"2.0","method":"my_method","params":["honkey","tonk"]}' localhost:8080
{"jsonrpc":"2.0","id":1,"result":"honkeytonk"}
```
npm package: @nrl-demo/rpcit
Description: Knowledgr JSON-RPC 2.0 Client
Author: Johan Nordberg
Latest version: 1.0.3


rpcit
=====

Command-line [Steem-flavoured](https://github.com/steemit/rpc-auth) [JSON-RPC 2.0](http://www.jsonrpc.org/specification) Client.


Install
-------

With [node.js](https://nodejs.org) installed do:

```bash
$ npm install -g rpcit
```

Or with [yarn](https://yarnpkg.com):

```bash
$ yarn global add rpcit
```


Usage
-----

```

  Usage: rpcit [options] <method> [params...]


  Options:

    -a, --address [url]  address to the RPC server (default: https://api.steemit.com)
    --dev                set address to https://api.steemitdev.com
    --stage              set address to https://api.steemitstage.com
    -s, --sign           sign the request using credentials from env vars RPCIT_ACCOUNT and RPCIT_KEY
    -r, --raw            write the raw JSON-RPC 2.0 response to stdout
    -v, --verbose        print debug info to stderr
    -h, --help           output usage information


  Params:

    Params can be passed as positional or by keyword
      param1 param2 param3 OR bar=param2 foo=param1

    You can pass JSON by prefixing the param with a colon (:)
      :'{"foo": "bar"}' OR key:='{"foo": "bar"}'

    Params can be read from stdin by passing a dash (-)
      $ echo '["foo", "bar"]' | rpcit some_method -

    Pass an underscore (_) for newline separated JSON, one line per param
      $ echo '{"foo": "bar"}\nfalse' | rpcit baz _


  Examples:

    Get latest global props
      $ rpcit get_dynamic_global_properties

    Get account info
      $ rpcit get_accounts :'["almost-digital"]'

    Get the account details for the first 100 accounts starting with foo
      $ rpcit lookup_accounts foo 100 | rpcit get_accounts _

    Get the witness-decided chain properties from gtg's node
      $ rpcit -a https://gtg.steem.house:8090 get_chain_properties

    Get user data from conveyor
      $ RPCIT_ACCOUNT=admin RPCIT_KEY=5POSTINGWIF rpcit -s conveyor.get_user_data user

```


---

*Share and Enjoy!*