@fluixi/devtools 0.2.0-alpha.2 → 0.2.0-alpha.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.
Files changed (158) hide show
  1. package/README.md +80 -2
  2. package/dist/callsite.cjs +72 -0
  3. package/dist/callsite.d.ts +22 -0
  4. package/dist/callsite.d.ts.map +1 -0
  5. package/dist/callsite.js +82 -0
  6. package/dist/callsite.mjs +51 -0
  7. package/dist/change-view.cjs +134 -0
  8. package/dist/change-view.d.ts +10 -0
  9. package/dist/change-view.d.ts.map +1 -0
  10. package/dist/change-view.js +102 -0
  11. package/dist/change-view.mjs +111 -0
  12. package/dist/copy.cjs +63 -0
  13. package/dist/copy.d.ts +9 -0
  14. package/dist/copy.d.ts.map +1 -0
  15. package/dist/copy.js +52 -0
  16. package/dist/copy.mjs +42 -0
  17. package/dist/describe.cjs +55 -0
  18. package/dist/describe.d.ts +3 -0
  19. package/dist/describe.d.ts.map +1 -0
  20. package/dist/describe.js +47 -0
  21. package/dist/describe.mjs +34 -0
  22. package/dist/detail-panel.cjs +307 -0
  23. package/dist/detail-panel.d.ts +17 -0
  24. package/dist/detail-panel.d.ts.map +1 -0
  25. package/dist/detail-panel.js +217 -0
  26. package/dist/detail-panel.mjs +284 -0
  27. package/dist/diff.cjs +225 -0
  28. package/dist/diff.d.ts +31 -0
  29. package/dist/diff.d.ts.map +1 -0
  30. package/dist/diff.js +132 -0
  31. package/dist/diff.mjs +202 -0
  32. package/dist/dom.cjs +204 -0
  33. package/dist/dom.d.ts +81 -0
  34. package/dist/dom.d.ts.map +1 -0
  35. package/dist/dom.js +269 -0
  36. package/dist/dom.mjs +183 -0
  37. package/dist/export.cjs +221 -0
  38. package/dist/export.d.ts +55 -0
  39. package/dist/export.d.ts.map +1 -0
  40. package/dist/export.js +90 -0
  41. package/dist/export.mjs +209 -0
  42. package/dist/float.cjs +232 -0
  43. package/dist/float.d.ts +54 -0
  44. package/dist/float.d.ts.map +1 -0
  45. package/dist/float.js +256 -0
  46. package/dist/float.mjs +211 -0
  47. package/dist/format.cjs +175 -0
  48. package/dist/format.d.ts +16 -0
  49. package/dist/format.d.ts.map +1 -0
  50. package/dist/format.js +188 -0
  51. package/dist/format.mjs +154 -0
  52. package/dist/graph-view.cjs +893 -0
  53. package/dist/graph-view.d.ts +79 -2
  54. package/dist/graph-view.d.ts.map +1 -1
  55. package/dist/graph-view.js +866 -50
  56. package/dist/graph-view.mjs +870 -0
  57. package/dist/highlight.cjs +140 -0
  58. package/dist/highlight.d.ts +56 -0
  59. package/dist/highlight.d.ts.map +1 -0
  60. package/dist/highlight.js +154 -0
  61. package/dist/highlight.mjs +119 -0
  62. package/dist/history.cjs +95 -0
  63. package/dist/history.d.ts +59 -0
  64. package/dist/history.d.ts.map +1 -0
  65. package/dist/history.js +85 -0
  66. package/dist/history.mjs +74 -0
  67. package/dist/hook.cjs +1562 -0
  68. package/dist/hook.d.ts +60 -0
  69. package/dist/hook.d.ts.map +1 -0
  70. package/dist/hook.js +142 -0
  71. package/dist/hook.mjs +1553 -0
  72. package/dist/index.cjs +4552 -0
  73. package/dist/index.d.ts +44 -1
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +25 -1
  76. package/dist/index.mjs +4544 -0
  77. package/dist/inspector.cjs +688 -0
  78. package/dist/inspector.d.ts +60 -0
  79. package/dist/inspector.d.ts.map +1 -0
  80. package/dist/inspector.js +415 -0
  81. package/dist/inspector.mjs +676 -0
  82. package/dist/instrument.cjs +497 -0
  83. package/dist/instrument.d.ts +147 -5
  84. package/dist/instrument.d.ts.map +1 -1
  85. package/dist/instrument.js +164 -44
  86. package/dist/instrument.mjs +487 -0
  87. package/dist/kind-filter.cjs +172 -0
  88. package/dist/kind-filter.d.ts +39 -0
  89. package/dist/kind-filter.d.ts.map +1 -0
  90. package/dist/kind-filter.js +151 -0
  91. package/dist/kind-filter.mjs +151 -0
  92. package/dist/menu.cjs +141 -0
  93. package/dist/menu.d.ts +37 -0
  94. package/dist/menu.d.ts.map +1 -0
  95. package/dist/menu.js +125 -0
  96. package/dist/menu.mjs +120 -0
  97. package/dist/observe.cjs +1352 -0
  98. package/dist/observe.d.ts +80 -0
  99. package/dist/observe.d.ts.map +1 -0
  100. package/dist/observe.js +893 -0
  101. package/dist/observe.mjs +1345 -0
  102. package/dist/palette.cjs +52 -0
  103. package/dist/palette.d.ts +11 -0
  104. package/dist/palette.d.ts.map +1 -0
  105. package/dist/palette.js +27 -0
  106. package/dist/palette.mjs +31 -0
  107. package/dist/path.cjs +45 -0
  108. package/dist/path.d.ts +19 -0
  109. package/dist/path.d.ts.map +1 -0
  110. package/dist/path.js +49 -0
  111. package/dist/path.mjs +24 -0
  112. package/dist/plugin.cjs +87 -0
  113. package/dist/plugin.d.ts +121 -0
  114. package/dist/plugin.d.ts.map +1 -0
  115. package/dist/plugin.js +74 -0
  116. package/dist/plugin.mjs +66 -0
  117. package/dist/plugins/context.cjs +98 -0
  118. package/dist/plugins/context.d.ts +10 -0
  119. package/dist/plugins/context.d.ts.map +1 -0
  120. package/dist/plugins/context.js +80 -0
  121. package/dist/plugins/context.mjs +75 -0
  122. package/dist/plugins/directives.cjs +98 -0
  123. package/dist/plugins/directives.d.ts +25 -0
  124. package/dist/plugins/directives.d.ts.map +1 -0
  125. package/dist/plugins/directives.js +78 -0
  126. package/dist/plugins/directives.mjs +75 -0
  127. package/dist/plugins/index.cjs +162 -0
  128. package/dist/plugins/index.d.ts +7 -0
  129. package/dist/plugins/index.d.ts.map +1 -0
  130. package/dist/plugins/index.js +9 -0
  131. package/dist/plugins/index.mjs +140 -0
  132. package/dist/source.cjs +111 -0
  133. package/dist/source.d.ts +72 -0
  134. package/dist/source.d.ts.map +1 -0
  135. package/dist/source.js +153 -0
  136. package/dist/source.mjs +90 -0
  137. package/dist/timeline.cjs +350 -0
  138. package/dist/timeline.d.ts +30 -0
  139. package/dist/timeline.d.ts.map +1 -0
  140. package/dist/timeline.js +271 -0
  141. package/dist/timeline.mjs +327 -0
  142. package/dist/tree.cjs +574 -0
  143. package/dist/tree.d.ts +128 -0
  144. package/dist/tree.d.ts.map +1 -0
  145. package/dist/tree.js +645 -0
  146. package/dist/tree.mjs +551 -0
  147. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  148. package/dist/value-pane.cjs +223 -0
  149. package/dist/value-pane.d.ts +10 -0
  150. package/dist/value-pane.d.ts.map +1 -0
  151. package/dist/value-pane.js +61 -0
  152. package/dist/value-pane.mjs +200 -0
  153. package/dist/wire.cjs +109 -0
  154. package/dist/wire.d.ts +100 -0
  155. package/dist/wire.d.ts.map +1 -0
  156. package/dist/wire.js +93 -0
  157. package/dist/wire.mjs +89 -0
  158. package/package.json +17 -5
