structured-context-map-views 0.0.0-stage → 0.1.0

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.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/dist/definition-KuPoA1mO.js +582 -0
  4. package/dist/definition-KuPoA1mO.js.map +1 -0
  5. package/dist/index.js +889 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/node.js +106 -0
  8. package/dist/node.js.map +1 -0
  9. package/dist/styles.css +497 -0
  10. package/dist/types/core/definition.d.ts +112 -0
  11. package/dist/types/core/graph.d.ts +16 -0
  12. package/dist/types/core/index.d.ts +6 -0
  13. package/dist/types/core/landscape.d.ts +44 -0
  14. package/dist/types/core/occurrence.d.ts +11 -0
  15. package/dist/types/core/schemas/definition.d.ts +163 -0
  16. package/dist/types/core/schemas/index.d.ts +418 -0
  17. package/dist/types/core/schemas/landscape-layout.d.ts +102 -0
  18. package/dist/types/core/schemas/param-ref.d.ts +10 -0
  19. package/dist/types/core/schemas/schema-url.d.ts +7 -0
  20. package/dist/types/core/schemas/settings.d.ts +27 -0
  21. package/dist/types/core/schemas/tree-layout.d.ts +40 -0
  22. package/dist/types/core/schemas/xy-layout.d.ts +94 -0
  23. package/dist/types/core/tree.d.ts +45 -0
  24. package/dist/types/core/xy.d.ts +43 -0
  25. package/dist/types/index.d.ts +7 -0
  26. package/dist/types/layouts/EdgeOverlay.d.ts +36 -0
  27. package/dist/types/layouts/LandscapeLayout.d.ts +8 -0
  28. package/dist/types/layouts/MapView.d.ts +12 -0
  29. package/dist/types/layouts/NodeCard.d.ts +16 -0
  30. package/dist/types/layouts/ParameterControls.d.ts +13 -0
  31. package/dist/types/layouts/TreeLayout.d.ts +16 -0
  32. package/dist/types/layouts/XYLayout.d.ts +9 -0
  33. package/dist/types/node/bundled-definitions.d.ts +1 -0
  34. package/dist/types/node/index.d.ts +17 -0
  35. package/package.json +69 -4
