@fluixi/devtools 0.2.0-alpha.4 → 0.2.0-alpha.6

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 (72) hide show
  1. package/dist/callsite.cjs +9 -0
  2. package/dist/callsite.d.ts +1 -1
  3. package/dist/callsite.d.ts.map +1 -1
  4. package/dist/callsite.js +10 -1
  5. package/dist/callsite.mjs +9 -0
  6. package/dist/change-view.js +2 -2
  7. package/dist/describe.js +2 -2
  8. package/dist/detail-panel.d.ts +1 -1
  9. package/dist/detail-panel.d.ts.map +1 -1
  10. package/dist/detail-panel.js +1 -1
  11. package/dist/diff.js +1 -1
  12. package/dist/export.cjs +1 -0
  13. package/dist/export.d.ts +2 -2
  14. package/dist/export.d.ts.map +1 -1
  15. package/dist/export.js +1 -1
  16. package/dist/export.mjs +1 -0
  17. package/dist/float.d.ts +1 -1
  18. package/dist/float.js +3 -3
  19. package/dist/format.js +3 -3
  20. package/dist/graph-view.cjs +12 -3
  21. package/dist/graph-view.d.ts.map +1 -1
  22. package/dist/graph-view.js +11 -2
  23. package/dist/graph-view.mjs +12 -3
  24. package/dist/history.d.ts +2 -2
  25. package/dist/history.js +2 -2
  26. package/dist/hook.cjs +158 -19
  27. package/dist/hook.d.ts +3 -3
  28. package/dist/hook.js +6 -6
  29. package/dist/hook.mjs +158 -19
  30. package/dist/index.cjs +186 -29
  31. package/dist/index.mjs +186 -29
  32. package/dist/inspector.cjs +8 -4
  33. package/dist/inspector.d.ts +2 -2
  34. package/dist/inspector.js +8 -8
  35. package/dist/inspector.mjs +8 -4
  36. package/dist/instrument.cjs +9 -3
  37. package/dist/instrument.d.ts +16 -1
  38. package/dist/instrument.d.ts.map +1 -1
  39. package/dist/instrument.mjs +9 -3
  40. package/dist/kind-filter.cjs +5 -2
  41. package/dist/kind-filter.d.ts +2 -2
  42. package/dist/kind-filter.js +4 -4
  43. package/dist/kind-filter.mjs +5 -2
  44. package/dist/observe.cjs +157 -19
  45. package/dist/observe.d.ts.map +1 -1
  46. package/dist/observe.js +165 -16
  47. package/dist/observe.mjs +157 -19
  48. package/dist/palette.cjs +4 -1
  49. package/dist/palette.d.ts.map +1 -1
  50. package/dist/palette.js +3 -0
  51. package/dist/palette.mjs +4 -1
  52. package/dist/path.d.ts +2 -2
  53. package/dist/path.js +2 -2
  54. package/dist/plugins/index.cjs +1 -1
  55. package/dist/plugins/index.mjs +1 -1
  56. package/dist/source.cjs +18 -3
  57. package/dist/source.d.ts +18 -3
  58. package/dist/source.d.ts.map +1 -1
  59. package/dist/source.js +29 -7
  60. package/dist/source.mjs +18 -3
  61. package/dist/timeline.js +3 -3
  62. package/dist/tree.cjs +19 -4
  63. package/dist/tree.d.ts.map +1 -1
  64. package/dist/tree.js +21 -2
  65. package/dist/tree.mjs +19 -4
  66. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  67. package/dist/wire.cjs +3 -1
  68. package/dist/wire.d.ts +2 -0
  69. package/dist/wire.d.ts.map +1 -1
  70. package/dist/wire.js +2 -0
  71. package/dist/wire.mjs +3 -1
  72. package/package.json +8 -2
