Skip to content

Commit

Permalink
Fix code in changeset files
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Sep 26, 2020
1 parent d9abc5d commit 5dd5262
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 23 deletions.
23 changes: 14 additions & 9 deletions .changeset/fast-owls-happen.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
- Add `autoUpdate` option to `useRemirror` hook from `@remirror/react` which means that the context object returned by the hook is always up to date with the latest editor state. It will also cause the component to rerender so be careful to only use it when necessary.

```tsx
const { active, commands } = useRemirror({ autoUpdate: true });
import React from 'react';
import { useRemirror } from 'remirror/react';

return (
<button
onClick={() => commands.toggleBold}
style={{ fontWeight: active.bold() ? 'bold' : undefined }}
>
B
</button>
);
const Editor = () => {
const { active, commands } = useRemirror({ autoUpdate: true });

return (
<button
onClick={() => commands.toggleBold}
style={{ fontWeight: active.bold() ? 'bold' : undefined }}
>
B
</button>
);
};
```

- Fix broken `onChangeHandler` parameter for the use `useRemirror` hook.
10 changes: 5 additions & 5 deletions .changeset/forty-donuts-knock.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Add support for prioritized keymaps. It's now possible to make sure that a hook which consumes `useKeymap` runs before the extension keybindings.

```ts
```tsx
import React from 'react';
import { ExtensionPriority } from 'remirror/core';
import { useKeymap } from 'remirror/react/hooks';
Expand All @@ -31,7 +31,7 @@ Here is a breakdown of the default priorities when consuming keymaps.
To change the default priority of the `createKeymap` method in a custom extension wrap the `KeyBindings` return in a tuple with the priority as the first parameter.

```ts
import { PlainExtension, KeyBindingsTuple, ExtensionPriority, KeyBindings } from 'remirror/core';
import { ExtensionPriority, KeyBindings, KeyBindingsTuple, PlainExtension } from 'remirror/core';

class CustomExtension extends PlainExtension {
get name() {
Expand All @@ -40,9 +40,9 @@ class CustomExtension extends PlainExtension {

createKeymap(): KeyBindingsTuple {
const bindings = {
Enter: () => return true,
Backspace: () => return true,
}
Enter: () => true,
Backspace: () => true,
};

return [ExtensionPriority.High, bindings];
}
Expand Down
2 changes: 1 addition & 1 deletion .changeset/happy-llamas-reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add new `extensionDecorator` function which augments the static properties of an
The following code will add a decorator to the extension.

```ts
import { PlainExtension, ExtensionPriority, extensionDecorator } from 'remirror/core';
import { extensionDecorator, ExtensionPriority, PlainExtension } from 'remirror/core';

interface ExampleOptions {
color?: string;
Expand Down
8 changes: 6 additions & 2 deletions .changeset/hot-seals-stare.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
Enable `all` selection when setting initial content and focusing on the editor.

```tsx
import React from 'react';
import { useRemirror } from 'remirror/react';

const { focus } = useRemirror();
focus('all');
const EditorButton = () => {
const { focus } = useRemirror();

return <button onClick={() => focus('all')} />;
};
```
4 changes: 2 additions & 2 deletions .changeset/new-apricots-travel.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

```tsx
import React from 'react';
import { RemirrorProvider, InvalidContentHandler } from 'remirror/core';
import { RemirrorProvider, useManager } from 'remirror/react';
import { InvalidContentHandler, RemirrorProvider } from 'remirror/core';
import { WysiwygPreset } from 'remirror/preset/wysiwyg';
import { RemirrorProvider, useManager } from 'remirror/react';

const EditorWrapper = () => {
const onError: InvalidContentHandler = useCallback(({ json, invalidContent, transformers }) => {
Expand Down
2 changes: 1 addition & 1 deletion .changeset/ninety-terms-wait.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Enable disabling input rules with a `shouldSkip` method. This is now available a
Consuming this API looks something like this.

```ts
import { PlainExtension, Dispose } from 'remirror/core';
import { Dispose, PlainExtension } from 'remirror/core';

class CoolExtension extends PlainExtension {
get name() {
Expand Down
2 changes: 1 addition & 1 deletion .changeset/smart-peaches-mate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Add new `presetDecorator` function which augments the static properties of an `P
The following code will add a decorator to the preset.

```ts
import { Preset presetDecorator } from 'remirror/core';
import { Preset, presetDecorator } from 'remirror/core';

interface ExampleOptions {
color?: string;
Expand Down
3 changes: 2 additions & 1 deletion .changeset/thick-pianos-wink.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ With tags, you can select a specific sub selection of marks and nodes. This will

```ts
import { ExtensionTag } from 'remirror/core';
import { createCoreManager, CorePreset } from 'remirror/preset/core';
import { CorePreset, createCoreManager } from 'remirror/preset/core';
import { WysiwygPreset } from 'remirror/preset/wysiwyg';

const manager = createCoreManager(() => [new WysiwygPreset(), new CorePreset()], {
extraAttributes: [
{
Expand Down
2 changes: 1 addition & 1 deletion .changeset/tiny-chefs-hug.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Positioners now return an array of `VirtualPositions` or an empty array if no po
An example of creating a new positioner with the new api is below.

```ts
import { Positioner, Coords, hasStateChanged } from '@remirror/extension-positioner';
import { Coords, hasStateChanged, Positioner } from '@remirror/extension-positioner';

export const cursorPopupPositioner = Positioner.create<Coords>({
hasChanged: hasStateChanged,
Expand Down
1 change: 1 addition & 0 deletions .changeset/tricky-boats-listen.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Fix type annotations for `createCommands` functions. This was causing issues wit
The following should now work with full type inference.

```tsx
import React from 'react';
import { useRemirror } from 'remirror/react';

const EditorButton = () => {
Expand Down
1 change: 1 addition & 0 deletions support/root/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
!.eslintrc.js
!**/.eslintrc.js
!.changeset
**/lib
lib
**/dist
Expand Down

1 comment on commit 5dd5262

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://remirror.io as production
🚀 Deployed on https://5f6f861bfc813e2d80f24975--remirror.netlify.app

Please sign in to comment.