@zenfg/inspector 0.1.0-beta.3 → 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 (172) hide show
  1. package/GUIDE.md +182 -0
  2. package/README.md +61 -89
  3. package/THEMING.md +124 -0
  4. package/dist/FrameGraphInspector.d.ts +23 -4
  5. package/dist/FrameGraphInspector.d.ts.map +1 -1
  6. package/dist/FrameGraphInspector.js +137 -29
  7. package/dist/FrameGraphInspector.js.map +1 -1
  8. package/dist/capture.d.ts +5 -0
  9. package/dist/capture.d.ts.map +1 -0
  10. package/dist/capture.js +2 -0
  11. package/dist/capture.js.map +1 -0
  12. package/dist/debugCaptureModel.d.ts +19 -0
  13. package/dist/debugCaptureModel.d.ts.map +1 -1
  14. package/dist/debugCaptureModel.js +36 -2
  15. package/dist/debugCaptureModel.js.map +1 -1
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/panelAliasAnalysis.d.ts +1 -0
  20. package/dist/panelAliasAnalysis.d.ts.map +1 -1
  21. package/dist/panelAliasAnalysis.js +23 -54
  22. package/dist/panelAliasAnalysis.js.map +1 -1
  23. package/dist/panelCytoscapeGraphRenderer.d.ts +15 -2
  24. package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
  25. package/dist/panelCytoscapeGraphRenderer.js +145 -23
  26. package/dist/panelCytoscapeGraphRenderer.js.map +1 -1
  27. package/dist/panelDetailLayout.d.ts +27 -0
  28. package/dist/panelDetailLayout.d.ts.map +1 -0
  29. package/dist/panelDetailLayout.js +174 -0
  30. package/dist/panelDetailLayout.js.map +1 -0
  31. package/dist/panelDetailStyles.d.ts +2 -0
  32. package/dist/panelDetailStyles.d.ts.map +1 -0
  33. package/dist/panelDetailStyles.js +57 -0
  34. package/dist/panelDetailStyles.js.map +1 -0
  35. package/dist/panelDiagnosticsView.d.ts +10 -1
  36. package/dist/panelDiagnosticsView.d.ts.map +1 -1
  37. package/dist/panelDiagnosticsView.js +166 -57
  38. package/dist/panelDiagnosticsView.js.map +1 -1
  39. package/dist/panelDomHelpers.d.ts.map +1 -1
  40. package/dist/panelDomHelpers.js +6 -5
  41. package/dist/panelDomHelpers.js.map +1 -1
  42. package/dist/panelGraphLayout.d.ts +3 -2
  43. package/dist/panelGraphLayout.d.ts.map +1 -1
  44. package/dist/panelGraphLayout.js +6 -5
  45. package/dist/panelGraphLayout.js.map +1 -1
  46. package/dist/panelGraphRenderer.d.ts +10 -0
  47. package/dist/panelGraphRenderer.d.ts.map +1 -1
  48. package/dist/panelGraphRenderer.js.map +1 -1
  49. package/dist/panelGraphScene.d.ts +1 -0
  50. package/dist/panelGraphScene.d.ts.map +1 -1
  51. package/dist/panelGraphScene.js +69 -32
  52. package/dist/panelGraphScene.js.map +1 -1
  53. package/dist/panelGraphSearch.d.ts +16 -0
  54. package/dist/panelGraphSearch.d.ts.map +1 -0
  55. package/dist/panelGraphSearch.js +93 -0
  56. package/dist/panelGraphSearch.js.map +1 -0
  57. package/dist/panelGraphView.d.ts +82 -0
  58. package/dist/panelGraphView.d.ts.map +1 -1
  59. package/dist/panelGraphView.js +15 -4
  60. package/dist/panelGraphView.js.map +1 -1
  61. package/dist/panelGraphVisuals.d.ts +14 -6
  62. package/dist/panelGraphVisuals.d.ts.map +1 -1
  63. package/dist/panelGraphVisuals.js +126 -51
  64. package/dist/panelGraphVisuals.js.map +1 -1
  65. package/dist/panelInspectorView.d.ts +8 -0
  66. package/dist/panelInspectorView.d.ts.map +1 -1
  67. package/dist/panelInspectorView.js +242 -48
  68. package/dist/panelInspectorView.js.map +1 -1
  69. package/dist/panelListStyles.d.ts +3 -0
  70. package/dist/panelListStyles.d.ts.map +1 -0
  71. package/dist/panelListStyles.js +155 -0
  72. package/dist/panelListStyles.js.map +1 -0
  73. package/dist/panelMemoryStyles.d.ts +3 -0
  74. package/dist/panelMemoryStyles.d.ts.map +1 -0
  75. package/dist/panelMemoryStyles.js +42 -0
  76. package/dist/panelMemoryStyles.js.map +1 -0
  77. package/dist/panelMemoryView.d.ts +13 -1
  78. package/dist/panelMemoryView.d.ts.map +1 -1
  79. package/dist/panelMemoryView.js +161 -41
  80. package/dist/panelMemoryView.js.map +1 -1
  81. package/dist/panelPassesView.d.ts +15 -0
  82. package/dist/panelPassesView.d.ts.map +1 -1
  83. package/dist/panelPassesView.js +202 -72
  84. package/dist/panelPassesView.js.map +1 -1
  85. package/dist/panelRawView.d.ts +15 -0
  86. package/dist/panelRawView.d.ts.map +1 -0
  87. package/dist/panelRawView.js +105 -0
  88. package/dist/panelRawView.js.map +1 -0
  89. package/dist/panelResourcesView.d.ts +8 -0
  90. package/dist/panelResourcesView.d.ts.map +1 -1
  91. package/dist/panelResourcesView.js +62 -31
  92. package/dist/panelResourcesView.js.map +1 -1
  93. package/dist/panelSelection.d.ts +9 -1
  94. package/dist/panelSelection.d.ts.map +1 -1
  95. package/dist/panelSelection.js +34 -4
  96. package/dist/panelSelection.js.map +1 -1
  97. package/dist/panelTheme.d.ts +13 -0
  98. package/dist/panelTheme.d.ts.map +1 -0
  99. package/dist/panelTheme.js +104 -0
  100. package/dist/panelTheme.js.map +1 -0
  101. package/dist/panelTypes.d.ts +10 -1
  102. package/dist/panelTypes.d.ts.map +1 -1
  103. package/dist/panelTypes.js.map +1 -1
  104. package/dist/panelVisualTheme.d.ts +147 -50
  105. package/dist/panelVisualTheme.d.ts.map +1 -1
  106. package/dist/panelVisualTheme.js +34 -44
  107. package/dist/panelVisualTheme.js.map +1 -1
  108. package/dist/panelWorkbenchHelpers.d.ts +12 -1
  109. package/dist/panelWorkbenchHelpers.d.ts.map +1 -1
  110. package/dist/panelWorkbenchHelpers.js +62 -1
  111. package/dist/panelWorkbenchHelpers.js.map +1 -1
  112. package/dist/panelWorkbenchStyles.d.ts +2 -0
  113. package/dist/panelWorkbenchStyles.d.ts.map +1 -0
  114. package/dist/panelWorkbenchStyles.js +101 -0
  115. package/dist/panelWorkbenchStyles.js.map +1 -0
  116. package/dist/panelWorkbenchView.d.ts +16 -0
  117. package/dist/panelWorkbenchView.d.ts.map +1 -1
  118. package/dist/panelWorkbenchView.js +228 -50
  119. package/dist/panelWorkbenchView.js.map +1 -1
  120. package/dist/query.js.map +1 -1
  121. package/dist/styles.d.ts.map +1 -1
  122. package/dist/styles.js +147 -195
  123. package/dist/styles.js.map +1 -1
  124. package/dist/theme.d.ts +22 -0
  125. package/dist/theme.d.ts.map +1 -0
  126. package/dist/theme.js +10 -0
  127. package/dist/theme.js.map +1 -0
  128. package/dist/themeDefinitions.d.ts +251 -0
  129. package/dist/themeDefinitions.d.ts.map +1 -0
  130. package/dist/themeDefinitions.js +96 -0
  131. package/dist/themeDefinitions.js.map +1 -0
  132. package/dist/themePalette.d.ts +66 -0
  133. package/dist/themePalette.d.ts.map +1 -0
  134. package/dist/themePalette.js +37 -0
  135. package/dist/themePalette.js.map +1 -0
  136. package/dist/themes.css +165 -0
  137. package/package.json +44 -10
  138. package/src/FrameGraphInspector.ts +130 -31
  139. package/src/capture.ts +4 -0
  140. package/src/debugCaptureModel.ts +53 -2
  141. package/src/index.ts +6 -2
  142. package/src/panelAliasAnalysis.ts +24 -70
  143. package/src/panelCytoscapeGraphRenderer.ts +140 -23
  144. package/src/panelDetailLayout.ts +155 -0
  145. package/src/panelDetailStyles.ts +56 -0
  146. package/src/panelDiagnosticsView.ts +166 -85
  147. package/src/panelDomHelpers.ts +4 -5
  148. package/src/panelGraphLayout.ts +6 -5
  149. package/src/panelGraphRenderer.ts +7 -0
  150. package/src/panelGraphScene.ts +68 -30
  151. package/src/panelGraphSearch.ts +96 -0
  152. package/src/panelGraphView.ts +14 -4
  153. package/src/panelGraphVisuals.ts +122 -52
  154. package/src/panelInspectorView.ts +227 -48
  155. package/src/panelListStyles.ts +154 -0
  156. package/src/panelMemoryStyles.ts +41 -0
  157. package/src/panelMemoryView.ts +178 -53
  158. package/src/panelPassesView.ts +190 -137
  159. package/src/panelRawView.ts +99 -0
  160. package/src/panelResourcesView.ts +69 -56
  161. package/src/panelSelection.ts +37 -5
  162. package/src/panelTheme.ts +85 -0
  163. package/src/panelTypes.ts +7 -1
  164. package/src/panelVisualTheme.ts +38 -49
  165. package/src/panelWorkbenchHelpers.ts +60 -2
  166. package/src/panelWorkbenchStyles.ts +100 -0
  167. package/src/panelWorkbenchView.ts +201 -52
  168. package/src/query.ts +11 -11
  169. package/src/styles.ts +148 -195
  170. package/src/theme.ts +24 -0
  171. package/src/themeDefinitions.ts +103 -0
  172. package/src/themePalette.ts +44 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panelTheme.js","sourceRoot":"","sources":["../src/panelTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAyB,MAAM,uBAAuB,CAAC;AAEzG,gGAAgG;AAChG,MAAM,OAAO,wBAAwB;IAEJ;IADZ,KAAK,GAAG,IAAI,GAAG,EAAmE,CAAC;IACpG,YAA6B,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAElD,KAAK,CAAC,KAA4B;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACpC,IAAI,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC;gBAAE,SAAS;YAC9F,IAAI,KAAK,CAAC,QAAQ;gBAAE,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;;gBACtE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;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,iBAAiB,CAAC,GAAG,CAAC,CAAC;YAC/F,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAAE,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACnE,CAAC;aAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACxB,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACnH,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IACF,IAAI,CAAC;QAAC,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;YACpC,CAAC;QAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAAC,CAAC;AAC/B,CAAC","sourcesContent":["import type { InspectorTheme, InspectorThemeVariables } from './theme.ts';\nimport { internalThemeProperty, stormVariables } from './themeDefinitions.ts';\nimport { createGraphVisualTheme, defaultThemeValue, type GraphVisualTheme } from './panelVisualTheme.ts';\n\n/** Own only declarations written by this API, restoring pre-existing inline styles on reset. */\nexport class InspectorThemeController {\n private readonly owned = new Map<string, { previous: string; priority: string; applied: string }>();\n constructor(private readonly root: HTMLElement) {}\n\n apply(theme: InspectorTheme | null): void {\n const style = this.root.style;\n for (const [key, entry] of this.owned) {\n if (style.getPropertyValue(key) !== entry.applied || style.getPropertyPriority(key)) continue;\n if (entry.previous) style.setProperty(key, entry.previous, entry.priority);\n else style.removeProperty(key);\n }\n this.owned.clear();\n const entries = Object.entries(theme?.variables ?? {}).filter(([key]) => Object.hasOwn(stormVariables, key));\n if (theme?.colorScheme) entries.push(['--zfgi-color-scheme', theme.colorScheme]);\n for (const [key, value] of entries) {\n if (typeof value !== 'string') continue;\n const previous = style.getPropertyValue(key);\n const priority = style.getPropertyPriority(key);\n style.setProperty(key, value);\n this.owned.set(key, { previous, priority, applied: style.getPropertyValue(key) });\n }\n }\n\n destroy(): void { this.owned.clear(); }\n}\n\n/** Resolve through the DOM once per refresh, including var(), color-mix(), and CSS lengths. */\nexport function resolveGraphTheme(root: HTMLElement): GraphVisualTheme {\n const document = root.ownerDocument;\n const view = document?.defaultView;\n if (!view || !root.isConnected) return createGraphVisualTheme();\n const styles = view.getComputedStyle(root);\n const probe = document.createElement('span');\n probe.style.cssText = 'position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;overflow:hidden;';\n probe.setAttribute('aria-hidden', 'true');\n root.appendChild(probe);\n const cache = new Map<string, string>();\n let context: CanvasRenderingContext2D | null | undefined;\n const color = (value: string): string | undefined => {\n probe.style.color = '';\n probe.style.color = value;\n if (!probe.style.color) return undefined;\n const resolved = view.getComputedStyle(probe).color;\n if (/^(#[\\da-f]{3,8}|rgba?\\([\\d.,\\s]+\\))$/i.test(resolved)) return resolved;\n // Normalize newer CSS color spaces into sRGB supported by Cytoscape.\n if (context === undefined) {\n const canvas = document.createElement('canvas'); canvas.width = canvas.height = 1;\n context = canvas.getContext('2d', { willReadFrequently: true });\n }\n if (!context) return undefined;\n context.clearRect(0, 0, 1, 1);\n context.fillStyle = resolved;\n context.fillRect(0, 0, 1, 1);\n const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data;\n return `rgba(${r}, ${g}, ${b}, ${a! / 255})`;\n };\n const read = (key: keyof InspectorThemeVariables): string => {\n const cached = cache.get(key);\n if (cached !== undefined) return cached;\n const value = styles.getPropertyValue(internalThemeProperty(key)).trim() || defaultThemeValue(key);\n let result = value;\n if (key.endsWith('font-family')) {\n probe.style.fontFamily = value;\n result = view.getComputedStyle(probe).fontFamily;\n } else if (key.endsWith('size') || key.endsWith('width')) {\n probe.style.fontSize = ''; probe.style.fontSize = value;\n result = probe.style.fontSize ? view.getComputedStyle(probe).fontSize : defaultThemeValue(key);\n if (!(parseFloat(result) > 0)) result = defaultThemeValue(key);\n } else if (key.endsWith('opacity') || key.endsWith('scale')) {\n const n = Number(value);\n result = Number.isFinite(n) && n >= 0 && (!key.endsWith('opacity') || n <= 1) ? value : defaultThemeValue(key);\n } else {\n result = color(value) ?? defaultThemeValue(key);\n }\n cache.set(key, result);\n return result;\n };\n try { return createGraphVisualTheme(read); }\n finally { probe.remove(); }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { GraphVisualTheme } from './panelVisualTheme.ts';
1
2
  import type { GraphRenderer } from './panelGraphRenderer.ts';
2
3
  import type { FrameGraphDebugEdge } from './debugCaptureModel.ts';
3
4
  export type GraphFlowRelation = {
@@ -20,7 +21,7 @@ export type Selection = {
20
21
  key: string;
21
22
  } | {
22
23
  kind: 'culled';
23
- index: number;
24
+ id: string;
24
25
  } | {
25
26
  kind: 'allocation';
26
27
  id: string;
@@ -32,14 +33,22 @@ export type WorkbenchTab = 'overview' | 'graph' | 'passes' | 'resources' | 'memo
32
33
  export type PassesSubview = 'list' | 'groups';
33
34
  export type InspectorTab = 'summary' | 'relations' | 'raw';
34
35
  export type GraphViewState = {
36
+ theme?: GraphVisualTheme;
37
+ readonly refreshTheme?: () => void;
35
38
  readonly host: HTMLElement;
36
39
  readonly toolbar: HTMLElement;
37
40
  readonly legend?: HTMLElement;
38
41
  readonly layoutElementBudget?: number;
39
42
  groupsEnabled: boolean;
43
+ showResourceDeclarations?: boolean;
40
44
  readonly expandedGroupPaths: Set<string>;
41
45
  renderer?: GraphRenderer;
42
46
  fitOnNextRender: boolean;
43
47
  anchorElementIdOnNextRender?: string;
48
+ revealOnNextRender?: {
49
+ readonly selection: Selection;
50
+ readonly revision: number;
51
+ };
52
+ captureRevision?: number;
44
53
  };
45
54
  //# sourceMappingURL=panelTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panelTypes.d.ts","sourceRoot":"","sources":["../src/panelTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAC3F,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,SAAS,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAA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a,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"panelTypes.js","sourceRoot":"","sources":["../src/panelTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphRenderer } from './panelGraphRenderer.ts';\nimport type { FrameGraphDebugEdge } from './debugCaptureModel.ts';\n\nexport type GraphFlowRelation = {\n readonly role: 'declaration' | 'value' | 'ordering' | 'output-producer' | 'output-initial';\n readonly nodeIds: readonly string[];\n readonly rootKey?: string;\n readonly dependency?: FrameGraphDebugEdge;\n};\n\nexport type Selection =\n | { kind: 'node'; id: string }\n | { kind: 'group'; pathKey: string }\n | { kind: 'resource'; id: string }\n | { kind: 'root'; key: string }\n | { kind: 'culled'; index: number }\n | { kind: 'allocation'; id: string }\n | { kind: 'segment'; index: number };\n\nexport type WorkbenchTab = 'overview' | 'graph' | 'passes' | 'resources' | 'memory' | 'diagnostics';\nexport type PassesSubview = 'list' | 'groups';\nexport type InspectorTab = 'summary' | 'relations' | 'raw';\n\nexport type GraphViewState = {\n readonly host: HTMLElement;\n readonly toolbar: HTMLElement;\n readonly legend?: HTMLElement;\n\treadonly layoutElementBudget?: number;\n groupsEnabled: boolean;\n readonly expandedGroupPaths: Set<string>;\n renderer?: GraphRenderer;\n fitOnNextRender: boolean;\n anchorElementIdOnNextRender?: string;\n};\n"]}
1
+ {"version":3,"file":"panelTypes.js","sourceRoot":"","sources":["../src/panelTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphVisualTheme } from './panelVisualTheme.ts';\nimport type { GraphRenderer } from './panelGraphRenderer.ts';\nimport type { FrameGraphDebugEdge } from './debugCaptureModel.ts';\n\nexport type GraphFlowRelation = {\n readonly role: 'declaration' | 'value' | 'ordering' | 'output-producer' | 'output-initial';\n readonly nodeIds: readonly string[];\n readonly rootKey?: string;\n readonly dependency?: FrameGraphDebugEdge;\n};\n\nexport type Selection =\n | { kind: 'node'; id: string }\n | { kind: 'group'; pathKey: string }\n | { kind: 'resource'; id: string }\n | { kind: 'root'; key: string }\n | { kind: 'culled'; id: string }\n | { kind: 'allocation'; id: string }\n | { kind: 'segment'; index: number };\n\nexport type WorkbenchTab = 'overview' | 'graph' | 'passes' | 'resources' | 'memory' | 'diagnostics';\nexport type PassesSubview = 'list' | 'groups';\nexport type InspectorTab = 'summary' | 'relations' | 'raw';\n\nexport type GraphViewState = {\n theme?: GraphVisualTheme;\n readonly refreshTheme?: () => void;\n readonly host: HTMLElement;\n readonly toolbar: HTMLElement;\n readonly legend?: HTMLElement;\n\treadonly layoutElementBudget?: number;\n groupsEnabled: boolean;\n showResourceDeclarations?: boolean;\n readonly expandedGroupPaths: Set<string>;\n renderer?: GraphRenderer;\n fitOnNextRender: boolean;\n anchorElementIdOnNextRender?: string;\n revealOnNextRender?: { readonly selection: Selection; readonly revision: number };\n captureRevision?: number;\n};\n"]}
@@ -1,84 +1,181 @@
1
- export declare const FRAME_GRAPH_DEBUG_VISUAL_THEME: {
2
- readonly canvas: "#0b0f14";
3
- readonly panel: "#0f151d";
4
- readonly surface: "#131b24";
5
- readonly surfaceRaised: "#18222d";
6
- readonly surfaceHover: "#1d2935";
7
- readonly border: "#263341";
8
- readonly text: "#e6edf3";
9
- readonly textSecondary: "#b4beca";
10
- readonly muted: "#8b98a5";
11
- readonly accent: "#38bdf8";
12
- readonly success: "#34d399";
13
- readonly warning: "#fbbf24";
14
- readonly danger: "#fb7185";
15
- readonly fontUi: "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif";
16
- readonly fontMono: "ui-monospace, SFMono-Regular, Consolas, \"Liberation Mono\", monospace";
1
+ import type { InspectorThemeVariables } from './theme.ts';
2
+ type Variable = keyof InspectorThemeVariables;
3
+ export declare function mixHex(front: string, back: string, amount: number): string;
4
+ export declare function defaultThemeValue(key: Variable, variables?: InspectorThemeVariables): string;
5
+ export declare function createGraphVisualTheme(read?: (key: Variable) => string): {
6
+ canvas: string;
7
+ surface: string;
8
+ surfaceRaised: string;
9
+ text: string;
10
+ muted: string;
11
+ render: {
12
+ stroke: string;
13
+ fill: string;
14
+ };
15
+ compute: {
16
+ stroke: string;
17
+ fill: string;
18
+ };
19
+ copy: {
20
+ stroke: string;
21
+ fill: string;
22
+ };
23
+ clear: {
24
+ stroke: string;
25
+ fill: string;
26
+ };
27
+ command: {
28
+ stroke: string;
29
+ fill: string;
30
+ };
31
+ external: {
32
+ stroke: string;
33
+ fill: string;
34
+ };
35
+ declaration: {
36
+ stroke: string;
37
+ fill: string;
38
+ };
39
+ output: {
40
+ stroke: string;
41
+ fill: string;
42
+ };
43
+ texture: {
44
+ stroke: string;
45
+ fill: string;
46
+ };
47
+ buffer: {
48
+ stroke: string;
49
+ fill: string;
50
+ };
51
+ group: {
52
+ stroke: string;
53
+ fill: string;
54
+ alternateFill: string;
55
+ };
56
+ dependency: {
57
+ value: string;
58
+ ordering: string;
59
+ };
60
+ access: {
61
+ read: string;
62
+ write: string;
63
+ };
64
+ selected: string;
65
+ hover: string;
66
+ activeBackground: {
67
+ color: string;
68
+ opacity: number;
69
+ size: number;
70
+ };
71
+ culled: {
72
+ stroke: string;
73
+ fill: string;
74
+ };
75
+ fontFamily: string;
76
+ fontSize: number;
77
+ nodeBorderWidth: number;
78
+ groupBorderWidth: number;
79
+ edgeWidth: number;
80
+ edgeOpacity: number;
81
+ orderingOpacity: number;
82
+ groupOpacity: number;
83
+ arrowScale: number;
84
+ hoverWidth: number;
85
+ selectedWidth: number;
17
86
  };
87
+ export type GraphVisualTheme = ReturnType<typeof createGraphVisualTheme>;
18
88
  export declare const GRAPH_VISUAL_THEME: {
19
- readonly canvas: "#0b0f14";
20
- readonly surface: "#131b24";
21
- readonly surfaceRaised: "#18222d";
22
- readonly text: "#e6edf3";
23
- readonly muted: "#8b98a5";
24
- readonly render: {
89
+ canvas: string;
90
+ surface: string;
91
+ surfaceRaised: string;
92
+ text: string;
93
+ muted: string;
94
+ render: {
95
+ stroke: string;
96
+ fill: string;
97
+ };
98
+ compute: {
25
99
  stroke: string;
26
100
  fill: string;
27
101
  };
28
- readonly compute: {
102
+ copy: {
29
103
  stroke: string;
30
104
  fill: string;
31
105
  };
32
- readonly copy: {
106
+ clear: {
33
107
  stroke: string;
34
108
  fill: string;
35
109
  };
36
- readonly clear: {
110
+ command: {
37
111
  stroke: string;
38
112
  fill: string;
39
113
  };
40
- readonly command: {
114
+ external: {
41
115
  stroke: string;
42
116
  fill: string;
43
117
  };
44
- readonly external: {
118
+ declaration: {
45
119
  stroke: string;
46
120
  fill: string;
47
121
  };
48
- readonly declaration: {
122
+ output: {
49
123
  stroke: string;
50
124
  fill: string;
51
125
  };
52
- readonly output: {
126
+ texture: {
53
127
  stroke: string;
54
128
  fill: string;
55
129
  };
56
- readonly texture: {
57
- readonly stroke: "#f472b6";
58
- readonly fill: "#3c1f32";
130
+ buffer: {
131
+ stroke: string;
132
+ fill: string;
59
133
  };
60
- readonly buffer: {
61
- readonly stroke: "#2dd4bf";
62
- readonly fill: "#123632";
134
+ group: {
135
+ stroke: string;
136
+ fill: string;
137
+ alternateFill: string;
63
138
  };
64
- readonly group: {
65
- readonly stroke: "#64748b";
66
- readonly fill: "#141c29";
67
- readonly alternateFill: "#172033";
139
+ dependency: {
140
+ value: string;
141
+ ordering: string;
68
142
  };
69
- readonly dependency: {
70
- readonly value: "#94a3b8";
71
- readonly ordering: "#8593a6";
143
+ access: {
144
+ read: string;
145
+ write: string;
72
146
  };
73
- readonly access: {
74
- readonly read: "#2dd4bf";
75
- readonly write: "#f59e0b";
147
+ selected: string;
148
+ hover: string;
149
+ activeBackground: {
150
+ color: string;
151
+ opacity: number;
152
+ size: number;
76
153
  };
77
- readonly selected: "#38bdf8";
78
- readonly hover: "#cbd5e1";
79
- readonly culled: {
80
- readonly stroke: "#64748b";
81
- readonly fill: "#171d24";
154
+ culled: {
155
+ stroke: string;
156
+ fill: string;
82
157
  };
158
+ fontFamily: string;
159
+ fontSize: number;
160
+ nodeBorderWidth: number;
161
+ groupBorderWidth: number;
162
+ edgeWidth: number;
163
+ edgeOpacity: number;
164
+ orderingOpacity: number;
165
+ groupOpacity: number;
166
+ arrowScale: number;
167
+ hoverWidth: number;
168
+ selectedWidth: number;
169
+ };
170
+ export declare const FRAME_GRAPH_DEBUG_VISUAL_THEME: {
171
+ canvas: string;
172
+ panel: string;
173
+ surface: string;
174
+ surfaceRaised: string;
175
+ surfaceHover: string;
176
+ text: string;
177
+ textSecondary: string;
178
+ muted: string;
83
179
  };
180
+ export {};
84
181
  //# sourceMappingURL=panelVisualTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panelVisualTheme.d.ts","sourceRoot":"","sources":["../src/panelVisualTheme.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;CAgBjC,CAAC;AAWX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBrB,CAAC"}
1
+ {"version":3,"file":"panelVisualTheme.d.ts","sourceRoot":"","sources":["../src/panelVisualTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,KAAK,QAAQ,GAAG,MAAM,uBAAuB,CAAC;AAC9C,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1E;AACD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,GAAE,uBAAwC,GAAG,MAAM,CAK5G;AACD,wBAAgB,sBAAsB,CAAC,IAAI,GAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,MAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBzF;AACD,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA2B,CAAC;AAC3D,eAAO,MAAM,8BAA8B;;;;;;;;;CAE1C,CAAC"}
@@ -1,47 +1,37 @@
1
- export const FRAME_GRAPH_DEBUG_VISUAL_THEME = {
2
- canvas: '#0b0f14',
3
- panel: '#0f151d',
4
- surface: '#131b24',
5
- surfaceRaised: '#18222d',
6
- surfaceHover: '#1d2935',
7
- border: '#263341',
8
- text: '#e6edf3',
9
- textSecondary: '#b4beca',
10
- muted: '#8b98a5',
11
- accent: '#38bdf8',
12
- success: '#34d399',
13
- warning: '#fbbf24',
14
- danger: '#fb7185',
15
- fontUi: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
16
- fontMono: 'ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace',
17
- };
18
- function category(stroke) {
19
- const canvas = FRAME_GRAPH_DEBUG_VISUAL_THEME.canvas;
20
- const fill = '#' + [1, 3, 5].map((offset) => Math.round(parseInt(stroke.slice(offset, offset + 2), 16) * 0.18
21
- + parseInt(canvas.slice(offset, offset + 2), 16) * 0.82).toString(16).padStart(2, '0')).join('');
22
- return { stroke, fill };
1
+ import { stormVariables } from "./themeDefinitions.js";
2
+ export function mixHex(front, back, amount) {
3
+ return '#' + [1, 3, 5].map(offset => Math.round(parseInt(front.slice(offset, offset + 2), 16) * amount + parseInt(back.slice(offset, offset + 2), 16) * (1 - amount)).toString(16).padStart(2, '0')).join('');
4
+ }
5
+ export function defaultThemeValue(key, variables = stormVariables) {
6
+ let value = variables[key];
7
+ value = value.replace(/var\((--zfgi-[\w-]+), ([^()]+)\)/g, (_match, name) => defaultThemeValue(name, variables));
8
+ const mix = /^color-mix\(in srgb, (#[\da-f]+) ([\d.]+)%, (#[\da-f]+)\)$/i.exec(value);
9
+ return mix ? mixHex(mix[1], mix[3], Number(mix[2]) / 100) : value;
23
10
  }
24
- export const GRAPH_VISUAL_THEME = {
25
- canvas: FRAME_GRAPH_DEBUG_VISUAL_THEME.canvas,
26
- surface: FRAME_GRAPH_DEBUG_VISUAL_THEME.surface,
27
- surfaceRaised: FRAME_GRAPH_DEBUG_VISUAL_THEME.surfaceRaised,
28
- text: FRAME_GRAPH_DEBUG_VISUAL_THEME.text,
29
- muted: FRAME_GRAPH_DEBUG_VISUAL_THEME.muted,
30
- render: category('#57C785'),
31
- compute: category('#9AA5FF'),
32
- copy: category('#F2CD60'),
33
- clear: category('#C4CF89'),
34
- command: category('#CF91E8'),
35
- external: category('#F29A67'),
36
- declaration: category('#B9AB94'),
37
- output: category('#EC91AE'),
38
- texture: { stroke: '#f472b6', fill: '#3c1f32' },
39
- buffer: { stroke: '#2dd4bf', fill: '#123632' },
40
- group: { stroke: '#64748b', fill: '#141c29', alternateFill: '#172033' },
41
- dependency: { value: '#94a3b8', ordering: '#8593a6' },
42
- access: { read: '#2dd4bf', write: '#f59e0b' },
43
- selected: FRAME_GRAPH_DEBUG_VISUAL_THEME.accent,
44
- hover: '#cbd5e1',
45
- culled: { stroke: '#64748b', fill: '#171d24' },
11
+ export function createGraphVisualTheme(read = defaultThemeValue) {
12
+ const category = (kind) => ({
13
+ stroke: read(('--zfgi-graph-' + kind + '-stroke')), fill: read(('--zfgi-graph-' + kind + '-fill')),
14
+ });
15
+ const number = (key) => parseFloat(read(key));
16
+ return {
17
+ canvas: read('--zfgi-canvas'), surface: read('--zfgi-surface'), surfaceRaised: read('--zfgi-surface-raised'),
18
+ text: read('--zfgi-graph-text'), muted: read('--zfgi-graph-muted'),
19
+ render: category('render'), compute: category('compute'), copy: category('copy'), clear: category('clear'),
20
+ command: category('command'), external: category('external'), declaration: category('declaration'), output: category('output'), texture: category('texture'), buffer: category('buffer'),
21
+ group: { stroke: read('--zfgi-graph-group-stroke'), fill: read('--zfgi-graph-group-fill'), alternateFill: read('--zfgi-graph-group-alternate-fill') },
22
+ dependency: { value: read('--zfgi-graph-value'), ordering: read('--zfgi-graph-ordering') },
23
+ access: { read: read('--zfgi-graph-read'), write: read('--zfgi-graph-write') },
24
+ selected: read('--zfgi-graph-selected'), hover: read('--zfgi-graph-hover'),
25
+ activeBackground: { color: read('--zfgi-graph-active-bg'), opacity: number('--zfgi-graph-active-bg-opacity'), size: number('--zfgi-graph-active-bg-size') },
26
+ culled: { stroke: read('--zfgi-graph-culled-stroke'), fill: read('--zfgi-graph-culled-fill') },
27
+ fontFamily: read('--zfgi-graph-font-family'), fontSize: number('--zfgi-graph-font-size'),
28
+ nodeBorderWidth: number('--zfgi-graph-node-border-width'), groupBorderWidth: number('--zfgi-graph-group-border-width'),
29
+ edgeWidth: number('--zfgi-graph-edge-width'), edgeOpacity: number('--zfgi-graph-edge-opacity'), orderingOpacity: number('--zfgi-graph-ordering-opacity'), groupOpacity: number('--zfgi-graph-group-opacity'),
30
+ arrowScale: number('--zfgi-graph-arrow-scale'), hoverWidth: number('--zfgi-graph-hover-width'), selectedWidth: number('--zfgi-graph-selected-width'),
31
+ };
32
+ }
33
+ export const GRAPH_VISUAL_THEME = createGraphVisualTheme();
34
+ export const FRAME_GRAPH_DEBUG_VISUAL_THEME = {
35
+ canvas: defaultThemeValue('--zfgi-canvas'), panel: defaultThemeValue('--zfgi-background'), surface: defaultThemeValue('--zfgi-surface'), surfaceRaised: defaultThemeValue('--zfgi-surface-raised'), surfaceHover: defaultThemeValue('--zfgi-surface-hover'), text: defaultThemeValue('--zfgi-text'), textSecondary: defaultThemeValue('--zfgi-text-secondary'), muted: defaultThemeValue('--zfgi-muted'),
46
36
  };
47
37
  //# sourceMappingURL=panelVisualTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"panelVisualTheme.js","sourceRoot":"","sources":["../src/panelVisualTheme.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC7C,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,sEAAsE;IAC9E,QAAQ,EAAE,sEAAsE;CACvE,CAAC;AAEX,SAAS,QAAQ,CAAC,MAAc;IAC/B,MAAM,MAAM,GAAG,8BAA8B,CAAC,MAAM,CAAC;IACrD,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CACtD,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI;UACnD,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CACvD,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC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',\n\tborder: '#263341',\n\ttext: '#e6edf3',\n\ttextSecondary: '#b4beca',\n\tmuted: '#8b98a5',\n\taccent: '#38bdf8',\n\tsuccess: '#34d399',\n\twarning: '#fbbf24',\n\tdanger: '#fb7185',\n\tfontUi: 'system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n\tfontMono: 'ui-monospace, SFMono-Regular, Consolas, \"Liberation Mono\", monospace',\n} as const;\n\nfunction category(stroke: string) {\n\tconst canvas = FRAME_GRAPH_DEBUG_VISUAL_THEME.canvas;\n\tconst fill = '#' + [1, 3, 5].map((offset) => Math.round(\n\t\tparseInt(stroke.slice(offset, offset + 2), 16) * 0.18\n\t\t+ parseInt(canvas.slice(offset, offset + 2), 16) * 0.82,\n\t).toString(16).padStart(2, '0')).join('');\n\treturn { stroke, fill };\n}\n\nexport const GRAPH_VISUAL_THEME = {\n\tcanvas: FRAME_GRAPH_DEBUG_VISUAL_THEME.canvas,\n\tsurface: FRAME_GRAPH_DEBUG_VISUAL_THEME.surface,\n\tsurfaceRaised: FRAME_GRAPH_DEBUG_VISUAL_THEME.surfaceRaised,\n\ttext: FRAME_GRAPH_DEBUG_VISUAL_THEME.text,\n\tmuted: FRAME_GRAPH_DEBUG_VISUAL_THEME.muted,\n\trender: category('#57C785'),\n\tcompute: category('#9AA5FF'),\n\tcopy: category('#F2CD60'),\n\tclear: category('#C4CF89'),\n\tcommand: category('#CF91E8'),\n\texternal: category('#F29A67'),\n\tdeclaration: category('#B9AB94'),\n\toutput: category('#EC91AE'),\n\ttexture: { stroke: '#f472b6', fill: '#3c1f32' },\n\tbuffer: { stroke: '#2dd4bf', fill: '#123632' },\n\tgroup: { stroke: '#64748b', fill: '#141c29', alternateFill: '#172033' },\n\tdependency: { value: '#94a3b8', ordering: '#8593a6' },\n\taccess: { read: '#2dd4bf', write: '#f59e0b' },\n\tselected: FRAME_GRAPH_DEBUG_VISUAL_THEME.accent,\n\thover: '#cbd5e1',\n\tculled: { stroke: '#64748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;IAC1C,MAAM,EAAE,iBAAiB,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,aAAa,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,EAAE,YAAY,EAAE,iBAAiB,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,cAAc,CAAC;CAC3Y,CAAC","sourcesContent":["import { stormVariables } from './themeDefinitions.ts';\nimport type { InspectorThemeVariables } from './theme.ts';\ntype Variable = keyof InspectorThemeVariables;\nexport function mixHex(front: string, back: string, amount: number): string {\n return '#' + [1, 3, 5].map(offset => Math.round(parseInt(front.slice(offset, offset + 2), 16) * amount + parseInt(back.slice(offset, offset + 2), 16) * (1 - amount)).toString(16).padStart(2, '0')).join('');\n}\nexport function defaultThemeValue(key: Variable, variables: InspectorThemeVariables = stormVariables): string {\n let value: string = variables[key];\n value = value.replace(/var\\((--zfgi-[\\w-]+), ([^()]+)\\)/g, (_match, name: Variable) => defaultThemeValue(name, variables));\n const mix = /^color-mix\\(in srgb, (#[\\da-f]+) ([\\d.]+)%, (#[\\da-f]+)\\)$/i.exec(value);\n return mix ? mixHex(mix[1]!, mix[3]!, Number(mix[2]) / 100) : value;\n}\nexport function createGraphVisualTheme(read: (key: Variable) => string = defaultThemeValue) {\n const category = (kind: 'render' | 'compute' | 'copy' | 'clear' | 'command' | 'external' | 'declaration' | 'output' | 'texture' | 'buffer') => ({\n stroke: read(('--zfgi-graph-' + kind + '-stroke') as Variable), fill: read(('--zfgi-graph-' + kind + '-fill') as Variable),\n });\n const number = (key: Variable) => parseFloat(read(key));\n return {\n canvas: read('--zfgi-canvas'), surface: read('--zfgi-surface'), surfaceRaised: read('--zfgi-surface-raised'),\n text: read('--zfgi-graph-text'), muted: read('--zfgi-graph-muted'),\n render: category('render'), compute: category('compute'), copy: category('copy'), clear: category('clear'),\n command: category('command'), external: category('external'), declaration: category('declaration'), output: category('output'), texture: category('texture'), buffer: category('buffer'),\n group: { stroke: read('--zfgi-graph-group-stroke'), fill: read('--zfgi-graph-group-fill'), alternateFill: read('--zfgi-graph-group-alternate-fill') },\n dependency: { value: read('--zfgi-graph-value'), ordering: read('--zfgi-graph-ordering') },\n access: { read: read('--zfgi-graph-read'), write: read('--zfgi-graph-write') },\n selected: read('--zfgi-graph-selected'), hover: read('--zfgi-graph-hover'),\n activeBackground: { color: read('--zfgi-graph-active-bg'), opacity: number('--zfgi-graph-active-bg-opacity'), size: number('--zfgi-graph-active-bg-size') },\n culled: { stroke: read('--zfgi-graph-culled-stroke'), fill: read('--zfgi-graph-culled-fill') },\n fontFamily: read('--zfgi-graph-font-family'), fontSize: number('--zfgi-graph-font-size'),\n nodeBorderWidth: number('--zfgi-graph-node-border-width'), groupBorderWidth: number('--zfgi-graph-group-border-width'),\n edgeWidth: number('--zfgi-graph-edge-width'), edgeOpacity: number('--zfgi-graph-edge-opacity'), orderingOpacity: number('--zfgi-graph-ordering-opacity'), groupOpacity: number('--zfgi-graph-group-opacity'),\n arrowScale: number('--zfgi-graph-arrow-scale'), hoverWidth: number('--zfgi-graph-hover-width'), selectedWidth: number('--zfgi-graph-selected-width'),\n };\n}\nexport type GraphVisualTheme = ReturnType<typeof createGraphVisualTheme>;\nexport const GRAPH_VISUAL_THEME = createGraphVisualTheme();\nexport const FRAME_GRAPH_DEBUG_VISUAL_THEME = {\n canvas: defaultThemeValue('--zfgi-canvas'), panel: defaultThemeValue('--zfgi-background'), surface: defaultThemeValue('--zfgi-surface'), surfaceRaised: defaultThemeValue('--zfgi-surface-raised'), surfaceHover: defaultThemeValue('--zfgi-surface-hover'), text: defaultThemeValue('--zfgi-text'), textSecondary: defaultThemeValue('--zfgi-text-secondary'), muted: defaultThemeValue('--zfgi-muted'),\n};\n"]}
@@ -1,10 +1,12 @@
1
1
  import type { FrameGraphDebugResource, FrameGraphDebugViewModel } from './debugCaptureModel.ts';
2
- import type { Selection } from './panelTypes.ts';
2
+ import type { Selection, WorkbenchTab } from './panelTypes.ts';
3
3
  export type WorkbenchCallbacks = {
4
4
  readonly onSelect: (selection: Selection) => void;
5
5
  readonly onHover: (selection: Selection | undefined) => void;
6
6
  readonly onGroupToggle: (pathKey: string) => void;
7
7
  readonly isGroupExpanded: (pathKey: string) => boolean;
8
+ readonly onReveal?: (selection: Selection, tab: WorkbenchTab) => void;
9
+ readonly onNavigate?: (tab: WorkbenchTab, filter?: 'culled') => void;
8
10
  };
9
11
  export type WorkbenchTableColumn = {
10
12
  readonly label: string;
@@ -31,4 +33,13 @@ export declare function formatResourceDescriptor(resource: FrameGraphDebugResour
31
33
  export declare function resourceAccessCounts(snapshot: FrameGraphDebugViewModel, resourceId: string): readonly [number, number];
32
34
  export declare function createEmptyTableRow(columnCount: number, text: string): HTMLTableRowElement;
33
35
  export declare function resourceLabel(snapshot: FrameGraphDebugViewModel, resourceId: string): string;
36
+ /** All tablists use a single tab stop and automatic keyboard activation. */
37
+ export declare function enableTabKeyboard(tabList: HTMLElement): void;
38
+ export declare function formatTimingCoverage(timed: number, eligible: number): string;
39
+ export declare function formatMeasuredGpuWork(micros: number, timed: number, eligible: number): string;
40
+ export declare function formatEstimateCoverage(bytes: number | undefined, coverage: {
41
+ known: number;
42
+ total: number;
43
+ }): string;
44
+ export declare function writeClipboardText(text: string): Promise<void>;
34
45
  //# sourceMappingURL=panelWorkbenchHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panelWorkbenchHelpers.d.ts","sourceRoot":"","sources":["../src/panelWorkbenchHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MA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AAM,CAEpH;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAepE"}
@@ -5,7 +5,7 @@ export function selectionKey(selection) {
5
5
  case 'group': return `group:${selection.pathKey}`;
6
6
  case 'resource': return `resource:${selection.id}`;
7
7
  case 'root': return `root:${selection.key}`;
8
- case 'culled': return `culled:${selection.index}`;
8
+ case 'culled': return `culled:${selection.id}`;
9
9
  case 'allocation': return `allocation:${selection.id}`;
10
10
  case 'segment': return `segment:${selection.index}`;
11
11
  }
@@ -159,4 +159,65 @@ export function resourceLabel(snapshot, resourceId) {
159
159
  const resource = snapshot.resourceById.get(resourceId);
160
160
  return resource ? labelResource(resource) : `resource-${resourceId}`;
161
161
  }
162
+ /** All tablists use a single tab stop and automatic keyboard activation. */
163
+ export function enableTabKeyboard(tabList) {
164
+ const buttons = () => Array.from(tabList.querySelectorAll('[role="tab"]'));
165
+ const sync = () => {
166
+ for (const button of buttons())
167
+ button.tabIndex = button.getAttribute('aria-selected') === 'true' && !button.disabled ? 0 : -1;
168
+ };
169
+ tabList.addEventListener('click', sync);
170
+ tabList.addEventListener('keydown', (event) => {
171
+ if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
172
+ return;
173
+ const available = buttons().filter((button) => !button.disabled && !button.hidden);
174
+ if (!available.length)
175
+ return;
176
+ const index = Math.max(0, available.indexOf(document.activeElement));
177
+ const next = event.key === 'Home' ? 0 : event.key === 'End' ? available.length - 1
178
+ : (index + (event.key === 'ArrowRight' ? 1 : -1) + available.length) % available.length;
179
+ event.preventDefault();
180
+ event.stopPropagation();
181
+ available[next].click();
182
+ available[next].focus();
183
+ sync();
184
+ });
185
+ sync();
186
+ }
187
+ export function formatTimingCoverage(timed, eligible) {
188
+ if (eligible === 0)
189
+ return 'Not applicable · no eligible passes';
190
+ if (timed === 0)
191
+ return `Not collected · 0/${eligible}`;
192
+ return `${timed === eligible ? 'Complete' : 'Partial'} · ${timed}/${eligible} timed`;
193
+ }
194
+ export function formatMeasuredGpuWork(micros, timed, eligible) {
195
+ if (eligible === 0)
196
+ return 'Not applicable';
197
+ if (timed === 0)
198
+ return 'Not collected';
199
+ return `${(micros / 1000).toFixed(3)} ms · ${formatTimingCoverage(timed, eligible)}`;
200
+ }
201
+ export function formatEstimateCoverage(bytes, coverage) {
202
+ return bytes === undefined ? `Unknown · ${coverage.known}/${coverage.total} sizes known` : formatBytes(bytes);
203
+ }
204
+ export async function writeClipboardText(text) {
205
+ if (navigator.clipboard?.writeText)
206
+ return navigator.clipboard.writeText(text);
207
+ const input = document.createElement('textarea');
208
+ input.value = text;
209
+ input.readOnly = true;
210
+ input.style.cssText = 'position:fixed;left:-9999px;top:0';
211
+ document.body.append(input);
212
+ const previous = document.activeElement;
213
+ input.select();
214
+ try {
215
+ if (!document.execCommand('copy'))
216
+ throw new Error('Clipboard is unavailable.');
217
+ }
218
+ finally {
219
+ input.remove();
220
+ previous?.focus();
221
+ }
222
+ }
162
223
  //# sourceMappingURL=panelWorkbenchHelpers.js.map