# @atlassian/confluence-web-components

> Web components used to render common Confluence components in Connect add-ons.

Latest version **0.0.14** (published 2016-03-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlassian/confluence-web-components
pnpm add @atlassian/confluence-web-components
yarn add @atlassian/confluence-web-components
bun add @atlassian/confluence-web-components
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2016-03-17 |
| First published | 2016-03-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 4.2.2 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Drew Walker |
| Maintainers | atlassian-aui, dwalker |
| Keywords | web-component, web-components, atlassian, confluence, react, atlassian connect, add-ons, plugins |

## Links

- npm: https://www.npmjs.com/package/@atlassian/confluence-web-components
- Repository: https://bitbucket.org/atlassian/confluence-web-components
- Homepage: https://bitbucket.org/atlassian/confluence-web-components#readme
- Issues: https://bitbucket.org/atlassian/confluence-web-components/issues?status=new&status=open
- npm.io page: https://npm.io/package/@atlassian/confluence-web-components

## Dependencies (5)

- [react](https://npm.io/package/react.md) 0.14.5
- [react-dom](https://npm.io/package/react-dom.md) 0.14.5
- [classnames](https://npm.io/package/classnames.md) 2.2.3
- [reactive-elements](https://npm.io/package/reactive-elements.md) 0.6.3
- [document-register-element](https://npm.io/package/document-register-element.md) 0.5.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.14 (latest) — 2016-03-17
- 0.0.13 — 2016-03-10
- 0.0.12 — 2016-03-06
- 0.0.11 — 2016-03-06
- 0.0.10 — 2016-03-03
- 0.0.9 — 2016-03-03
- 0.0.8 — 2016-03-03
- 0.0.7 — 2016-03-02
- 0.0.6 — 2016-03-02

## README

[![Coverage Status](https://coveralls.io/repos/bitbucket/atlassian/confluence-web-components/badge.svg?branch=master)](https://coveralls.io/bitbucket/atlassian/confluence-web-components?branch=master)

## Installation

```
npm install @atlassian/confluence-web-components
```

## Usage

```
<!doctype html>
<head>
    <title>My connect add-on</title>
    <script src="node_modules/@atlassian/confluence-web-components/dist/confluence-web-components.js"></script>
</head>
<body>
    ...
    <confluence-quick-search placeholder="Search..."></confluence-quick-search>
    ...
</body>
</html>
```

## Bundles

The Confluence web components are provided as 4 different bundles, which contain all components:

File                                           | Size (gzipped) | Description
---------------------------------------------- | -------------- | ------------------------------------------------------
dist/confluence-web-components-flatpack.js     | 156kb          | This is the unminified bundle with all dependencies included. This is the best option forgetting up and running and for use in your development environment.
dist/confluence-web-components-flatpack.min.js | 44kb           | The minified version of the bundle above. This is what you should use in production.
dist/confluence-web-components.js              | 11.4kb         | This is the unminified bundle with React and ReactDOM excluded. You should use this bundle if you use React for your own components and would like to use a shared/CDN copy. The bundle assumes that React and ReactDOM are available as global variables.
dist/confluence-web-components.min.js          | 6.6kb          | The minified version of the previous version. This is the best option for a production environment using a CDN copy of React and ReactDOM.

NOTE: It is not currently supported to consume individual web components or create your own custom bundle.

## Quick search

```
<confluence-quick-search
    container-class={string}
    placeholder={string}
></confluence-quick-search>
```

Allows users to easily navigate to recently visited pages, perform a search without leaving the current page, or performance a site-wide search.

**container-class {string}** - A CSS class name that will be applied to the root DOM node.  Use this to help target styles in your theme.
**placeholder {bool}** - Placeholder text to show in the search input field.

## Content body

```
<confluence-content-body
    content-id={number}
></confluence-quick-search>
```

Renders the HTML content for a piece of content (e.g. page or blogpost). This does not include the content title or comments.

**content-id {number}** - The ID of the content to render. This parameter is required.

## Content list

Displays a list of content items based on a CQL query.

```
<confluence-content-list
    cql={string}
></confluence-content-list>
```

**cql {string}** - The CQL used to retrieve content.
**tag-name {ul|ol=ol}** - The tag of the containing element. Default is "ol".
**limit {number=25}** - The maximum number of items to fetch and display. Default is 25.
**container-class** - Will be applied to the root element.
**item-class** - Will be applied to each item in the list.

## Running the Connect add-on locally

### Setup this repo locally

```
git clone https://bitbucket.org/atlassian/confluence-web-components.git
nvm install v4.2.2             # switch to node 4.2.2
npm install                    # install dependencies
```

### Start Confluence on port 1990
### Start the add-on on port 3000

```
npm start
```

When the add-on starts, it will automatically register itself with the local Confluence instance.

## Potential roadmap

### v1.0
* Will include the following components:
    - Comment list
    - Content body
    - Content list
    - Content title
    - Quick search
    - Space title
    - Space list
* Will use React 0.14.5

### v1.0.x
* Will only include bug fixes or backwards compatible changes to components from 1.0 release.

### v1.x
* Will include new components, potential deprecation of existing components, or minor React version updates.

---
_Source: https://npm.io/package/@atlassian/confluence-web-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
