@fluixi/devtools 1.0.0-alpha.108 → 1.0.0-alpha.110

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 (83) hide show
  1. package/dist/callsite.mjs +4 -63
  2. package/dist/change-view.mjs +6 -106
  3. package/dist/chunk-235BSS43.mjs +185 -0
  4. package/dist/chunk-2ACSNLS6.mjs +87 -0
  5. package/dist/chunk-2VDMQ3VF.mjs +520 -0
  6. package/dist/chunk-33U2S43X.mjs +121 -0
  7. package/dist/chunk-B3SAJ7QG.mjs +72 -0
  8. package/dist/chunk-BTCWJTXR.mjs +216 -0
  9. package/dist/chunk-CPZWLBCQ.mjs +35 -0
  10. package/dist/chunk-D25KZZBZ.mjs +212 -0
  11. package/dist/chunk-EBSROPWJ.mjs +314 -0
  12. package/dist/chunk-F664XLZL.mjs +743 -0
  13. package/dist/chunk-FY5K3QVT.mjs +35 -0
  14. package/dist/chunk-GDQXCOQB.mjs +43 -0
  15. package/dist/chunk-JLNWT36I.mjs +118 -0
  16. package/dist/chunk-JTHAZJJZ.mjs +780 -0
  17. package/dist/chunk-L6XQGNMW.mjs +106 -0
  18. package/dist/chunk-MN6O673L.mjs +90 -0
  19. package/dist/chunk-NDUBBBNL.mjs +70 -0
  20. package/dist/chunk-NT7YMK77.mjs +157 -0
  21. package/dist/chunk-NVULLJDH.mjs +120 -0
  22. package/dist/chunk-NWLSDERQ.mjs +68 -0
  23. package/dist/chunk-OPIGF5XB.mjs +184 -0
  24. package/dist/chunk-P5I7DWFX.mjs +292 -0
  25. package/dist/chunk-PSSBFXBD.mjs +155 -0
  26. package/dist/chunk-PTQ5VCYE.mjs +103 -0
  27. package/dist/chunk-UAEJ3N7F.mjs +76 -0
  28. package/dist/chunk-V6DKWEYD.mjs +67 -0
  29. package/dist/chunk-VO2V7AC5.mjs +80 -0
  30. package/dist/chunk-WGQH7RUW.mjs +25 -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.cjs +2 -1
  35. package/dist/detail-panel.d.ts.map +1 -1
  36. package/dist/detail-panel.js +1 -0
  37. package/dist/detail-panel.mjs +6 -280
  38. package/dist/diff.mjs +4 -201
  39. package/dist/dom.mjs +7 -176
  40. package/dist/export.mjs +6 -207
  41. package/dist/float.mjs +5 -206
  42. package/dist/format.mjs +5 -151
  43. package/dist/graph-view.mjs +9 -875
  44. package/dist/highlight.mjs +6 -113
  45. package/dist/history.cjs +14 -2
  46. package/dist/history.d.ts +8 -1
  47. package/dist/history.d.ts.map +1 -1
  48. package/dist/history.js +15 -2
  49. package/dist/history.mjs +4 -70
  50. package/dist/hook.cjs +26 -1
  51. package/dist/hook.d.ts +4 -0
  52. package/dist/hook.d.ts.map +1 -1
  53. package/dist/hook.js +13 -0
  54. package/dist/hook.mjs +16 -1719
  55. package/dist/index.cjs +34 -5
  56. package/dist/index.mjs +106 -4673
  57. package/dist/inspector.mjs +11 -677
  58. package/dist/instrument.mjs +9 -486
  59. package/dist/kind-filter.mjs +6 -148
  60. package/dist/menu.mjs +4 -116
  61. package/dist/observe.cjs +15 -1
  62. package/dist/observe.d.ts +2 -0
  63. package/dist/observe.d.ts.map +1 -1
  64. package/dist/observe.js +3 -0
  65. package/dist/observe.mjs +14 -1510
  66. package/dist/palette.mjs +6 -28
  67. package/dist/path.mjs +3 -21
  68. package/dist/plugin.mjs +9 -57
  69. package/dist/plugins/context.mjs +6 -71
  70. package/dist/plugins/directives.mjs +8 -68
  71. package/dist/plugins/index.cjs +1 -1
  72. package/dist/plugins/index.mjs +13 -136
  73. package/dist/source.mjs +12 -93
  74. package/dist/timeline.cjs +5 -2
  75. package/dist/timeline.d.ts.map +1 -1
  76. package/dist/timeline.js +5 -1
  77. package/dist/timeline.mjs +7 -323
  78. package/dist/tree.mjs +11 -558
  79. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  80. package/dist/value-pane.mjs +6 -196
  81. package/dist/wire.cjs +1 -1
  82. package/dist/wire.mjs +6 -86
  83. package/package.json +3 -3
