Skip to content

Commit

Permalink
[docs] Migrate rte and prism demos to @mantine/demos
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 30, 2022
1 parent 657debe commit 9e50d49
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { useMantineTheme } from '@mantine/core';
import { usage } from '@demos/rte';
import { RichTextEditorDemos } from '@mantine/demos';

export function RichTextDemo() {
const theme = useMantineTheme();
const Component = usage.component as any;
const Component = RichTextEditorDemos.usage.component as any;
return (
<Component
style={{
Expand Down
4 changes: 2 additions & 2 deletions docs/src/docs/changelog/2-5-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
ChipsDemos,
PaginationDemos,
TimeRangeInputDemos,
RichTextEditorDemos,
} from '@mantine/demos';
import * as RichTextDemos from '@demos/rte';

## UMD builds deprecation

Expand Down Expand Up @@ -61,7 +61,7 @@ Checkout [Next.js guide](https://mantine.dev/theming/next/) to learn more.
[@mantine/rte](https://mantine.dev/others/rte/) is a new package with RichTextEditor component.
Component integrates seamlessly with your MantineTheme and provides all basic rich text editing features:

<Demo data={RichTextDemos.usage} />
<Demo data={RichTextEditorDemos.usage} />

## New components

Expand Down
6 changes: 3 additions & 3 deletions docs/src/docs/changelog/3-5-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
ProgressDemos,
SwitchDemos,
TransferListDemos,
PrismDemos,
RichTextEditorDemos,
} from '@mantine/demos';
import * as PrismDemos from '@demos/prism';
import * as RichTextDemos from '@demos/rte';

## @mantine/prism changes

Expand Down Expand Up @@ -61,7 +61,7 @@ import * as RichTextDemos from '@demos/rte';

[RichTextEditor](https://mantine.dev/others/rte/) now supports mentions:

<Demo data={RichTextDemos.mentions} demoProps={{ toggle: true, zIndex: 5 }} />
<Demo data={RichTextEditorDemos.mentions} demoProps={{ toggle: true, zIndex: 5 }} />

[TransferList](https://mantine.dev/core/transfer-list/) now supports items grouping:

Expand Down
3 changes: 1 addition & 2 deletions docs/src/docs/core/Code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ docs: 'core/Code.mdx'
styles: ['Code', 'single-node']
---

import { CodeDemos } from '@mantine/demos';
import * as PrismDemos from '@demos/prism';
import { CodeDemos, PrismDemos } from '@mantine/demos';

## Inline code

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/others/prism.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license: MIT
styles: ['Prism', 'PrismTabs']
---

import * as PrismDemos from '@demos/prism';
import { PrismDemos } from '@mantine/demos';

## Installation

Expand Down
14 changes: 7 additions & 7 deletions docs/src/docs/others/rte.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license: MIT
styles: ['RichTextEditor']
---

import * as RichTextDemos from '@demos/rte';
import { RichTextEditorDemos } from '@mantine/demos';

## Installation

Expand All @@ -34,14 +34,14 @@ yarn add @mantine/rte @mantine/core @mantine/hooks

## Demo

<Demo data={RichTextDemos.usage} />
<Demo data={RichTextEditorDemos.usage} />

## Usage

`value` and `onChange` props are required for component to work.
Note that though component is controlled you cannot force value (limitation of Quill.js library).

<Demo data={RichTextDemos.simple} />
<Demo data={RichTextEditorDemos.simple} />

## Configure toolbar

Expand All @@ -60,7 +60,7 @@ RichTextEditor supports these controls in toolbar:

You can add, remove and configure controls arrangement in toolbar with `controls` prop:

<Demo data={RichTextDemos.toolbar} />
<Demo data={RichTextEditorDemos.toolbar} />

To configure sticky toolbar properties set following props:

Expand All @@ -77,7 +77,7 @@ To configure sticky toolbar properties set following props:

## Images and videos embeds

<Demo data={RichTextDemos.embeds} />
<Demo data={RichTextEditorDemos.embeds} />

## Images upload

Expand Down Expand Up @@ -125,7 +125,7 @@ if you are planning to use images.
RichTextEditor comes with [quill-mentions plugin](https://github.com/quill-mention/quill-mention).
To add mentions support, add provide [quill-mentions](https://github.com/quill-mention/quill-mention) configuration to `mentions` prop:

<Demo data={RichTextDemos.mentions} />
<Demo data={RichTextEditorDemos.mentions} />

## Extra modules

Expand All @@ -151,7 +151,7 @@ function Demo() {

When editor is readonly state, user cannot edit content, toolbar is hidden:

<Demo data={RichTextDemos.readOnly} />
<Demo data={RichTextEditorDemos.readOnly} />

## Keyboard shortcuts

Expand Down

0 comments on commit 9e50d49

Please sign in to comment.