open-index/open-npm huggingface dataset:
npm package: @financial-times/babel-preset-ip-wxp
Description: the worker experience teams babel preset
Author: Internal Products
Latest version: 1.0.3

# babel-preset-ip-wxp
[![npm version](https://badge.fury.io/js/%40financial-times%2Fbabel-preset-ip-wxp.svg)](https://badge.fury.io/js/%40financial-times%2Fbabel-preset-ip-wxp)
[![CircleCI](https://circleci.com/gh/Financial-Times/ip-wxp-babel-preset.svg?style=svg&circle-token=01189dd5c509afec7e798c1112dc2a98f4b66a2e)](https://circleci.com/gh/Financial-Times/ip-wxp-babel-preset)

This is the [babel preset](https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/user-handbook.md#making-your-own-preset) used by the worker experience team. 

It uses the [env preset](https://github.com/babel/babel/tree/master/packages/babel-preset-env) configured for `node 8.10.0` as it's base with the below extras:

- [@babel/plugin-proposal-object-rest-spread](https://www.npmjs.com/package/@babel/plugin-proposal-object-rest-spread) - to enable the [spread operator](https://github.com/tc39/proposal-object-rest-spread) with objects as well as arrays
- [@babel/plugin-proposal-optional-chaining](https://www.npmjs.com/package/@babel/plugin-proposal-optional-chaining) - because it's great and removes the need for a bunch of pointless code

This module can be used via [`package.json`](https://babeljs.io/docs/usage/babelrc/#use-via-packagejson):

```json
"babel": {
  "presets": [
    "@financial-times/ip-wxp"
  ]
},
```

or [`.babelrc`](https://babeljs.io/docs/usage/babelrc/)
```js
{
  presets: [
    '@financial-times/ip-wxp'
  ]
}
```
npm package: @financial-times/biz-ops-utils
Description: Utilities for interacting with biz ops data
Author: Reliability Engineering
Latest version: 0.0.1-beta.7

# @financial-times/biz-ops-utils

A small collection of utilities used by both the Biz Ops Admin application directly and by @financial-times/biz-ops-view.

They may be useful when constructing complex user interfaces from Biz Ops components.

## Requirements

-   node 14+
-   npm 7+

## Installation

```js
npm i @financial-times/biz-ops-utils
```

## API

### `markdownToHtml(string)`

Converts a string of markdown to html using settings common to the whole Biz Ops ecosystem

### `constants`

An object of useful constants:

```js
{

  // List of the base data types of our GraphQL implementations that contain temporal information
  TEMPORAL_TYPES: ['Date', 'Time', 'DateTime'],

  // List of the base data types of our GraphQL implementations that contain numeric information
  NUMBER_TYPES: ['Int', 'Float'],
}
```

### `hasValue(value, propDef)`

Used to determine if a property retrieved from the Biz Ops GraphQL API contains a value. It takes into account the type of data expected in the property.

#### Parameters

-   `value` - the value to be tested
-   `propDef` - the definition of the property being inspected, as defined in [Biz Ops Schema](https://github.com/Financial-Times/biz-ops-schema)

### `graphqlFragment()`

Used to generate a fragment of GraphQL that can be used to construct a valid Biz Ops GraphQL query to retrieve data for a property.

### Parameters

-   `propName` - the name of the property
-   `propDef` - the definition of the property being queried, as defined in [Biz Ops Schema](https://github.com/Financial-Times/biz-ops-schema)
-   `useRichRelationships` [default: `true`] - whether or not to query for relationships using a structure that surfaces properties defined on the relationships as well as data about the record at the other end of the relationship

### `getComponentAssigner()`

Deliberately left undocumented for now - the API is not really mature and usage is discouraged apart from in Biz Ops Admin and @financial-times/biz-ops-view, its only 2 consumers at present.
npm package: @financial-times/biz-ops-view
Description: UI components for displaying biz ops data
Author: Reliability Engineering
Latest version: 0.3.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @financial-times/biz-ops-view

Components for displaying data retrieved from the Biz Ops graph.

## Requirements

-   node 18+
-   npm 8+

## Installation

```js
npm i @financial-times/biz-ops-view
```

## API

### Styles

Using a build that is able to extract CSS files required by JS files `require('@financial-times/biz-ops-view/main.css')` in your main browser JS file.

### `typeComponents`

An object containing a range of components for rendering a wide variety of Biz Ops types

### `labels`

Object containing the following components and functions:
(To be documented)

-   Label,
-   getSmartLabel,
-   getBooleanLabel,
-   IsActiveLabel,

### `componentAssigner(propDef)`

Given a [Biz Ops Schema](https://github.com/Financial-Times/biz-ops-schema) property definition, returns the most appropriate choice of component to display a value contained in that property.

// TODO should be possible to pass in `type + propName` tuples as input

### BizOpsLink

React component that displays a link to a Biz Ops record

#### Props

-   `id` - optional id attribute for the link
-   `type` - type of the record to link to
-   `value` - a value, containing at least a `code` for the record, and ideally a `name` too retrieved from Biz Ops
-   `baseUrl` [default: `''`] - optional base url for the link

### BizOpsDataListRow

React component that displays a value from Biz Ops using the appropriate choice of component for the data type and a label to the left of it, marked up as follows:

```html
<dt>Label</dt>
<dd>value</dd>
```

Suitable for placing in a `<dl class="biz-ops-data-list">`

#### Props

Note that these can typically be provided as follows:

```jsx
<BizOpsDataListRow value={value} {...propDef} id={propDef.name} />
```

Where `propDef` is the property definition from Biz Ops schema

-   `id` - optional id attribute for the component used to display the value
-   `value` - a value stored in a Biz Ops property
-   `type`, `showInactive`, `description`, `label` - All taken from the Biz Ops schema property definition

### BizOpsComponent

React component that displays a value from Biz Ops using the appropriate choice of component for the data type

#### Props

Same as [BizOpsDataListRow](#bizopsdatalistrow)
npm package: @financial-times/biz-ops-view-utils
Description: Utilities for interacting with biz ops data
Author: Reliability Engineering
Latest version: 0.3.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @financial-times/biz-ops-view-utils

A small collection of utilities used by both the Biz Ops Admin application directly and by @financial-times/biz-ops-view.

They may be useful when constructing complex user interfaces from Biz Ops components.

## Requirements

-   node 18+
-   npm 9+

## Installation

```js
npm i @financial-times/biz-ops-view-utils
```

## API

### `markdownToHtml(string)`

Converts a string of markdown to html using settings common to the whole Biz Ops ecosystem

### `constants`

An object of useful constants:

```js
{

  // List of the base data types of our GraphQL implementations that contain temporal information
  TEMPORAL_TYPES: ['Date', 'Time', 'DateTime'],

  // List of the base data types of our GraphQL implementations that contain numeric information
  NUMBER_TYPES: ['Int', 'Float'],
}
```

### `hasValue(value, propDef)`

Used to determine if a property retrieved from the Biz Ops GraphQL API contains a value. It takes into account the type of data expected in the property.

#### Parameters

-   `value` - the value to be tested
-   `propDef` - the definition of the property being inspected, as defined in [Biz Ops Schema](https://github.com/Financial-Times/biz-ops-schema)

### `graphqlFragment()`

Used to generate a fragment of GraphQL that can be used to construct a valid Biz Ops GraphQL query to retrieve data for a property.

### Parameters

-   `propName` - the name of the property
-   `propDef` - the definition of the property being queried, as defined in [Biz Ops Schema](https://github.com/Financial-Times/biz-ops-schema)
-   `useRichRelationships` [default: `true`] - whether or not to query for relationships using a structure that surfaces properties defined on the relationships as well as data about the record at the other end of the relationship

### `getComponentAssigner()`

Deliberately left undocumented for now - the API is not really mature and usage is discouraged apart from in Biz Ops Admin and @financial-times/biz-ops-view, its only 2 consumers at present.