@@ -1,12 +1,89 @@
1
- import type { RNode } from './instrument.js';
1
+ import type { RNode, NodeKind } from './instrument.js';
2
+ /** Which way a dependency runs on screen: left to right, or top to bottom. */
3
+ export type GraphDirection = 'horizontal' | 'vertical';
2
4
  export interface GraphViewOptions {
3
5
  onSelect?: (node: RNode | null) => void;
6
+ /**
7
+ * Double-clicking a card. Given the node so the host can pick which of its locations to
8
+ * open: a component has one for where it was declared and another for where it was used.
9
+ */
10
+ onReveal?: (node: RNode) => void;
11
+ /**
12
+ * A wide panel reads left to right; a tall narrow one, which is what a side panel usually
13
+ * is, reads top to bottom.
14
+ * @default 'horizontal'
15
+ */
16
+ direction?: GraphDirection;
17
+ /**
18
+ * Fold a store's key signals into the store card until it is opened. A cart with four
19
+ * items is a dozen signals nobody asked to see, and the store already shows their value.
20
+ * @default true
21
+ */
22
+ collapseStores?: boolean;
23
+ /**
24
+ * Put what a dependency made, and the application never asked for, behind one card. A
25
+ * router's revalidation counter is real state, and it is not what anyone opened the graph
26
+ * to look at.
27
+ * @default true
28
+ */
29
+ groupExternal?: boolean;
30
+ /**
31
+ * Draw a card for each place a signal reaches the document, and each place it is set from.
32
+ *
33
+ * Off by default: one card per attribute and text hole is more cards than nodes on most
34
+ * pages, and the graph is about the nodes. On, it is the whole chain: handler, signal,
35
+ * memo, element.
36
+ * @default false
37
+ */
38
+ showBindings?: boolean;
39
+ /**
40
+ * Draw only these kinds. Omitted, or null, draws every kind, which is what an empty
41
+ * filter means to a reader: no filter, rather than nothing to see.
42
+ */
43
+ kinds?: Iterable<NodeKind> | null;
44
+ /** The project a path is shown relative to. See the inspector's option of the same name. */
45
+ root?: string;
4
46
  }
