0.1.22 • Published 3 years ago

@dotwebstack/webcomponents v0.1.22

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

DotWebStack Web Components

A set of embeddable Linked Data web components, built on React.

Build Status NPM (Scoped)

Prerequisites

The following tools are required:

Installation

These webcomponents can be installed using NPM:

npm install --save @dotwebstack/webcomponents @rdfjs/data-model

And of course, also with Yarn:

yarn add @dotwebstack/webcomponents @rdfjs/data-model

Documentation

Usage with React

Here is an example of using webcomponents within a React application:

import React from 'react';
import { GraphContext, Vocabulary } from '@dotwebstack/webcomponents';

const endpoint = 'https://bag.basisregistraties.overheid.nl/def/bag';

const App = () => (
  <GraphContext src={endpoint}>
    {(store) => (
      <Vocabulary store={store} />
    )}
  </GraphContext>
);

ReactDOM.render(<App />, document.getElementById('root'));

Usage without React

All components are also available by string reference to the renderComponent and createComponent methods. This makes it possible to use web components in a non-React application:

import { createComponent, renderComponent } from '@dotwebstack/webcomponents';

// Alternative method when not using ES6 modules:
// const namedNode = require('@rdfjs/data-model').namedNode;
// const renderComponent = require('@dotwebstack/webcomponents').renderComponent;
// const createComponent = require('@dotwebstack/webcomponents').renderComponent;

renderComponent(
  document.getElementById('root'),
  'GraphContext',
  {
    src: 'https://bag.basisregistraties.overheid.nl/def/bag',
    children: (store: any) => createComponent('Vocabulary', { store }),
  },
);

See the example folder for more configurations.

Development

Install dependencies:

npm install

Start development server:

npm run start

Release

Make sure to switch to the master branch first.

Prepare a new version (change update type to minor or major when relevant):

npm version patch

Push commit & tag:

git push origin master --tags

To publish the new version to the NPM registry:

npm publish

License

This project is published under the MIT License.

0.1.22

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.2.0

4 years ago

0.1.17

4 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago