@restormel/ui-graph-svelte 0.1.0 → 0.1.1
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.
- package/README.md +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/GraphCanvas.svelte.d.ts +5 -1
- package/dist/lib/NodeDetail.svelte.d.ts +14 -1
- package/dist/types.d.ts +18 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,6 +11,15 @@ Svelte 5 implementation of the Restormel Graph canvas (`GraphCanvas`, optional `
|
|
|
11
11
|
|
|
12
12
|
There is **no** `@restormel/contracts` dependency.
|
|
13
13
|
|
|
14
|
+
## TypeScript
|
|
15
|
+
|
|
16
|
+
- **`dist` component typings** use `Component<GraphRendererProps>` for **`GraphCanvas`** and **`Component<NodeDetailProps>`** for **`NodeDetail`**, so callbacks such as **`onJumpToReferences?: (nodeId: string) => void`** are explicit under strict **`svelte-check`**.
|
|
17
|
+
- Re-exported aliases: **`GraphCanvasProps`** (same as **`GraphRendererProps`** from **`@restormel/graph-core/viewModel`**), **`NodeDetailProps`**.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import type { GraphCanvasProps } from "@restormel/ui-graph-svelte";
|
|
21
|
+
```
|
|
22
|
+
|
|
14
23
|
## Install (workspace / monorepo)
|
|
15
24
|
|
|
16
25
|
```bash
|
|
@@ -23,6 +32,8 @@ Build `@restormel/graph-core` before consuming subpath imports in dev toolchains
|
|
|
23
32
|
|
|
24
33
|
The canvas uses SOPHIA design tokens as CSS variables (for example `--color-bg`, `--color-sage`, `--color-text`, `--radius-md`, `--font-ui`, `--text-meta`). Host apps should load a compatible token sheet. The demo app mirrors SOPHIA’s `design-tokens.css` under `apps/restormel-graph-demo/src/lib/graph-demo-tokens.css`.
|
|
25
34
|
|
|
35
|
+
**`@restormel/ui-graph-svelte/styles.css`:** optional; ships **component-scoped** rules from the library build. It does **not** define `:root` palette variables. If the host already loads the same token names as SOPHIA’s `design-tokens.css`, importing `styles.css` is **not** required for colours (see **[docs/restormel-graph-sophia-consumer.md](../../docs/restormel-graph-sophia-consumer.md)** §3).
|
|
36
|
+
|
|
26
37
|
## Usage
|
|
27
38
|
|
|
28
39
|
Pass **nodes**, **edges**, and optional **ghost** layers and semantic style maps. Shape matches `GraphRendererProps` in `@restormel/graph-core/viewModel`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as GraphCanvas } from './lib/GraphCanvas.svelte';
|
|
2
2
|
export { default as NodeDetail } from './lib/NodeDetail.svelte';
|
|
3
3
|
export { graphCanvasEdgeKey, type GraphCanvasEdgeSemanticStyle, type GraphCanvasNodeSemanticStyle, type GraphCanvasNodeShape, } from './lib/semanticStyles';
|
|
4
|
+
export type { GraphCanvasProps, NodeDetailProps } from './types';
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
import type { GraphEdge, GraphNode } from "@restormel/graph-core/viewModel";
|
|
3
|
+
|
|
4
|
+
export interface NodeDetailProps {
|
|
5
|
+
node: GraphNode;
|
|
6
|
+
edges: GraphEdge[];
|
|
7
|
+
nodes: GraphNode[];
|
|
8
|
+
position: { x: number; y: number };
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onJumpToReferences?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const NodeDetail: Component<NodeDetailProps>;
|
|
14
|
+
export default NodeDetail;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GraphEdge, GraphNode } from '@restormel/graph-core/viewModel';
|
|
2
|
+
/**
|
|
3
|
+
* GraphCanvas props — identical to Contract v0 {@link GraphRendererProps} in `@restormel/graph-core/viewModel`.
|
|
4
|
+
* Re-exported for ergonomic imports from this package.
|
|
5
|
+
*/
|
|
6
|
+
export type { GraphRendererProps as GraphCanvasProps } from '@restormel/graph-core/viewModel';
|
|
7
|
+
/** Props for the inline NodeDetail panel. */
|
|
8
|
+
export interface NodeDetailProps {
|
|
9
|
+
node: GraphNode;
|
|
10
|
+
edges: GraphEdge[];
|
|
11
|
+
nodes: GraphNode[];
|
|
12
|
+
position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
onJumpToReferences?: () => void;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restormel/ui-graph-svelte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Svelte 5 graph canvas for Restormel Graph Contract v0 (ported from SOPHIA).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"svelte": "^5.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@restormel/graph-core": "0.1.
|
|
31
|
+
"@restormel/graph-core": "0.1.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|