ammachado opened a new pull request, #24064:
URL: https://github.com/apache/camel/pull/24064

   # Description
   
   _Claude Code on behalf of Adriano Machado_
   
   Implements the `camel-route-diagram` web component 
([CAMEL-23636](https://issues.apache.org/jira/browse/CAMEL-23636)), a 
framework-agnostic, zero-dependency SVG diagram renderer for Apache Camel 
routes. It is distributed as a single minified ES module bundled inside 
`camel-diagram`, ready to be embedded in the developer console or any HTML page.
   
   **What this PR adds:**
   
   - **`camel-diagram` Maven module** — a new `components/camel-diagram` module 
with `frontend-maven-plugin` build infrastructure (Node/npm managed by the 
plugin, no system-level tooling required). esbuild bundles `src/main/frontend/` 
into 
`src/main/resources/META-INF/resources/camel/diagram/camel-route-diagram.js`.
   - **Layout engine** (`layout.js`) — a pure-JS port of 
`RouteDiagramLayoutEngine`: depth-first traversal, branch-aware column 
assignment, collision avoidance for multi-branch EIPs 
(choice/multicast/circuitBreaker), and a post-pass that prevents straight-line 
edges from passing through intermediate nodes.
   - **Web component** (`camel-route-diagram.js`) — a 
[Lit](https://lit.dev)-based custom element (`<camel-route-diagram src="…" 
refresh="…" filter="…">`) that polls the route-structure dev-console endpoint, 
lays out nodes with the engine above, and renders an SVG with:
     - Colour-coded rounded-rect nodes with [Lucide](https://lucide.dev) icons 
(ISC License, paths inlined) and optional exchange-count statistics.
     - Cubic Bézier edges with arrow-head markers scoped per `<svg>` (Firefox 
compatibility).
     - Full CSS custom-property theming (`--crd-color-*`, `--crd-bg`, 
`--crd-fg`, …) and automatic dark-mode via `prefers-color-scheme`.
     - ARIA labels on every node and diagram for accessibility.
     - `AbortController`-based fetch cancellation so overlapping polls never 
produce stale renders.
   - **License attribution** — `build.mjs` appends Lucide's ISC notice to the 
esbuild-generated `.LEGAL.txt` sidecar (esbuild only detects npm-bundled 
packages, not inlined string literals) and regenerates 
`THIRD-PARTY-NOTICES.txt` with both the BSD-3-Clause (Lit) and ISC (Lucide) 
full license texts.
   - **Smoke-test page** (`smoke-test.html`) — a self-contained HTML file for 
local manual testing; no build step needed.
   - **Documentation** — a new `camel-diagram.adoc` component page and an entry 
in the 4.21 upgrade guide.
   - **Test** — `WebComponentBundleTest` verifies that the built JS artefact is 
present in the JAR and that `THIRD-PARTY-NOTICES.txt` mentions both Lit and 
Lucide.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL-23636) 
filed for the change.
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to