@emeryld/rrroutes-contract 2.7.12 → 2.7.13

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-contract",
3
3
  "description": "TypeScript contract definitions for RRRoutes",
4
- "version": "2.7.12",
4
+ "version": "2.7.13",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "dist/index.cjs",
@@ -978,37 +978,24 @@
978
978
  return `vscode://file/${encodeURI(vscodePath)}:${line}:${column}`
979
979
  }
980
980
 
981
- function sourceDisplay(source) {
982
- if (!source || !source.file) return '—'
983
- const line = Number.isFinite(source.line) ? source.line : 1
984
- const column = Number.isFinite(source.column) ? source.column : 1
985
- return `${source.file}:${line}:${column}`
986
- }
987
-
988
- function createSourceRow(key, source, engine) {
981
+ function createSourceRow(label, source, engine) {
989
982
  const box = el('div', 'kv')
990
- const keyNode = el('div', 'k')
991
- const valueNode = el('div', 'v mono')
983
+ const labelNode = el('div', 'v mono')
992
984
 
993
985
  if (!source || !source.file) {
994
- setHighlighted(keyNode, key, engine)
995
- box.appendChild(keyNode)
996
- setHighlighted(valueNode, '—', engine)
997
- box.appendChild(valueNode)
986
+ setHighlighted(labelNode, label, engine)
987
+ box.appendChild(labelNode)
998
988
  return box
999
989
  }
1000
990
 
1001
991
  const href = sourceHref(source)
1002
- const keyLink = document.createElement('a')
1003
- keyLink.href = href
1004
- keyLink.target = '_blank'
1005
- keyLink.rel = 'noopener noreferrer'
1006
- keyLink.innerHTML = engine.highlight(key)
1007
- keyNode.appendChild(keyLink)
1008
-
1009
- setHighlighted(valueNode, sourceDisplay(source), engine)
1010
- box.appendChild(keyNode)
1011
- box.appendChild(valueNode)
992
+ const link = document.createElement('a')
993
+ link.href = href
994
+ link.target = '_blank'
995
+ link.rel = 'noopener noreferrer'
996
+ link.innerHTML = engine.highlight(label)
997
+ labelNode.appendChild(link)
998
+ box.appendChild(labelNode)
1012
999
  return box
1013
1000
  }
1014
1001
 
@@ -1055,6 +1042,11 @@
1055
1042
  }
1056
1043
  }
1057
1044
 
1045
+ function resolveSchemaSourceLabel(schemaKey, sourceValue) {
1046
+ if (!sourceValue || typeof sourceValue !== 'object') return schemaKey || 'schema'
1047
+ return sourceValue.sourceName || sourceValue.tag || schemaKey || 'schema'
1048
+ }
1049
+
1058
1050
  function createTreeNode(name = '') {
1059
1051
  return {
1060
1052
  name,
@@ -1174,7 +1166,10 @@
1174
1166
  if (schemaSource.sourceValue) {
1175
1167
  block.appendChild(
1176
1168
  createSourceRow(
1177
- schemaSource.schemaKey || `${sectionName}Schema`,
1169
+ resolveSchemaSourceLabel(
1170
+ schemaSource.schemaKey || `${sectionName}Schema`,
1171
+ schemaSource.sourceValue,
1172
+ ),
1178
1173
  schemaSource.sourceValue,
1179
1174
  engine,
1180
1175
  ),