@fluixi/devtools 1.0.0-alpha.107 → 1.0.0-alpha.109

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 (65) hide show
  1. package/dist/callsite.mjs +4 -63
  2. package/dist/change-view.mjs +6 -106
  3. package/dist/chunk-2VDMQ3VF.mjs +520 -0
  4. package/dist/chunk-33U2S43X.mjs +121 -0
  5. package/dist/chunk-4P45Y5EB.mjs +214 -0
  6. package/dist/chunk-B3SAJ7QG.mjs +72 -0
  7. package/dist/chunk-CPZWLBCQ.mjs +35 -0
  8. package/dist/chunk-D25KZZBZ.mjs +212 -0
  9. package/dist/chunk-EBSROPWJ.mjs +314 -0
  10. package/dist/chunk-F664XLZL.mjs +743 -0
  11. package/dist/chunk-FY5K3QVT.mjs +35 -0
  12. package/dist/chunk-G7Z7CVP5.mjs +184 -0
  13. package/dist/chunk-GDQXCOQB.mjs +43 -0
  14. package/dist/chunk-L6XQGNMW.mjs +106 -0
  15. package/dist/chunk-MN6O673L.mjs +90 -0
  16. package/dist/chunk-NDUBBBNL.mjs +70 -0
  17. package/dist/chunk-NT7YMK77.mjs +157 -0
  18. package/dist/chunk-NVULLJDH.mjs +120 -0
  19. package/dist/chunk-NWLSDERQ.mjs +68 -0
  20. package/dist/chunk-OPIGF5XB.mjs +184 -0
  21. package/dist/chunk-P5I7DWFX.mjs +292 -0
  22. package/dist/chunk-PKARAAIS.mjs +75 -0
  23. package/dist/chunk-PSSBFXBD.mjs +155 -0
  24. package/dist/chunk-PTQ5VCYE.mjs +103 -0
  25. package/dist/chunk-PU4MJ5RU.mjs +107 -0
  26. package/dist/chunk-UAEJ3N7F.mjs +76 -0
  27. package/dist/chunk-V6DKWEYD.mjs +67 -0
  28. package/dist/chunk-VO2V7AC5.mjs +80 -0
  29. package/dist/chunk-WGQH7RUW.mjs +25 -0
  30. package/dist/chunk-Y5OQWBAM.mjs +777 -0
  31. package/dist/chunk-Z6KYHEKY.mjs +64 -0
  32. package/dist/copy.mjs +3 -39
  33. package/dist/describe.mjs +3 -31
  34. package/dist/detail-panel.mjs +6 -280
  35. package/dist/diff.mjs +4 -201
  36. package/dist/dom.mjs +7 -176
  37. package/dist/export.mjs +6 -207
  38. package/dist/float.mjs +5 -206
  39. package/dist/format.mjs +5 -151
  40. package/dist/graph-view.mjs +9 -875
  41. package/dist/highlight.mjs +6 -113
  42. package/dist/history.mjs +4 -70
  43. package/dist/hook.mjs +16 -1719
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.mjs +106 -4673
  46. package/dist/inspector.mjs +11 -677
  47. package/dist/instrument.mjs +9 -486
  48. package/dist/kind-filter.mjs +6 -148
  49. package/dist/menu.mjs +4 -116
  50. package/dist/observe.mjs +14 -1510
  51. package/dist/palette.mjs +6 -28
  52. package/dist/path.mjs +3 -21
  53. package/dist/plugin.mjs +9 -57
  54. package/dist/plugins/context.mjs +6 -71
  55. package/dist/plugins/directives.mjs +8 -68
  56. package/dist/plugins/index.cjs +1 -1
  57. package/dist/plugins/index.mjs +13 -136
  58. package/dist/source.mjs +12 -93
  59. package/dist/timeline.mjs +7 -323
  60. package/dist/tree.mjs +11 -558
  61. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  62. package/dist/value-pane.mjs +6 -196
  63. package/dist/wire.cjs +1 -1
  64. package/dist/wire.mjs +6 -86
  65. package/package.json +3 -3
