@riebeckite/graph 0.0.0-stage → 0.0.36

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/package.json CHANGED
@@ -1,6 +1,74 @@
1
1
  {
2
2
  "name": "@riebeckite/graph",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.36",
4
+ "license": "Apache-2.0",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "source": "./index.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./client": {
16
+ "types": "./dist/client.d.ts",
17
+ "import": "./dist/client.js",
18
+ "source": "./client.ts",
19
+ "default": "./dist/client.js"
20
+ },
21
+ "./ui": {
22
+ "types": "./dist/ui.d.ts",
23
+ "import": "./dist/ui.js",
24
+ "source": "./ui.tsx",
25
+ "default": "./dist/ui.js"
26
+ },
27
+ "./style.css": "./style.css",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "files": [
31
+ "LICENSE",
32
+ "README.md",
33
+ "README_ja.md",
34
+ "dist",
35
+ "style.css"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "dependencies": {
41
+ "hono": "^4.12.25"
42
+ },
43
+ "devDependencies": {
44
+ "tsx": "^4.22.4"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/Rerurate514/riebeckite.git",
49
+ "directory": "packages/graph"
50
+ },
51
+ "homepage": "https://github.com/Rerurate514/riebeckite#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/Rerurate514/riebeckite/issues"
54
+ },
55
+ "description": "Shared force-directed graph engine, filters, groups, and settings for Riebeckite.",
56
+ "keywords": [
57
+ "riebeckite",
58
+ "graph",
59
+ "force",
60
+ "canvas",
61
+ "obsidian"
62
+ ],
63
+ "engines": {
64
+ "node": "^20.19.0 || >=22.12.0"
65
+ },
66
+ "sideEffects": [
67
+ "./style.css"
68
+ ],
69
+ "scripts": {
70
+ "build": "node ../../scripts/build_package.mjs",
71
+ "test": "node --import tsx --test \"test/*.test.ts\"",
72
+ "benchmark": "node --import tsx benchmark/run.ts"
73
+ }
6
74
  }
