Skip to content

Commit

Permalink
Add more pages
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Sep 6, 2023
1 parent 3e6eae1 commit 1cfad2c
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 43 deletions.
4 changes: 4 additions & 0 deletions platform-docs/docs/advanced/create-format.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
sidebar_position: 1
---

# Create a RichText format
5 changes: 5 additions & 0 deletions platform-docs/docs/advanced/dynamic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 3
---

# Augmenting blocks
5 changes: 5 additions & 0 deletions platform-docs/docs/advanced/interactivity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 2
---

# Interactivity API
5 changes: 5 additions & 0 deletions platform-docs/docs/advanced/wordpress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 4
---

# Gutenberg and WordPress
4 changes: 1 addition & 3 deletions platform-docs/docs/basic-concepts/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
sidebar_position: 2
---

# Data

## Data Format
# Data Format

A block editor document is a collection of semantically consistent descriptions of what each block is and what its essential data is.

Expand Down
5 changes: 5 additions & 0 deletions platform-docs/docs/basic-concepts/rendering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 6
---

# Rendering blocks
7 changes: 4 additions & 3 deletions platform-docs/docs/basic-concepts/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ The Gutenberg platform allows you to render these pieces separately and lay them

## The Block Toolbar

Wrapping your `BlockList` component within the `BlockTools` wrapper allows the editor to render a block toolbar adjacent to the selected block.
Wrapping your `BlockCanvas` component within the `BlockTools` wrapper allows the editor to render a block toolbar adjacent to the selected block.

## The Block Inspector

Render `BlockInspector`.
You can use the `BlockInspector` to render what is called the block inspector. It's a set of tools that are specific to the selected block.
While the block toolbar contains what is considered the "main tools" to manipuate each block, the block inspector is meant to render advanced tools and customization options. It is generally rendered as a sidebar or a modal.

## The Block Inserter

`Inserter`
By default the block editor renders a block inserter at the end of the canvas if there's no block selected. It also renders an inserter if you hover the area between two consecutive blocks. That said, you can also decide to render a permanent inserter for instance in a header of your editor. You can do so by using the `Inserter` component.
5 changes: 5 additions & 0 deletions platform-docs/docs/create-block/attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 4
---

# Block attributes
3 changes: 3 additions & 0 deletions platform-docs/docs/create-block/block-supports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
sidebar_position: 3
---
4 changes: 4 additions & 0 deletions platform-docs/docs/create-block/first-block-type.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
sidebar_position: 1
---

# Your first block type
5 changes: 5 additions & 0 deletions platform-docs/docs/create-block/nested-blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 5
---

# Nested blocks
5 changes: 5 additions & 0 deletions platform-docs/docs/create-block/transforms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 6
---

# Block Transforms
5 changes: 5 additions & 0 deletions platform-docs/docs/create-block/using-styles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 2
---

# Using styles and stylesheets
5 changes: 5 additions & 0 deletions platform-docs/docs/create-block/writing-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 7
---

# Writing Flow and Pasting
53 changes: 16 additions & 37 deletions platform-docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ To build a block editor, you need to install the following dependencies
- `@wordpress/element`
- `@wordpress/block-library`
- `@wordpress/components`
- `@wordpress/keyboard-shortcuts`

## Setup vite to use JSX and @wordpress/element as a pragma

Expand Down Expand Up @@ -77,14 +76,9 @@ It's time to render our first block editor.
import { createRoot, createElement, useState } from "@wordpress/element";
import {
BlockEditorProvider,
BlockList,
BlockEditorKeyboardShortcuts,
WritingFlow,
ObserveTyping,
BlockCanvas,
} from "@wordpress/block-editor";
import { registerCoreBlocks } from "@wordpress/block-library";
import { Popover, SlotFillProvider } from "@wordpress/components";
import { ShortcutProvider } from "@wordpress/keyboard-shortcuts";

// Default styles that are needed for the editor.
import "@wordpress/components/build-style/style.css";
Expand All @@ -101,36 +95,21 @@ registerCoreBlocks();
function Editor() {
const [blocks, setBlocks] = useState([]);
return (
// The Shortcut Provider enables the keyboard shortcuts of the editor.
<ShortcutProvider>
{/* The Slot Fill Provider is necessary to allow popovers and dropdowns to render properly */}
<SlotFillProvider>
{/*
The BlockEditorProvider is the wrapper of the block editor's state.
All the UI elements of the block editor need to be rendered within this provider.
*/}
<BlockEditorProvider
value={blocks}
onChange={setBlocks}
onInput={setBlocks}
>
<BlockEditorKeyboardShortcuts.Register />

{/*
The WritingFlow component enables arrow navigation accross the blocks
and a few other keyboard interactions within the block editor
*/}
<WritingFlow>
{/* The ObserveTyping component allows the editor to automatically show or hide the block toolbar while typing. */}
<ObserveTyping>
<BlockList />
</ObserveTyping>
</WritingFlow>
</BlockEditorProvider>
{/* Wrapper that renders popovers and dropdowns */}
<Popover.Slot />¨
</SlotFillProvider>
</ShortcutProvider>
{/*
The BlockEditorProvider is the wrapper of the block editor's state.
All the UI elements of the block editor need to be rendered within this provider.
*/}
<BlockEditorProvider
value={blocks}
onChange={setBlocks}
onInput={setBlocks}
>
{/*
The BlockCanvas component render the block list within an iframe
and wire up all the necessary events to make the block editor work.
*/}
<BlockCanvas height="500px" />
</BlockEditorProvider>
);
}

Expand Down

0 comments on commit 1cfad2c

Please sign in to comment.