@riebeckite/plugin-local-graph 0.0.5 → 0.0.7

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 CHANGED
@@ -81,6 +81,6 @@ internal selection key `/explore?note=<slug>`.
81
81
 
82
82
  ## See also
83
83
 
84
- - [Plugin guide](../../docs/plugins_en.md)
85
- - [`@riebeckite/plugin-backlinks`](../plugin-backlinks/README.md)
86
- - [`@riebeckite/plugin-garden-explorer`](../plugin-garden-explorer/README.md)
84
+ - [Plugin guide](../../../docs/en/plugin-system.md)
85
+ - [`@riebeckite/plugin-backlinks`](../backlinks/README.md)
86
+ - [`@riebeckite/plugin-garden-explorer`](../garden-explorer/README.md)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { buildGraphEdges, layoutRadialGraph } from "@riebeckite/core";
2
2
  export { default as LocalGraph } from "./components/local-graph.js";
3
- export { buildGraphEdges, layoutRadialGraph };
4
3
  export type { LocalGraphData, LocalGraphNode, LocalGraphNodeRelation, } from "./src/local-graph.js";
5
4
  export { getLocalGraph } from "./src/local-graph.server.js";
5
+ export { buildGraphEdges, layoutRadialGraph };
6
6
  export declare function localGraphPlugin(): import("@riebeckite/core").RiebeckitePlugin<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-local-graph",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "hono": "^4.12.25",
25
- "@riebeckite/core": "0.0.5"
25
+ "@riebeckite/core": "0.0.7"
26
+ },
27
+ "devDependencies": {
28
+ "tsx": "^4.22.4",
29
+ "@riebeckite/test": "0.0.7"
26
30
  },
27
31
  "publishConfig": {
28
32
  "access": "public"
@@ -57,6 +61,7 @@
57
61
  "./style.css"
58
62
  ],
59
63
  "scripts": {
60
- "build": "node ../../../scripts/build_package.mjs"
64
+ "build": "node ../../../scripts/build_package.mjs",
65
+ "test": "node --import tsx --test \"test/*.test.ts\""
61
66
  }
62
67
  }