@@ -0,0 +1,103 @@
1
+ import {
2
+ formatValue
3
+ } from "./chunk-NT7YMK77.mjs";
4
+
5
+ // src/diff.ts
6
+ var MAX_ENTRIES = 24;
7
+ var ENTRY_VALUE = 120;
8
+ var ENTRY_JSON = 4e3;
9
+ var show = (value) => formatValue(value, ENTRY_VALUE);
10
+ function json(value) {
11
+ if (value === null || typeof value !== "object") return void 0;
12
+ try {
13
+ const text = JSON.stringify(value);
14
+ return text && text.length <= ENTRY_JSON ? text : void 0;
15
+ } catch {
16
+ return void 0;
17
+ }
18
+ }
19
+ var side = (value, key) => {
20
+ const text = json(value);
21
+ return { [key]: show(value), ...text ? { [`${key}Json`]: text } : {} };
22
+ };
23
+ var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
24
+ function same(a, b) {
25
+ if (Object.is(a, b)) return true;
26
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
27
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
28
+ const ka = Object.keys(a);
29
+ const kb = Object.keys(b);
30
+ if (ka.length !== kb.length) return false;
31
+ return ka.every((k) => Object.is(a[k], b[k]));
32
+ }
33
+ function diffArray(before, after) {
34
+ let head = 0;
35
+ while (head < before.length && head < after.length && same(before[head], after[head])) head++;
36
+ let tail = 0;
37
+ while (tail < before.length - head && tail < after.length - head && same(before[before.length - 1 - tail], after[after.length - 1 - tail])) {
38
+ tail++;
39
+ }
40
+ const entries = [];
41
+ let skipped = 0;
42
+ const push = (entry) => {
43
+ if (entries.length < MAX_ENTRIES) entries.push(entry);
44
+ else skipped++;
45
+ };
46
+ const removedCount = before.length - head - tail;
47
+ const addedCount = after.length - head - tail;
48
+ const overlap = Math.min(removedCount, addedCount);
49
+ for (let i = 0; i < overlap; i++) {
50
+ push({
51
+ key: String(head + i),
52
+ op: "changed",
53
+ ...side(before[head + i], "from"),
54
+ ...side(after[head + i], "to")
55
+ });
56
+ }
57
+ for (let i = overlap; i < addedCount; i++) {
58
+ push({ key: String(head + i), op: "added", ...side(after[head + i], "to") });
59
+ }
60
+ for (let i = overlap; i < removedCount; i++) {
61
+ push({ key: String(head + i), op: "removed", ...side(before[head + i], "from") });
62
+ }
63
+ return {
64
+ shape: "array",
65
+ entries,
66
+ ...skipped ? { more: skipped } : {},
67
+ ...before.length !== after.length ? { length: { from: before.length, to: after.length } } : {}
68
+ };
69
+ }
70
+ function diffObject(before, after) {
71
+ const entries = [];
72
+ let skipped = 0;
73
+ const push = (entry) => {
74
+ if (entries.length < MAX_ENTRIES) entries.push(entry);
75
+ else skipped++;
76
+ };
77
+ for (const key of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
78
+ const had = key in before;
79
+ const has = key in after;
80
+ if (had && has) {
81
+ if (!same(before[key], after[key])) {
82
+ push({ key, op: "changed", ...side(before[key], "from"), ...side(after[key], "to") });
83
+ }
84
+ } else if (has) push({ key, op: "added", ...side(after[key], "to") });
85
+ else push({ key, op: "removed", ...side(before[key], "from") });
86
+ }
87
+ return { shape: "object", entries, ...skipped ? { more: skipped } : {} };
88
+ }
89
+ function diffValues(before, after) {
90
+ if (Array.isArray(before) && Array.isArray(after)) {
91
+ const change = diffArray(before, after);
92
+ return change.entries?.length || change.length ? change : void 0;
93
+ }
94
+ if (isPlainObject(before) && isPlainObject(after)) {
95
+ const change = diffObject(before, after);
96
+ return change.entries?.length ? change : void 0;
97
+ }
98
+ return void 0;
99
+ }
100
+
101
+ export {
102
+ diffValues
103
+ };
@@ -0,0 +1,76 @@
1
+ import {
2
+ copyText
3
+ } from "./chunk-GDQXCOQB.mjs";
4
+
5
+ // src/change-view.ts
6
+ var escape = (text) => text.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
7
+ var SIGN = { added: "+", removed: "−", changed: "~" };
8
+ function pretty(json) {
9
+ if (!json) return void 0;
10
+ try {
11
+ return JSON.stringify(JSON.parse(json), null, 2);
12
+ } catch {
13
+ return void 0;
14
+ }
15
+ }
16
+ function sideOf(text, json, cls) {
17
+ const block = pretty(json);
18
+ if (!block) return `<span class="ch-${cls}">${escape(text ?? "")}</span>`;
19
+ 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>`;
20
+ }
21
+ function changeRows(change, limit = Infinity) {
22
+ if (!change?.entries?.length) return "";
23
+ const shown = change.entries.slice(0, limit);
24
+ const hidden = change.entries.length - shown.length + (change.more ?? 0);
25
+ const rows = shown.map((entry) => {
26
+ const from = sideOf(entry.from, entry.fromJson, "from");
27
+ const to = sideOf(entry.to, entry.toJson, "to");
28
+ const sides = entry.op === "changed" ? `${from}<span class="ch-arrow">→</span>${to}` : entry.op === "added" ? to : from;
29
+ const stacked = entry.fromJson || entry.toJson ? " ch-stacked" : "";
30
+ 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>`;
31
+ }).join("");
32
+ const size = change.length ? `<div class="ch-size">${change.length.from} → ${change.length.to} items</div>` : "";
33
+ return `<div class="ch-list">${size}${rows}${hidden > 0 ? `<div class="ch-more">and ${hidden} more</div>` : ""}</div>`;
34
+ }
35
+ function handleCopyClick(event) {
36
+ const button = event.target?.closest?.(".ch-copy");
37
+ if (!button) return false;
38
+ void copyText(button.dataset.copy ?? "", button);
39
+ return true;
40
+ }
41
+ var CHANGE_CSS = `
42
+ .ch-list { margin-top: 4px; font-family: ui-monospace, monospace; font-size: 11px; }
43
+ .ch-size { color: var(--fx-muted, #8a90a2); margin-bottom: 2px; }
44
+ .ch-row { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
45
+ .ch-row.ch-stacked { align-items: flex-start; padding: 3px 0; }
46
+ .ch-sign { flex: none; width: 9px; text-align: center; }
47
+ .ch-added .ch-sign { color: var(--state, #34d399); }
48
+ .ch-removed .ch-sign { color: var(--fx-write, #fb7185); }
49
+ .ch-changed .ch-sign { color: var(--effect, #fbbf24); }
50
+ .ch-key { flex: none; color: var(--fx-muted, #8a90a2); }
51
+ .ch-sides { min-width: 0; flex: 1; overflow-wrap: anywhere; }
52
+ .ch-stacked .ch-sides { display: flex; flex-direction: column; gap: 2px; }
53
+ .ch-from { color: var(--fx-muted, #8a90a2); }
54
+ .ch-row:not(.ch-stacked) .ch-from { text-decoration: line-through; }
55
+ .ch-arrow { color: var(--fx-muted, #8a90a2); margin: 0 4px; }
56
+ .ch-to { color: var(--fx-label, #e7e9ee); }
57
+ .ch-more { color: var(--fx-muted, #8a90a2); margin-top: 2px; }
58
+ /* In the corner: an object can be tall, and a button under it is a scroll away. */
59
+ .ch-block { position: relative; border-radius: 4px; border: 1px solid var(--fx-line, #ffffff14); }
60
+ .ch-block.ch-from { opacity: .72; }
61
+ .ch-json { margin: 0; padding: 5px 7px; overflow-x: auto; white-space: pre; font: inherit; }
62
+ .ch-copy {
63
+ position: absolute; top: 3px; right: 3px; padding: 1px 6px; cursor: pointer;
64
+ font: inherit; font-size: 9.5px; opacity: 0; transition: opacity .12s;
65
+ border: 1px solid var(--fx-line, #ffffff26); border-radius: 3px;
66
+ background: var(--fx-panel, #14161c); color: var(--fx-muted, #8a90a2);
67
+ }
68
+ .ch-block:hover .ch-copy, .ch-copy:focus { opacity: 1; }
69
+ .ch-copy:hover { color: var(--fx-label, #e7e9ee); }
70
+ `;
71
+
72
+ export {
73
+ changeRows,
74
+ handleCopyClick,
75
+ CHANGE_CSS
76
+ };
@@ -0,0 +1,67 @@
1
+ // src/plugin.ts
2
+ var plugins = [];
3
+ function registerDevtoolsPlugin(plugin) {
4
+ const at = plugins.findIndex((p) => p.name === plugin.name);
5
+ if (at === -1) plugins.push(plugin);
6
+ else plugins[at] = plugin;
7
+ }
8
+ function devtoolsPlugins() {
9
+ return plugins;
10
+ }
11
+ function annotationOf(node, name) {
12
+ return node.extra?.[name];
13
+ }
14
+ function pluginRows(node, graph) {
15
+ const out = [];
16
+ for (const plugin of plugins) {
17
+ if (!plugin.rows) continue;
18
+ try {
19
+ out.push(...plugin.rows(node, graph));
20
+ } catch {
21
+ }
22
+ }
23
+ return out;
24
+ }
25
+ function pluginElementRows(extra) {
26
+ if (!extra) return [];
27
+ const out = [];
28
+ for (const plugin of plugins) {
29
+ if (!plugin.elementRows) continue;
30
+ try {
31
+ out.push(...plugin.elementRows(extra));
32
+ } catch {
33
+ }
34
+ }
35
+ return out;
36
+ }
37
+ function pluginElementBadge(extra) {
38
+ if (!extra) return void 0;
39
+ for (const plugin of plugins) {
40
+ try {
41
+ const badge = plugin.elementBadge?.(extra);
42
+ if (badge) return badge;
43
+ } catch {
44
+ }
45
+ }
46
+ return void 0;
47
+ }
48
+ function pluginBadge(node) {
49
+ for (const plugin of plugins) {
50
+ try {
51
+ const badge = plugin.badge?.(node);
52
+ if (badge) return badge;
53
+ } catch {
54
+ }
55
+ }
56
+ return void 0;
57
+ }
58
+
59
+ export {
60
+ registerDevtoolsPlugin,
61
+ devtoolsPlugins,
62
+ annotationOf,
63
+ pluginRows,
64
+ pluginElementRows,
65
+ pluginElementBadge,
66
+ pluginBadge
67
+ };
@@ -0,0 +1,80 @@
1
+ import {
2
+ nodeState,
3
+ nodeVersion
4
+ } from "./chunk-EBSROPWJ.mjs";
5
+ import {
6
+ formatValue
7
+ } from "./chunk-NT7YMK77.mjs";
8
+
9
+ // src/export.ts
10
+ var at = (source) => {
11
+ if (!source) return void 0;
12
+ const where = `${source.file ?? ""}:${source.line ?? ""}:${source.column ?? ""}`;
13
+ const out = source.compiled;
14
+ const same = out?.line === source.line && out?.column === source.column;
15
+ return out && !same ? `${where} (out ${out.line ?? ""}:${out.column ?? ""})` : where;
16
+ };
17
+ function naming(graph) {
18
+ const seen = /* @__PURE__ */ new Map();
19
+ for (const node of graph.values()) seen.set(node.label, (seen.get(node.label) ?? 0) + 1);
20
+ return (id) => {
21
+ const node = graph.get(id);
22
+ if (!node) return `#${id}`;
23
+ return (seen.get(node.label) ?? 0) > 1 ? `${node.label}#${node.id}` : node.label;
24
+ };
25
+ }
26
+ function exportGraph(graph, options = {}) {
27
+ const limit = options.limit ?? 400;
28
+ const name = naming(graph);
29
+ const nodes = [...graph.values()].map((node) => {
30
+ let value = node.detail ?? node.value;
31
+ if (node.read) {
32
+ try {
33
+ value = formatValue(node.read(), limit);
34
+ } catch {
35
+ }
36
+ }
37
+ const feeds = [...node.deps].map(name);
38
+ const wrote = [...node.writes].map(name);
39
+ const state = nodeState(node);
40
+ return {
41
+ id: node.id,
42
+ label: node.label,
43
+ kind: node.kind,
44
+ ...node.authored === false ? { authored: false } : {},
45
+ ...value ? { value } : {},
46
+ ...node.runs ? { runs: node.runs } : {},
47
+ // Only a node with a core has one; a static node would report a version of 0.
48
+ ...node.core?.version !== void 0 ? { version: nodeVersion(node) } : {},
49
+ ...state ? { state } : {},
50
+ ...feeds.length ? { reads: feeds } : {},
51
+ ...wrote.length ? { writes: wrote } : {},
52
+ ...node.createdIn !== void 0 ? { madeIn: name(node.createdIn) } : {},
53
+ ...at(node.source) ? { source: at(node.source) } : {},
54
+ ...at(node.declaredAt) ? { declaredAt: at(node.declaredAt) } : {},
55
+ ...at(node.usedAt) ? { usedAt: at(node.usedAt) } : {},
56
+ ...node.targets?.length ? {
57
+ updates: node.targets.map((target) => {
58
+ const what = target.name ? `${target.name} of ${target.element}` : target.element;
59
+ const where = at(target.source);
60
+ return where ? `${what} — ${where}` : what;
61
+ })
62
+ } : {},
63
+ ...node.setAt?.length ? { setAt: node.setAt.map((s) => at(s)).filter(Boolean) } : {}
64
+ };
65
+ });
66
+ return {
67
+ t: Date.now(),
68
+ from: options.fromSource ? "source" : "running application",
69
+ nodes,
70
+ ...options.events?.length ? { events: [...options.events] } : {}
71
+ };
72
+ }
73
+ function graphToJson(graph, options = {}) {
74
+ return JSON.stringify(exportGraph(graph, options), null, 2);
75
+ }
76
+
77
+ export {
78
+ exportGraph,
79
+ graphToJson
80
+ };
@@ -0,0 +1,25 @@
1
+ // src/path.ts
2
+ var normalize = (file) => file.replace(/\\/g, "/");
3
+ var ROOTED = /^\/|^(Users|home|var|opt|private|tmp|mnt|srv)\//;
4
+ var WORKSPACE_DIRS = /* @__PURE__ */ new Set(["packages", "apps", "libs", "examples"]);
5
+ function shortenPath(file, root) {
6
+ const path = normalize(file);
7
+ if (root) {
8
+ const base = normalize(root).replace(/\/+$/, "");
9
+ if (base && path.startsWith(`${base}/`)) return path.slice(base.length + 1);
10
+ if (base.startsWith("/") && path.startsWith(`${base.slice(1)}/`)) return path.slice(base.length);
11
+ }
12
+ const installed = path.lastIndexOf("node_modules/");
13
+ if (installed >= 0) return path.slice(installed + "node_modules/".length);
14
+ if (ROOTED.test(path)) {
15
+ const segments = path.split("/");
16
+ for (let i = segments.length - 2; i > 0; i--) {
17
+ if (WORKSPACE_DIRS.has(segments[i])) return segments.slice(i).join("/");
18
+ }
19
+ }
20
+ return path;
21
+ }
22
+
23
+ export {
24
+ shortenPath
25
+ };
@@ -0,0 +1,64 @@
1
+ import {
2
+ floatCard
3
+ } from "./chunk-D25KZZBZ.mjs";
4
+ import {
5
+ indentValue
6
+ } from "./chunk-NT7YMK77.mjs";
7
+
8
+ // src/value-pane.ts
9
+ var escape = (text) => text.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
10
+ function createValuePane(host) {
11
+ const doc = host.ownerDocument;
12
+ let built = null;
13
+ const close = () => {
14
+ built?.remove();
15
+ built = null;
16
+ };
17
+ const onKey = (event) => {
18
+ if (event.key === "Escape") close();
19
+ };
20
+ doc.addEventListener("keydown", onKey);
21
+ return {
22
+ open(title, text) {
23
+ close();
24
+ built = floatCard(doc, title, { x: 80, y: 80, width: 420, height: 320 });
25
+ const shut = doc.createElement("button");
26
+ shut.type = "button";
27
+ shut.className = "vp-close";
28
+ shut.textContent = "✕";
29
+ shut.title = "Close";
30
+ shut.addEventListener("click", close);
31
+ built.bar.append(shut);
32
+ const body = doc.createElement("pre");
33
+ body.className = "vp-body";
34
+ body.innerHTML = escape(indentValue(text));
35
+ built.card.append(body);
36
+ doc.body.appendChild(built.card);
37
+ },
38
+ close,
39
+ get isOpen() {
40
+ return built !== null;
41
+ },
42
+ destroy() {
43
+ doc.removeEventListener("keydown", onKey);
44
+ close();
45
+ }
46
+ };
47
+ }
48
+ var VALUE_PANE_CSS = `
49
+ .vp-close {
50
+ margin-left: auto; background: none; border: 0; cursor: pointer;
51
+ color: var(--fx-muted, #8a90a2); font-size: 12px; line-height: 1; padding: 2px 4px;
52
+ }
53
+ .vp-close:hover { color: var(--fx-label, #e7e9ee); }
54
+ .vp-body {
55
+ flex: 1; margin: 0; padding: 8px; overflow: auto; white-space: pre;
56
+ font-family: ui-monospace, monospace; font-size: 11.5px; line-height: 1.5;
57
+ color: var(--fx-label, #e7e9ee);
58
+ }
59
+ `;
60
+
61
+ export {
62
+ createValuePane,
63
+ VALUE_PANE_CSS
64
+ };
package/dist/copy.mjs CHANGED
@@ -1,42 +1,6 @@
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
- }
1
+ import {
2
+ copyText
3
+ } from "./chunk-GDQXCOQB.mjs";
40
4
  export {
41
5
  copyText
42
6
  };
