Commit graph

89 commits

Author SHA1 Message Date
sarahgarcin1
0f8192eceb css narrative
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 25s
2026-02-27 13:50:51 +01:00
sarahgarcin1
68d23440e2 fix après changement de nom des champs 2
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 22s
2026-02-27 12:57:21 +01:00
sarahgarcin1
25fc60ebe9 fix après changement de nom des champs
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
2026-02-27 12:51:47 +01:00
sarahgarcin1
153e75c0a9 merge + ajout des boutons sur les tuiles page projet + css page narrative
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 25s
2026-02-27 12:24:35 +01:00
isUnknown
ea277917f7 template projet --> project
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
2026-02-26 17:35:24 +01:00
isUnknown
76dee1b074 fix: align content field names with blueprints, fix API field calls
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
Content .txt files:
- narrative.txt (×4): Introduction → Intro
- chapter.txt (×3): Text → Body
- geoformat.txt: Intro → Text
- map.txt: move Text content into Intro field

narrative.json.php:
- parseChapter: $chapter->text() → $chapter->body()
- parseMarker: $marker->text() → $marker->body()
- parseMap: $map->text() → $map->intro()
- narrative root: $page->introduction() → $page->intro()

Also commits Kirby content directory rename (1_cohesion-des-mondes → cohesion-des-mondes)
and new _drafts content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 17:09:51 +01:00
isUnknown
f3c7132044 refactor: simplify ElementPopup with flat refs and style descriptors
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 22s
Flatten ref({ value }) to simple ref(), replace 9 updateX functions with
a generic updateProp driven by descriptor arrays, and loop over descriptors
in generatePreviewCss/loadValuesFromStylesheet/applyAllStyles. Remove
trivial passthrough computed properties. (-123 lines)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:47:58 +01:00
isUnknown
0c682c78c0 rename parseCarte → parseMap, fix marker icon size, remove testing checklist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:10:14 +01:00
isUnknown
41fbe71a1f feat: render full map content (image, intro, markers) in PagedJS
- Fix template check 'carte' → 'map' so map subpages are served by API
- Add parseMarker() and enrich parseCarte() with static image, intro, markers
- Include map children in parseGeoformat() alongside chapters
- Resolve map block references in chapters to full carte data
- Update narrative store flattening with new carte fields
- Replace MapBlock placeholder with full carte rendering (title, image, tags, intro, markers with icons and blocks)
- Add default marker-pin.svg for markers without custom icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:00:28 +01:00
isUnknown
9d80845335 improve map blueprint layout 2026-02-26 11:37:54 +01:00
isUnknown
d07522ae7f map blueprint : layout and field text -> intro 2026-02-26 11:35:30 +01:00
isUnknown
45a41e5d89 coverLabel : add " 2026-02-26 11:30:32 +01:00
isUnknown
033023f6ef refactor: move coverFiles to plugin as page/file methods
Replace GeoformatPage model with a plugin registering coverFiles as a
pageMethod (available on all pages) and coverLabel as a fileMethod to
display "Carte [title]" for map children files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:30:32 +01:00
isUnknown
c8c544e427 merge 2026-02-26 11:30:25 +01:00
isUnknown
c5cc94bf5d feat: add geoformat page model with coverFiles method
Expose combined files (page files + map children files) for the cover
field query in the geoformat blueprint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:29:07 +01:00
isUnknown
9482dfa08c refactor: restructure blueprints with tabs and shared fields
Reorganize narrative, geoformat, chapter, project and map blueprints
to use tabs layout. Add shared blueprint fields and files tab partials.
Update map block query for new page hierarchy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:29:07 +01:00
isUnknown
ffcb1a9f2e rename: chapitre/projet templates to chapter/project
Standardize French template names to English across blueprints,
content files, PHP templates, Vue components and Pinia stores.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:29:07 +01:00
sarahgarcin1
99a924010f page projet.php
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 22s
2026-02-26 09:11:39 +01:00
sarahgarcin1
95efcac454 merge
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
2026-02-24 19:49:50 +01:00
sarahgarcin1
f6032f717d narrative web version 2026-02-24 19:47:30 +01:00
isUnknown
9ea02b2465 fix: capture map image immediately on "Définir le cadrage" click
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
Save map data directly via API instead of emit('input') to avoid
draft state. Capture image, clear flag, then reload — the panel
shows the correct image in a single reload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:26:40 +01:00
isUnknown
342a6eccf1 fix: update Coloris color swatches in TextSettings after loading custom styles
Dispatch input events on color inputs after syncFromStore so Coloris
updates its ::before pseudo-element swatches with loaded values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:02:33 +01:00
isUnknown
f760e1942a fix: race condition on custom styles loading + misc cleanup
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 22s
Guard watcher-triggered renders in usePreviewRenderer until first
explicit render completes, preventing premature renders with default
styles. Also: disable Contenu tab, update content/blueprints, add
global disabled button styles, minor formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 13:53:55 +01:00
isUnknown
9ed028a560 git : track content
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 21s
2026-02-12 15:58:44 +01:00
isUnknown
51532d41d9 Map plugin : remove map static image plugin
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 18s
2026-02-06 12:06:32 +01:00
isUnknown
208d46ff28 refactor: one PHP file per route with subdirectories
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 19s
Properly organize routes following design-to-pack pattern:
- routes/markers/get.php
- routes/markers/create.php
- routes/markers/update.php
- routes/markers/delete.php
- routes/position/update.php
- routes/image/capture.php
- routes/image/check-flag.php
- routes/image/clear-flag.php

