@0001-labs/idv1 4.0.2 → 4.0.4
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 +2 -0
- package/package.json +1 -1
- package/src/util/explorer.css +1 -1
- package/src/util/explorer.ts +3 -3
package/README.md
CHANGED
|
@@ -76,3 +76,5 @@ The [specification](https://idv1.0001.dev/docs/spec) owns the code design. [MIT
|
|
|
76
76
|
The five masks are `LLNNNN`, `LLNNLL`, `LLLLNN`, `LLLLLL` and the remaining `XXXXXX` codes. Taxonomy always starts at position zero. Namespace is external context, never inferred from letters inside a code. Upgrading requires reminting affected records and their references; existing applications stay on their pinned release until migrated. Total structural capacity remains 62⁶; a pool can reset and reissue short handles when exhausted. Keep durable record keys and allocation context separate from those handles.
|
|
77
77
|
|
|
78
78
|
`overviewHtml({ directory, records, namespaceIds })` from `@0001-labs/idv1/overview` renders separate Shapes, Taxonomies and Namespaces tables. Import `@0001-labs/idv1/overview.css` for the base layout; hosts supply theme variables. Namespace labels contain no dashes. Capacities come from the package; record counts come from the supplied catalogue.
|
|
79
|
+
|
|
80
|
+
Explorer's cross-namespace labels separate the namespace and ID with a space.
|
package/package.json
CHANGED
package/src/util/explorer.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.explorer-path { display: flex; flex-wrap: wrap; column-gap: calc(var(--unit) / 2); }
|
|
3
3
|
.explorer-rows { display: flex; flex-direction: column; }
|
|
4
4
|
.explorer-taxonomy { color: var(--idv1-explorer-accent, #fec20d); }
|
|
5
|
-
.explorer-row { display: grid; grid-template-columns: calc(
|
|
5
|
+
.explorer-row { display: grid; grid-template-columns: calc(9 * var(--cell)) minmax(0, 1fr) auto calc(4 * var(--cell)); column-gap: calc(var(--unit) / 2); margin: 0; color: inherit; text-decoration: none; }
|
|
6
6
|
.explorer-step, .explorer-title, .explorer-row > span, p.explorer-row { box-sizing: border-box; display: block; height: var(--unit); padding-top: calc(var(--unit) / 5); line-height: calc(var(--unit) * 4 / 5); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: inherit; text-decoration: none; }
|
|
7
7
|
.explorer-row > .explorer-mono { font-family: var(--idv1-explorer-mono, monospace); font-variant-numeric: tabular-nums; white-space: pre; text-overflow: clip; letter-spacing: calc(var(--cell) - 1ch); padding-inline-start: calc((var(--cell) - 1ch) / 2); box-shadow: inset 0 0 0 1px var(--rule); background-image: linear-gradient(to right, var(--rule) 2px, transparent 2px), linear-gradient(to right, color-mix(in oklab, var(--ink) 9%, transparent) 1px, transparent 1px); background-size: var(--unit) 100%, var(--cell) 100%; }
|
|
8
8
|
.explorer-gap { margin-block-start: var(--unit); }
|
package/src/util/explorer.ts
CHANGED
|
@@ -45,11 +45,11 @@ export function createExplorer(data: ExplorerData) {
|
|
|
45
45
|
const topLevel = (namespace: string) => [...nodes.values()].filter(node => node.namespace === namespace && node.at === undefined
|
|
46
46
|
&& !(parents.get(node.qualifiedId) ?? []).some(parent => nodes.get(parent)?.namespace === namespace));
|
|
47
47
|
const owner = (namespace: string) => data.namespaces.find(entry => entry.pair === namespace);
|
|
48
|
-
const short = (id: string) => id.length === 2 ? id : id.slice(1, 3) + id.slice(4);
|
|
48
|
+
const short = (id: string) => id.length === 2 ? id : id.slice(1, 3) + ' ' + id.slice(4);
|
|
49
49
|
const byKind = (a: Node, b: Node) => (b.at ?? 0) - (a.at ?? 0) || a.group.localeCompare(b.group) || a.label.localeCompare(b.label);
|
|
50
50
|
|
|
51
51
|
const tagged = (entry: Taxonomy) => [...nodes.values()].filter(node =>
|
|
52
|
-
node.shape === entry.shape && node.qualifiedId.slice(4).
|
|
52
|
+
node.shape === entry.shape && node.qualifiedId.slice(4).startsWith(entry.tag));
|
|
53
53
|
const identifierKey = (entry: Identifier) => `-${entry.namespace}-${entry.code}`;
|
|
54
54
|
const named = (id: string) => {
|
|
55
55
|
const entry = identifiers.find(entry => identifierKey(entry) === id);
|
|
@@ -62,7 +62,7 @@ export function createExplorer(data: ExplorerData) {
|
|
|
62
62
|
const ofShape = (name: string) => [...nodes.values()].filter(node => node.shape === name);
|
|
63
63
|
const scope = (path: string[]) => { const at = path.at(-1); return !at || lists[at] ? data.namespace : at.length === 2 ? at : at.includes(':') ? '' : nodes.get(at)?.namespace ?? ''; };
|
|
64
64
|
const idIn = (id: string, namespace: string) => id.length > 2 && id.slice(1, 3) === namespace ? id.slice(4) : short(id);
|
|
65
|
-
const kindOf = (node: Node) => taxonomy.find(entry => entry.shape === node.shape && node.qualifiedId.slice(4).
|
|
65
|
+
const kindOf = (node: Node) => taxonomy.find(entry => entry.shape === node.shape && node.qualifiedId.slice(4).startsWith(entry.tag))?.name ?? shapeName(node.shape);
|
|
66
66
|
const rowsOf = (path: string[], list: Node[]): Entry[] => list.sort(byKind).map(node => ({
|
|
67
67
|
path: [...path, node.qualifiedId], id: idIn(node.qualifiedId, scope(path)), label: node.label, kind: kindOf(node), count: children.get(node.qualifiedId)?.length ?? 0,
|
|
68
68
|
}));
|