=== First Draft Feed ===
Contributors:      justinnealey
Tags:              revisions, draft, history, feed, diff
Requires at least: 6.4
Tested up to:      6.9
Stable tag:        1.0.0
Requires PHP:      7.4
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Show a post's revision history as a readable, chronological feed.

== Description ==

First Draft Feed is a WordPress block that renders a single post's revision history as a readable, chronological feed. Each revision is a "moment" — timestamped, with a visual diff showing what changed. Readers follow the evolution of thinking, not just the finished product.

**Who is this for?**

* **Writers** who work in public and want to expose how their thinking evolved.
* **Readers** who want to follow a post's development over time like a story.
* **Site owners** who want to control which posts expose their drafts and how much history is visible.

**How it works**

Drop the First Draft Feed block onto any post or page. It renders a feed of that post's revision history, pulled from a custom REST API endpoint that safely surfaces WordPress revision data without requiring authentication.

Each revision card shows:

* Timestamp — when the revision was saved
* Word count delta — e.g. "+ 312 words"
* Visual diff — additions and removals highlighted in context, rendered as clean text (no raw HTML diffs)

The feed loads oldest-to-newest so readers experience the post as it was written.

**Features**

* Per-post opt-in — revisions are only exposed when the author explicitly enables the feed
* Author notes — optional context shown at the top of the feed
* Three diff styles — inline, split, or summary view
* Image tracking — images in revisions are preserved and diffed alongside text
* Collapsible cards — readers expand only what interests them
* Max revision limit — cap how many revisions appear (1-50)
* Toggle individual elements — show or hide diffs, word counts, and timestamps
* Block supports — wide/full alignment, background/text color, spacing, and font size

== Installation ==

1. Upload the `first-draft-feed` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Edit a post or page and insert the "First Draft Feed" block.

== Source Code ==

The files inside `build/` are minified production output generated from the human-readable source in `src/`. The build pipeline uses `@wordpress/scripts` (webpack), declared in `package.json`.

The canonical, public source repository — including the unminified `src/` files, build configuration, and full development history — is hosted at:

https://github.com/jnealey88/first-draft-feed

To rebuild the production assets from source:

`npm install`
`npm run build`

This regenerates everything in `build/` from `src/`. Anyone reviewing, auditing, or forking the plugin can reproduce the distributed build with these two commands. See the README in the source repository for the full list of source files and development instructions.

== Frequently Asked Questions ==

= How do I enable the revision feed on a post? =

Insert the First Draft Feed block into your post, then toggle "Enable revision feed for this post" in the block sidebar settings.

= Does this expose all my drafts automatically? =

No. The revision feed is strictly opt-in. Each post must be individually enabled by the author. No revision data is exposed until you explicitly turn it on.

= What post types are supported? =

Any public post type that supports revisions — posts, pages, and compatible custom post types.

= Can readers see my raw HTML? =

No. The plugin strips all HTML from revision content and renders clean, readable text. Images are extracted and displayed separately.

= Does this work with block themes and classic themes? =

Yes. The block uses standard WordPress block supports (alignment, color, spacing, typography) and works in both the block editor and classic themes with block support.

== Screenshots ==

1. The First Draft Feed block in the editor with settings panel open.
2. A published post showing the revision feed with inline diffs.
3. Split diff view comparing two revisions side by side.

== Changelog ==

= 1.0.0 =
* Initial release.
* Revision feed block with per-post opt-in.
* Three diff styles: inline, split, and summary.
* Author notes, word count deltas, and timestamps.
* Image tracking across revisions.
* Custom REST API endpoint for public revision data.
* Support for all public post types with revisions.