package/dist/callsite.cjs CHANGED
@@ -30,6 +30,15 @@ var INTERNAL = [
30
30
  "/packages/dom/",
31
31
  "/packages/core/",
32
32
  "/packages/devtools/",
33
+ "/packages/web-components/",
34
+ "/packages/auth/",
35
+ "/packages/oauth2/",
36
+ "/packages/session/",
37
+ "/packages/router/",
38
+ "/packages/head/",
39
+ "/packages/start/",
40
+ "/packages/server/",
41
+ "/packages/template-runtime/",
33
42
  "/@fluixi/",
34
43
  "node_modules",
35
44
  "fluixi-devtools",
@@ -3,7 +3,7 @@ import type { ReactiveSourceLocation } from './source.js';
3
3
  * Where a node came from, and whether that is the application or something it depends on.
4
4
  *
5
5
  * The application's own frame is the useful one, but a node made while a package was loading
6
- * has no application frame above it at all — a router's revalidation counter, made when its
6
+ * has no application frame above it at all: a router's revalidation counter, made when its
7
7
  * module is evaluated. Falling back to the package's own frame is what stops that node being
8
8
  * a card with no name, no origin and no explanation.
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"callsite.d.ts","sourceRoot":"","sources":["../src/callsite.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAqD1D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,sBAAsB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAgBrE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,sBAAsB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAErE"}
1
+ {"version":3,"file":"callsite.d.ts","sourceRoot":"","sources":["../src/callsite.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AA8D1D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,sBAAsB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAgBrE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,sBAAsB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAErE"}
package/dist/callsite.js CHANGED
@@ -12,6 +12,15 @@ const INTERNAL = [
12
12
  '/packages/dom/',
13
13
  '/packages/core/',
14
14
  '/packages/devtools/',
15
+ '/packages/web-components/',
16
+ '/packages/auth/',
17
+ '/packages/oauth2/',
18
+ '/packages/session/',
19
+ '/packages/router/',
20
+ '/packages/head/',
21
+ '/packages/start/',
22
+ '/packages/server/',
23
+ '/packages/template-runtime/',
15
24
  '/@fluixi/',
16
25
  'node_modules',
17
26
  'fluixi-devtools',
@@ -49,7 +58,7 @@ function locate(frame, origin) {
49
58
  * Where a node came from, and whether that is the application or something it depends on.
50
59
  *
51
60
  * The application's own frame is the useful one, but a node made while a package was loading
52
- * has no application frame above it at all — a router's revalidation counter, made when its
61
+ * has no application frame above it at all: a router's revalidation counter, made when its
53
62
  * module is evaluated. Falling back to the package's own frame is what stops that node being
54
63
  * a card with no name, no origin and no explanation.
55
64
  */
package/dist/callsite.mjs CHANGED
@@ -5,6 +5,15 @@ var INTERNAL = [
5
5
  "/packages/dom/",
6
6
  "/packages/core/",
7
7
  "/packages/devtools/",
8
+ "/packages/web-components/",
9
+ "/packages/auth/",
10
+ "/packages/oauth2/",
11
+ "/packages/session/",
12
+ "/packages/router/",
13
+ "/packages/head/",
14
+ "/packages/start/",
15
+ "/packages/server/",
16
+ "/packages/template-runtime/",
8
17
  "/@fluixi/",
9
18
  "node_modules",
10
19
  "fluixi-devtools",
@@ -1,4 +1,4 @@
1
- // A diff, drawn. Shared between the timeline's open row and the panel that opens from it —
1
+ // A diff, drawn. Shared between the timeline's open row and the panel that opens from it ,
2
2
  // same rows, cut to a handful in the sidebar and shown in full when there is room.
3
3
  //
4
4
  // An object is drawn as an object: `{id: 1, text: "go"}` on one line is what the cards
@@ -14,7 +14,7 @@ function pretty(json) {
14
14
  return JSON.stringify(JSON.parse(json), null, 2);
15
15
  }
16
16
  catch {
17
- // It came from JSON.stringify, so this should not happen — but a malformed payload is
17
+ // It came from JSON.stringify, so this should not happen, but a malformed payload is
18
18
  // not worth losing the row over.
19
19
  return undefined;
20
20
  }
package/dist/describe.js CHANGED
@@ -3,10 +3,10 @@
3
3
  // The element is described at the moment it is reported and the reference dropped: holding
4
4
  // one would keep a removed subtree alive for as long as the panel is open.
5
5
  //
6
- // Enough to find it on the page — tag, id, a class or two — without being a selector.
6
+ // Enough to find it on the page: tag, id, a class or two, without being a selector.
7
7
  /** More than this is a selector, not a label. */
8
8
  const MAX_CLASSES = 2;
9
- /** `text in li` — the element it sits in is what locates it. */
9
+ /** `text in li`: the element it sits in is what locates it. */
10
10
  function textOwner(node) {
11
11
  const parent = node.parentElement;
12
12
  return parent ? `text in ${describeElement(parent)}` : 'text';
@@ -9,7 +9,7 @@ export interface DetailPanel {
9
9
  destroy(): void;
10
10
  }
11
11
  export interface DetailPanelOptions {
12
- /** A node in the panel was clicked — the host can select it on the graph. */
12
+ /** A node in the panel was clicked: the host can select it on the graph. */
13
13
  onPick?(id: number): void;
14
14
  }
15
15
  export declare function createDetailPanel(host: HTMLElement, options?: DetailPanelOptions): DetailPanel;
@@ -1 +1 @@
1
- {"version":3,"file":"detail-panel.d.ts","sourceRoot":"","sources":["../src/detail-panel.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,mFAAmF;IACnF,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACtD,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0CAA0C;IAC1C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AA2DD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAwIlG;AAED,eAAO,MAAM,gBAAgB,0vHAsCf,CAAC"}
1
+ {"version":3,"file":"detail-panel.d.ts","sourceRoot":"","sources":["../src/detail-panel.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,mFAAmF;IACnF,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACtD,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0CAA0C;IAC1C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AA2DD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAwIlG;AAED,eAAO,MAAM,gBAAgB,0vHAsCf,CAAC"}
@@ -138,7 +138,7 @@ export function createDetailPanel(host, options = {}) {
138
138
  return `<div class="dp-group"><div class="dp-verb">${VERBS[kind]}</div><div class="dp-nodes">${items}</div></div>`;
139
139
  })
140
140
  .join('');
141
- // Where the value reaches the page — the last step of the chain.
141
+ // Where the value reaches the page: the last step of the chain.
142
142
  const node = cause ? graph.get(cause.id) : undefined;
143
143
  // Both: a template's holes can share one original position, and then only the compiled
144
144
  // line tells them apart.
package/dist/diff.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // What changed, rather than what the value is now.
2
2
  //
3
3
  // `todos [{…}] → [{…}, {…}]` says nothing the graph did not. "One row added at index 2, here
4
- // it is" does. Computed at the write, while both sides are still in hand — afterwards only
4
+ // it is" does. Computed at the write, while both sides are still in hand, afterwards only
5
5
  // the new value exists.
6
6
  import { formatValue } from './format.js';
7
7
  /** Enough to see what happened, few enough that a write stays cheap. */
package/dist/export.cjs CHANGED
@@ -38,6 +38,7 @@ var shared = host[MARKS] ?? {
38
38
  components: /* @__PURE__ */ new Map()
39
39
  };
40
40
  host[MARKS] = shared;
41
+ shared.classes ??= /* @__PURE__ */ new WeakMap();
41
42
 
42
43
  // src/format.ts
43
44
  var MAX_DEPTH = 3;
package/dist/export.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * The graph as something to paste somewhere else.
3
3
  *
4
4
  * A panel shows one node at a time; a bug report needs all of them at once. This is the whole
5
- * graph as plain json — values, kinds, ownership, sources, what each node reaches in the
5
+ * graph as plain json: values, kinds, ownership, sources, what each node reaches in the
6
6
  * document and where it is written from.
7
7
  *
8
8
  * Names rather than ids wherever a reader has to follow a reference: `deps: ["count"]` can be
@@ -23,7 +23,7 @@ interface ExportedNode {
23
23
  id: number;
24
24
  label: string;
25
25
  kind: string;
26
- /** Absent when the framework named it — see RNode.authored. */
26
+ /** Absent when the framework named it: see RNode.authored. */
27
27
  authored?: boolean;
28
28
  value?: string;
29
29
  runs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA0B,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,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3
3
  *
4
4
  * A panel shows one node at a time; a bug report needs all of them at once. This is the whole
5
- * graph as plain json — values, kinds, ownership, sources, what each node reaches in the
5
+ * graph as plain json: values, kinds, ownership, sources, what each node reaches in the
6
6
  * document and where it is written from.
7
7
  *
8
8
  * Names rather than ids wherever a reader has to follow a reference: `deps: ["count"]` can be
package/dist/export.mjs CHANGED
@@ -22,6 +22,7 @@ var shared = host[MARKS] ?? {
22
22
  components: /* @__PURE__ */ new Map()
23
23
  };
24
24
  host[MARKS] = shared;
25
+ shared.classes ??= /* @__PURE__ */ new WeakMap();
25
26
 
26
27
  // src/format.ts
27
28
  var MAX_DEPTH = 3;
package/dist/float.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * it back exactly where it was.
8
8
  *
9
9
  * The pane element itself is moved rather than re-rendered. Whatever drew into it keeps its
10
- * handle on it, its listeners, and its scroll position — a floated timeline is the same
10
+ * handle on it, its listeners, and its scroll position, a floated timeline is the same
11
11
  * timeline, not a copy of one.
12
12
  */
13
13
  export interface FloatOptions {
package/dist/float.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * it back exactly where it was.
8
8
  *
9
9
  * The pane element itself is moved rather than re-rendered. Whatever drew into it keeps its
10
- * handle on it, its listeners, and its scroll position — a floated timeline is the same
10
+ * handle on it, its listeners, and its scroll position, a floated timeline is the same
11
11
  * timeline, not a copy of one.
12
12
  */
13
13
  /** So a card cannot be dragged or resized into something unreadable. */
@@ -146,8 +146,8 @@ export function makeFloatable(pane, options) {
146
146
  pane.classList.add('fx-floatable');
147
147
  pane.append(button);
148
148
  /**
149
- * The panes rewrite their own contents — the inspector replaces its markup whenever the
150
- * selection changes — which takes the button with it. Rather than asking each of them to
149
+ * The panes rewrite their own contents: the inspector replaces its markup whenever the
150
+ * selection changes: which takes the button with it. Rather than asking each of them to
151
151
  * leave it alone, it is put back when it goes.
152
152
  */
153
153
  const keep = new MutationObserver(() => {
package/dist/format.js CHANGED
@@ -1,14 +1,14 @@
1
1
  // Turning a live value into something a graph can print.
2
2
  //
3
- // Not JSON.stringify: a signal holds whatever the author put in it — a Map, a Date, a class
4
- // instance, a dom node, something that refers to itself, a getter that throws — and
3
+ // Not JSON.stringify: a signal holds whatever the author put in it, a Map, a Date, a class
4
+ // instance, a dom node, something that refers to itself, a getter that throws, and
5
5
  // stringify answers `{}`, `[object Object]` or an exception for most of that. This walks the
6
6
  // value instead, so every case has an answer and none of them is a crash.
7
7
  //
8
8
  // It is a label, not a serializer. Depth and length are capped, and what is cut says so.
9
9
  const MAX_DEPTH = 3;
10
10
  const MAX_ENTRIES = 8;
11
- /** A dom node, without assuming this realm's Node — an iframe's is a different class. */
11
+ /** A dom node, without assuming this realm's Node, an iframe's is a different class. */
12
12
  function domName(v) {
13
13
  if (typeof v?.nodeType !== 'number' || typeof v.nodeName !== 'string')
14
14
  return null;
@@ -77,7 +77,10 @@ var KIND_COLOR = {
77
77
  binding: "#5eead4",
78
78
  setter: "#fb7185",
79
79
  group: "#8a90a2",
80
- element: "#8a90a2"
80
+ element: "#8a90a2",
81
+ "custom-element": "#2dd4bf",
82
+ module: "#facc15",
83
+ service: "#60a5fa"
81
84
  };
82
85
  var kindVar = (kind) => `--fx-kind-${kind}`;
83
86
  var kindColor = (kind) => `var(${kindVar(kind)}, ${KIND_COLOR[kind]})`;
@@ -197,8 +200,8 @@ var OVER_NATURAL = 12;
197
200
  var MIN_MAX_ZOOM = 8;
198
201
  var ABSOLUTE_MAX_ZOOM = 4e3;
199
202
  var DRAG_SLOP = 4;
200
- var KIND_CLASS = { state: "n-state", memo: "n-memo", effect: "n-effect", store: "n-store", resource: "n-resource", component: "n-component", control: "n-control", router: "n-router", handler: "n-handler", group: "n-group", binding: "n-binding", setter: "n-setter", directive: "n-directive", context: "n-context", provider: "n-provider" };
201
- var KIND_GLYPH = { state: "◆ state", memo: "ƒ memo", effect: "⚡ effect", store: "▤ store", resource: "⟳ resource", component: "◧ component", control: "⑂ control flow", router: "⤳ router", handler: "⇄ route", group: "▤ framework", binding: "⇥ dom", setter: "✎ sets", directive: "⌘ directive", context: "◈ context", provider: "◈ provider" };
203
+ var KIND_CLASS = { state: "n-state", memo: "n-memo", effect: "n-effect", store: "n-store", resource: "n-resource", component: "n-component", control: "n-control", router: "n-router", handler: "n-handler", group: "n-group", binding: "n-binding", setter: "n-setter", directive: "n-directive", context: "n-context", provider: "n-provider", "custom-element": "n-custom-element", module: "n-module", service: "n-service" };
204
+ var KIND_GLYPH = { state: "◆ state", memo: "ƒ memo", effect: "⚡ effect", store: "▤ store", resource: "⟳ resource", component: "◧ component", control: "⑂ control flow", router: "⤳ router", handler: "⇄ route", group: "▤ framework", binding: "⇥ dom", setter: "✎ sets", directive: "⌘ directive", context: "◈ context", provider: "◈ provider", "custom-element": "⬡ custom element", module: "▦ module", service: "⚙ service" };
202
205
  var GROUP_ID = -1;
203
206
  var bindingIds = /* @__PURE__ */ new Map();
204
207
  var bindingId = (place) => {
@@ -459,6 +462,7 @@ function createGraphView(svg, options = {}) {
459
462
  const inProject = (at) => !!at?.file && at.external !== true;
460
463
  const machinery = (n) => {
461
464
  if (n.authored !== false) return false;
465
+ if (n.scope !== void 0) return false;
462
466
  if (n.kind === "state" || n.kind === "memo" || n.kind === "effect" || n.kind === "context") {
463
467
  return true;
464
468
  }
@@ -868,6 +872,11 @@ ${kindRules((k) => `.fx-node.n-${k}`, "--glow")}
868
872
  .fx-node.n-binding { opacity: .72; }
869
873
  .fx-node.n-setter { opacity: .72; }
870
874
  .fx-node.n-binding .fx-box, .fx-node.n-setter .fx-box { stroke-dasharray: 3 3; }
875
+ /* An element, module or service: a group its signals and memos belong to, so it reads as one. */
876
+ .fx-node.n-custom-element .fx-box, .fx-node.n-module .fx-box, .fx-node.n-service .fx-box {
877
+ stroke-width: 2.2;
878
+ fill: color-mix(in oklab, var(--glow, #5eead4) 14%, var(--fx-node-bg, #131722));
879
+ }
871
880
  .fx-node.n-external { opacity: .55; }
872
881
  .fx-node.n-external .fx-box { stroke-dasharray: 3 2; }
873
882
  .fx-box { fill: var(--fx-node-bg, #131722); stroke: var(--glow, #5eead4); stroke-width: 1.4; stroke-opacity: calc(.5 + var(--pulse,0) * .5); }
@@ -1 +1 @@
1
- {"version":3,"file":"graph-view.d.ts","sourceRoot":"","sources":["../src/graph-view.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAgHvD,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAClC,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;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;IACd,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAChC,uDAAuD;IACvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,wCAAwC;IACxC,SAAS,IAAI,IAAI,CAAC;IAClB,sFAAsF;IACt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AAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,kFAAkF;IAClF,KAAK,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;CAC5C;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,GAAE,gBAAqB,GAAG,SAAS,CA0zB7F;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,QAqDxB,CAAC"}
@@ -50,8 +50,8 @@ const MIN_MAX_ZOOM = 8;
50
50
  const ABSOLUTE_MAX_ZOOM = 4000;
51
51
  /** Past this the pointer was panning, not clicking. */
52
52
  const DRAG_SLOP = 4;
53
- const KIND_CLASS = { state: 'n-state', memo: 'n-memo', effect: 'n-effect', store: 'n-store', resource: 'n-resource', component: 'n-component', control: 'n-control', router: 'n-router', handler: 'n-handler', group: 'n-group', binding: 'n-binding', setter: 'n-setter', directive: 'n-directive', context: 'n-context', provider: 'n-provider' };
54
- const KIND_GLYPH = { state: '◆ state', memo: 'ƒ memo', effect: '⚡ effect', store: '▤ store', resource: '⟳ resource', component: '◧ component', control: '⑂ control flow', router: '⤳ router', handler: '⇄ route', group: '▤ framework', binding: '⇥ dom', setter: '✎ sets', directive: '⌘ directive', context: '◈ context', provider: '◈ provider' };
53
+ const KIND_CLASS = { state: 'n-state', memo: 'n-memo', effect: 'n-effect', store: 'n-store', resource: 'n-resource', component: 'n-component', control: 'n-control', router: 'n-router', handler: 'n-handler', group: 'n-group', binding: 'n-binding', setter: 'n-setter', directive: 'n-directive', context: 'n-context', provider: 'n-provider', 'custom-element': 'n-custom-element', module: 'n-module', service: 'n-service' };
54
+ const KIND_GLYPH = { state: '◆ state', memo: 'ƒ memo', effect: '⚡ effect', store: '▤ store', resource: '⟳ resource', component: '◧ component', control: '⑂ control flow', router: '⤳ router', handler: '⇄ route', group: '▤ framework', binding: '⇥ dom', setter: '✎ sets', directive: '⌘ directive', context: '◈ context', provider: '◈ provider', 'custom-element': '⬡ custom element', module: '▦ module', service: '⚙ service' };
55
55
  /** The card that stands for everything a dependency made and the application never touched. */
56
56
  const GROUP_ID = -1;
57
57
  /**
@@ -440,6 +440,10 @@ export function createGraphView(svg, options = {}) {
440
440
  const machinery = (n) => {
441
441
  if (n.authored !== false)
442
442
  return false;
443
+ // Inside an element, module or service the app declared: what it holds is the point of
444
+ // showing it, even when a package named the signal rather than the app.
445
+ if (n.scope !== undefined)
446
+ return false;
443
447
  if (n.kind === 'state' || n.kind === 'memo' || n.kind === 'effect' || n.kind === 'context') {
444
448
  return true;
445
449
  }
@@ -956,6 +960,11 @@ ${kindRules((k) => `.fx-node.n-${k}`, '--glow')}
956
960
  .fx-node.n-binding { opacity: .72; }
957
961
  .fx-node.n-setter { opacity: .72; }
958
962
  .fx-node.n-binding .fx-box, .fx-node.n-setter .fx-box { stroke-dasharray: 3 3; }
963
+ /* An element, module or service: a group its signals and memos belong to, so it reads as one. */
964
+ .fx-node.n-custom-element .fx-box, .fx-node.n-module .fx-box, .fx-node.n-service .fx-box {
965
+ stroke-width: 2.2;
966
+ fill: color-mix(in oklab, var(--glow, #5eead4) 14%, var(--fx-node-bg, #131722));
967
+ }
959
968
  .fx-node.n-external { opacity: .55; }
960
969
  .fx-node.n-external .fx-box { stroke-dasharray: 3 2; }
961
970
  .fx-box { fill: var(--fx-node-bg, #131722); stroke: var(--glow, #5eead4); stroke-width: 1.4; stroke-opacity: calc(.5 + var(--pulse,0) * .5); }
@@ -50,7 +50,10 @@ var KIND_COLOR = {
50
50
  binding: "#5eead4",
51
51
  setter: "#fb7185",
52
52
  group: "#8a90a2",
53
- element: "#8a90a2"
53
+ element: "#8a90a2",
54
+ "custom-element": "#2dd4bf",
55
+ module: "#facc15",
56
+ service: "#60a5fa"
54
57
  };
55
58
  var kindVar = (kind) => `--fx-kind-${kind}`;
56
59
  var kindColor = (kind) => `var(${kindVar(kind)}, ${KIND_COLOR[kind]})`;
@@ -170,8 +173,8 @@ var OVER_NATURAL = 12;
170
173
  var MIN_MAX_ZOOM = 8;
171
174
  var ABSOLUTE_MAX_ZOOM = 4e3;
172
175
  var DRAG_SLOP = 4;
173
- var KIND_CLASS = { state: "n-state", memo: "n-memo", effect: "n-effect", store: "n-store", resource: "n-resource", component: "n-component", control: "n-control", router: "n-router", handler: "n-handler", group: "n-group", binding: "n-binding", setter: "n-setter", directive: "n-directive", context: "n-context", provider: "n-provider" };
174
- var KIND_GLYPH = { state: "◆ state", memo: "ƒ memo", effect: "⚡ effect", store: "▤ store", resource: "⟳ resource", component: "◧ component", control: "⑂ control flow", router: "⤳ router", handler: "⇄ route", group: "▤ framework", binding: "⇥ dom", setter: "✎ sets", directive: "⌘ directive", context: "◈ context", provider: "◈ provider" };
176
+ var KIND_CLASS = { state: "n-state", memo: "n-memo", effect: "n-effect", store: "n-store", resource: "n-resource", component: "n-component", control: "n-control", router: "n-router", handler: "n-handler", group: "n-group", binding: "n-binding", setter: "n-setter", directive: "n-directive", context: "n-context", provider: "n-provider", "custom-element": "n-custom-element", module: "n-module", service: "n-service" };
177
+ var KIND_GLYPH = { state: "◆ state", memo: "ƒ memo", effect: "⚡ effect", store: "▤ store", resource: "⟳ resource", component: "◧ component", control: "⑂ control flow", router: "⤳ router", handler: "⇄ route", group: "▤ framework", binding: "⇥ dom", setter: "✎ sets", directive: "⌘ directive", context: "◈ context", provider: "◈ provider", "custom-element": "⬡ custom element", module: "▦ module", service: "⚙ service" };
175
178
  var GROUP_ID = -1;
176
179
  var bindingIds = /* @__PURE__ */ new Map();
177
180
  var bindingId = (place) => {
@@ -432,6 +435,7 @@ function createGraphView(svg, options = {}) {
432
435
  const inProject = (at) => !!at?.file && at.external !== true;
433
436
  const machinery = (n) => {
434
437
  if (n.authored !== false) return false;
438
+ if (n.scope !== void 0) return false;
435
439
  if (n.kind === "state" || n.kind === "memo" || n.kind === "effect" || n.kind === "context") {
436
440
  return true;
437
441
  }
@@ -841,6 +845,11 @@ ${kindRules((k) => `.fx-node.n-${k}`, "--glow")}
841
845
  .fx-node.n-binding { opacity: .72; }
842
846
  .fx-node.n-setter { opacity: .72; }
843
847
  .fx-node.n-binding .fx-box, .fx-node.n-setter .fx-box { stroke-dasharray: 3 3; }
848
+ /* An element, module or service: a group its signals and memos belong to, so it reads as one. */
849
+ .fx-node.n-custom-element .fx-box, .fx-node.n-module .fx-box, .fx-node.n-service .fx-box {
850
+ stroke-width: 2.2;
851
+ fill: color-mix(in oklab, var(--glow, #5eead4) 14%, var(--fx-node-bg, #131722));
852
+ }
844
853
  .fx-node.n-external { opacity: .55; }
845
854
  .fx-node.n-external .fx-box { stroke-dasharray: 3 2; }
846
855
  .fx-box { fill: var(--fx-node-bg, #131722); stroke: var(--glow, #5eead4); stroke-width: 1.4; stroke-opacity: calc(.5 + var(--pulse,0) * .5); }
package/dist/history.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface GraphEvent {
19
19
  readonly change?: ValueChange;
20
20
  /**
21
21
  * The name at the time. A consumer normally reads it off the graph, but a disposed node is
22
- * no longer there — and a list re-render is mostly disposals — so it travels with the event.
22
+ * no longer there: and a list re-render is mostly disposals, so it travels with the event.
23
23
  */
24
24
  readonly label?: string;
25
25
  }
@@ -52,7 +52,7 @@ export interface Commit {
52
52
  readonly cause?: GraphEvent;
53
53
  }
54
54
  /**
55
- * Oldest first. A commit whose opening write has aged out still groups — its events carry the
55
+ * Oldest first. A commit whose opening write has aged out still groups, its events carry the
56
56
  * number, and a partial commit beats dropping the runs after it.
57
57
  */
58
58
  export declare function toCommits(events: readonly GraphEvent[]): Commit[];
package/dist/history.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // What happened, in order.
2
2
  //
3
3
  // A snapshot says what the graph is; by the time a panel polls, the propagation is over and
4
- // everything reads as settled. So the observer's callbacks are recorded as they arrive — the
4
+ // everything reads as settled. So the observer's callbacks are recorded as they arrive, the
5
5
  // runtime calls them from inside the write, so the order is real rather than reconstructed.
6
6
  //
7
7
  // Events group into commits: a write with nothing running came from a handler and opens one.
@@ -62,7 +62,7 @@ export function createHistory(limit) {
62
62
  };
63
63
  }
64
64
  /**
65
- * Oldest first. A commit whose opening write has aged out still groups — its events carry the
65
+ * Oldest first. A commit whose opening write has aged out still groups, its events carry the
66
66
  * number, and a partial commit beats dropping the runs after it.
67
67
  */
68
68
  export function toCommits(events) {