@@ -0,0 +1,497 @@
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme {
4
+ :root, :host {
5
+ --mv-spacing: 0.25rem;
6
+ --mv-text-xs: 0.75rem;
7
+ --mv-text-xs--line-height: calc(1 / 0.75);
8
+ --mv-text-sm: 0.875rem;
9
+ --mv-text-sm--line-height: calc(1.25 / 0.875);
10
+ --mv-font-weight-semibold: 600;
11
+ --mv-tracking-wide: 0.025em;
12
+ --mv-leading-tight: 1.25;
13
+ --mv-leading-snug: 1.375;
14
+ --mv-radius-md: 0.375rem;
15
+ --mv-radius-lg: 0.5rem;
16
+ --mv-color-surface: #f8f8f7;
17
+ --mv-color-card: #ffffff;
18
+ --mv-color-ink: #1f2328;
19
+ --mv-color-muted: #59636e;
20
+ --mv-color-edge: #d1d9e0;
21
+ --mv-color-accent: #0969da;
22
+ }
23
+ }
24
+ .mv\:pointer-events-none {
25
+ pointer-events: none;
26
+ }
27
+ .mv\:absolute {
28
+ position: absolute;
29
+ }
30
+ .mv\:relative {
31
+ position: relative;
32
+ }
33
+ .mv\:inset-0 {
34
+ inset: 0px;
35
+ }
36
+ .mv\:inset-8 {
37
+ inset: calc(var(--mv-spacing) * 8);
38
+ }
39
+ .mv\:float-left {
40
+ float: left;
41
+ }
42
+ .mv\:m-0 {
43
+ margin: 0px;
44
+ }
45
+ .mv\:mt-1 {
46
+ margin-top: var(--mv-spacing);
47
+ }
48
+ .mv\:mr-1\.5 {
49
+ margin-right: calc(var(--mv-spacing) * 1.5);
50
+ }
51
+ .mv\:box-border {
52
+ box-sizing: border-box;
53
+ }
54
+ .mv\:block {
55
+ display: block;
56
+ }
57
+ .mv\:flex {
58
+ display: flex;
59
+ }
60
+ .mv\:grid {
61
+ display: grid;
62
+ }
63
+ .mv\:size-6 {
64
+ width: calc(var(--mv-spacing) * 6);
65
+ height: calc(var(--mv-spacing) * 6);
66
+ }
67
+ .mv\:h-full {
68
+ height: 100%;
69
+ }
70
+ .mv\:min-h-0 {
71
+ min-height: 0px;
72
+ }
73
+ .mv\:min-h-\[28rem\] {
74
+ min-height: 28rem;
75
+ }
76
+ .mv\:w-44 {
77
+ width: calc(var(--mv-spacing) * 44);
78
+ }
79
+ .mv\:w-full {
80
+ width: 100%;
81
+ }
82
+ .mv\:w-max {
83
+ width: max-content;
84
+ }
85
+ .mv\:max-w-44 {
86
+ max-width: calc(var(--mv-spacing) * 44);
87
+ }
88
+ .mv\:max-w-\[36rem\] {
89
+ max-width: 36rem;
90
+ }
91
+ .mv\:min-w-\[36rem\] {
92
+ min-width: 36rem;
93
+ }
94
+ .mv\:min-w-full {
95
+ min-width: 100%;
96
+ }
97
+ .mv\:flex-1 {
98
+ flex: 1;
99
+ }
100
+ .mv\:shrink-0 {
101
+ flex-shrink: 0;
102
+ }
103
+ .mv\:-translate-x-1\/2 {
104
+ --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
105
+ translate: var(--tw-translate-x) var(--tw-translate-y);
106
+ }
107
+ .mv\:-translate-x-3 {
108
+ --tw-translate-x: calc(var(--mv-spacing) * -3);
109
+ translate: var(--tw-translate-x) var(--tw-translate-y);
110
+ }
111
+ .mv\:translate-y-1\/2 {
112
+ --tw-translate-y: calc(1 / 2 * 100%);
113
+ translate: var(--tw-translate-x) var(--tw-translate-y);
114
+ }
115
+ .mv\:translate-y-3 {
116
+ --tw-translate-y: calc(var(--mv-spacing) * 3);
117
+ translate: var(--tw-translate-x) var(--tw-translate-y);
118
+ }
119
+ .mv\:rotate-180 {
120
+ rotate: 180deg;
121
+ }
122
+ .mv\:cursor-pointer {
123
+ cursor: pointer;
124
+ }
125
+ .mv\:list-none {
126
+ list-style-type: none;
127
+ }
128
+ .mv\:grid-cols-\[auto_1fr\] {
129
+ grid-template-columns: auto 1fr;
130
+ }
131
+ .mv\:grid-rows-\[1fr_auto\] {
132
+ grid-template-rows: 1fr auto;
133
+ }
134
+ .mv\:flex-col {
135
+ flex-direction: column;
136
+ }
137
+ .mv\:flex-col-reverse {
138
+ flex-direction: column-reverse;
139
+ }
140
+ .mv\:flex-row {
141
+ flex-direction: row;
142
+ }
143
+ .mv\:flex-wrap {
144
+ flex-wrap: wrap;
145
+ }
146
+ .mv\:items-center {
147
+ align-items: center;
148
+ }
149
+ .mv\:items-start {
150
+ align-items: flex-start;
151
+ }
152
+ .mv\:items-stretch {
153
+ align-items: stretch;
154
+ }
155
+ .mv\:justify-between {
156
+ justify-content: space-between;
157
+ }
158
+ .mv\:justify-center {
159
+ justify-content: center;
160
+ }
161
+ .mv\:gap-0\.5 {
162
+ gap: calc(var(--mv-spacing) * 0.5);
163
+ }
164
+ .mv\:gap-1 {
165
+ gap: var(--mv-spacing);
166
+ }
167
+ .mv\:gap-1\.5 {
168
+ gap: calc(var(--mv-spacing) * 1.5);
169
+ }
170
+ .mv\:gap-2 {
171
+ gap: calc(var(--mv-spacing) * 2);
172
+ }
173
+ .mv\:gap-3 {
174
+ gap: calc(var(--mv-spacing) * 3);
175
+ }
176
+ .mv\:gap-4 {
177
+ gap: calc(var(--mv-spacing) * 4);
178
+ }
179
+ .mv\:gap-x-4 {
180
+ column-gap: calc(var(--mv-spacing) * 4);
181
+ }
182
+ .mv\:gap-y-2 {
183
+ row-gap: calc(var(--mv-spacing) * 2);
184
+ }
185
+ .mv\:truncate {
186
+ overflow: hidden;
187
+ text-overflow: ellipsis;
188
+ white-space: nowrap;
189
+ }
190
+ .mv\:overflow-auto {
191
+ overflow: auto;
192
+ }
193
+ .mv\:overflow-visible {
194
+ overflow: visible;
195
+ }
196
+ .mv\:rounded {
197
+ border-radius: 0.25rem;
198
+ }
199
+ .mv\:rounded-full {
200
+ border-radius: calc(infinity * 1px);
201
+ }
202
+ .mv\:rounded-lg {
203
+ border-radius: var(--mv-radius-lg);
204
+ }
205
+ .mv\:rounded-md {
206
+ border-radius: var(--mv-radius-md);
207
+ }
208
+ .mv\:border {
209
+ border-style: var(--tw-border-style);
210
+ border-width: 1px;
211
+ }
212
+ .mv\:border-0 {
213
+ border-style: var(--tw-border-style);
214
+ border-width: 0px;
215
+ }
216
+ .mv\:border-2 {
217
+ border-style: var(--tw-border-style);
218
+ border-width: 2px;
219
+ }
220
+ .mv\:border-b {
221
+ border-bottom-style: var(--tw-border-style);
222
+ border-bottom-width: 1px;
223
+ }
224
+ .mv\:border-l {
225
+ border-left-style: var(--tw-border-style);
226
+ border-left-width: 1px;
227
+ }
228
+ .mv\:border-dashed {
229
+ --tw-border-style: dashed;
230
+ border-style: dashed;
231
+ }
232
+ .mv\:border-edge {
233
+ border-color: var(--mv-color-edge);
234
+ }
235
+ .mv\:border-muted\/60 {
236
+ border-color: var(--mv-color-muted);
237
+ @supports (color: color-mix(in lab, red, red)) {
238
+ border-color: color-mix(in oklab, var(--mv-color-muted) 60%, transparent);
239
+ }
240
+ }
241
+ .mv\:bg-card {
242
+ background-color: var(--mv-color-card);
243
+ }
244
+ .mv\:bg-surface {
245
+ background-color: var(--mv-color-surface);
246
+ }
247
+ .mv\:bg-surface\/80 {
248
+ background-color: var(--mv-color-surface);
249
+ @supports (color: color-mix(in lab, red, red)) {
250
+ background-color: color-mix(in oklab, var(--mv-color-surface) 80%, transparent);
251
+ }
252
+ }
253
+ .mv\:fill-none {
254
+ fill: none;
255
+ }
256
+ .mv\:stroke-accent\/60 {
257
+ stroke: var(--mv-color-accent);
258
+ @supports (color: color-mix(in lab, red, red)) {
259
+ stroke: color-mix(in oklab, var(--mv-color-accent) 60%, transparent);
260
+ }
261
+ }
262
+ .mv\:stroke-muted\/50 {
263
+ stroke: var(--mv-color-muted);
264
+ @supports (color: color-mix(in lab, red, red)) {
265
+ stroke: color-mix(in oklab, var(--mv-color-muted) 50%, transparent);
266
+ }
267
+ }
268
+ .mv\:p-0 {
269
+ padding: 0px;
270
+ }
271
+ .mv\:p-2 {
272
+ padding: calc(var(--mv-spacing) * 2);
273
+ }
274
+ .mv\:p-4 {
275
+ padding: calc(var(--mv-spacing) * 4);
276
+ }
277
+ .mv\:px-0\.5 {
278
+ padding-inline: calc(var(--mv-spacing) * 0.5);
279
+ }
280
+ .mv\:px-1 {
281
+ padding-inline: var(--mv-spacing);
282
+ }
283
+ .mv\:px-2\.5 {
284
+ padding-inline: calc(var(--mv-spacing) * 2.5);
285
+ }
286
+ .mv\:px-8 {
287
+ padding-inline: calc(var(--mv-spacing) * 8);
288
+ }
289
+ .mv\:py-1\.5 {
290
+ padding-block: calc(var(--mv-spacing) * 1.5);
291
+ }
292
+ .mv\:py-8 {
293
+ padding-block: calc(var(--mv-spacing) * 8);
294
+ }
295
+ .mv\:pt-10 {
296
+ padding-top: calc(var(--mv-spacing) * 10);
297
+ }
298
+ .mv\:pl-14 {
299
+ padding-left: calc(var(--mv-spacing) * 14);
300
+ }
301
+ .mv\:text-left {
302
+ text-align: left;
303
+ }
304
+ .mv\:text-sm {
305
+ font-size: var(--mv-text-sm);
306
+ line-height: var(--tw-leading, var(--mv-text-sm--line-height));
307
+ }
308
+ .mv\:text-xs {
309
+ font-size: var(--mv-text-xs);
310
+ line-height: var(--tw-leading, var(--mv-text-xs--line-height));
311
+ }
312
+ .mv\:text-\[0\.65rem\] {
313
+ font-size: 0.65rem;
314
+ }
315
+ .mv\:leading-snug {
316
+ --tw-leading: var(--mv-leading-snug);
317
+ line-height: var(--mv-leading-snug);
318
+ }
319
+ .mv\:leading-tight {
320
+ --tw-leading: var(--mv-leading-tight);
321
+ line-height: var(--mv-leading-tight);
322
+ }
323
+ .mv\:font-semibold {
324
+ --tw-font-weight: var(--mv-font-weight-semibold);
325
+ font-weight: var(--mv-font-weight-semibold);
326
+ }
327
+ .mv\:tracking-wide {
328
+ --tw-tracking: var(--mv-tracking-wide);
329
+ letter-spacing: var(--mv-tracking-wide);
330
+ }
331
+ .mv\:whitespace-nowrap {
332
+ white-space: nowrap;
333
+ }
334
+ .mv\:text-ink {
335
+ color: var(--mv-color-ink);
336
+ }
337
+ .mv\:text-muted {
338
+ color: var(--mv-color-muted);
339
+ }
340
+ .mv\:uppercase {
341
+ text-transform: uppercase;
342
+ }
343
+ .mv\:opacity-75 {
344
+ opacity: 75%;
345
+ }
346
+ .mv\:shadow-sm {
347
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
348
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
349
+ }
350
+ .mv\:\[writing-mode\:vertical-rl\] {
351
+ writing-mode: vertical-rl;
352
+ }
353
+ @media (hover: hover) {
354
+ .mv\:hover\:border-accent:hover {
355
+ border-color: var(--mv-color-accent);
356
+ }
357
+ .mv\:hover\:text-accent:hover {
358
+ color: var(--mv-color-accent);
359
+ }
360
+ }
361
+ .mv\:focus-visible\:outline-2:focus-visible {
362
+ outline-style: var(--tw-outline-style);
363
+ outline-width: 2px;
364
+ }
365
+ .mv\:focus-visible\:outline-accent:focus-visible {
366
+ outline-color: var(--mv-color-accent);
367
+ }
368
+ @property --tw-translate-x {
369
+ syntax: "*";
370
+ inherits: false;
371
+ initial-value: 0;
372
+ }
373
+ @property --tw-translate-y {
374
+ syntax: "*";
375
+ inherits: false;
376
+ initial-value: 0;
377
+ }
378
+ @property --tw-translate-z {
379
+ syntax: "*";
380
+ inherits: false;
381
+ initial-value: 0;
382
+ }
383
+ @property --tw-border-style {
384
+ syntax: "*";
385
+ inherits: false;
386
+ initial-value: solid;
387
+ }
388
+ @property --tw-leading {
389
+ syntax: "*";
390
+ inherits: false;
391
+ }
392
+ @property --tw-font-weight {
393
+ syntax: "*";
394
+ inherits: false;
395
+ }
396
+ @property --tw-tracking {
397
+ syntax: "*";
398
+ inherits: false;
399
+ }
400
+ @property --tw-shadow {
401
+ syntax: "*";
402
+ inherits: false;
403
+ initial-value: 0 0 #0000;
404
+ }
405
+ @property --tw-shadow-color {
406
+ syntax: "*";
407
+ inherits: false;
408
+ }
409
+ @property --tw-shadow-alpha {
410
+ syntax: "<percentage>";
411
+ inherits: false;
412
+ initial-value: 100%;
413
+ }
414
+ @property --tw-inset-shadow {
415
+ syntax: "*";
416
+ inherits: false;
417
+ initial-value: 0 0 #0000;
418
+ }
419
+ @property --tw-inset-shadow-color {
420
+ syntax: "*";
421
+ inherits: false;
422
+ }
423
+ @property --tw-inset-shadow-alpha {
424
+ syntax: "<percentage>";
425
+ inherits: false;
426
+ initial-value: 100%;
427
+ }
428
+ @property --tw-ring-color {
429
+ syntax: "*";
430
+ inherits: false;
431
+ }
432
+ @property --tw-ring-shadow {
433
+ syntax: "*";
434
+ inherits: false;
435
+ initial-value: 0 0 #0000;
436
+ }
437
+ @property --tw-inset-ring-color {
438
+ syntax: "*";
439
+ inherits: false;
440
+ }
441
+ @property --tw-inset-ring-shadow {
442
+ syntax: "*";
443
+ inherits: false;
444
+ initial-value: 0 0 #0000;
445
+ }
446
+ @property --tw-ring-inset {
447
+ syntax: "*";
448
+ inherits: false;
449
+ }
450
+ @property --tw-ring-offset-width {
451
+ syntax: "<length>";
452
+ inherits: false;
453
+ initial-value: 0px;
454
+ }
455
+ @property --tw-ring-offset-color {
456
+ syntax: "*";
457
+ inherits: false;
458
+ initial-value: #fff;
459
+ }
460
+ @property --tw-ring-offset-shadow {
461
+ syntax: "*";
462
+ inherits: false;
463
+ initial-value: 0 0 #0000;
464
+ }
465
+ @property --tw-outline-style {
466
+ syntax: "*";
467
+ inherits: false;
468
+ initial-value: solid;
469
+ }
470
+ @layer properties {
471
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
472
+ *, ::before, ::after, ::backdrop {
473
+ --tw-translate-x: 0;
474
+ --tw-translate-y: 0;
475
+ --tw-translate-z: 0;
476
+ --tw-border-style: solid;
477
+ --tw-leading: initial;
478
+ --tw-font-weight: initial;
479
+ --tw-tracking: initial;
480
+ --tw-shadow: 0 0 #0000;
481
+ --tw-shadow-color: initial;
482
+ --tw-shadow-alpha: 100%;
483
+ --tw-inset-shadow: 0 0 #0000;
484
+ --tw-inset-shadow-color: initial;
485
+ --tw-inset-shadow-alpha: 100%;
486
+ --tw-ring-color: initial;
487
+ --tw-ring-shadow: 0 0 #0000;
488
+ --tw-inset-ring-color: initial;
489
+ --tw-inset-ring-shadow: 0 0 #0000;
490
+ --tw-ring-inset: initial;
491
+ --tw-ring-offset-width: 0px;
492
+ --tw-ring-offset-color: #fff;
493
+ --tw-ring-offset-shadow: 0 0 #0000;
494
+ --tw-outline-style: solid;
495
+ }
496
+ }
497
+ }
@@ -0,0 +1,112 @@
1
+ import type { FromSchema } from 'json-schema-to-ts';
2
+ import { definitionSchema, type landscapeLayoutSchema, MAP_VIEW_SCHEMAS, type settingsSchema, type treeLayoutSchema, type xyLayoutSchema } from './schemas';
3
+ export { MAP_VIEW_SCHEMAS };
4
+ type References = {
5
+ references: [
6
+ typeof settingsSchema,
7
+ typeof treeLayoutSchema,
8
+ typeof landscapeLayoutSchema,
9
+ typeof xyLayoutSchema,
10
+ typeof definitionSchema
11
+ ];
12
+ parseIfThenElseKeywords: true;
13
+ };
14
+ type ParamRef = {
15
+ $param: string;
16
+ };
17
+ /** Drop `{ $param }` bindings from every setting's type: what remains after resolution. */
18
+ type Resolved<T> = T extends ParamRef ? never : T extends readonly (infer U)[] ? Resolved<U>[] : T extends object ? {
19
+ [K in keyof T]: Resolved<T[K]>;
20
+ } : T;
21
+ /** A definition as authored: settings may be `{ $param }` bindings, defaulted properties may be absent. */
22
+ export type AuthoredDefinition = FromSchema<typeof definitionSchema, References & {
23
+ keepDefaultedPropertiesOptional: true;
24
+ }>;
25
+ type FilledDefinition = FromSchema<typeof definitionSchema, References>;
26
+ /** A region with parameters applied and defaults filled in: what layouts receive. */
27
+ export type Region = Resolved<FilledDefinition['regions'][number]>;
28
+ export type LayoutConfig = Region['layout'];
29
+ export type TreeLayoutConfig = Extract<LayoutConfig, {
30
+ type: 'tree';
31
+ }>;
32
+ export type LandscapeLayoutConfig = Extract<LayoutConfig, {
33
+ type: 'landscape';
34
+ }>;
35
+ export type XYLayoutConfig = Extract<LayoutConfig, {
36
+ type: 'xy';
37
+ }>;
38
+ export type AxisConfig = XYLayoutConfig['x'];
39
+ export type GroupLevel = LandscapeLayoutConfig['group'][number];
40
+ export type IntermediateDisplay = Extract<GroupLevel, {
41
+ type: string;
42
+ }>['intermediate'];
43
+ export type NodesConfig = Region['nodes'];
44
+ export type EdgesConfig = Region['edges'];
45
+ export type Orientation = TreeLayoutConfig['orientation'];
46
+ export type DagMode = TreeLayoutConfig['dag'];
47
+ export type NodeStyle = NodesConfig['style'];
48
+ /**
49
+ * A validated map view definition. Plain data, so hosts can pass it across a server/browser
50
+ * boundary. Settings in `source` may still be `{ $param }` bindings; {@link resolveRegions}
51
+ * replaces them with parameter values.
52
+ */
53
+ export type MapViewDefinition = {
54
+ /** The definition's `$id`. */
55
+ id: string;
56
+ title: string;
57
+ description?: string;
58
+ /** `$id` of the schema whose spaces this map view applies to. */
59
+ schema: string;
60
+ parameters: Parameter[];
61
+ /** The definition as authored. */
62
+ source: AuthoredDefinition;
63
+ };
64
+ /** A setting the reader can change, with the control generated from its schema. */
65
+ export type Parameter = {
66
+ name: string;
67
+ title: string;
68
+ description?: string;
69
+ default: unknown;
70
+ control: ParameterControl;
71
+ };
72
+ /** Options are JSON primitives, so they can be labelled and compared directly. */
73
+ export type ParameterControl = {
74
+ kind: 'select';
75
+ options: readonly Primitive[];
76
+ } | {
77
+ kind: 'multiselect';
78
+ options: readonly Primitive[];
79
+ } | {
80
+ kind: 'toggle';
81
+ };
82
+ type Primitive = string | number | boolean | null;
83
+ export type ParameterValues = Readonly<Record<string, unknown>>;
84
+ export declare class MapViewDefinitionError extends Error {
85
+ constructor(name: string, message: string);
86
+ }
87
+ /**
88
+ * Parse a JSON5 map view definition and check it against the bundled schemas. `name` labels
89
+ * error messages (hosts pass where the definition came from).
90
+ *
91
+ * Beyond schema validation: every parameter needs a control derivable from its schema, and
92
+ * every value that control can produce must satisfy the parameter's schema; every `$param`
93
+ * must name a declared parameter; and each parameter's values must be valid wherever it's
94
+ * bound, checked by substituting them and re-validating.
95
+ */
96
+ export declare function parseMapViewDefinition(name: string, text: string): MapViewDefinition;
97
+ /**
98
+ * The value each parameter takes: the given value if its control could produce it, otherwise
99
+ * (missing, or stale saved state) the default. Hosts' controls and rendering both use this.
100
+ */
101
+ export declare function resolveParameterValues(definition: MapViewDefinition, values?: ParameterValues): ParameterValues;
102
+ /** Apply parameter values to a definition's regions and fill in setting defaults. */
103
+ export declare function resolveRegions(definition: MapViewDefinition, values?: ParameterValues): Region[];
104
+ /**
105
+ * The filter selecting the nodes a map view shows, if any. Hosts apply it when loading the space.
106
+ * PROTOTYPE: filters are evaluated by the host, not per region in the browser, because
107
+ * structured-context's filter evaluator can't yet be bundled for a browser (its only entry point,
108
+ * `structured-context/api`, imports Node built-ins). That's fine while only the first region renders.
109
+ */
110
+ export declare function selectionFilter(definition: MapViewDefinition, values?: ParameterValues): string | undefined;
111
+ /** Map view definitions that apply to a space with the given schema. */
112
+ export declare function mapViewsForSchema(definitions: readonly MapViewDefinition[], schemaId: string | undefined): MapViewDefinition[];
@@ -0,0 +1,16 @@
1
+ import type { Hierarchy, SpaceGraph, SpaceNode } from 'structured-context/api';
2
+ type NodeId = SpaceNode['id'];
3
+ /** A directed parent → child edge of a space graph, carrying the metadata of the reference it came from. */
4
+ export type Edge = SpaceGraph['parentEdges'] extends ReadonlyMap<string, readonly (infer E)[]> ? E : never;
5
+ /**
6
+ * Edges to a node's parents, in the order the node declares them. A graph narrowed by a filter keeps
7
+ * edges to parents outside it; those are left out.
8
+ */
9
+ export declare function parentEdges(graph: SpaceGraph, id: NodeId): readonly Edge[];
10
+ /** Edges to a node's children, in graph order of the children. */
11
+ export declare function childEdges(graph: SpaceGraph, id: NodeId): readonly Edge[];
12
+ /** Every edge whose parent and child are both in the graph. */
13
+ export declare function edgesWithin(graph: SpaceGraph): Edge[];
14
+ /** Whether an edge belongs to the given hierarchy (as opposed to a relationship or another hierarchy). */
15
+ export declare function isHierarchyEdge(edge: Edge, hierarchy: Hierarchy | undefined): boolean;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ export { type AuthoredDefinition, type AxisConfig, type DagMode, type EdgesConfig, type GroupLevel, type IntermediateDisplay, type LandscapeLayoutConfig, type LayoutConfig, MAP_VIEW_SCHEMAS, type MapViewDefinition, MapViewDefinitionError, mapViewsForSchema, type NodeStyle, type NodesConfig, type Orientation, type Parameter, type ParameterControl, type ParameterValues, parseMapViewDefinition, type Region, resolveParameterValues, resolveRegions, selectionFilter, type TreeLayoutConfig, type XYLayoutConfig, } from './definition';
2
+ export { type Edge, isHierarchyEdge } from './graph';
3
+ export { buildLandscape, type Landscape, type LandscapeOccurrence, type ViaStep } from './landscape';
4
+ export { occurrenceKey, type PathSegment } from './occurrence';
5
+ export { buildTree, type Tree, type TreeLink, type TreeOccurrence, treeLinks } from './tree';
6
+ export { buildXYPlot, type Unplaced, type XYLink, type XYPlot, type XYPoint } from './xy';
@@ -0,0 +1,44 @@
1
+ import type { SpaceGraph, SpaceNode } from 'structured-context/api';
2
+ import type { LandscapeLayoutConfig } from './definition';
3
+ /** One rendered container or node in a landscape. */
4
+ export type LandscapeOccurrence = {
5
+ /** Path-based key, unique within the map view (see {@link occurrenceKey}). */
6
+ key: string;
7
+ /** Index of the grouping level this occurrence belongs to. */
8
+ level: number;
9
+ /** A node, or a field value shared by the nodes inside (`null`: the field is empty). */
10
+ item: {
11
+ kind: 'node';
12
+ node: SpaceNode;
13
+ } | {
14
+ kind: 'value';
15
+ field: string;
16
+ value: string | null;
17
+ };
18
+ /** Nodes on the `via` chain that joined this node to the node level above, one entry per skipped type. */
19
+ via: ViaStep[];
20
+ /** Key of the node's first occurrence when this is a repeat. Repeats are rendered in full. */
21
+ repeatOf?: string;
22
+ children: LandscapeOccurrence[];
23
+ };
24
+ export type ViaStep = {
25
+ type: string;
26
+ nodes: SpaceNode[];
27
+ };
28
+ export type Landscape = {
29
+ groups: LandscapeOccurrence[];
30
+ /**
31
+ * Nodes of a grouped level that no container above reaches (e.g. an Activity with no
32
+ * Outcome when grouping by Outcomes), each with its own contents.
33
+ */
34
+ ungrouped: LandscapeOccurrence[];
35
+ };
36
+ /**
37
+ * Lay a space out as nested containers following the layout's grouping levels.
38
+ *
39
+ * Adjacent node levels are joined by any edge between their types, in either direction, or only
40
+ * edges from `edge.field`. A `via` chain joins them through the skipped types. A field level
41
+ * splits the next node level by that field's values. A node reached from several containers
42
+ * appears in each, in full: the levels are finite, so repeating contents can't recurse.
43
+ */
44
+ export declare function buildLandscape(graph: SpaceGraph, regionId: string, layout: LandscapeLayoutConfig): Landscape;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * One step of an occurrence path: a node title, a `[field, value]` group, or `null` for the
3
+ * ungrouped area. Encoded distinctly, so a field group can't collide with a node of the same name.
4
+ */
5
+ export type PathSegment = string | readonly [field: string, value: string | null] | null;
6
+ /**
7
+ * Path-based key for one occurrence of a node: region, then the steps from the outermost
8
+ * container down to the node. Unique within a map view even when a node appears several times.
9
+ * Hosts can render several map views at once, so layouts scope keys to the map view instance.
10
+ */
11
+ export declare function occurrenceKey(regionId: string, path: readonly PathSegment[]): string;