1.4.2 • Published 11 days ago

@asyncapi/web-component v1.4.2

Weekly downloads
68
License
Apache-2.0
Repository
github
Last release
11 days ago

All Contributors

Overview

A official React component for AsyncAPI 2.0 specification. It allows you to render the documentation of your asynchronous API provided in the AsyncAPI specification format and validate this specification. You can fully restyle the component using your own styles.

CAUTION: This package only supports AsyncAPI 2.0 specification. If you use 1.x, we recommend that you upgrade to the latest AsyncAPI version using the Node.js or Go converters.

Playground

This repository comes in with a Playground application. Test it to see the component in action and play with it before you use it in your application.

You can also run the Playground application locally by following this instruction from the development guide.

Prerequisites

  • react (version 16.8.0 or higher)

Installation

Run this command to install the component in your project:

npm install --save @asyncapi/react-component

Check out this simple sandbox application that uses the asyncapi-react component:

Edit asyncapi-react-in-action

Props

The list of props for the AsyncAPI React component includes:

  • schema: string | AsyncApiInterface | FetchingSchemaInterface

    The schema property is required and contains AsyncAPI specification. Use the string type, the AsyncApiInterface type, or the FetchingSchemaInterface object to fetch the schema from an external resource. For more information on what it contains and what it should look like, read AsyncAPI Specification.

  • config?: Partial<ConfigInterface>

    The config property is optional and contains configuration for the AsyncAPI component. For more information on the available configuration options, read the Configuration Modification document. This property is concatenated with the default configuration.

    NOTE: The Partial<T> type means that every field in the T type is optional.

Features

For a list and description of features offered by the AsyncAPI React component, see this directory.

Styles

To use default styles based on SAP Fundamentals, import them as follows:

import "@asyncapi/react-component/lib/styles/fiori.css";

For information on how to change styles, read the Style Modification document.

Web Component

If you are not using React you may want to use the @asyncapi/web-component component as a plain web component. This is achieved by making use of web-react-components.

Installation

Run this command to install the component in your project:

npm install --save @asyncapi/web-component

Using in Angular

To use component in Angular, follow these steps:

  1. Update AppModule by adding the CUSTOM_ELEMENTS_SCHEMA to the schemas array in the NgModule metadata:

    import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
    
    @NgModule({
      ...
      schemas: [
        CUSTOM_ELEMENTS_SCHEMA,
      ]
    })
    export class AppModule {}
  2. Import the @asyncapi/web-component module in an Angular's component where you want to use the web component:

    import { Component } from '@angular/core';
    import '@asyncapi/web-component/lib/asyncapi-web-component';
    
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      ...
    }
  3. Use web component in the template as follows:

    <asyncapi-component [schema]="schema" [config]="config" [cssImportPath]="cssImportPath"></asyncapi-component>

    where:

  • schema is a schema property from React component,
  • config is a config property from React component,
  • cssImportPath is the path to styles. By default it is assets/fiori.css

    NOTE: The easiest way to use the default css is to copy the content of the @asyncapi/react-component/lib/styles/fiori.css file to a assets/asyncapi.css file.

Development

For information on how to set up a development environment, write and run tests, follow the naming and architecture convention defined for the project in the Development Guide.

Releasing

For information on how to release a new version of the library or the playground application, or details on creating a changelog file, read the Releasing document.

Contribution

If you have a feature request, add it as an issue or propose changes in a pull request (PR). If you create a feature request, use the dedicated Feature request issue template. When you create a PR, follow the contributing rules described in the CONTRIBUTING.md document.

If you have a bug to report, reproduce it in an online code editor. For example, use CodeSandbox. Attach the link to the reproduced bug to your issue. Log the bug using the Bug report template.

Missing features

See the list of features that are still missing in the component:

If you want to help us develop them, feel free to contribute.

Credits

Contributors

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

1.4.2

11 days ago

1.4.1

11 days ago

1.3.8

15 days ago

1.4.0

14 days ago

1.3.7

15 days ago

1.3.6

15 days ago

1.3.5

15 days ago

1.3.4

15 days ago

1.3.3

15 days ago

1.3.2

18 days ago

1.3.1

1 month ago

1.3.0

1 month ago

1.2.26

1 month ago

1.2.24

1 month ago

