Skip to content

Commit

Permalink
docs: update more examples page
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Dec 29, 2024
1 parent ed2ae27 commit b538103
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 28 deletions.
44 changes: 34 additions & 10 deletions packages/svelte-lexical/src/routes/examples/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
<div>
<div class="example-intro">
<h1>1. Plain Text Editor</h1>
<div>Plain text Editor with history plugin.</div>
<div>
<p>Plain text Editor with history plugin.</p>
<p>
It also has the Action bar (bottom right corner with import/export
and other actions).
</p>
</div>
</div>
<Composer1PlainText />
</div>
Expand All @@ -35,8 +41,20 @@
<div class="example-intro">
<h1>3. Rich Text Editor - Advanced</h1>
<div>
Rich text Editor with following plugins: History, List, CheckList,
HorizontalRule, Image and MarkdownShortcutPlugin.
<p>Rich text Editor with the following plugins:</p>
<ul>
<li>History</li>
<li>List</li>
<li>CheckList</li>
<li>HorizontalRule</li>
<li>Image</li>
<li>MarkdownShortcutPlugin</li>
</ul>

<p>
It also adds toolbar color pickers for text color and text
background.
</p>
</div>
</div>
<Composer3RichTextAdv />
Expand All @@ -45,10 +63,11 @@
<div class="example-intro">
<h1>4. Rich Text Editor with Hyperlinks</h1>
<div>
Rich text Editor with links support using LinkPlugin, AutoLinkPlugin
and FloatingLinkEditorPlugin. It also includes all plugins from the
previous example i.e. History, List, CheckList, HorizontalRule, Image
and MarkdownShortcutPlugin.
<p>
Rich text Editor with links support using LinkPlugin, AutoLinkPlugin
and FloatingLinkEditorPlugin.
</p>
<p>It also includes all plugins from the previous example.</p>
</div>
</div>
<Composer4RtLinks />
Expand All @@ -57,9 +76,14 @@
<div class="example-intro">
<h1>5. Rich Text Editor with Code Blocks</h1>
<div>
Rich text Editor with support for Code Blocks. It also includes all
plugins from the previous example i.e. History, List, CheckList,
HorizontalRule, Image, Link, AutoLink and MarkdownShortcutPlugin.
<p>
Rich text Editor with support for Code Blocks. It also includes all
plugins from the previous example.
</p>
<p>
When the focus is inside a Code Block, the toolbar shows dropdown
for language selection and hides rich text formatting options.
</p>
<p>
The font size drop down is replaced with font size entry control.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<ListPlugin />
<CheckListPlugin />
<HorizontalRulePlugin />
<ImagePlugin />
<ImagePlugin captionsEnabled={false} />
<MarkdownShortcutPlugin
transformers={[
...TEXT_FORMAT_TRANSFORMERS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<svelte:options runes={true} />

<script lang="ts">
import DropDownBackColorPicker from '$lib/components/toolbar/DropDownBackColorPicker.svelte';
import DropDownTextColorPicker from '$lib/components/toolbar/DropDownTextColorPicker.svelte';
import {BlockFormatDropDown} from '$lib/index.js';
import {BoldButton} from '$lib/index.js';
import {Divider} from '$lib/index.js';
Expand Down Expand Up @@ -54,10 +56,12 @@
<UnderlineButton />
<StrikethroughButton />
<FormatCodeButton />
<DropDownTextColorPicker />
<DropDownBackColorPicker />
<Divider />
<InsertDropDown>
<InsertHRDropDownItem />
<InsertImageDropDownItem onclick={() => imageDialog!.open()} />
<InsertImageDropDownItem onclick={() => imageDialog.open()} />
</InsertDropDown>
<Divider />
<DropDownAlign />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<ListPlugin />
<CheckListPlugin />
<HorizontalRulePlugin />
<ImagePlugin />
<ImagePlugin captionsEnabled={false} />
<AutoLinkPlugin />
<LinkPlugin {validateUrl} />
{#if !isSmallWidthViewport}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<svelte:options runes={true} />

<script lang="ts">
import DropDownBackColorPicker from '$lib/components/toolbar/DropDownBackColorPicker.svelte';
import DropDownTextColorPicker from '$lib/components/toolbar/DropDownTextColorPicker.svelte';
import {BlockFormatDropDown, InsertLink} from '$lib/index.js';
import {BoldButton} from '$lib/index.js';
import {Divider} from '$lib/index.js';
Expand Down Expand Up @@ -54,6 +56,8 @@
<UnderlineButton />
<StrikethroughButton />
<FormatCodeButton />
<DropDownTextColorPicker />
<DropDownBackColorPicker />
<InsertLink />
<Divider />
<InsertDropDown>
Expand Down
39 changes: 24 additions & 15 deletions packages/svelte-lexical/src/routes/examples/Composer5Toolbar.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<svelte:options runes={true} />

<script lang="ts">
import CodeLanguageDropDown from '$lib/components/toolbar/CodeLanguageDropDown.svelte';
import DropDownBackColorPicker from '$lib/components/toolbar/DropDownBackColorPicker.svelte';
import DropDownTextColorPicker from '$lib/components/toolbar/DropDownTextColorPicker.svelte';
import {
BlockFormatDropDown,
CodeDropDrownItem,
Expand Down Expand Up @@ -51,21 +54,27 @@
</BlockFormatDropDown>
<Divider />
{/if}
<FontFamilyDropDown />
<FontSizeEntry />
<Divider />
<BoldButton />
<ItalicButton />
<UnderlineButton />
<StrikethroughButton />
<FormatCodeButton />
<InsertLink />
<Divider />
<InsertDropDown>
<InsertHRDropDownItem />
<InsertImageDropDownItem onclick={() => imageDialog!.open()} />
</InsertDropDown>
<Divider />
{#if blockType === 'code'}
<CodeLanguageDropDown />
{:else}
<FontFamilyDropDown />
<FontSizeEntry />
<Divider />
<BoldButton />
<ItalicButton />
<UnderlineButton />
<StrikethroughButton />
<FormatCodeButton />
<DropDownTextColorPicker />
<DropDownBackColorPicker />
<InsertLink />
<Divider />
<InsertDropDown>
<InsertHRDropDownItem />
<InsertImageDropDownItem onclick={() => imageDialog.open()} />
</InsertDropDown>
<Divider />
{/if}
<DropDownAlign />
<!-- dialogs -->
<InsertImageDialog bind:this={imageDialog} />
Expand Down

0 comments on commit b538103

Please sign in to comment.