Each route in its own file for better maintainability.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 11:58:54 +01:00
isUnknown
590c842072 refactor: split API routes into separate files
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 15s
Reorganize routes following design-to-pack pattern:
- routes/markers.php: CRUD operations for markers
- routes/position.php: Position update (single mode)
- routes/image.php: Image capture and regeneration flag management

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 11:55:55 +01:00
isUnknown
9193ac8900 feat: implement automatic static map image generation
- Add html-to-image for capturing map container with markers
- Auto-generate map image on page/marker save via hooks
- Use flag system (.regenerate-map-image) to trigger generation on Panel reload
- Create file using Kirby API for proper indexing
- Add mapStaticImage field in blueprint to display generated image
- Wait for map to be fully loaded before capture
- Capture entire container (map + custom markers)
- Filter MapLibre controls from capture

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 11:48:20 +01:00
isUnknown
3465ee5b2a update CI workflow
Some checks failed
Deploy / Build and Deploy to Production (push) Has been cancelled
2026-02-06 09:21:14 +01:00
isUnknown
5531aebc04 feat: add map framing save button and prevent initial load save
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 17s
- Add "Définir le cadrage" button in multi mode to save current map
  center and zoom as default framing
- Add getCurrentZoom() method in MapPreview to retrieve current zoom level
- Fix: prevent automatic save on initial load with isInitialLoad flag
  to avoid marking page as modified when loading existing data
- Style: dark button theme for save framing button

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 09:20:12 +01:00
isUnknown
8e67431622 fix: use title-based slugs for new markers
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 20s
Generate marker slugs from title (e.g., "marqueur-2") instead of
timestamp-based slugs (e.g., "marker-1770362950"). Also fix panelUrl
generation to use Kirby's panel URL method.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:47:28 +01:00
isUnknown
575534d182 feat: display custom marker icons on parent map
API now returns iconUrl and iconSize for each marker, allowing custom
marker icons defined in marker.yml to be displayed on the map-editor
field of the parent map page.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 08:28:49 +01:00
isUnknown
68d3142126 fix: marker title displayed immediately on creation
- Return title directly instead of reading from page object
- Prevents showing identifier/slug before reload
- New markers now display "Marqueur [index]" immediately in list
- Also return num directly for consistency

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 16:27:06 +01:00
isUnknown
75d3b557fe plugin : search input color
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 18s
2026-01-29 16:21:12 +01:00
isUnknown
b19635f324 feat: add custom marker icons with configurable size
- Add markerIcon files field to marker.yml for custom JPG/PNG/SVG icons
- Add markerIconSize range field (20-500px, default 40px) with unit display
- Layout icon fields side-by-side (50/50 width) in marker blueprint
- Add markerIconUrl prop in index.php to auto-detect uploaded icon
- Add markerIconSize prop in index.php to read size from page data
- Update MapPreview.vue to display custom images instead of default pins
- Set icon dimensions dynamically based on markerIconSize value
- Icon size updates on save/reload (reactive implementation deferred)
- Remove custom tiles background functionality (not needed)

Note: Custom icons show uploaded image, may have white background on
transparent PNGs depending on image processing. Size is non-reactive
and requires save + reload to update in preview.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 16:14:33 +01:00
isUnknown
925e98aea7 refactor: use Kirby page title for markers and add button tooltips
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 19s
- Remove custom title field from marker.yml blueprint
- Use default Kirby page title for marker names in MarkerList
- Add French tooltips to MarkerList buttons (Ajouter, Modifier, Supprimer)
- API already uses page title via $marker->title()->value()

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 15:17:17 +01:00
isUnknown
bad465406d fix: resolve marker positioning bug and integrate Kirby design system
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 17s
- Fix marker positioning issue where markers would glide and misalign during zoom
- Implement two-wrapper structure to isolate CSS transforms from MapLibre positioning
- Outer .custom-marker: MapLibre handles positioning via translate3d()
- Inner .marker-inner: Visual transforms (rotate, scale) isolated from MapLibre
- Remove debug console.log statements
- Integrate Kirby design system in MarkerList and GeocodeSearch components
- Use Kirby CSS variables (--input-color-back, --color-border, etc.)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 15:10:32 +01:00
isUnknown
63dc136309 change help message 2026-01-29 14:35:51 +01:00
isUnknown
818506fcfa fix: add polling and reset handling for single mode coordinates
Enhanced coordinate synchronization in single mode to handle Panel
actions like "Supprimer" (reset to saved values).