package/style.css ADDED
@@ -0,0 +1,393 @@
1
+ .rr-graph {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ min-height: 0;
6
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
7
+ border-radius: var(--rb-radius-md, 6px);
8
+ background: var(--rb-color-paper, #ffffff);
9
+ color: var(--rb-color-ink, #1f2937);
10
+ overflow: hidden;
11
+ }
12
+
13
+ .rr-graph__header {
14
+ display: flex;
15
+ align-items: baseline;
16
+ justify-content: space-between;
17
+ gap: 1rem;
18
+ padding: 0.75rem 1rem;
19
+ border-bottom: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
20
+ }
21
+
22
+ .rr-graph__title {
23
+ margin: 0;
24
+ font-family: var(--rb-font-heading, inherit);
25
+ font-size: 0.95rem;
26
+ font-weight: 600;
27
+ letter-spacing: 0.01em;
28
+ }
29
+
30
+ .rr-graph__count,
31
+ .rr-graph__status,
32
+ .rr-graph__help {
33
+ color: var(--rb-color-muted, #6b7280);
34
+ font-size: 0.72rem;
35
+ line-height: 1.5;
36
+ }
37
+
38
+ .rr-graph__help {
39
+ margin: 0.25rem 0 0.5rem;
40
+ }
41
+
42
+ .rr-graph__toolbar {
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: space-between;
46
+ gap: 0.75rem;
47
+ min-height: 2.5rem;
48
+ padding: 0.35rem 0.5rem 0.35rem 0.75rem;
49
+ border-bottom: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
50
+ background: var(--rb-color-surface, #f7f7f5);
51
+ }
52
+
53
+ .rr-graph__status {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ gap: 0.5rem;
57
+ align-items: center;
58
+ text-transform: uppercase;
59
+ letter-spacing: 0.06em;
60
+ }
61
+
62
+ .rr-graph__warning {
63
+ color: var(--rb-color-warning, #a16207);
64
+ text-transform: none;
65
+ letter-spacing: 0;
66
+ }
67
+
68
+ .rr-graph__actions {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 0.25rem;
72
+ }
73
+
74
+ .rr-graph__actions button,
75
+ .rr-graph__menu button,
76
+ .rr-graph__settings button,
77
+ .rr-graph__groups button,
78
+ .rr-graph__animate-actions button {
79
+ appearance: none;
80
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
81
+ border-radius: var(--rb-radius-sm, 4px);
82
+ background: var(--rb-color-paper, #ffffff);
83
+ color: var(--rb-color-ink, #1f2937);
84
+ font: inherit;
85
+ font-size: 0.72rem;
86
+ line-height: 1;
87
+ padding: 0.4rem 0.5rem;
88
+ cursor: pointer;
89
+ }
90
+
91
+ .rr-graph__actions button:hover,
92
+ .rr-graph__menu button:hover,
93
+ .rr-graph__settings button:hover,
94
+ .rr-graph__groups button:hover,
95
+ .rr-graph__animate-actions button:hover {
96
+ border-color: var(--rb-color-border-strong, #9ca3af);
97
+ background: var(--rb-color-surface, #f7f7f5);
98
+ }
99
+
100
+ .rr-graph__actions button:disabled,
101
+ .rr-graph__settings button:disabled {
102
+ opacity: 0.45;
103
+ cursor: default;
104
+ }
105
+
106
+ .rr-graph__settings-toggle {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ }
111
+
112
+ .rr-graph__stage {
113
+ position: relative;
114
+ flex: 1;
115
+ min-height: 18rem;
116
+ height: min(58vh, 34rem);
117
+ background: var(--rb-color-paper, #ffffff);
118
+ }
119
+
120
+ .rr-graph__canvas {
121
+ position: absolute;
122
+ inset: 0;
123
+ display: block;
124
+ width: 100%;
125
+ height: 100%;
126
+ cursor: grab;
127
+ touch-action: none;
128
+ outline: none;
129
+ }
130
+
131
+ .rr-graph__canvas:focus-visible {
132
+ box-shadow: inset 0 0 0 2px var(--rb-color-focus, #2563eb);
133
+ }
134
+
135
+ .rr-graph__fallback {
136
+ margin: 0;
137
+ padding: 1rem 1.25rem;
138
+ font-size: 0.8rem;
139
+ columns: 2;
140
+ }
141
+
142
+ .rr-graph__fallback a {
143
+ color: var(--rb-color-link, #2563eb);
144
+ }
145
+
146
+ .rr-graph__menu {
147
+ position: fixed;
148
+ z-index: 60;
149
+ width: 13rem;
150
+ padding: 0.35rem;
151
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border-strong, #9ca3af);
152
+ border-radius: var(--rb-radius-sm, 4px);
153
+ background: var(--rb-color-paper, #ffffff);
154
+ box-shadow: 0 10px 24px rgb(0 0 0 / 0.16);
155
+ }
156
+
157
+ .rr-graph__menu-title {
158
+ margin: 0;
159
+ padding: 0.35rem 0.5rem 0.45rem;
160
+ border-bottom: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
161
+ color: var(--rb-color-muted, #6b7280);
162
+ font-size: 0.7rem;
163
+ overflow: hidden;
164
+ text-overflow: ellipsis;
165
+ white-space: nowrap;
166
+ }
167
+
168
+ .rr-graph__menu button {
169
+ display: block;
170
+ width: 100%;
171
+ border: 0;
172
+ background: transparent;
173
+ text-align: left;
174
+ padding: 0.45rem 0.5rem;
175
+ }
176
+
177
+ .rr-graph__settings {
178
+ position: absolute;
179
+ top: 0.5rem;
180
+ right: 0.5rem;
181
+ bottom: 0.5rem;
182
+ z-index: 50;
183
+ width: min(19rem, calc(100% - 1rem));
184
+ overflow-y: auto;
185
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border-strong, #9ca3af);
186
+ border-radius: var(--rb-radius-md, 6px);
187
+ background: var(--rb-color-paper, #ffffff);
188
+ box-shadow: 0 12px 32px rgb(0 0 0 / 0.14);
189
+ font-size: 0.75rem;
190
+ }
191
+
192
+ .rr-graph__settings-header {
193
+ position: sticky;
194
+ top: 0;
195
+ z-index: 1;
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: space-between;
199
+ padding: 0.6rem 0.75rem;
200
+ border-bottom: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
201
+ background: var(--rb-color-paper, #ffffff);
202
+ }
203
+
204
+ .rr-graph__settings-header h3 {
205
+ margin: 0;
206
+ font-family: var(--rb-font-heading, inherit);
207
+ font-size: 0.8rem;
208
+ font-weight: 600;
209
+ }
210
+
211
+ .rr-graph__settings details {
212
+ border-bottom: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
213
+ padding: 0.5rem 0.75rem 0.65rem;
214
+ }
215
+
216
+ .rr-graph__settings summary {
217
+ cursor: pointer;
218
+ font-size: 0.7rem;
219
+ font-weight: 600;
220
+ letter-spacing: 0.05em;
221
+ text-transform: uppercase;
222
+ color: var(--rb-color-muted, #6b7280);
223
+ padding: 0.2rem 0;
224
+ }
225
+
226
+ .rr-graph__settings details[open] summary {
227
+ margin-bottom: 0.5rem;
228
+ }
229
+
230
+ .rr-graph__field {
231
+ display: flex;
232
+ flex-direction: column;
233
+ gap: 0.3rem;
234
+ margin-bottom: 0.5rem;
235
+ }
236
+
237
+ .rr-graph__field label {
238
+ font-size: 0.7rem;
239
+ color: var(--rb-color-muted, #6b7280);
240
+ }
241
+
242
+ .rr-graph__field input[type="search"],
243
+ .rr-graph__field input[type="text"],
244
+ .rr-graph__group input[type="text"] {
245
+ width: 100%;
246
+ box-sizing: border-box;
247
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
248
+ border-radius: var(--rb-radius-sm, 4px);
249
+ background: var(--rb-color-surface, #f7f7f5);
250
+ color: var(--rb-color-ink, #1f2937);
251
+ font: inherit;
252
+ font-size: 0.72rem;
253
+ padding: 0.35rem 0.45rem;
254
+ }
255
+
256
+ .rr-graph__field input:focus-visible,
257
+ .rr-graph__group input:focus-visible {
258
+ outline: 2px solid var(--rb-color-focus, #2563eb);
259
+ outline-offset: 1px;
260
+ }
261
+
262
+ .rr-graph__check {
263
+ display: flex;
264
+ align-items: center;
265
+ gap: 0.4rem;
266
+ padding: 0.18rem 0;
267
+ font-size: 0.72rem;
268
+ cursor: pointer;
269
+ }
270
+
271
+ .rr-graph__range {
272
+ display: block;
273
+ margin: 0.5rem 0;
274
+ }
275
+
276
+ .rr-graph__range > span {
277
+ display: flex;
278
+ align-items: baseline;
279
+ justify-content: space-between;
280
+ gap: 0.5rem;
281
+ color: var(--rb-color-muted, #6b7280);
282
+ font-size: 0.7rem;
283
+ }
284
+
285
+ .rr-graph__range output {
286
+ color: var(--rb-color-ink, #1f2937);
287
+ font-variant-numeric: tabular-nums;
288
+ }
289
+
290
+ .rr-graph__range input[type="range"] {
291
+ width: 100%;
292
+ margin: 0.3rem 0 0;
293
+ accent-color: var(--rb-color-accent, #2563eb);
294
+ }
295
+
296
+ .rr-graph__groups {
297
+ display: flex;
298
+ flex-direction: column;
299
+ gap: 0.35rem;
300
+ }
301
+
302
+ .rr-graph__group {
303
+ display: grid;
304
+ grid-template-columns: 1.6rem minmax(0, 1fr) repeat(3, 1.4rem);
305
+ gap: 0.2rem;
306
+ align-items: center;
307
+ }
308
+
309
+ .rr-graph__group input[type="color"] {
310
+ width: 1.5rem;
311
+ height: 1.5rem;
312
+ padding: 0;
313
+ border: var(--rb-rule-width, 1px) solid var(--rb-color-border, #d8d8d8);
314
+ border-radius: var(--rb-radius-sm, 4px);
315
+ background: none;
316
+ cursor: pointer;
317
+ }
318
+
319
+ .rr-graph__group button {
320
+ padding: 0.25rem;
321
+ font-size: 0.7rem;
322
+ }
323
+
324
+ .rr-graph__groups > button {
325
+ align-self: flex-start;
326
+ margin-top: 0.25rem;
327
+ }
328
+
329
+ .rr-graph__animate-actions {
330
+ display: flex;
331
+ gap: 0.3rem;
332
+ margin: 0.4rem 0;
333
+ }
334
+
335
+ .rr-graph__selection {
336
+ margin: 0;
337
+ padding: 0.6rem 0.75rem;
338
+ color: var(--rb-color-muted, #6b7280);
339
+ font-size: 0.7rem;
340
+ line-height: 1.5;
341
+ }
342
+
343
+ .rr-graph--expanded {
344
+ position: fixed;
345
+ inset: 0;
346
+ z-index: 80;
347
+ border: 0;
348
+ border-radius: 0;
349
+ background: var(--rb-color-paper, #ffffff);
350
+ }
351
+
352
+ .rr-graph--expanded .rr-graph__stage {
353
+ height: auto;
354
+ min-height: 0;
355
+ }
356
+
357
+ .rr-graph--expanded .rr-graph__canvas {
358
+ height: 100%;
359
+ }
360
+
361
+ @media (max-width: 40rem) {
362
+ .rr-graph__stage {
363
+ height: 64vh;
364
+ min-height: 20rem;
365
+ }
366
+
367
+ .rr-graph__settings {
368
+ inset: 0;
369
+ width: 100%;
370
+ border: 0;
371
+ border-radius: 0;
372
+ box-shadow: none;
373
+ }
374
+
375
+ .rr-graph__toolbar {
376
+ flex-wrap: wrap;
377
+ }
378
+
379
+ .rr-graph__actions {
380
+ width: 100%;
381
+ justify-content: flex-end;
382
+ }
383
+
384
+ .rr-graph__fallback {
385
+ columns: 1;
386
+ }
387
+ }
388
+
389
+ @media (prefers-reduced-motion: reduce) {
390
+ .rr-graph * {
391
+ scroll-behavior: auto;
392
+ }
393
+ }