package/dist/describe.mjs CHANGED
@@ -1,34 +1,6 @@
1
- // src/describe.ts
2
- var MAX_CLASSES = 2;
3
- function textOwner(node) {
4
- const parent = node.parentElement;
5
- return parent ? `text in ${describeElement(parent)}` : "text";
6
- }
7
- function describeElement(el) {
8
- const tag = el.tagName.toLowerCase();
9
- const id = el.id ? `#${el.id}` : "";
10
- const raw = typeof el.className === "string" ? el.className : el.getAttribute("class") ?? "";
11
- const classes = raw.split(/\s+/).filter(Boolean).slice(0, MAX_CLASSES).map((c) => `.${c}`).join("");
12
- return `${tag}${id}${classes}`;
13
- }
14
- function describeNode(target) {
15
- const node = target;
16
- if (!node || typeof node.nodeType !== "number") return "detached";
17
- switch (node.nodeType) {
18
- case 1:
19
- return describeElement(node);
20
- case 3:
21
- return textOwner(node);
22
- case 8: {
23
- const parent = node.parentElement;
24
- return parent ? `slot in ${describeElement(parent)}` : "slot";
25
- }
26
- case 11:
27
- return "fragment";
28
- default:
29
- return node.nodeName?.toLowerCase() ?? "node";
30
- }
31
- }
1
+ import {
2
+ describeNode
3
+ } from "./chunk-CPZWLBCQ.mjs";
32
4
  export {
33
5
  describeNode
34
6
  };
@@ -143,7 +143,8 @@ var VERBS = {
143
143
  write: "written",
144
144
  ran: "ran",
145
145
  created: "made",
146
- disposed: "gone"
146
+ disposed: "gone",
147
+ mark: "marked"
147
148
  };
148
149
  var MIN_W = 320;
149
150
  var MIN_H = 200;
@@ -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,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"}
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;AA4DD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAwIlG;AAED,eAAO,MAAM,gBAAgB,0vHAsCf,CAAC"}
@@ -16,6 +16,7 @@ const VERBS = {
16
16
  ran: 'ran',
17
17
  created: 'made',
18
18
  disposed: 'gone',
19
+ mark: 'marked',
19
20
  };
20
21
  /** So it cannot be resized into a sliver. */
21
22
  const MIN_W = 320;