package/dist/callsite.mjs CHANGED
@@ -1,66 +1,7 @@
1
- // src/callsite.ts
2
- var EXTENSION = ["chrome-extension://", "moz-extension://", "safari-web-extension://", "extension://"];
3
- var INTERNAL = [
4
- "/packages/reactive/",
5
- "/packages/dom/",
6
- "/packages/core/",
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/",
17
- "/@fluixi/",
18
- "node_modules",
19
- "fluixi-devtools",
20
- ...EXTENSION
21
- ];
22
- var REPORTING = [
23
- "/packages/reactive/src/lib/signal/graph/",
24
- "/packages/devtools/",
25
- "fluixi-devtools",
26
- // Not a fallback either: naming the agent as where a node came from is worse than nothing.
27
- ...EXTENSION
28
- ];
29
- var FRAME = /(?:at\s+(?:[^(]*\()?)([^()\s]+):(\d+):(\d+)\)?$/;
30
- var isInternal = (frame) => INTERNAL.some((part) => frame.includes(part));
31
- function locate(frame, origin) {
32
- const match = FRAME.exec(frame);
33
- if (!match) return void 0;
34
- let file = match[1];
35
- if (origin && file.startsWith(origin)) file = file.slice(origin.length);
36
- file = file.replace(/^\/@fs\//, "/").replace(/\?.*$/, "").replace(/^\//, "");
37
- return file ? { file, line: Number(match[2]), column: Number(match[3]) } : void 0;
38
- }
39
- function callSite(stack, origin) {
40
- if (!stack) return void 0;
41
- let fallback;
42
- for (const line of stack.split("\n")) {
43
- const frame = line.trim();
44
- if (!frame.startsWith("at ")) continue;
45
- if (!isInternal(frame)) {
46
- const location = locate(frame, origin);
47
- if (location) return { location, external: false };
48
- continue;
49
- }
50
- if (!fallback && !REPORTING.some((part) => frame.includes(part))) fallback = locate(frame, origin);
51
- }
52
- return fallback ? { location: { ...fallback, external: true }, external: true } : void 0;
53
- }
54
- function currentCallSite(origin) {
55
- const errors = Error;
56
- const limit = errors.stackTraceLimit;
57
- errors.stackTraceLimit = 50;
58
- try {
59
- return callSite(new Error().stack, origin);
60
- } finally {
61
- errors.stackTraceLimit = limit;
62
- }
63
- }
1
+ import {
2
+ callSite,
3
+ currentCallSite
4
+ } from "./chunk-NWLSDERQ.mjs";
64
5
  export {
65
6
  callSite,
66
7
  currentCallSite
@@ -1,109 +1,9 @@
1
- // src/copy.ts
2
- function confirmOn(button, said = "copied") {
3
- if (!button) return;
4
- const was = button.textContent;
5
- button.textContent = said;
6
- setTimeout(() => {
7
- button.textContent = was;
8
- }, 1200);
9
- }
10
- function fallback(text, button) {
11
- try {
12
- const doc = button?.ownerDocument ?? document;
13
- const area = doc.createElement("textarea");
14
- area.value = text;
15
- area.setAttribute("readonly", "");
16
- area.style.position = "fixed";
17
- area.style.opacity = "0";
18
- doc.body.appendChild(area);
19
- area.select();
20
- doc.execCommand("copy");
21
- area.remove();
22
- confirmOn(button);
23
- return true;
24
- } catch {
25
- return false;
26
- }
27
- }
28
- async function copyText(text, button) {
29
- const clipboard = globalThis.navigator?.clipboard;
30
- if (clipboard?.writeText) {
31
- try {
32
- await clipboard.writeText(text);
33
- confirmOn(button);
34
- return true;
35
- } catch {
36
- }
37
- }
38
- return fallback(text, button);
39
- }
40
-
41
- // src/change-view.ts
42
- var escape = (text) => text.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
43
- var SIGN = { added: "+", removed: "−", changed: "~" };
44
- function pretty(json) {
45
- if (!json) return void 0;
46
- try {
47
- return JSON.stringify(JSON.parse(json), null, 2);
48
- } catch {
49
- return void 0;
50
- }
51
- }
52
- function sideOf(text, json, cls) {
53
- const block = pretty(json);
54
- if (!block) return `<span class="ch-${cls}">${escape(text ?? "")}</span>`;
55
- return `<div class="ch-block ch-${cls}"><button type="button" class="ch-copy" title="Copy" data-copy="${escape(block)}">copy</button><pre class="ch-json">${escape(block)}</pre></div>`;
56
- }
57
- function changeRows(change, limit = Infinity) {
58
- if (!change?.entries?.length) return "";
59
- const shown = change.entries.slice(0, limit);
60
- const hidden = change.entries.length - shown.length + (change.more ?? 0);
61
- const rows = shown.map((entry) => {
62
- const from = sideOf(entry.from, entry.fromJson, "from");
63
- const to = sideOf(entry.to, entry.toJson, "to");
64
- const sides = entry.op === "changed" ? `${from}<span class="ch-arrow">→</span>${to}` : entry.op === "added" ? to : from;
65
- const stacked = entry.fromJson || entry.toJson ? " ch-stacked" : "";
66
- return `<div class="ch-row ch-${entry.op}${stacked}"><span class="ch-sign">${SIGN[entry.op] ?? "·"}</span><span class="ch-key">${escape(entry.key)}</span><span class="ch-sides">${sides}</span></div>`;
67
- }).join("");
68
- const size = change.length ? `<div class="ch-size">${change.length.from} → ${change.length.to} items</div>` : "";
69
- return `<div class="ch-list">${size}${rows}${hidden > 0 ? `<div class="ch-more">and ${hidden} more</div>` : ""}</div>`;
70
- }
71
- function handleCopyClick(event) {
72
- const button = event.target?.closest?.(".ch-copy");
73
- if (!button) return false;
74
- void copyText(button.dataset.copy ?? "", button);
75
- return true;
76
- }
77
- var CHANGE_CSS = `
78
- .ch-list { margin-top: 4px; font-family: ui-monospace, monospace; font-size: 11px; }
79
- .ch-size { color: var(--fx-muted, #8a90a2); margin-bottom: 2px; }
80
- .ch-row { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
81
- .ch-row.ch-stacked { align-items: flex-start; padding: 3px 0; }
82
- .ch-sign { flex: none; width: 9px; text-align: center; }
83
- .ch-added .ch-sign { color: var(--state, #34d399); }
84
- .ch-removed .ch-sign { color: var(--fx-write, #fb7185); }
85
- .ch-changed .ch-sign { color: var(--effect, #fbbf24); }
86
- .ch-key { flex: none; color: var(--fx-muted, #8a90a2); }
87
- .ch-sides { min-width: 0; flex: 1; overflow-wrap: anywhere; }
88
- .ch-stacked .ch-sides { display: flex; flex-direction: column; gap: 2px; }
89
- .ch-from { color: var(--fx-muted, #8a90a2); }
90
- .ch-row:not(.ch-stacked) .ch-from { text-decoration: line-through; }
91
- .ch-arrow { color: var(--fx-muted, #8a90a2); margin: 0 4px; }
92
- .ch-to { color: var(--fx-label, #e7e9ee); }
93
- .ch-more { color: var(--fx-muted, #8a90a2); margin-top: 2px; }
94
- /* In the corner: an object can be tall, and a button under it is a scroll away. */
95
- .ch-block { position: relative; border-radius: 4px; border: 1px solid var(--fx-line, #ffffff14); }
96
- .ch-block.ch-from { opacity: .72; }
97
- .ch-json { margin: 0; padding: 5px 7px; overflow-x: auto; white-space: pre; font: inherit; }
98
- .ch-copy {
99
- position: absolute; top: 3px; right: 3px; padding: 1px 6px; cursor: pointer;
100
- font: inherit; font-size: 9.5px; opacity: 0; transition: opacity .12s;
101
- border: 1px solid var(--fx-line, #ffffff26); border-radius: 3px;
102
- background: var(--fx-panel, #14161c); color: var(--fx-muted, #8a90a2);
103
- }
104
- .ch-block:hover .ch-copy, .ch-copy:focus { opacity: 1; }
105
- .ch-copy:hover { color: var(--fx-label, #e7e9ee); }
106
- `;
1
+ import {
2
+ CHANGE_CSS,
3
+ changeRows,
4
+ handleCopyClick
5
+ } from "./chunk-UAEJ3N7F.mjs";
6
+ import "./chunk-GDQXCOQB.mjs";
107
7
  export {
108
8
  CHANGE_CSS,
109
9
  changeRows,