open-index/open-npm huggingface dataset:
npm package: @publicodes/forms
Description: Utilities to convert publicodes rules in interactive forms
Latest version: 0.6.1

This library exports utilities to create interactive forms and simulators from publicodes rules.

This library is framework-agnostic and can be used with any state management system:

- React useState
- Redux
- Svelte stores
- Vue reactive system
- etc.

## Usage

```typescript
// Create a form builder
const engine = new Engine(rules)
const formBuilder = new FormBuilder({ engine })

// Initialize form state
let state = FormBuilder.newState()
state = formBuilder.start(state, 'target . rule')

// Get current page UI elements
const formElements = formBuilder.currentPage(state)

// Handle user input
state = formBuilder.handleInputChange(state, 'rule . name', 'new value')

// Navigate pages
state = formBuilder.goToNextPage(state)
state = formBuilder.goToPreviousPage(state)

// Get pagination information
const { current, pageCount, hasNextPage, hasPreviousPage } =
    formBuilder.pagination(state)
```

## Getting started

```sh
npm install publicodes publicodes-form
```

Then follow the [guide](https://publi.codes/docs/tutoriel#documentation-interactive) to create a simple page.
npm package: @publicodes/react-ui
Description: UI to explore publicodes computations
Latest version: 1.10.0

This package exports React components to display a publicodes explanation page
and rule links. It requires the `publicodes` core package to be installed.

## Getting started

```sh
npm install publicodes publicodes-react
```

Then follow the [tutorial](https://publi.codes/docs/tutoriel#documentation-interactive) to create a simple page.

You can also jump to a specific guide for your framework:

- [Next.js](https://publi.codes/docs/guides/nextjs)
- [Svelte](https://publi.codes/docs/guides/nextjs)
- [Other example (on Github)](https://github.com/publicodes/publicodes/tree/master/examples)
npm package: @publicodes/rest-api
Description: Publicodes API
Latest version: 1.5.3

This package allows you to create a REST API, which follows OpenAPI 3.0 specifications, from your Publicodes rules.

It consists of [Koa](https://github.com/koajs/koa) middleware that adds routes to your router:

- `POST` `/evaluate` Evaluate one or more expressions with a given situation
- `GET` `/rules` Returns the list of all your rules
- `GET` `/rules/{rule}` Returns a specific rule

## Getting started

```bash
npm install @publicodes/api
```

```ts
import Router from '@koa/router'
import Koa from 'koa'
import Engine from 'publicodes'
import { koaMiddleware as publicodesAPI } from '@publicodes/api'

const app = new Koa()
const router = new Router()

// Create middleware with your Engine
const apiRoutes = publicodesAPI(new Engine('coucou: 0'))

// Basic routes usage (/evaluate, /rules, etc.)
router.use(apiRoutes)

// Or use with specific route prefix (/v1/evaluate, /v1/rules, etc.)
router.use('/v1', apiRoutes)

app.use(router.routes()).listen(3000)

// ...
```

- A complete example file is in the sources if needed : [example.ts](https://github.com/publicodes/publicodes/blob/master/packages/rest-api/example.ts).
- This package is used in production by **[mon-entreprise API](https://mon-entreprise.urssaf.fr/d%C3%A9veloppeur/api)**
npm package: @publicodes/tools
Description: A CLI tool for Publicodes
Author: Emile Rolley
Latest version: 1.8.1

CLI tools and utilities for Publicodes.

## Installation

```sh
npm install @publicodes/tools
```

## Features

- **Compilation**: Convert .publicodes files into JSON models and TypeScript types
- **Rule Imports**: Import rules from NPM packages using the `importer!` syntax
- **Optimization**: Optimize models using constant folding
- **Migration**: Tools for migrating between Publicodes versions
- **CLI**: Command-line interface for easy project setup, compilation and development

## Usage

**Create a new Publicodes project**

```
$ npx @publicodes/tools init
```

**Compile it**

```
$ npm run publicodes compile
```

**Create a dev server for rule documentation**

```
$ npm run publicodes dev
```

## Documentation

For full documentation, visit [publi.codes/docs/api/tools](https://publi.codes/docs/api/tools)
npm package: @publicspace/serial
Description: Serialize HTML and JSON data with Cheerio
Author: Sam Larsen
Latest version: 0.1.0

<a href="https://github.com/apublicspace/serial"><img src="https://cheerio.js.org/img/orange-c.svg" width="60" alt="Cheerio"></a>

###

# Serialize HTML and JSON data

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/apublicspace/serial/blob/master/LICENSE.md)

### Cheerio extension for HTML and JSON data serialization

## Installation and Import

Install @publicspace/serial with npm:

```sh
npm install @publicspace/serial
```

Import serial:

```js
import serial from "@publicspace/serial";
```

## Serialize HTML and JSON Data

htmlToJson usage:

```js
const json = Serial.htmlToJson(`
	<h1>
		Hello, World!
	</h1>
`);
```

jsonToHtml usage:

```js
const html = Serial.jsonToHtml([
	{
		tag: "h1",
		children: [
			{
				type: "text",
				content: "Hello, World!"
			}
		]
	}
]);
```

## Example Usage

Import the module:

```js
import Serial from "@publicspace/serial";
```

### HTML to JSON

Convert HTML to JSON:

```js
const html = `
	<div class="container">
		<h1>Hello, World!</h1>
		<p>This is a paragraph.</p>
	</div>
`;
const json = Serial.htmlToJson(html);
console.log(json);
```

Convert entire HTML document to JSON:

```js
const html = `
	<html data-theme="theme">
		<head>
			<meta charset="UTF-8">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<title>Document</title>
		</head>
		<body id="top" class="hero-container animation">
			<main>
				<h1>Hello, World!</h1>
				<p>This is a paragraph.</p>
			</main>
		</body>
	</html>
`;
const json = Serial.htmlToJson(html, true);
console.log(json);
```

### JSON to HTML

Convert JSON to HTML:

```js
const json = [
	{
		tag: "html",
		attributes: {
			"data-theme": "theme"
		},
		children: [
			{
				tag: "head",
				children: [
					{
						tag: "meta",
						attributes: {
							charset: "UTF-8"
						}
					},
					{
						tag: "meta",
						attributes: {
							name: "viewport",
							content: "width=device-width, initial-scale=1.0"
						}
					},
					{
						tag: "title",
						children: [
							{
								type: "text",
								content: "Document"
							}
						]
					}
				]
			},
			{
				tag: "body",
				attributes: {
					id: "top",
					class: "hero-container animation"
				},
				children: [
					{
						tag: "main",
						children: [
							{
								tag: "h1",
								children: [
									{
										type: "text",
										content: "Hello, World!"
									}
								]
							},
							{
								tag: "p",
								children: [
									{
										type: "text",
										content: "This is a paragraph."
									}
								]
							}
						]
					}
				]
			}
		]
	}
];
const html = Serial.jsonToHtml(json);
console.log(html);
```
npm package: @publicsquare/elements-js
Description: PublicSquare JavaScript Elements
Latest version: 1.9.10

# PublicSquare JavaScript Elements

[![Version](https://img.shields.io/npm/v/@publicsquare/publicsquare-js.svg)](https://www.npmjs.org/package/@publicsquare/publicsquare-js)
[![Downloads](https://img.shields.io/npm/dm/@publicsquare/publicsquare-js.svg)](https://www.npmjs.org/package/@publicsquare/publicsquare-js)

The [PublicSquare](https://publicsquare.com/) JavaScript Elements SDK

## Installation

Using [Node Package Manager](https://docs.npmjs.com/)

```sh
npm install --save @publicsquare/publicsquare-js
```

Using [Yarn](https://classic.yarnpkg.com/en/docs/)

```sh
yarn add @publicsquare/publicsquare-js
```

## Documentation

For a complete list of options and examples, please refer to our [JavaScript Elements SDK docs](https://developers.publicsquare.com/sdks/web/javascript/)

## Usage

### Initialization

```javascript
import { PublicSquare } from '@publicsquare/publicsquare-js';

const psq = await new PublicSquare().init('<API Key>'); // replace with your Publishable API key
```
npm package: @publicsquare/elements-react
Description: PublicSquare React Elements
Latest version: 1.9.10

# PublicSquare React Elements

[![Version](https://img.shields.io/npm/v/@publicsquare/elements-react.svg)](https://www.npmjs.org/package/@publicsquare/elements-react)
[![Downloads](https://img.shields.io/npm/dm/@publicsquare/elements-react.svg)](https://www.npmjs.org/package/@publicsquare/elements-react)

A thin React wrapper for [PublicSquare](https://publicsquare.com/) JavaScript Elements SDK.

## Installation

Using [Node Package Manager](https://docs.npmjs.com/)

```sh
npm install --save @publicsquare/elements-react
```

Using [Yarn](https://classic.yarnpkg.com/en/docs/)

```sh
yarn add @publicsquare/elements-react
```

## Documentation

For a complete list of options and examples, please refer to our [React Elements SDK docs](https://developers.publicsquare.com/sdks/web/react/)

## Usage

### Initialization

Initializing the SDK is done via calling the `usePublicSquare` hook with parameters:

```jsx
import {
  PublicSquareProvider,
  CardElement,
  usePublicSquare,
} from '@publicsquare/publicsquare-react';

const App = () => {
  return (
    <PublicSquareProvider apiKey={apiKey}> // Publishable API Key
      <MyComponent />
    </PublicSquareProvider>
  );
};

const MyComponent = () => {
  const { publicSquare } = usePublicSquare();

  return <CardElement id="cardInput" />;
};
```
npm package: @publidata/utils-custom-element
Description: Polifill to allow using HTML custom elements in Safari
Author: Publidata
Latest version: 1.0.0

# <div align='center'><img width='80px' src="https://medias.publidata.io/production/images/images/000/044/056/original/logo.png?1577195330" ><p align="center">utils-custom-element</p></div>


This Polyfill is based on the [@ungap/custom-elements](https://github.com/ungap/custom-elements) package. However this version will only trigger the patch if we're using a Safari browser on an IOS device.


## 🛠️ Install Dependencies
Using yarn :
```bash
yarn add @publidata/utils-custom-element
````
or using NPM :
```bash
npm install @publidata/utils-custom-element
```

## 🧑🏻‍💻 Usage
Make sure you import before using any custom web components
```js
import "@publidata/utils-custom-element/dist";
```
npm package: @publidata/utils-fontawesome
Description: Collection of methods to handle opening hours
Author: Publidata
Latest version: 1.2.5-alpha.2

# @publidata/utils-fontawesome

## Description:
Provides utilities to work with fontawesome icons and retrieve them as SVG.

## Installation:

```bash
npm install @publidata/utils-fontawesome

# or

yarn add @publidata/utils-fontawesome
```
## Usage:

Retrieve a FA icon as SVG (native of from a kit) :

```js
import { FontAwesomeUtils } from "@publidata/utils-fontawesome";

const icons = [
  "fas fa-home", // Native icon are retrieved from fontawesome npm package
  "far fa-home", // Regular icon are retrieved from fontawesome npm package
  "fa-home", // No prefix will not work
  "fak fa-[name]", // Custom icon are retrieved from fontawesome api
];

// Only if you use icons from a fontawesome kit
FontAwesomeUtils.setToken("YOUR_TOKEN");
FontAwesomeUtils.setKit("KIT_ID");

// To get a single icon
FontAwesomeUtils.toSvg("fas fa-ambulance").then(svg => {
  console.log(svg);
});

// To get multiple icons
FontAwesomeUtils.toSvgs(icons).then(svgs => {
  console.log(svgs);
});
```

The `FontAwesomeApi` class allows to communicate with the fontawesome api.

```js
import { FontAwesomeApi } from "@publidata/utils-fontawesome";

const fontAwesomeApi = new FontAwesomeApi("YOUR_TOKEN"); // Mandatory to pass the token in the constructor

// Get all kits related to the account
fontAwesomeApi.kits().then(kits => {
  console.log(kits);
});
/* LOGS :
--------
  {
    me {
      kits [
        {
          id,
          name,
          token,
          version,
          licenseSelected,
          technologySelected
        },
        ...
      ]
    }
  }
*/

// Get one kit with all details
fontAwesomeApi.getKit("KIT_ID").then(kit => {
  console.log(kit);
});
/* LOGS :
--------
  {
    me: {
      kit: {
        name,
        token,
        version,
        licenseSelected,
        technologySelected,
        iconUploads:[
          {
            name,
            path,
            width,
            height,
            version,
            unicode
          },
          ...
        ]
      }
    }
*/

// Get all icons related uploded to the kit
fontAwesomeApi.kitIcons("KIT_ID").then(icons => {
  console.log(icons);
});
/* LOGS :
--------
  [
    {
      name,
      path,
      width,
      height,
      version,
      unicode
    }
  ]
*/
```

Use `isValidFa` to check if a string is a valid fontawesome icon.

```js
import { isValidFa } from "@publidata/utils-fontawesome";

isValidFa("fas fa-home"); // true
isValidFa("far fa-home"); // true
isValidFa("fa-home"); // false
isValidFa("fak fa-[name]"); // true
```
See the test file for more examples : ./tests/4_validators.test.js

Use `isFaKit` to check if a string is a valid fontawesome kit.

```js
import { isFaKit } from "@publidata/utils-fontawesome";

isFaKit("fas fa-home"); // false
isFaKit("far fa-home"); // false
isFaKit("fa-home"); // false
isFaKit("fak fa-[name]"); // true
```
See the test file for more examples : ./tests/4_validators.test.js
npm package: @publigo/pdfme-common
Description: TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
Author: hand-dot
Latest version: 0.0.2

## @pdfme/common

This library provides shared types, constants, and utility functions used across the [@pdfme/ui](https://www.npmjs.com/package/@pdfme/ui) and [@pdfme/generator](https://www.npmjs.com/package/@pdfme/generator) packages. The shared types include definitions for templates and other commonly used structures.

For the complete documentation of pdfme, please refer to [this link](https://pdfme.com/docs/getting-started).
npm package: @publigo/pdfme-generator
Description: TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
Author: hand-dot
Latest version: 0.0.0

## @pdfme/generator

This library provides the `generate` function for creating PDF files using templates and inputs.

For the complete documentation of pdfme, please refer to [this link](https://pdfme.com/docs/getting-started).
npm package: @publigo/pdfme-schemas
Description: TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
Author: hand-dot
Latest version: 0.0.8

## @pdfme/schemas

This library provides schemas for pdfme templates.  
The currently supported schemas can be found in [this document](https://pdfme.com/docs/supported-features).

These schemas are used as plugins in [@pdfme/ui](https://www.npmjs.com/package/@pdfme/ui) and [@pdfme/generator](https://www.npmjs.com/package/@pdfme/generator), where they are interpreted by UI components and the PDF generator.

For the complete documentation of pdfme, please refer to [this link](https://pdfme.com/docs/getting-started).
npm package: @publigo/pdfme-ui
Description: TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
Author: hand-dot
Latest version: 0.0.6

## @pdfme/ui

This library provides the following classes, which can be integrated into applications built with any framework:

- `Designer`: A WYSIWYG editor for designing templates.
- `Form`: A form based on templates for collecting input data.
- `Viewer`: A viewer for displaying PDF files generated with [@pdfme/generator](https://www.npmjs.com/package/@pdfme/generator) using templates and input data.

For the complete documentation of pdfme, please refer to [this link](https://pdfme.com/docs/getting-started).
npm package: @publikit/navigationrail
Description: Desktop vertical navigation rail component with scroll management, customization, drag-and-drop reordering, and overflow handling
Author: Pirimera
Latest version: 0.1.0

# @publikit/navigationrail

Desktop vertical navigation rail component with scroll management, drag-and-drop customization, and overflow handling.

## Features

- **Fully Customizable** - Config-based architecture with optional adapters
- **Scroll Management** - Automatic scroll position persistence
- **Pinned Items** - Pin favorite items to always show
- **Drag & Drop** - Reorder items via drag and drop (using @dnd-kit)
- **Overflow Handling** - "More Items" popover for overflow
- **Accessible** - ARIA roles and labels on rail and nav
- **Type-Safe** - Full TypeScript support
- **Lightweight** - Uses `@publikit/base` for shared components

## Installation

```bash
npm install @publikit/navigationrail
```

### Peer Dependencies

```bash
npm install react react-dom lucide-react tailwindcss @publikit/base
npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities
```

The customization popover uses `@dnd-kit` for drag-and-drop reordering; install these peers in your app.

## Quick Start

```tsx
import { NavigationRail } from '@publikit/navigationrail';

const config = {
  items: navigationItems,
  visibleItems: visibleItems,
  pinnedItems: pinnedItems,
  allItemsForCustomization: allItems,
  onReorder: handleReorder,
  onToggleVisibility: handleToggleVisibility,
  onTogglePinned: handleTogglePinned,
  onReset: handleReset,
  getItemBadge: (item) => item.badge,
};

<NavigationRail config={config} />
```

## With Routing Adapter

```tsx
import { NavLink, useMatch } from 'react-router-dom';

<NavigationRail
  config={config}
  adapters={{ routing: { Link: NavLink, useMatch } }}
/>
```

## With i18n Labels

```tsx
import { useTranslation } from 'react-i18next';

function MyNavigationRail() {
  const { t } = useTranslation('navigation');

  return (
    <NavigationRail
      config={config}
      labels={{
        customization: {
          title: t('customize.title'),
          description: t('customize.description'),
          reset: t('customize.reset'),
        },
      }}
    />
  );
}
```

## With Footer

```tsx
<NavigationRail config={config} footer={<WorkspaceSwitcher variant="desktop" />} />
```

## API Reference

### NavigationRailProps

| Prop | Type | Description |
|------|------|-------------|
| `config` | `NavigationRailConfig` | Navigation configuration |
| `adapters` | `{ routing?: RoutingAdapter }` | Optional routing adapter |
| `scrollPositionKey` | `string` | Storage key for scroll position |
| `maxDisplayedItems` | `number` | Max displayed items (default: 5) |
| `labels` | `{ customization?: CustomizationLabels }` | Labels for customization popover |
| `footer` | `ReactNode` | Optional footer content |
| `className` | `string` | Custom className |

### Hooks

```tsx
import { useScrollableContainer, SCROLL_AMOUNT, SCROLL_CHECK_DELAY } from '@publikit/navigationrail';
```

## License

MIT