Editor Architecture
The story editor is built around several core packages:packages/story-editor/- Main editor interface and componentspackages/canvas/- Canvas rendering and element manipulationpackages/animation/- Animation system and effectspackages/design-system/- Shared UI componentspackages/elements/- Story element types (text, images, video, shapes)
Main Interface Components
Canvas Area
The canvas is the central workspace where you design your story pages. It uses a layered architecture:- Display Layer (
displayLayer.js) - Shows non-interactive preview of elements with animations - Edit Layer (
editLayer.js) - Handles element selection and manipulation - Frames Layer (
framesLayer.js) - Displays element boundaries and controls
packages/story-editor/src/components/canvas/
Library Panel
The left sidebar provides access to:- Media (
PANE_IDS.Media) - Upload and manage images/videos - Text (
PANE_IDS.Text) - Text presets and styles - Shapes (
PANE_IDS.Shapes) - Geometric shapes and stickers - Page Templates (
PANE_IDS.PageTemplates) - Pre-designed page layouts
packages/story-editor/src/components/library/paneIds.ts
Design Panel
The right sidebar contains contextual design controls:- Text Style - Font, size, color, and formatting
- Animation - Add movement and effects
- Size & Position - Precise element placement
- Page Background - Background colors, images, and audio
packages/story-editor/src/components/panels/design/
Provider Architecture
The editor uses React Context providers for state management:packages/story-editor/src/storyEditor.js:70-115
Key Features
Canvas-based editing
Direct manipulation of elements with drag-and-drop, resize, and rotate controls powered by the
@googleforcreators/moveable package.Multi-page stories
Create sequential pages with smooth transitions. Navigate between pages using the page navigation controls.
Rich media support
Upload images, videos, and audio directly through the WordPress media library integration.
Animation system
Apply professional animations with real-time preview. Animations work in both the editor (WAAPI) and output (AMP).
Layout Grid System
The editor uses CSS Grid for precise layout positioning:h= headerc= canvas pagep= previous page navn= next page navw= workspace footer
packages/story-editor/src/components/canvas/layout.js:82-96
Design System Integration
The editor extensively uses components from@googleforcreators/design-system:
Button,Input,Dropdown- Form controlsTooltip,Modal,Dialog- OverlaysSnackbarProvider- NotificationsPopupProvider- Contextual popups
The editor supports RTL (right-to-left) languages through the
stylisRTLPlugin for styled-components.Next Steps
Creating Stories
Learn how to create your first story and add pages
Working with Media
Upload and manage images, videos, and audio
Adding Animations
Bring your stories to life with animations
Text & Styling
Format text and apply styles