3.10.5 • Published 2 months ago

@oakjs/addon-remirror v3.10.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

GitHub npm CI codecov

@oakjs/addon-remirror

An addon to use Remirror as an oak field

Installation

yarn add @oakjs/addon-remirror remirror @remirror/react @remirror/pm

Usage

import { Builder, baseAddon } from '@oakjs/react';
import { remirrorFieldAddon } from '@oakjs/addon-remirror';

import '@oakjs/theme/dist/oak.min.css';
import '@oakjs/addon-remirror/dist/oak-addon-remirror.min.css';

const myAddon = () => ({
  overrides: [{
    type: 'component',
    targets: ['title', 'text', 'button'],
    fields: [{
      key: 'content',
      type: 'remirror',
    }],
  }],
});

export default () => {
  const [content, setContent] = useState([]);

  return (
    <Builder
      addons={[baseAddon(), remirrorFieldAddon(), myAddon()]}
      value={content}
      onChange={setContent}
    />
  );
};

Documentation

The remirrorFieldAddon() addon adds a new field with the remirror type.

You can then either directly create component settings with the remirror field type:

import { BuilderField, baseAddon } from '@oakjs/react';
import { remirrorFieldAddon } from '@oakjs/addon-remirror';

const myAddon = () => ({
  settings: [{
    id: 'my-setting',
    type: 'remirror',
    key: 'property.subProperty',
  }],
});

export default () => (
  <BuilderField
    addons={[baseAddon(), remirrorFieldAddon(), myAddon()]}
    value={content}
    onChange={setContent}
  />
);

Or override existing component settings:

import { Builder, baseAddon } from '@oakjs/react';
import { remirrorFieldAddon } from '@oakjs/addon-remirror';

const myAddon = () => ({
  overrides: [{
    type: 'component',
    targets: ['title', 'text', 'button'],
    fields: [{
      key: 'content',
      type: 'remirror',
    }],
  }],
});

export default () => (
  <Builder
    addons={[baseAddon(), remirrorFieldAddon(), myAddon()]}
    value={content}
    onChange={setContent}
  />
);

Contributing

npm.io

Please check the CONTRIBUTING.md doc for contribution guidelines.

License

This software is licensed under MIT.

3.11.0-beta.0

2 months ago

3.10.3

2 months ago

3.10.5

2 months ago

3.10.4

2 months ago

3.10.2

2 months ago

3.10.1

2 months ago

3.10.0

2 months ago

3.9.1

2 months ago

3.9.0

2 months ago

3.8.0

3 months ago

3.8.4

3 months ago

3.8.3

3 months ago

3.8.2

3 months ago

3.8.5

3 months ago

3.7.13

3 months ago

3.7.11

3 months ago

3.7.10

3 months ago

3.7.9

3 months ago

3.7.8

4 months ago

3.7.5

5 months ago

3.7.4

6 months ago

3.6.5

6 months ago

3.7.3

6 months ago

3.6.4

6 months ago

3.5.5

7 months ago

3.6.3

7 months ago

3.6.9

6 months ago

3.7.7

5 months ago

3.7.6

5 months ago

3.6.7

6 months ago

3.7.1

6 months ago

3.6.2

7 months ago

3.7.0

6 months ago

3.6.10

6 months ago

3.6.1

7 months ago

3.6.0

7 months ago

3.5.2

9 months ago

3.5.1

10 months ago

3.5.0

10 months ago

3.4.0

1 year ago

3.2.2

1 year ago

3.3.0

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.0.10

1 year ago

3.1.0

1 year ago

3.0.0

2 years ago

3.0.9

2 years ago

3.0.0-alpha.33

2 years ago

3.0.0-alpha.32

2 years ago

3.0.0-alpha.24

2 years ago

3.0.0-alpha.21

2 years ago

3.0.0-alpha.19

2 years ago

3.0.0-alpha.18

2 years ago

3.0.0-alpha.16

2 years ago

3.0.0-alpha.13

2 years ago

3.0.0-alpha.7

2 years ago

3.0.0-alpha.4

2 years ago

3.0.0-alpha.3

2 years ago

3.0.0-alpha.2

2 years ago

3.0.0-alpha.1

2 years ago

3.0.0-alpha.0

2 years ago