Issues Fixed:
- Marker not updating when clicking "Supprimer" button in Panel
- Panel "Supprimer" restores saved coordinates but marker didn't move
- No detection of programmatic field value changes

Solution:
- Add MutationObserver to detect attribute changes on input fields
- Add 500ms polling as fallback for value detection
- Add nextTick() for reactive updates to ensure proper timing
- Handle coordinate reset: when invalid, return to default center
- Proper cleanup with onBeforeUnmount for observers and intervals

Behavior:
- User changes field → marker updates immediately
- User drags marker → fields update immediately
- User clicks "Supprimer" → marker returns to saved position
- Fields cleared → marker disappears, map resets to default center

Technical Details:
- MutationObserver watches 'value' attribute on lat/lon inputs
- Polling checks every 500ms for changes missed by events
- Watcher uses nextTick() to ensure DOM updates complete
- All event listeners and observers properly cleaned up on unmount

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 14:34:28 +01:00
isUnknown
cc44a68e66 fix: implement form-based coordinate sync for single mode map
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 19s
Fixed marker display and centering in single mode (marker pages) by
changing from props-based to form-based coordinate synchronization.

Issues Fixed:
- Kirby blueprint query syntax {{ page.field }} passed literal strings
  instead of values to component props
- Invalid coordinates (NaN, NaN) caused map initialization errors
- Marker not displaying in marker page position tab
- Map not centering on marker location

Solution:
- Remove latitude/longitude props from marker.yml blueprint
- Read coordinates directly from Panel form fields via DOM
- Add event listeners to sync form changes with map
- Bidirectional sync: drag marker → updates form fields
- Robust coordinate validation (check for NaN, null, 0)

Changes:
- MapEditor.vue: Add form field reading and event listeners
- MapEditor.vue: Replace props-based coords with reactive refs
- MapEditor.vue: Update marker drag handler to modify form inputs
- marker.yml: Remove non-functional query string props
- routes.php: Use data() instead of body() for all routes

Single Mode Flow:
1. Component reads latitude/longitude from form inputs on mount
2. Creates marker and centers map on valid coordinates
3. Form changes → updates marker position
4. Marker drag → updates form fields (triggers save on user action)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 14:17:01 +01:00
isUnknown
32e8301d91 feat: transform map-editor markers into Kirby subpages
Some checks failed
Deploy / Build and Deploy to Production (push) Has been cancelled
Major refactoring of the map-editor plugin to store markers as Kirby
subpages instead of YAML data, enabling extensible block content.

Backend Changes:
- Add API routes for marker CRUD operations (GET, POST, PATCH, DELETE)
- Create marker.yml blueprint with content & position tabs
- Add markers section to map.yml blueprint
- Update useMapData to only handle center/zoom/background
- Create useMarkersApi composable for API communication

Frontend Changes:
- Refactor MapEditor.vue to support multi/single modes
- Multi mode: loads markers via API, redirects to Panel for editing
- Single mode: displays single marker for position tab in marker page
- Remove MarkerEditor.vue modal (replaced by Panel editing)
- Normalize position format handling (lon vs lng)

API Features:
- Session-based auth for Panel requests (no CSRF needed)
- Proper error handling and validation
- Markers created as listed pages (not drafts)
- Uses Kirby's data() method for JSON parsing

Documentation:
- Add IMPLEMENTATION_SUMMARY.md with technical details
- Add TESTING_CHECKLIST.md with 38 test cases

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 14:08:40 +01:00
isUnknown
b47195488a map plugin : improve styles 2026-01-28 16:33:48 +01:00
isUnknown
2b0f4f8742 refactor: comprehensive map-editor plugin refactoring (phases 1-3)
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 18s
This commit implements a complete refactoring of the map-editor plugin to
improve code organization, reusability, and maintainability.

## Phase 1: Extraction of composables and factory functions

**New composables:**
- `useMarkers.js`: Centralized marker state and CRUD operations
  - Exports: markers, selectedMarkerId, editingMarker refs
  - Computed: canAddMarker, hasMarkers, selectedMarker
  - Methods: addMarker, updateMarker, deleteMarker, selectMarker, etc.
  - Includes createMarker() factory to eliminate code duplication

- `useMapData.js`: Map data persistence (YAML load/save)
  - Exports: center, zoom refs
  - Methods: loadMapData, saveMapData, debouncedSave
  - Handles lifecycle cleanup of debounce timeouts