package/style.css CHANGED
@@ -1,149 +1,149 @@
1
- @layer components {
2
- .local-graph {
3
- margin-top: 4rem;
4
- padding-top: 1.5rem;
5
- border-top: var(--rb-rule-width) solid var(--rb-color-border);
6
- }
7
-
8
- .local-graph__header {
9
- display: flex;
10
- justify-content: space-between;
11
- align-items: end;
12
- gap: var(--rb-space-2);
13
- margin-bottom: var(--rb-space-1);
14
- }
15
-
16
- .local-graph__eyebrow {
17
- margin: 0 0 0.25rem;
18
- color: var(--rb-color-muted);
19
- font-size: 0.75rem;
20
- font-weight: 700;
21
- letter-spacing: 0.12em;
22
- text-transform: uppercase;
23
- }
24
-
25
- .local-graph h2 {
26
- margin: 0;
27
- font-size: clamp(1.4rem, 4vw, 2rem);
28
- line-height: 1.1;
29
- }
30
-
31
- .local-graph__explorer-link {
32
- flex: none;
33
- color: var(--rb-color-ink);
34
- font-size: 0.9rem;
35
- font-weight: 700;
36
- text-decoration: none;
37
- border-bottom: var(--rb-rule-width) solid currentColor;
38
- }
39
-
40
- .local-graph__explorer-link:focus-visible,
41
- .local-graph__node a:focus-visible {
42
- outline: 2px solid var(--rb-color-accent);
43
- outline-offset: 2px;
44
- }
45
-
46
- .local-graph__canvas {
47
- display: block;
48
- width: 100%;
49
- min-height: 16rem;
50
- border: var(--rb-rule-width) solid var(--rb-color-border);
51
- background-image:
52
- linear-gradient(var(--rb-color-border) 1px, transparent 1px),
53
- linear-gradient(90deg, var(--rb-color-border) 1px, transparent 1px);
54
- background-size: 40px 40px;
55
- }
56
-
57
- .local-graph__edge {
58
- stroke: var(--rb-color-border);
59
- stroke-width: 1.2;
60
- }
61
-
62
- .local-graph__edge[data-direction="backlink"] {
63
- stroke-dasharray: 4 4;
64
- }
65
-
66
- .local-graph__node a {
67
- color: var(--rb-color-ink);
68
- cursor: pointer;
69
- text-decoration: none;
70
- }
71
-
72
- .local-graph__node circle {
73
- fill: var(--rb-color-paper);
74
- stroke: var(--rb-color-ink);
75
- stroke-width: 1.5;
76
- }
77
-
78
- .local-graph__node[data-relation="current"] circle {
79
- fill: var(--rb-color-accent);
80
- stroke: var(--rb-color-accent);
81
- }
82
-
83
- .local-graph__node[data-relation="backlink"] circle {
84
- stroke-dasharray: 3 3;
85
- }
86
-
87
- .local-graph__node[data-relation="both"] circle {
88
- fill: color-mix(in srgb, var(--rb-color-accent) 18%, var(--rb-color-paper));
89
- }
90
-
91
- .local-graph__node text {
92
- fill: currentColor;
93
- font-size: 0.78rem;
94
- font-weight: 600;
95
- pointer-events: none;
96
- }
97
-
98
- .local-graph__explorer-link:hover,
99
- .local-graph__node a:hover text {
100
- color: var(--rb-color-accent);
101
- fill: var(--rb-color-accent);
102
- }
103
-
104
- .local-graph__legend {
105
- display: flex;
106
- flex-wrap: wrap;
107
- gap: var(--rb-space-1);
108
- margin-top: var(--rb-space-1);
109
- color: var(--rb-color-muted);
110
- font-size: 0.8rem;
111
- }
112
-
113
- .local-graph__legend span {
114
- display: inline-flex;
115
- align-items: center;
116
- gap: 0.4rem;
117
- }
118
-
119
- .local-graph__legend i {
120
- width: 0.75rem;
121
- height: 0.75rem;
122
- border: var(--rb-rule-width) solid var(--rb-color-ink);
123
- border-radius: 999px;
124
- }
125
-
126
- .local-graph__legend i[data-kind="current"] {
127
- background: var(--rb-color-accent);
128
- border-color: var(--rb-color-accent);
129
- }
130
-
131
- .local-graph__legend i[data-kind="backlink"] {
132
- border-style: dashed;
133
- }
134
-
135
- @media (max-width: 640px) {
136
- .local-graph__header {
137
- display: grid;
138
- align-items: start;
139
- }
140
-
141
- .local-graph__canvas {
142
- min-height: 13rem;
143
- }
144
-
145
- .local-graph__node text {
146
- font-size: 0.68rem;
147
- }
148
- }
149
- }
1
+ @layer components {
2
+ .local-graph {
3
+ margin-top: 4rem;
4
+ padding-top: 1.5rem;
5
+ border-top: var(--rb-rule-width) solid var(--rb-color-border);
6
+ }
7
+
8
+ .local-graph__header {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: end;
12
+ gap: var(--rb-space-2);
13
+ margin-bottom: var(--rb-space-1);
14
+ }
15
+
16
+ .local-graph__eyebrow {
17
+ margin: 0 0 0.25rem;
18
+ color: var(--rb-color-muted);
19
+ font-size: 0.75rem;
20
+ font-weight: 700;
21
+ letter-spacing: 0.12em;
22
+ text-transform: uppercase;
23
+ }
24
+
25
+ .local-graph h2 {
26
+ margin: 0;
27
+ font-size: clamp(1.4rem, 4vw, 2rem);
28
+ line-height: 1.1;
29
+ }
30
+
31
+ .local-graph__explorer-link {
32
+ flex: none;
33
+ color: var(--rb-color-ink);
34
+ font-size: 0.9rem;
35
+ font-weight: 700;
36
+ text-decoration: none;
37
+ border-bottom: var(--rb-rule-width) solid currentColor;
38
+ }
39
+
40
+ .local-graph__explorer-link:focus-visible,
41
+ .local-graph__node a:focus-visible {
42
+ outline: 2px solid var(--rb-color-accent);
43
+ outline-offset: 2px;
44
+ }
45
+
46
+ .local-graph__canvas {
47
+ display: block;
48
+ width: 100%;
49
+ min-height: 16rem;
50
+ border: var(--rb-rule-width) solid var(--rb-color-border);
51
+ background-image:
52
+ linear-gradient(var(--rb-color-border) 1px, transparent 1px),
53
+ linear-gradient(90deg, var(--rb-color-border) 1px, transparent 1px);
54
+ background-size: 40px 40px;
55
+ }
56
+
57
+ .local-graph__edge {
58
+ stroke: var(--rb-color-border);
59
+ stroke-width: 1.2;
60
+ }
61
+
62
+ .local-graph__edge[data-direction="backlink"] {
63
+ stroke-dasharray: 4 4;
64
+ }
65
+
66
+ .local-graph__node a {
67
+ color: var(--rb-color-ink);
68
+ cursor: pointer;
69
+ text-decoration: none;
70
+ }
71
+
72
+ .local-graph__node circle {
73
+ fill: var(--rb-color-paper);
74
+ stroke: var(--rb-color-ink);
75
+ stroke-width: 1.5;
76
+ }
77
+
78
+ .local-graph__node[data-relation="current"] circle {
79
+ fill: var(--rb-color-accent);
80
+ stroke: var(--rb-color-accent);
81
+ }
82
+
83
+ .local-graph__node[data-relation="backlink"] circle {
84
+ stroke-dasharray: 3 3;
85
+ }
86
+
87
+ .local-graph__node[data-relation="both"] circle {
88
+ fill: color-mix(in srgb, var(--rb-color-accent) 18%, var(--rb-color-paper));
89
+ }
90
+
91
+ .local-graph__node text {
92
+ fill: currentColor;
93
+ font-size: 0.78rem;
94
+ font-weight: 600;
95
+ pointer-events: none;
96
+ }
97
+
98
+ .local-graph__explorer-link:hover,
99
+ .local-graph__node a:hover text {
100
+ color: var(--rb-color-accent);
101
+ fill: var(--rb-color-accent);
102
+ }
103
+
104
+ .local-graph__legend {
105
+ display: flex;
106
+ flex-wrap: wrap;
107
+ gap: var(--rb-space-1);
108
+ margin-top: var(--rb-space-1);
109
+ color: var(--rb-color-muted);
110
+ font-size: 0.8rem;
111
+ }
112
+
113
+ .local-graph__legend span {
114
+ display: inline-flex;
115
+ align-items: center;
116
+ gap: 0.4rem;
117
+ }
118
+
119
+ .local-graph__legend i {
120
+ width: 0.75rem;
121
+ height: 0.75rem;
122
+ border: var(--rb-rule-width) solid var(--rb-color-ink);
123
+ border-radius: 999px;
124
+ }
125
+
126
+ .local-graph__legend i[data-kind="current"] {
127
+ background: var(--rb-color-accent);
128
+ border-color: var(--rb-color-accent);
129
+ }
130
+
131
+ .local-graph__legend i[data-kind="backlink"] {
132
+ border-style: dashed;
133
+ }
134
+
135
+ @media (max-width: 640px) {
136
+ .local-graph__header {
137
+ display: grid;
138
+ align-items: start;
139
+ }
140
+
141
+ .local-graph__canvas {
142
+ min-height: 13rem;
143
+ }
144
+
145
+ .local-graph__node text {
146
+ font-size: 0.68rem;
147
+ }
148
+ }
149
+ }