@graph-artifact/core 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,10 @@ interface GraphCanvasProps {
12
12
  /** Optional branding overlays (included in exports). */
13
13
  branding?: {
14
14
  logo?: {
15
- src: string;
15
+ /** Image URL to render (e.g. PNG). Prefer `node` for inline SVG via SVGR. */
16
+ src?: string;
17
+ /** Inline logo node (e.g. an SVGR component). */
18
+ node?: ReactNode;
16
19
  alt?: string;
17
20
  position?: CornerPosition;
18
21
  width?: number;
@@ -349,7 +349,9 @@ function GraphCanvasInner({ parsed, metadata, onNodeClick, canvasOverrides, hide
349
349
  background: ${theme.mode === 'dark' ? theme.color.darkBg2 : theme.color.white};
350
350
  border: 1px solid ${theme.color.gray2};
351
351
  }
352
- ` }), branding?.logo?.src && (_jsx("div", { style: {
352
+ /* Ensure inline SVG logos scale to the requested width. */
353
+ .ga-logo svg { width: 100%; height: auto; display: block; }
354
+ ` }), (branding?.logo?.src || branding?.logo?.node) && (_jsx("div", { style: {
353
355
  position: 'absolute',
354
356
  zIndex: 5,
355
357
  pointerEvents: 'none',
@@ -358,7 +360,11 @@ function GraphCanvasInner({ parsed, metadata, onNodeClick, canvasOverrides, hide
358
360
  ...(branding.logo.position === 'bottom-right' ? { bottom: 12, right: 12 } : {}),
359
361
  ...(branding.logo.position === 'top-left' || !branding.logo.position ? { top: 12, left: 12 } : {}),
360
362
  opacity: branding.logo.opacity ?? 1,
361
- }, children: _jsx("img", { src: branding.logo.src, alt: branding.logo.alt ?? 'logo', width: branding.logo.width ?? 120, height: branding.logo.height, style: { display: 'block' } }) })), branding?.watermark?.text && (_jsxs("div", { style: {
363
+ }, children: branding.logo.node ? (_jsx("div", { className: "ga-logo", style: {
364
+ width: branding.logo.width ?? 120,
365
+ height: branding.logo.height,
366
+ display: 'block',
367
+ }, children: branding.logo.node })) : (_jsx("img", { src: branding.logo.src, alt: branding.logo.alt ?? 'logo', width: branding.logo.width ?? 120, height: branding.logo.height, style: { display: 'block' } })) })), branding?.watermark?.text && (_jsxs("div", { style: {
362
368
  position: 'absolute',
363
369
  left: '50%',
364
370
  bottom: 14,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graph-artifact/core",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Composable Mermaid-like parser, layout engine, and React renderer for interactive diagram artifacts.",
5
5
  "license": "MIT",
6
6
  "repository": {