1.2.25

1 month ago

1.2.23

2 months ago

1.2.21

2 months ago

1.2.22

2 months ago

1.2.20

2 months ago

1.2.19

2 months ago

1.2.16

2 months ago

1.2.17

2 months ago

1.2.14

2 months ago

1.2.15

2 months ago

1.2.18

2 months ago

1.2.13

2 months ago

1.2.12

2 months ago

1.2.10

3 months ago

1.2.11

3 months ago

1.2.9

4 months ago

1.2.8

4 months ago

1.2.7

4 months ago

1.2.6

4 months ago

1.2.5

4 months ago

1.2.4

4 months ago

1.2.3

4 months ago

1.2.0

4 months ago

1.2.2

4 months ago

1.2.1

4 months ago

1.1.0

5 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago

1.0.3

5 months ago

1.0.0-next.48

10 months ago

1.0.0-next.47

1 year ago

1.0.0-next.46

1 year ago

1.0.0-next.45

1 year ago

1.0.0-next.44

1 year ago

1.0.0-next.43

1 year ago

1.0.0-next.42

2 years ago

1.0.0-next.41

2 years ago

1.0.0-next.39

2 years ago

0.24.23

2 years ago

1.0.0-next.40

2 years ago

1.0.0-next.38

2 years ago

1.0.0-next.37

2 years ago

0.24.22

2 years ago

1.0.0-next.36

2 years ago

1.0.0-next.35

2 years ago

0.24.21

2 years ago

0.24.20

2 years ago

1.0.0-next.33

2 years ago

1.0.0-next.32

2 years ago

1.0.0-next.31

2 years ago

1.0.0-next.30

2 years ago

1.0.0-next.34

2 years ago

1.0.0-next.29

2 years ago

1.0.0-next.28

2 years ago

1.0.0-next.27

2 years ago

1.0.0-next.26

2 years ago

1.0.0-next.25

2 years ago

0.24.18

2 years ago

1.0.0-next.22

2 years ago

0.24.17

2 years ago

0.24.19

2 years ago

1.0.0-next.24

2 years ago

0.24.16

2 years ago

1.0.0-next.23

2 years ago

0.24.15

2 years ago

0.24.14

2 years ago

0.24.13

2 years ago

1.0.0-next.21

2 years ago

1.0.0-next.19

3 years ago

1.0.0-next.20

2 years ago

0.24.12

3 years ago

0.24.11

3 years ago

0.24.10

3 years ago

0.24.9

3 years ago

0.24.8

3 years ago

0.24.5

3 years ago

0.24.7

3 years ago

0.24.6

3 years ago

1.0.0-next.18

3 years ago

1.0.0-next.17

3 years ago

1.0.0-next.16

3 years ago

0.24.4

3 years ago

1.0.0-next.15

3 years ago

1.0.0-next.14

3 years ago

1.0.0-next.13

3 years ago

1.0.0-next.12

3 years ago

1.0.0-next.11

3 years ago

1.0.0-next.10

3 years ago

0.24.3

3 years ago

1.0.0-next.9

3 years ago

0.24.2

3 years ago

1.0.0-next.8

3 years ago

1.0.0-next.7

3 years ago

0.24.1

3 years ago

1.0.0-next.6

3 years ago

0.24.0

3 years ago

1.0.0-next.4

3 years ago

1.0.0-next.5

3 years ago

0.21.0-next.1

3 years ago

1.0.0-next.1

3 years ago

1.0.0-next.2

3 years ago

0.22.7

3 years ago

0.22.6

3 years ago

0.22.5

3 years ago

0.23.1

3 years ago

0.23.0

3 years ago

1.0.0-next.3

3 years ago

0.22.4

3 years ago

0.22.3

3 years ago

0.22.2

3 years ago

0.22.1

3 years ago

0.21.0

3 years ago

0.22.0

3 years ago

0.20.2

3 years ago

0.20.1

3 years ago

0.20.0

3 years ago

0.19.2

3 years ago

0.19.1

3 years ago

0.19.0

3 years ago

0.18.2

3 years ago

0.18.1

3 years ago

0.17.9

3 years ago

0.17.8

3 years ago

0.17.7

3 years ago

0.17.6

3 years ago

0.17.5

3 years ago

0.16.2

3 years ago