**Benefits:**
- Eliminated code duplication (2 identical marker creation blocks)
- Separated business logic from UI concerns
- Improved testability with pure functions
- Added JSDoc documentation throughout

## Phase 2: Component extraction

**New components:**
- `MarkerList.vue`: Extracted sidebar UI from MapEditor.vue
  - Props: markers, selectedMarkerId, maxMarkers
  - Emits: add-marker, select-marker, edit-marker, delete-marker, select-location
  - Includes integrated GeocodeSearch component
  - Self-contained styles with scoped CSS

**Benefits:**
- MapEditor.vue reduced from 370 → 230 lines (-40%)
- Clear separation of concerns (orchestration vs presentation)
- Reusable component for potential future use
- Easier to test and maintain

## Phase 3: Utils restructuring with JSDoc

**New structure:**
```
utils/
├── constants.js           # NOMINATIM_API, MAP_DEFAULTS, DEBOUNCE_DELAYS
├── api/
│   └── nominatim.js      # geocode() with full JSDoc typedefs
└── helpers/
    └── debounce.js       # Generic debounce utility
```

**Removed:**
- `utils/geocoding.js` (replaced by modular structure)

**Benefits:**
- Constants centralized for easy configuration
- API layer separated from helpers
- Complete JSDoc type annotations for better IDE support
- Better organization following standard patterns

## Updated components

**MapEditor.vue:**
- Now uses useMarkers and useMapData composables
- Uses MarkerList component instead of inline template
- Cleaner setup function with better separation
- Reduced from 537 → 256 lines (CSS moved to MarkerList)

**GeocodeSearch.vue:**
- Updated imports to use new utils structure
- Uses DEBOUNCE_DELAYS constant instead of hardcoded value

## Build verification

-  npm run build successful
-  Bundle size unchanged (806.10 kB / 223.46 KiB gzipped)
-  All functionality preserved
-  No breaking changes

## Documentation

- Added comprehensive README.md with:
  - Architecture overview
  - Composables usage examples
  - Component API documentation
  - Data flow diagrams
  - Development guide

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 16:29:15 +01:00
isUnknown
437349cd2b feat: add Phase 2 features to map-editor plugin (rich marker content)
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 16s
Implement marker editing modal with comprehensive content management:
- MarkerEditor.vue modal with custom overlay (replaces k-dialog)
- Edit marker on double-click or via edit button in list
- Required fields: title (validated), optional description
- Editable position (lat/lon) and custom icon support
- Content blocks system: add/remove/reorder text and image blocks
- French translations for all UI elements
- Click marker in list to center map on it with smooth animation
- Fix marker anchor to bottom (pin tip) for accurate positioning
- Auto-save with isDirty flag to detect any form changes

Modal features:
- Title field (required)
- Description textarea (optional)
- Position inputs (latitude/longitude)
- Icon selector (default or custom via UUID/filename)
- Content builder with text and image blocks
- Block reordering (up/down) and deletion
- Validation: save button enabled only when title filled and form modified

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 16:16:19 +01:00
isUnknown
dc84ff63a2 feat: add map-editor plugin with interactive OSM map and markers
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 19s
Implement Phase 1 of custom Kirby plugin for editing interactive maps:
- OpenStreetMap base layer with MapLibre GL JS
- Click to add markers, drag to reposition
- Marker list sidebar with selection and deletion
- Auto-save with debounce (YAML format)
- Add marker button creates marker at current map center
- Max 50 markers per map (configurable)
- Clean UI with marker counter

Blueprint updated to use new map-editor field type instead of placeholder.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 15:43:23 +01:00
isUnknown
7e42c4baec refactor: rename carte template to map for consistency
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 15s
Rename all carte.yml files to map.yml and update references in blueprints to use English naming convention consistently across the codebase. This includes renaming 5 content files and updating template references in narrative and block blueprints.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 14:07:40 +01:00
isUnknown
c7e751695f fix build process
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 17s
2026-01-27 18:15:34 +01:00
isUnknown
e229deb0f6 fix color picker z-index (always above)
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 16s
2026-01-09 17:03:11 +01:00
isUnknown
83455b7098 fix: improve Coloris color picker visibility and button clickability
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 16s
- Fix grid layout: add second column for input (grid-template-columns: var(--input-h) 1fr)
- Ensure color picker button is clickable with cursor pointer and pointer-events auto
- Set color picker z-index to 10000 to display above all UI elements
- Add global styles to ensure Coloris button is always clickable

Fixes issues where:
- Color picker appeared behind ElementPopup
- Button was not consistently clickable
- Grid layout was missing second column definition

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 16:54:10 +01:00
isUnknown
f8ac1ec8fc untrack content 2026-01-09 16:22:56 +01:00