feat: integrate Kirby CMS data with Vue print editor

- Add JSON content representation template (recit.json.php)
- Create virtual /print page plugin for recit pages
- Add recit.php base template for content representation
- Create Pinia store for recit data management
- Add block components (text, heading, image, list, quote, video, map)
- Update PagedJsWrapper for dynamic content rendering with data-page-type
- Modify header.php to pass recit JSON URL via data attribute
- Update App.vue to load recit data on mount

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
isUnknown 2025-12-08 18:01:01 +01:00
parent 446b6cd9e7
commit 790eb7414e
17 changed files with 807 additions and 56 deletions

View file

@ -0,0 +1,37 @@
<?php
/**
* Virtual Print Page Plugin
*
* Crée une page virtuelle /print pour chaque récit
* Permet d'accéder à l'éditeur d'impression via /projet/recit/print
*/
use Kirby\Cms\Page;
use Kirby\Uuid\Uuid;
Kirby::plugin('geoproject/virtual-print-page', [
'routes' => [
[
'pattern' => '(:all)/print',
'action' => function ($parentPath) {
// Trouver la page parente (le récit)
$parent = page($parentPath);
if (!$parent || $parent->intendedTemplate()->name() !== 'recit') {
return $this->next();
}
// Créer la page virtuelle avec Page::factory()
return Page::factory([
'slug' => 'print',
'template' => 'print',
'parent' => $parent,
'content' => [
'title' => 'Impression - ' . $parent->title()->value(),
'uuid' => Uuid::generate()
]
]);
}
]
]
]);