structured-context-map-views 0.6.1 → 0.7.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.
- package/README.md +1 -1
- package/dist/{ParameterControls-A1HJWyt9.js → ParameterControls-Be05VST0.js} +505 -188
- package/dist/ParameterControls-Be05VST0.js.map +1 -0
- package/dist/artifact.html +70 -1
- package/dist/artifact.js +2 -2
- package/dist/artifact.js.map +1 -1
- package/dist/cli.js +12 -6
- package/dist/cli.js.map +1 -1
- package/dist/{definition-Cp1CCigh.js → definition-SjmROmJC.js} +308 -188
- package/dist/definition-SjmROmJC.js.map +1 -0
- package/dist/html.js +19 -0
- package/dist/html.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/node-ctbuxC-s.js +74 -0
- package/dist/node-ctbuxC-s.js.map +1 -0
- package/dist/node.js +2 -2
- package/dist/page.html +94 -25
- package/dist/{projection-C-dATsdO.js → projection-DKNLziP0.js} +282 -124
- package/dist/projection-DKNLziP0.js.map +1 -0
- package/dist/read-definitions-DFcOXatz.js +51 -0
- package/dist/read-definitions-DFcOXatz.js.map +1 -0
- package/dist/styles.css +69 -0
- package/dist/types/artifact/load.d.ts +1 -1
- package/dist/types/{layouts/EdgeOverlay.d.ts → components/ConnectorOverlay.d.ts} +6 -15
- package/dist/types/components/GraphLayout.d.ts +8 -0
- package/dist/types/components/LandscapeLayout.d.ts +9 -0
- package/dist/types/{layouts → components}/MapView.d.ts +4 -1
- package/dist/types/components/NeighbourhoodLayout.d.ts +7 -0
- package/dist/types/{layouts/NodeCard.d.ts → components/NodeComponent.d.ts} +1 -1
- package/dist/types/components/TreeLayout.d.ts +6 -0
- package/dist/types/{layouts → components}/XYLayout.d.ts +3 -3
- package/dist/types/{layouts → components}/annotations-context.d.ts +1 -1
- package/dist/types/components/layout.d.ts +22 -0
- package/dist/types/core/annotations.d.ts +2 -3
- package/dist/types/core/definition.d.ts +664 -30
- package/dist/types/core/layouts/graph/schema.d.ts +24 -0
- package/dist/types/core/layouts/helpers.d.ts +42 -0
- package/dist/types/core/layouts/landscape/projection.d.ts +75 -0
- package/dist/types/core/layouts/landscape/schema.d.ts +223 -0
- package/dist/types/core/layouts/neighbourhood/projection.d.ts +26 -0
- package/dist/types/core/layouts/neighbourhood/schema.d.ts +51 -0
- package/dist/types/core/layouts/schemas.d.ts +427 -0
- package/dist/types/core/{tree.d.ts → layouts/tree/projection.d.ts} +9 -11
- package/dist/types/core/layouts/xy/projection.d.ts +32 -0
- package/dist/types/core/{format/xy-layout.d.ts → layouts/xy/schema.d.ts} +2 -0
- package/dist/types/core/{format → schema}/definition-schema.d.ts +22 -12
- package/dist/types/core/{snapshot.d.ts → space-snapshot.d.ts} +1 -4
- package/dist/types/index.d.ts +6 -9
- package/dist/types/node/html.d.ts +6 -0
- package/dist/types/node/index.d.ts +7 -30
- package/dist/types/node/page.d.ts +1 -1
- package/dist/types/node/read-definitions.d.ts +17 -0
- package/dist/types/node/snapshot.d.ts +1 -1
- package/dist/types/viewer/Viewer.d.ts +5 -5
- package/package.json +10 -4
- package/dist/ParameterControls-A1HJWyt9.js.map +0 -1
- package/dist/definition-Cp1CCigh.js.map +0 -1
- package/dist/node-aizYAYlq.js +0 -130
- package/dist/node-aizYAYlq.js.map +0 -1
- package/dist/projection-C-dATsdO.js.map +0 -1
- package/dist/types/core/format/index.d.ts +0 -450
- package/dist/types/core/format/landscape-layout.d.ts +0 -102
- package/dist/types/core/graph.d.ts +0 -16
- package/dist/types/core/landscape.d.ts +0 -44
- package/dist/types/core/occurrence.d.ts +0 -11
- package/dist/types/core/xy.d.ts +0 -43
- package/dist/types/layouts/LandscapeLayout.d.ts +0 -8
- package/dist/types/layouts/TreeLayout.d.ts +0 -16
- /package/dist/types/{layouts → components}/ParameterControls.d.ts +0 -0
- /package/dist/types/{layouts → components}/ParameterInputs.d.ts +0 -0
- /package/dist/types/{layouts → components}/useParameterControls.d.ts +0 -0
- /package/dist/types/core/{format/tree-layout.d.ts → layouts/tree/schema.d.ts} +0 -0
- /package/dist/types/core/{format → schema}/param-ref.d.ts +0 -0
- /package/dist/types/core/{format → schema}/schema-url.d.ts +0 -0
- /package/dist/types/core/{format → schema}/settings.d.ts +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { i as parseMapViewDefinition } from "./definition-SjmROmJC.js";
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
//#region src/node/bundled-definitions.ts
|
|
5
|
+
var BUNDLED_DEFINITIONS = {
|
|
6
|
+
"graph.json5": "// Every node and edge as a network. Any schema.\n{\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\n $id: 'sctx-map-view://core/graph',\n title: 'Graph',\n parameters: {\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'shape' },\n labels: { type: 'boolean', title: 'Relationship labels', default: false },\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\n },\n regions: [\n {\n id: 'main',\n layout: { type: 'graph' },\n nodes: { style: { $param: 'nodeStyle' }, validation: { $param: 'validation' } },\n edges: { show: true, labels: { $param: 'labels' } },\n },\n ],\n}\n",
|
|
7
|
+
"neighbourhood.json5": "// One node with the nodes it is related to around it. Any schema.\n{\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\n $id: 'sctx-map-view://core/neighbourhood',\n title: 'Neighbourhood',\n parameters: {\n labels: { type: 'boolean', title: 'Relationship labels', default: true },\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\n },\n regions: [\n {\n id: 'main',\n layout: { type: 'neighbourhood' },\n nodes: { validation: { $param: 'validation' } },\n edges: { show: true, labels: { $param: 'labels' } },\n },\n ],\n}\n",
|
|
8
|
+
"strategy-tree.json5": "// Strategy stack as a tree: vision → mission → goals → opportunities → solutions → experiments.\n{\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\n $id: 'sctx-map-view://core/strategy-tree',\n title: 'Strategy tree',\n schema: 'sctx://core/strategy_general',\n parameters: {\n orientation: { $ref: 'settings.json#/$defs/orientation', default: 'vertical' },\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'card' },\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\n cardFields: {\n title: 'Card fields',\n type: 'array',\n items: { enum: ['status', 'priority', 'summary'] },\n default: ['status'],\n },\n },\n regions: [\n {\n id: 'main',\n layout: { type: 'tree', orientation: { $param: 'orientation' } },\n nodes: { style: { $param: 'nodeStyle' }, fields: { $param: 'cardFields' }, validation: { $param: 'validation' } },\n edges: { show: true },\n },\n ],\n}\n",
|
|
9
|
+
"tree.json5": "// The hierarchy as a tree. Any schema that has one.\n{\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\n $id: 'sctx-map-view://core/tree',\n title: 'Tree',\n parameters: {\n orientation: { $ref: 'settings.json#/$defs/orientation', default: 'vertical' },\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'card' },\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\n },\n regions: [\n {\n id: 'main',\n layout: { type: 'tree', orientation: { $param: 'orientation' } },\n nodes: { style: { $param: 'nodeStyle' }, validation: { $param: 'validation' } },\n edges: { show: true },\n },\n ],\n}\n"
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/node/read-definitions.ts
|
|
13
|
+
var SCHEME = "sctx-map-view://";
|
|
14
|
+
var PACKAGE_NAME = "structured-context-map-views";
|
|
15
|
+
/**
|
|
16
|
+
* Definitions in `folders` and this package's embedded ones, each checked against the namespace of its source.
|
|
17
|
+
* Throws on the first invalid definition or a repeated id.
|
|
18
|
+
*/
|
|
19
|
+
function readDefinitionFolders(folders) {
|
|
20
|
+
const foundAt = /* @__PURE__ */ new Map();
|
|
21
|
+
const definitions = [];
|
|
22
|
+
const add = (label, text, source) => {
|
|
23
|
+
const definition = parseMapViewDefinition(label, text);
|
|
24
|
+
assertIdNamespace(definition.id, source, label);
|
|
25
|
+
const existing = foundAt.get(definition.id);
|
|
26
|
+
if (existing) throw new Error(`Map view id "${definition.id}" is defined by both ${existing} and ${label}.`);
|
|
27
|
+
foundAt.set(definition.id, label);
|
|
28
|
+
definitions.push(definition);
|
|
29
|
+
};
|
|
30
|
+
for (const [file, text] of Object.entries(BUNDLED_DEFINITIONS)) add(`${PACKAGE_NAME}/${file}`, text, { kind: "core" });
|
|
31
|
+
for (const { dir, source } of folders) {
|
|
32
|
+
if (!isDirectory(dir)) continue;
|
|
33
|
+
for (const file of readdirSync(dir).filter((f) => f.endsWith(".json5")).sort()) {
|
|
34
|
+
const path = join(dir, file);
|
|
35
|
+
add(path, readFileSync(path, "utf8"), source);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return definitions;
|
|
39
|
+
}
|
|
40
|
+
function assertIdNamespace(id, source, path) {
|
|
41
|
+
const segments = id.slice(16).split("/");
|
|
42
|
+
const expected = source.kind === "core" ? `${SCHEME}core/<name>` : source.kind === "plugin" ? `${SCHEME}${source.plugin}/<name>` : `${SCHEME}<name>`;
|
|
43
|
+
if (!(source.kind === "config" ? segments.length === 1 : segments.length === 2 && segments[0] === (source.kind === "core" ? "core" : source.plugin)) || source.kind === "plugin" && source.plugin === "core") throw new Error(`Map view namespace violation: ${path} has $id "${id}". Use the form "${expected}".`);
|
|
44
|
+
}
|
|
45
|
+
function isDirectory(path) {
|
|
46
|
+
return existsSync(path) && statSync(path).isDirectory();
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { readDefinitionFolders as t };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=read-definitions-DFcOXatz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-definitions-DFcOXatz.js","names":[],"sources":["../src/node/bundled-definitions.ts","../src/node/read-definitions.ts"],"sourcesContent":["// Generated by scripts/generate-definitions.ts from map-views/*.json5. Do not edit.\nexport const BUNDLED_DEFINITIONS: Record<string, string> = {\n \"graph.json5\": \"// Every node and edge as a network. Any schema.\\n{\\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\\n $id: 'sctx-map-view://core/graph',\\n title: 'Graph',\\n parameters: {\\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'shape' },\\n labels: { type: 'boolean', title: 'Relationship labels', default: false },\\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\\n },\\n regions: [\\n {\\n id: 'main',\\n layout: { type: 'graph' },\\n nodes: { style: { $param: 'nodeStyle' }, validation: { $param: 'validation' } },\\n edges: { show: true, labels: { $param: 'labels' } },\\n },\\n ],\\n}\\n\",\n \"neighbourhood.json5\": \"// One node with the nodes it is related to around it. Any schema.\\n{\\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\\n $id: 'sctx-map-view://core/neighbourhood',\\n title: 'Neighbourhood',\\n parameters: {\\n labels: { type: 'boolean', title: 'Relationship labels', default: true },\\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\\n },\\n regions: [\\n {\\n id: 'main',\\n layout: { type: 'neighbourhood' },\\n nodes: { validation: { $param: 'validation' } },\\n edges: { show: true, labels: { $param: 'labels' } },\\n },\\n ],\\n}\\n\",\n \"strategy-tree.json5\": \"// Strategy stack as a tree: vision → mission → goals → opportunities → solutions → experiments.\\n{\\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\\n $id: 'sctx-map-view://core/strategy-tree',\\n title: 'Strategy tree',\\n schema: 'sctx://core/strategy_general',\\n parameters: {\\n orientation: { $ref: 'settings.json#/$defs/orientation', default: 'vertical' },\\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'card' },\\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\\n cardFields: {\\n title: 'Card fields',\\n type: 'array',\\n items: { enum: ['status', 'priority', 'summary'] },\\n default: ['status'],\\n },\\n },\\n regions: [\\n {\\n id: 'main',\\n layout: { type: 'tree', orientation: { $param: 'orientation' } },\\n nodes: { style: { $param: 'nodeStyle' }, fields: { $param: 'cardFields' }, validation: { $param: 'validation' } },\\n edges: { show: true },\\n },\\n ],\\n}\\n\",\n \"tree.json5\": \"// The hierarchy as a tree. Any schema that has one.\\n{\\n $schema: 'https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json',\\n $id: 'sctx-map-view://core/tree',\\n title: 'Tree',\\n parameters: {\\n orientation: { $ref: 'settings.json#/$defs/orientation', default: 'vertical' },\\n nodeStyle: { $ref: 'settings.json#/$defs/nodeStyle', default: 'card' },\\n validation: { $ref: 'settings.json#/$defs/validationLevel', default: 'off' },\\n },\\n regions: [\\n {\\n id: 'main',\\n layout: { type: 'tree', orientation: { $param: 'orientation' } },\\n nodes: { style: { $param: 'nodeStyle' }, validation: { $param: 'validation' } },\\n edges: { show: true },\\n },\\n ],\\n}\\n\",\n};\n","import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { type MapViewDefinition, parseMapViewDefinition } from '../core/definition';\nimport { BUNDLED_DEFINITIONS } from './bundled-definitions';\n\nconst SCHEME = 'sctx-map-view://';\nconst PACKAGE_NAME = 'structured-context-map-views';\n\nexport type DefinitionSource = { kind: 'core' } | { kind: 'plugin'; plugin: string } | { kind: 'config' };\n\n/**\n * Definitions in `folders` and this package's embedded ones, each checked against the namespace of its source.\n * Throws on the first invalid definition or a repeated id.\n */\nexport function readDefinitionFolders(folders: { dir: string; source: DefinitionSource }[]): MapViewDefinition[] {\n const foundAt = new Map<string, string>();\n const definitions: MapViewDefinition[] = [];\n const add = (label: string, text: string, source: DefinitionSource) => {\n const definition = parseMapViewDefinition(label, text);\n assertIdNamespace(definition.id, source, label);\n const existing = foundAt.get(definition.id);\n if (existing) throw new Error(`Map view id \"${definition.id}\" is defined by both ${existing} and ${label}.`);\n foundAt.set(definition.id, label);\n definitions.push(definition);\n };\n\n for (const [file, text] of Object.entries(BUNDLED_DEFINITIONS))\n add(`${PACKAGE_NAME}/${file}`, text, { kind: 'core' });\n for (const { dir, source } of folders) {\n if (!isDirectory(dir)) continue;\n for (const file of readdirSync(dir)\n .filter((f) => f.endsWith('.json5'))\n .sort()) {\n const path = join(dir, file);\n add(path, readFileSync(path, 'utf8'), source);\n }\n }\n return definitions;\n}\n\nfunction assertIdNamespace(id: string, source: DefinitionSource, path: string): void {\n const segments = id.slice(SCHEME.length).split('/');\n const expected =\n source.kind === 'core'\n ? `${SCHEME}core/<name>`\n : source.kind === 'plugin'\n ? `${SCHEME}${source.plugin}/<name>`\n : `${SCHEME}<name>`;\n const ok =\n source.kind === 'config'\n ? segments.length === 1\n : segments.length === 2 && segments[0] === (source.kind === 'core' ? 'core' : source.plugin);\n if (!ok || (source.kind === 'plugin' && source.plugin === 'core')) {\n throw new Error(`Map view namespace violation: ${path} has $id \"${id}\". Use the form \"${expected}\".`);\n }\n}\n\nfunction isDirectory(path: string): boolean {\n return existsSync(path) && statSync(path).isDirectory();\n}\n"],"mappings":";;;;AACA,IAAa,sBAA8C;CACzD,eAAe;CACf,uBAAuB;CACvB,uBAAuB;CACvB,cAAc;AAChB;;;ACDA,IAAM,SAAS;AACf,IAAM,eAAe;;;;;AAQrB,SAAgB,sBAAsB,SAA2E;CAC/G,MAAM,0BAAU,IAAI,IAAoB;CACxC,MAAM,cAAmC,CAAC;CAC1C,MAAM,OAAO,OAAe,MAAc,WAA6B;EACrE,MAAM,aAAa,uBAAuB,OAAO,IAAI;EACrD,kBAAkB,WAAW,IAAI,QAAQ,KAAK;EAC9C,MAAM,WAAW,QAAQ,IAAI,WAAW,EAAE;EAC1C,IAAI,UAAU,MAAM,IAAI,MAAM,gBAAgB,WAAW,GAAG,uBAAuB,SAAS,OAAO,MAAM,EAAE;EAC3G,QAAQ,IAAI,WAAW,IAAI,KAAK;EAChC,YAAY,KAAK,UAAU;CAC7B;CAEA,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,mBAAmB,GAC3D,IAAI,GAAG,aAAa,GAAG,QAAQ,MAAM,EAAE,MAAM,OAAO,CAAC;CACvD,KAAK,MAAM,EAAE,KAAK,YAAY,SAAS;EACrC,IAAI,CAAC,YAAY,GAAG,GAAG;EACvB,KAAK,MAAM,QAAQ,YAAY,GAAG,CAAC,CAChC,QAAQ,MAAM,EAAE,SAAS,QAAQ,CAAC,CAAC,CACnC,KAAK,GAAG;GACT,MAAM,OAAO,KAAK,KAAK,IAAI;GAC3B,IAAI,MAAM,aAAa,MAAM,MAAM,GAAG,MAAM;EAC9C;CACF;CACA,OAAO;AACT;AAEA,SAAS,kBAAkB,IAAY,QAA0B,MAAoB;CACnF,MAAM,WAAW,GAAG,MAAM,EAAa,CAAC,CAAC,MAAM,GAAG;CAClD,MAAM,WACJ,OAAO,SAAS,SACZ,GAAG,OAAO,eACV,OAAO,SAAS,WACd,GAAG,SAAS,OAAO,OAAO,WAC1B,GAAG,OAAO;CAKlB,IAAI,EAHF,OAAO,SAAS,WACZ,SAAS,WAAW,IACpB,SAAS,WAAW,KAAK,SAAS,QAAQ,OAAO,SAAS,SAAS,SAAS,OAAO,YAC7E,OAAO,SAAS,YAAY,OAAO,WAAW,QACxD,MAAM,IAAI,MAAM,iCAAiC,KAAK,YAAY,GAAG,mBAAmB,SAAS,GAAG;AAExG;AAEA,SAAS,YAAY,MAAuB;CAC1C,OAAO,WAAW,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY;AACxD"}
|
package/dist/styles.css
CHANGED
|
@@ -46,6 +46,15 @@
|
|
|
46
46
|
.mv\:-right-1\.5 {
|
|
47
47
|
right: calc(var(--mv-spacing) * -1.5);
|
|
48
48
|
}
|
|
49
|
+
.mv\:z-10 {
|
|
50
|
+
z-index: 10;
|
|
51
|
+
}
|
|
52
|
+
.mv\:col-start-1 {
|
|
53
|
+
grid-column-start: 1;
|
|
54
|
+
}
|
|
55
|
+
.mv\:col-start-2 {
|
|
56
|
+
grid-column-start: 2;
|
|
57
|
+
}
|
|
49
58
|
.mv\:float-left {
|
|
50
59
|
float: left;
|
|
51
60
|
}
|
|
@@ -64,6 +73,9 @@
|
|
|
64
73
|
.mv\:block {
|
|
65
74
|
display: block;
|
|
66
75
|
}
|
|
76
|
+
.mv\:contents {
|
|
77
|
+
display: contents;
|
|
78
|
+
}
|
|
67
79
|
.mv\:flex {
|
|
68
80
|
display: flex;
|
|
69
81
|
}
|
|
@@ -83,9 +95,15 @@
|
|
|
83
95
|
.mv\:min-h-0 {
|
|
84
96
|
min-height: 0px;
|
|
85
97
|
}
|
|
98
|
+
.mv\:min-h-12 {
|
|
99
|
+
min-height: calc(var(--mv-spacing) * 12);
|
|
100
|
+
}
|
|
86
101
|
.mv\:min-h-\[28rem\] {
|
|
87
102
|
min-height: 28rem;
|
|
88
103
|
}
|
|
104
|
+
.mv\:min-h-full {
|
|
105
|
+
min-height: 100%;
|
|
106
|
+
}
|
|
89
107
|
.mv\:w-44 {
|
|
90
108
|
width: calc(var(--mv-spacing) * 44);
|
|
91
109
|
}
|
|
@@ -124,6 +142,14 @@
|
|
|
124
142
|
--tw-translate-x: calc(var(--mv-spacing) * -3);
|
|
125
143
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
126
144
|
}
|
|
145
|
+
.mv\:-translate-y-1\/2 {
|
|
146
|
+
--tw-translate-y: calc(calc(1 / 2 * 100%) * -1);
|
|
147
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
148
|
+
}
|
|
149
|
+
.mv\:-translate-y-3 {
|
|
150
|
+
--tw-translate-y: calc(var(--mv-spacing) * -3);
|
|
151
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
152
|
+
}
|
|
127
153
|
.mv\:translate-y-1\/2 {
|
|
128
154
|
--tw-translate-y: calc(1 / 2 * 100%);
|
|
129
155
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -144,6 +170,9 @@
|
|
|
144
170
|
.mv\:grid-cols-\[auto_1fr\] {
|
|
145
171
|
grid-template-columns: auto 1fr;
|
|
146
172
|
}
|
|
173
|
+
.mv\:grid-cols-\[auto_auto_auto\] {
|
|
174
|
+
grid-template-columns: auto auto auto;
|
|
175
|
+
}
|
|
147
176
|
.mv\:grid-rows-\[1fr_auto\] {
|
|
148
177
|
grid-template-rows: 1fr auto;
|
|
149
178
|
}
|
|
@@ -192,12 +221,30 @@
|
|
|
192
221
|
.mv\:gap-4 {
|
|
193
222
|
gap: calc(var(--mv-spacing) * 4);
|
|
194
223
|
}
|
|
224
|
+
.mv\:gap-24 {
|
|
225
|
+
gap: calc(var(--mv-spacing) * 24);
|
|
226
|
+
}
|
|
195
227
|
.mv\:gap-x-4 {
|
|
196
228
|
column-gap: calc(var(--mv-spacing) * 4);
|
|
197
229
|
}
|
|
230
|
+
.mv\:gap-x-24 {
|
|
231
|
+
column-gap: calc(var(--mv-spacing) * 24);
|
|
232
|
+
}
|
|
198
233
|
.mv\:gap-y-2 {
|
|
199
234
|
row-gap: calc(var(--mv-spacing) * 2);
|
|
200
235
|
}
|
|
236
|
+
.mv\:gap-y-16 {
|
|
237
|
+
row-gap: calc(var(--mv-spacing) * 16);
|
|
238
|
+
}
|
|
239
|
+
.mv\:self-center {
|
|
240
|
+
align-self: center;
|
|
241
|
+
}
|
|
242
|
+
.mv\:justify-self-center {
|
|
243
|
+
justify-self: center;
|
|
244
|
+
}
|
|
245
|
+
.mv\:justify-self-end {
|
|
246
|
+
justify-self: flex-end;
|
|
247
|
+
}
|
|
201
248
|
.mv\:truncate {
|
|
202
249
|
overflow: hidden;
|
|
203
250
|
text-overflow: ellipsis;
|
|
@@ -275,6 +322,9 @@
|
|
|
275
322
|
.mv\:bg-warning {
|
|
276
323
|
background-color: var(--mv-color-warning);
|
|
277
324
|
}
|
|
325
|
+
.mv\:fill-muted {
|
|
326
|
+
fill: var(--mv-color-muted);
|
|
327
|
+
}
|
|
278
328
|
.mv\:fill-none {
|
|
279
329
|
fill: none;
|
|
280
330
|
}
|
|
@@ -290,6 +340,9 @@
|
|
|
290
340
|
stroke: color-mix(in oklab, var(--mv-color-muted) 50%, transparent);
|
|
291
341
|
}
|
|
292
342
|
}
|
|
343
|
+
.mv\:stroke-surface {
|
|
344
|
+
stroke: var(--mv-color-surface);
|
|
345
|
+
}
|
|
293
346
|
.mv\:p-0 {
|
|
294
347
|
padding: 0px;
|
|
295
348
|
}
|
|
@@ -299,6 +352,9 @@
|
|
|
299
352
|
.mv\:p-4 {
|
|
300
353
|
padding: calc(var(--mv-spacing) * 4);
|
|
301
354
|
}
|
|
355
|
+
.mv\:p-6 {
|
|
356
|
+
padding: calc(var(--mv-spacing) * 6);
|
|
357
|
+
}
|
|
302
358
|
.mv\:px-0\.5 {
|
|
303
359
|
padding-inline: calc(var(--mv-spacing) * 0.5);
|
|
304
360
|
}
|
|
@@ -340,6 +396,9 @@
|
|
|
340
396
|
.mv\:text-\[0\.65rem\] {
|
|
341
397
|
font-size: 0.65rem;
|
|
342
398
|
}
|
|
399
|
+
.mv\:text-\[10px\] {
|
|
400
|
+
font-size: 10px;
|
|
401
|
+
}
|
|
343
402
|
.mv\:leading-snug {
|
|
344
403
|
--tw-leading: var(--mv-leading-snug);
|
|
345
404
|
line-height: var(--mv-leading-snug);
|
|
@@ -371,6 +430,9 @@
|
|
|
371
430
|
.mv\:uppercase {
|
|
372
431
|
text-transform: uppercase;
|
|
373
432
|
}
|
|
433
|
+
.mv\:opacity-70 {
|
|
434
|
+
opacity: 70%;
|
|
435
|
+
}
|
|
374
436
|
.mv\:opacity-75 {
|
|
375
437
|
opacity: 75%;
|
|
376
438
|
}
|
|
@@ -378,6 +440,13 @@
|
|
|
378
440
|
--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));
|
|
379
441
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
380
442
|
}
|
|
443
|
+
.mv\:ring-2 {
|
|
444
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
445
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
446
|
+
}
|
|
447
|
+
.mv\:ring-accent {
|
|
448
|
+
--tw-ring-color: var(--mv-color-accent);
|
|
449
|
+
}
|
|
381
450
|
.mv\:\[writing-mode\:vertical-rl\] {
|
|
382
451
|
writing-mode: vertical-rl;
|
|
383
452
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SpaceSnapshot } from '../core/snapshot';
|
|
1
|
+
import type { SpaceSnapshot } from '../core/space-snapshot';
|
|
2
2
|
/**
|
|
3
3
|
* Every space written to the artifact's `spaces` collection: the `export` command's document, keyed by space
|
|
4
4
|
* name, with its parts as JSON strings. Rejects with a message fit to show the viewer.
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import type { Orientation } from '../core/definition';
|
|
2
|
-
|
|
3
|
-
* A connector between two occurrences. `cross` links (e.g. extra parents) are drawn dashed.
|
|
4
|
-
* `id` tells apart several links between the same occurrences; straight links between the same
|
|
5
|
-
* pair are drawn side by side, `lane` apart (0: on the line between centres).
|
|
6
|
-
*/
|
|
7
|
-
export type Link = {
|
|
8
|
-
from: string;
|
|
9
|
-
to: string;
|
|
10
|
-
kind?: 'tree' | 'cross';
|
|
11
|
-
id?: string;
|
|
12
|
-
lane?: number;
|
|
13
|
-
};
|
|
1
|
+
import type { EdgesConfig, Orientation } from '../core/definition';
|
|
2
|
+
import type { Connector } from '../core/layouts/helpers';
|
|
14
3
|
type Props = {
|
|
15
|
-
|
|
4
|
+
connectors: readonly Connector[];
|
|
5
|
+
/** The region's `edges` settings: whether connectors are drawn, and whether each shows its field. */
|
|
6
|
+
edges: EdgesConfig;
|
|
16
7
|
/** Rendered element of each occurrence, by occurrence key. */
|
|
17
8
|
elements: ReadonlyMap<string, HTMLElement>;
|
|
18
9
|
/**
|
|
@@ -32,5 +23,5 @@ type Props = {
|
|
|
32
23
|
* such as late font loads. The SVG fills the container instead of being sized from it, so it
|
|
33
24
|
* never holds the container open after the layout shrinks.
|
|
34
25
|
*/
|
|
35
|
-
export declare function
|
|
26
|
+
export declare function ConnectorOverlay({ connectors, edges, elements, container, routing }: Props): import("react").JSX.Element | null;
|
|
36
27
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LayoutConfig } from '../core/definition';
|
|
2
|
+
import { type LayoutProps } from './layout';
|
|
3
|
+
/**
|
|
4
|
+
* The space graph as a network, positioned by a force simulation. The hierarchy gives it shape:
|
|
5
|
+
* hierarchy edges hold their nodes close and each level settles below the one above, while
|
|
6
|
+
* relationship edges pull weakly and are drawn dashed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function GraphLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LayoutConfig<'graph'>>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LayoutConfig } from '../core/definition';
|
|
2
|
+
import type { LayoutProps } from './layout';
|
|
3
|
+
/**
|
|
4
|
+
* Strips of nested containers following each strip's grouping levels; the last level is drawn as
|
|
5
|
+
* nodes. Flexbox does the nesting and wrapping, and CSS grid lays out strips divided into cells.
|
|
6
|
+
* Containment shows the grouping edges, so no connectors are drawn. PROTOTYPE: `edges.show` has no
|
|
7
|
+
* effect here; other edges aren't drawn yet.
|
|
8
|
+
*/
|
|
9
|
+
export declare function LandscapeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LayoutConfig<'landscape'>>): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
2
|
import { type AnnotationIndex } from '../core/annotations';
|
|
3
3
|
import { type MapViewDefinition, type ParameterValues } from '../core/definition';
|
|
4
|
+
import type { LayoutProps } from './layout';
|
|
4
5
|
type Props = {
|
|
5
6
|
definition: MapViewDefinition;
|
|
6
7
|
graph: SpaceGraph;
|
|
@@ -12,7 +13,9 @@ type Props = {
|
|
|
12
13
|
*/
|
|
13
14
|
annotations?: AnnotationIndex;
|
|
14
15
|
onNodeSelect?: (node: SpaceNode) => void;
|
|
16
|
+
focus?: LayoutProps['focus'];
|
|
17
|
+
onFocusChange?: LayoutProps['onFocusChange'];
|
|
15
18
|
};
|
|
16
19
|
/** Renders a map view definition against a space. Sizes to its container and scrolls within it. */
|
|
17
|
-
export declare function MapView({ definition, graph, values, annotations, onNodeSelect }: Props): import("react").JSX.Element;
|
|
20
|
+
export declare function MapView({ definition, graph, values, annotations, onNodeSelect, focus, onFocusChange }: Props): import("react").JSX.Element;
|
|
18
21
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LayoutConfig } from '../core/definition';
|
|
2
|
+
import { type LayoutProps } from './layout';
|
|
3
|
+
/**
|
|
4
|
+
* One node with its neighbours around it. Selecting a neighbour moves the focus to it; selecting
|
|
5
|
+
* the focus is a regular node selection.
|
|
6
|
+
*/
|
|
7
|
+
export declare function NeighbourhoodLayout({ graph, region, instanceId, onNodeSelect, focus, onFocusChange, }: LayoutProps<LayoutConfig<'neighbourhood'>>): import("react").JSX.Element | null;
|
|
@@ -12,5 +12,5 @@ type Props = {
|
|
|
12
12
|
* tooltip. Deliberately a `div` with button semantics rather than a `<button>`: hosts style
|
|
13
13
|
* native form controls globally (Obsidian fixes button height and disables wrapping).
|
|
14
14
|
*/
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function NodeComponent({ node, repeat, nodes, onSelect }: Props): import("react").JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LayoutConfig } from '../core/definition';
|
|
2
|
+
import { type LayoutProps } from './layout';
|
|
3
|
+
/**
|
|
4
|
+
* Tree over the schema's hierarchy. Flexbox does the branching; the SVG overlay draws connectors.
|
|
5
|
+
*/
|
|
6
|
+
export declare function TreeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LayoutConfig<'tree'>>): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { LayoutConfig } from '../core/definition';
|
|
2
|
+
import { type LayoutProps } from './layout';
|
|
3
3
|
/**
|
|
4
4
|
* Nodes positioned by two numeric fields, with straight connectors between them. Positions are
|
|
5
5
|
* percentages of the plot area, which fills the container (scrolling below a minimum size). Nodes that can't be
|
|
6
6
|
* placed are listed under the plot with the reason.
|
|
7
7
|
* PROTOTYPE: labels may overlap where nodes sit close together; no collision handling.
|
|
8
8
|
*/
|
|
9
|
-
export declare function XYLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<
|
|
9
|
+
export declare function XYLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LayoutConfig<'xy'>>): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AnnotationIndex } from '../core/annotations';
|
|
2
|
-
/** The annotations a map view shows, already narrowed by its validation settings. Read by node
|
|
2
|
+
/** The annotations a map view shows, already narrowed by its validation settings. Read by node components. */
|
|
3
3
|
export declare const AnnotationsContext: import("react").Context<AnnotationIndex>;
|
|
4
4
|
export declare const useAnnotations: () => AnnotationIndex;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
+
import type { LayoutConfig, Region } from '../core/definition';
|
|
3
|
+
export type LayoutProps<L extends LayoutConfig = LayoutConfig> = {
|
|
4
|
+
graph: SpaceGraph;
|
|
5
|
+
/** The region with parameter values applied, narrowed to the layout's own settings. */
|
|
6
|
+
region: Region & {
|
|
7
|
+
layout: L;
|
|
8
|
+
};
|
|
9
|
+
/** Scopes occurrence keys when several map views render in one document. */
|
|
10
|
+
instanceId: string;
|
|
11
|
+
onNodeSelect?: (node: SpaceNode) => void;
|
|
12
|
+
/** The focus, for layouts arranged around one node; the layout keeps its own once the reader picks another. */
|
|
13
|
+
focus?: SpaceNode['id'];
|
|
14
|
+
onFocusChange?: (id: SpaceNode['id']) => void;
|
|
15
|
+
};
|
|
16
|
+
/** Connects a layout's occurrences to its `ConnectorOverlay`: `register` fills `elements` during commit, ahead of the overlay's layout effect. */
|
|
17
|
+
export declare function useOccurrenceElements(): {
|
|
18
|
+
container: HTMLDivElement | null;
|
|
19
|
+
setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null>>;
|
|
20
|
+
elements: Map<string, HTMLElement>;
|
|
21
|
+
register: (key: string) => (el: HTMLElement | null) => void;
|
|
22
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { RuleSeverity, SpaceGraph,
|
|
2
|
-
import type { SourceLocation, ValidationIssueKind } from 'structured-context/types';
|
|
3
|
-
type NodeId = SpaceNode['id'];
|
|
1
|
+
import type { RuleSeverity, SpaceGraph, ValidationResult } from 'structured-context/api';
|
|
2
|
+
import type { NodeId, SourceLocation, ValidationIssueKind } from 'structured-context/types';
|
|
4
3
|
/** structured-context's severity. */
|
|
5
4
|
export type Severity = RuleSeverity;
|
|
6
5
|
/** structured-context's issue `kind`. */
|