5
47
  export interface GraphView {
6
48
  update(graph: Map<number, RNode>, now?: number): void;
7
49
  clear(): void;
8
50
  select(id: number | null): void;
51
+ /** Multiply the zoom, about the middle of the view. */
52
+ zoomBy(factor: number): void;
53
+ /** Back to 1:1, everything in frame. */
54
+ resetView(): void;
55
+ /** Open or fold a node that has children, such as a store. Returns what it now is. */
56
+ toggle(id: number): boolean;
57
+ /** Lay the graph out along the other axis. */
58
+ setDirection(direction: GraphDirection): void;
59
+ readonly direction: GraphDirection;
60
+ /** Show what dependencies made as one card, or as themselves. */
61
+ setGroupExternal(group: boolean): void;
62
+ readonly groupExternal: boolean;
63
+ /** Show the document and the handlers as cards around the signals. */
64
+ setShowBindings(show: boolean): void;
65
+ readonly showBindings: boolean;
66
+ /** Draw only these kinds; null for all of them. */
67
+ setKinds(kinds: Iterable<NodeKind> | null): void;
68
+ readonly kinds: ReadonlySet<NodeKind> | null;
69
+ /**
70
+ * The graph as drawn, cards included.
71
+ *
72
+ * What a host should resolve a selected id against: the view invents nodes the host's own
73
+ * map has never heard of.
74
+ */
75
+ readonly shown: Map<number, RNode>;
76
+ /** Hold a set lit until called again. Hovering works over it and returns here. */
77
+ focus(ids: readonly number[] | null): void;
9
78
  }
10
79
  export declare function createGraphView(svg: SVGSVGElement, options?: GraphViewOptions): GraphView;
11
- export declare const DEVTOOLS_CSS = "\n.fx-edge { fill: none; stroke: #38415a; stroke-width: 1.6; opacity: .75; }\n.fx-wedge { fill: none; stroke: #fb7185; stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .65; }\n.fx-node { color: #5eead4; filter: drop-shadow(0 0 calc(var(--pulse,0) * 13px) var(--glow, #5eead4)); }\n.fx-node.n-state { --glow: #34d399; }\n.fx-node.n-memo { --glow: #a78bfa; }\n.fx-node.n-effect { --glow: #fbbf24; }\n.fx-node.n-store { --glow: #38bdf8; }\n.fx-node.n-resource { --glow: #fb7185; }\n.fx-box { fill: #131722; stroke: var(--glow, #5eead4); stroke-width: 1.4; stroke-opacity: calc(.5 + var(--pulse,0) * .5); }\n.fx-node.selected .fx-box { fill: #1a2230; stroke-width: 2.4; }\n.fx-kind { fill: var(--glow, #5eead4); font-family: ui-monospace, monospace; font-size: 9.5px; opacity: .85; }\n.fx-label { fill: #e7e9ee; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 13px; font-weight: 600; }\n.fx-value { fill: #8a90a2; font-family: ui-monospace, monospace; font-size: 12px; }\n.fx-node.n-effect .fx-value { fill: #fbbf24; }\n.fx-node.n-resource .fx-value { fill: #fb7185; }\n";
80
+ /**
81
+ * Default theme.
82
+ *
83
+ * Every colour reads a custom property first, so a host that defines them, a page with a
84
+ * light mode say, restyles the graph without replacing this. The fallbacks are the dark
85
+ * values it always had. The four node hues stay as they are: here colour is the distinction
86
+ * being drawn, not decoration.
87
+ */
88
+ export declare const DEVTOOLS_CSS: string;
12
89
  //# sourceMappingURL=graph-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph-view.d.ts","sourceRoot":"","sources":["../src/graph-view.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAmCvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,KAAK,IAAI,IAAI,CAAC;I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