diff --git a/CHANGELOG.md b/CHANGELOG.md index c497951..78e3e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Datastar +## 1.0.0-beta.1 - Unreleased + +- Require Datastar 0.21.3. + ## 1.0.0-alpha.3 - 2024-11-26 - Require Datastar 0.20.1. diff --git a/README.md b/README.md index bb87ef9..70e7917 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ # Datastar Plugin for Craft CMS -### A real-time, template-driven hypermedia framework for Craft CMS. +### A reactive, template-driven hypermedia framework for Craft CMS. -**This plugin is in alpha and its API may change.** +**This plugin is in beta and its API may change.** -This plugin integrates the [Datastar framework](https://data-star.dev/) into [Craft CMS](https://craftcms.com/), allowing you to create real-time front-ends driven by Twig templates. It aims to replace the need for front-end frameworks such as React, Vue.js and Alpine.js + htmx, and instead lets you manage state and run logic all within your Twig templates. +This plugin integrates [Datastar](https://data-star.dev/) with [Craft CMS](https://craftcms.com/), allowing you to create reactive frontends driven by Twig templates. It aims to replace the need for front-end frameworks such as React, Vue.js and Alpine.js + htmx, and instead lets you manage state and run logic within your Twig templates. With Datastar, you have the ability to define state and manipulate the DOM in real-time on the front-end, while modify the DOM with templates rendered on the back-end. Use-cases: @@ -38,7 +38,7 @@ This plugin requires [Craft CMS](https://craftcms.com/) 5.0.0 or later. To install the plugin, search for “Datastar” in the Craft Plugin Store, or install manually using composer. ```shell -composer require putyourlightson/craft-datastar:^1.0.0-alpha.2 +composer require putyourlightson/craft-datastar:^1.0.0-beta.1 ``` --- diff --git a/composer.json b/composer.json index e5d7d9f..68be073 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "name": "putyourlightson/craft-datastar", "description": "A real-time, template-driven hypermedia framework for Craft.", - "version": "1.0.0-alpha.3", + "version": "1.0.0-beta.1", "type": "craft-plugin", "license": "mit", "require": { "php": "^8.2", "craftcms/cms": "^5.0", - "putyourlightson/craft-datastar-module": "1.0.0-alpha.3" + "putyourlightson/craft-datastar-module": "1.0.0-beta.1" }, "require-dev": { "craftcms/ecs": "dev-main", diff --git a/examples/_datastar/save-entry.twig b/examples/_datastar/save-entry.twig new file mode 100644 index 0000000..465a831 --- /dev/null +++ b/examples/_datastar/save-entry.twig @@ -0,0 +1,58 @@ +{% set response = datastar.runAction('entries/save-entry', { + entryId: signals.entryId, + title: signals.title, +}) %} + +{% if response.isSuccessful %} + {% fragment %} + {# https://daisyui.com/components/alert/#success-color #} +
ID | @@ -22,28 +22,28 @@|||
---|---|---|---|
{{ entry.id }} |
-
+
{{ entry.title }}
|
{{ entry.author.username }} | - | diff --git a/examples/two-way-binding-function.twig b/examples/two-way-binding-function.twig index 86f065c..9d78e11 100644 --- a/examples/two-way-binding-function.twig +++ b/examples/two-way-binding-function.twig @@ -9,15 +9,15 @@ {# https://tailwindcss.com/docs/container #}