@praxisjs/devtools 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.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/assets/logo.svg +9 -0
- package/assets/uno.generated.css +205 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +1051 -0
- package/package.json +35 -0
- package/src/core/event-bus.ts +19 -0
- package/src/core/registry.ts +219 -0
- package/src/core/types.ts +45 -0
- package/src/decorators/debug.ts +161 -0
- package/src/decorators/index.ts +3 -0
- package/src/decorators/trace.ts +64 -0
- package/src/icons/ellipsis-vertical.tsx +20 -0
- package/src/icons/index.ts +6 -0
- package/src/icons/panel-bottom.tsx +19 -0
- package/src/icons/panel-left.tsx +19 -0
- package/src/icons/panel-right.tsx +19 -0
- package/src/icons/panel-top.tsx +19 -0
- package/src/icons/x.tsx +19 -0
- package/src/index.ts +20 -0
- package/src/plugins/components/components/component-detail.tsx +70 -0
- package/src/plugins/components/components/component-row.tsx +42 -0
- package/src/plugins/components/components/detail-row.tsx +22 -0
- package/src/plugins/components/components/detail-section.tsx +18 -0
- package/src/plugins/components/components/status-dot.tsx +14 -0
- package/src/plugins/components/components-tab.tsx +85 -0
- package/src/plugins/components/index.ts +9 -0
- package/src/plugins/signals/components/signal-detail.tsx +35 -0
- package/src/plugins/signals/components/signal-row.tsx +37 -0
- package/src/plugins/signals/index.ts +9 -0
- package/src/plugins/signals/signals-tab.tsx +99 -0
- package/src/plugins/timeline/components/badge.tsx +14 -0
- package/src/plugins/timeline/components/timeline-row.tsx +55 -0
- package/src/plugins/timeline/constants.ts +24 -0
- package/src/plugins/timeline/index.ts +9 -0
- package/src/plugins/timeline/timeline-tab.tsx +101 -0
- package/src/plugins/types.ts +10 -0
- package/src/ui/dev-tools.tsx +121 -0
- package/src/ui/panel.tsx +225 -0
- package/src/ui/shared/empty-state.tsx +12 -0
- package/src/ui/shared/icon-button.tsx +30 -0
- package/src/ui/shared/panel-section.tsx +18 -0
- package/src/ui/shared/search-input.tsx +18 -0
- package/src/ui/shared/side-panel.tsx +18 -0
- package/src/utils/format-time.ts +7 -0
- package/src/utils/format-value.ts +13 -0
- package/src/vite-env.d.ts +6 -0
- package/tsconfig.json +21 -0
- package/uno.config.ts +57 -0
- package/vite.config.ts +42 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1051 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n } from "@praxisjs/jsx/jsx-runtime";
|
|
2
|
+
import { signal as b, effect as P, onMount as C, onUnmount as I, peek as U } from "@praxisjs/core";
|
|
3
|
+
import { render as j } from "@praxisjs/runtime";
|
|
4
|
+
const N = "data:image/svg+xml,%3csvg%20width='1024'%20height='1024'%20viewBox='0%200%201024%201024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M605.411%20445.66L641.322%20498.293L641.342%20498.278L697.538%20578.57L742.673%20512.806L512.5%20178.878L281.327%20512.806L512.5%20848.182L603.519%20715.561L650.559%20782.134L512.701%20983L187%20510.478L512.701%2040L837%20510.478L698.206%20712.709L668.895%20671.104L604.033%20578.775L512%20712.504L373.199%20511.5L512.233%20309.092L584.13%20414.469L536.746%20480.456L513.69%20445.66L466.305%20511.5L512.166%20577.425L556.48%20513.91L605.411%20445.66Z'%20fill='url(%23paint0_linear_3024_20)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3024_20'%20x1='512'%20y1='40'%20x2='512'%20y2='983'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239B76FF'%20stop-opacity='0.86'/%3e%3cstop%20offset='1'%20stop-color='%232D246B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", F = '*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:host{all:initial;display:block;font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}*{box-sizing:border-box}input::placeholder{color:#6f6a8f}input:focus{outline:none;box-shadow:0 0 0 2px #9b90e64d}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#9b90e633;border-radius:2px}::-webkit-scrollbar-thumb:hover{background:#9b90e666}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.left-0{left:0}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-full{top:100%}.z-\\[2147483647\\]{z-index:2147483647}.z-10{z-index:10}.grid{display:grid}.grid-cols-\\[1\\.2fr_0\\.8fr_1fr_auto\\]{grid-template-columns:1.2fr .8fr 1fr auto}.m6{margin:1.5rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mr-\\[2px\\]{margin-right:2px}.ms{margin-inline-start:1rem}.mt-1{margin-top:.25rem}.box-border{box-sizing:border-box}.inline-block{display:inline-block}.h-\\[13px\\]{height:13px}.h-\\[22px\\]{height:22px}.h-\\[2px\\]{height:2px}.h-\\[32px\\]{height:32px}.h-\\[6px\\]{height:6px}.h-1{height:.25rem}.h-10{height:2.5rem}.h-3{height:.75rem}.h-7{height:1.75rem}.h-full{height:100%}.h-screen{height:100vh}.max-w-\\[200px\\]{max-width:200px}.min-w-0{min-width:0}.w-\\[13px\\]{width:13px}.w-\\[22px\\]{width:22px}.w-\\[2px\\]{width:2px}.w-\\[6px\\]{width:6px}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-4{width:1rem}.w-full{width:100%}.w-px{width:1px}.flex{display:flex}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.cursor-\\[ew-resize\\]{cursor:ew-resize}.cursor-\\[ns-resize\\]{cursor:ns-resize}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-\\[2px\\]{gap:2px}.gap-\\[3px\\]{gap:3px}.gap-\\[6px\\]{gap:6px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-border{--un-border-opacity:.25;border-color:rgba(155,144,230,var(--un-border-opacity))}.border-warn{--un-border-opacity:1;border-color:rgb(217 119 6 / var(--un-border-opacity))}.hover\\:border-accent:hover{--un-border-opacity:1;border-color:rgb(155 144 230 / var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.bg-\\[rgba\\(124\\,109\\,214\\,0\\.14\\)\\]{--un-bg-opacity:.14;background-color:rgba(124,109,214,var(--un-bg-opacity))}.bg-\\[rgba\\(14\\,165\\,122\\,0\\.14\\)\\]{--un-bg-opacity:.14;background-color:rgba(14,165,122,var(--un-bg-opacity))}.bg-\\[rgba\\(155\\,144\\,230\\,0\\.14\\)\\]{--un-bg-opacity:.14;background-color:rgba(155,144,230,var(--un-bg-opacity))}.bg-\\[rgba\\(217\\,119\\,6\\,0\\.14\\)\\]{--un-bg-opacity:.14;background-color:rgba(217,119,6,var(--un-bg-opacity))}.bg-\\[rgba\\(220\\,38\\,38\\,0\\.14\\)\\]{--un-bg-opacity:.14;background-color:rgba(220,38,38,var(--un-bg-opacity))}.bg-\\[rgba\\(74\\,222\\,128\\,0\\.12\\)\\]{--un-bg-opacity:.12;background-color:rgba(74,222,128,var(--un-bg-opacity))}.bg-accent{--un-bg-opacity:1;background-color:rgb(155 144 230 / var(--un-bg-opacity))}.bg-bg{--un-bg-opacity:1;background-color:rgb(15 13 23 / var(--un-bg-opacity))}.bg-border{--un-bg-opacity:.25;background-color:rgba(155,144,230,var(--un-bg-opacity))}.bg-header{--un-bg-opacity:1;background-color:rgb(22 19 38 / var(--un-bg-opacity))}.bg-input,.bg-section{--un-bg-opacity:1;background-color:rgb(27 24 48 / var(--un-bg-opacity))}.bg-selected{--un-bg-opacity:1;background-color:rgb(34 30 61 / var(--un-bg-opacity))}.bg-soft{--un-bg-opacity:.18;background-color:rgba(155,144,230,var(--un-bg-opacity))}.bg-subtle{--un-bg-opacity:1;background-color:rgb(111 106 143 / var(--un-bg-opacity))}.bg-success{--un-bg-opacity:1;background-color:rgb(14 165 122 / var(--un-bg-opacity))}.bg-transparent{background-color:transparent}.hover\\:bg-accent:hover{--un-bg-opacity:1;background-color:rgb(155 144 230 / var(--un-bg-opacity))}.hover\\:bg-section:hover{--un-bg-opacity:1;background-color:rgb(27 24 48 / var(--un-bg-opacity))}.hover\\:bg-soft:hover{--un-bg-opacity:.18;background-color:rgba(155,144,230,var(--un-bg-opacity))}.p-1{padding:.25rem}.px{padding-left:1rem;padding-right:1rem}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-\\[2px\\]{padding-top:2px;padding-bottom:2px}.py-\\[3px\\]{padding-top:3px;padding-bottom:3px}.py-\\[4px\\]{padding-top:4px;padding-bottom:4px}.py-\\[5px\\]{padding-top:5px;padding-bottom:5px}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-\\[10px\\]{padding-left:10px}.pl-\\[56px\\]{padding-left:56px}.pl-1{padding-left:.25rem}.pr-\\[14px\\]{padding-right:14px}.pr-3{padding-right:.75rem}.text-center{text-align:center}.text-right{text-align:right}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[20px\\]{font-size:20px}.text-\\[9px\\]{font-size:9px}.text-\\[\\#0ea57a\\]{--un-text-opacity:1;color:rgb(14 165 122 / var(--un-text-opacity))}.text-\\[\\#4ade80\\]{--un-text-opacity:1;color:rgb(74 222 128 / var(--un-text-opacity))}.text-\\[\\#7c6dd6\\]{--un-text-opacity:1;color:rgb(124 109 214 / var(--un-text-opacity))}.text-\\[\\#9b90e6\\],.text-accent{--un-text-opacity:1;color:rgb(155 144 230 / var(--un-text-opacity))}.text-\\[\\#d97706\\],.text-warn{--un-text-opacity:1;color:rgb(217 119 6 / var(--un-text-opacity))}.text-\\[\\#dc2626\\]{--un-text-opacity:1;color:rgb(220 38 38 / var(--un-text-opacity))}.text-muted{--un-text-opacity:1;color:rgb(199 195 230 / var(--un-text-opacity))}.text-subtle{--un-text-opacity:1;color:rgb(111 106 143 / var(--un-text-opacity))}.text-text,.hover\\:text-text:hover{--un-text-opacity:1;color:rgb(244 242 255 / var(--un-text-opacity))}.color-white{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.hover\\:color-muted:hover{--un-text-opacity:1;color:rgb(199 195 230 / var(--un-text-opacity))}.font-bold{font-weight:700}.font-semibold{font-weight:600}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-\\[0\\.07em\\]{letter-spacing:.07em}.tracking-\\[0\\.12em\\]{letter-spacing:.12em}.tracking-widest{letter-spacing:.1em}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.uppercase{text-transform:uppercase}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-\\[0_8px_32px_rgba\\(0\\,0\\,0\\,0\\.7\\)\\]{--un-shadow:0 8px 32px var(--un-shadow-color, rgba(0, 0, 0, .7));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.hover\\:shadow-\\[0_8px_32px_rgba\\(56\\,189\\,248\\,0\\.1\\)\\]:hover{--un-shadow:0 8px 32px var(--un-shadow-color, rgba(56, 189, 248, .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}';
|
|
5
|
+
class O {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.handlers = /* @__PURE__ */ new Map();
|
|
8
|
+
}
|
|
9
|
+
on(e, o) {
|
|
10
|
+
return this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set()), this.handlers.get(e).add(o), () => this.handlers.get(e)?.delete(o);
|
|
11
|
+
}
|
|
12
|
+
emit(e, o) {
|
|
13
|
+
this.handlers.get(e)?.forEach((r) => {
|
|
14
|
+
r(o);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const H = 200;
|
|
19
|
+
let W = 0;
|
|
20
|
+
function T() {
|
|
21
|
+
return `v${(++W).toString()}_${Date.now().toString(36)}`;
|
|
22
|
+
}
|
|
23
|
+
const f = class f {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.bus = new O(), this.instanceIds = /* @__PURE__ */ new WeakMap(), this.signals = /* @__PURE__ */ new Map(), this.components = /* @__PURE__ */ new Map(), this.timeline = [];
|
|
26
|
+
}
|
|
27
|
+
static get instance() {
|
|
28
|
+
return f._instance ??= new f(), f._instance;
|
|
29
|
+
}
|
|
30
|
+
getInstanceId(e) {
|
|
31
|
+
return this.instanceIds.has(e) || this.instanceIds.set(e, T()), this.instanceIds.get(e);
|
|
32
|
+
}
|
|
33
|
+
registerSignal(e, o, r, i) {
|
|
34
|
+
const a = this.getInstanceId(e), l = `${a}:${o}`, s = {
|
|
35
|
+
id: l,
|
|
36
|
+
label: o,
|
|
37
|
+
componentId: a,
|
|
38
|
+
componentName: i,
|
|
39
|
+
value: r,
|
|
40
|
+
history: [{ value: r, timestamp: Date.now() }],
|
|
41
|
+
changedAt: Date.now()
|
|
42
|
+
};
|
|
43
|
+
this.signals.set(l, s), this.bus.emit("signal:registered", s);
|
|
44
|
+
}
|
|
45
|
+
updateSignal(e, o, r, i) {
|
|
46
|
+
const l = `${this.getInstanceId(e)}:${o}`, s = this.signals.get(l);
|
|
47
|
+
if (!s) return;
|
|
48
|
+
const u = [
|
|
49
|
+
...s.history,
|
|
50
|
+
{ value: r, timestamp: Date.now() }
|
|
51
|
+
].slice(-20), c = {
|
|
52
|
+
...s,
|
|
53
|
+
value: r,
|
|
54
|
+
history: u,
|
|
55
|
+
changedAt: Date.now()
|
|
56
|
+
};
|
|
57
|
+
this.signals.set(l, c), this.bus.emit("signal:changed", { entry: c, oldValue: i }), this.pushTimeline({
|
|
58
|
+
type: "signal:change",
|
|
59
|
+
label: `${s.componentName}.${o}`,
|
|
60
|
+
data: { old: i, new: r, signalId: l }
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
registerComponent(e, o) {
|
|
64
|
+
const r = this.getInstanceId(e), i = {
|
|
65
|
+
id: r,
|
|
66
|
+
name: o,
|
|
67
|
+
renderCount: 0,
|
|
68
|
+
lastRenderDuration: 0,
|
|
69
|
+
mountedAt: Date.now(),
|
|
70
|
+
status: "mounted",
|
|
71
|
+
lifecycle: []
|
|
72
|
+
};
|
|
73
|
+
this.components.set(r, i), this.bus.emit("component:registered", i);
|
|
74
|
+
}
|
|
75
|
+
recordRender(e, o) {
|
|
76
|
+
const r = this.getInstanceId(e), i = this.components.get(r);
|
|
77
|
+
i && (i.renderCount++, i.lastRenderDuration = o, this.bus.emit("component:render", { ...i }), this.pushTimeline({
|
|
78
|
+
type: "component:render",
|
|
79
|
+
label: `<${i.name}>`,
|
|
80
|
+
data: {
|
|
81
|
+
componentId: r,
|
|
82
|
+
duration: +o.toFixed(3),
|
|
83
|
+
renderCount: i.renderCount
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
recordLifecycle(e, o) {
|
|
88
|
+
const r = this.getInstanceId(e), i = this.components.get(r);
|
|
89
|
+
if (!i) return;
|
|
90
|
+
const a = { hook: o, timestamp: Date.now() };
|
|
91
|
+
i.lifecycle.push(a), this.bus.emit("lifecycle", { componentId: r, name: i.name, hook: o });
|
|
92
|
+
const l = o === "onUnmount" ? "component:unmount" : o === "onBeforeMount" ? "component:mount" : "lifecycle";
|
|
93
|
+
if (this.pushTimeline({
|
|
94
|
+
type: l,
|
|
95
|
+
label: `<${i.name}>.${o}`,
|
|
96
|
+
data: { componentId: r, hook: o }
|
|
97
|
+
}), o === "onUnmount") {
|
|
98
|
+
i.status = "unmounted", this.bus.emit("component:unmount", { ...i }), this.components.delete(r);
|
|
99
|
+
for (const [s, u] of this.signals)
|
|
100
|
+
u.componentId === r && this.signals.delete(s);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
recordMethodCall(e, o, r, i, a, l) {
|
|
104
|
+
const s = this.getInstanceId(e);
|
|
105
|
+
this.pushTimeline({
|
|
106
|
+
type: "method:call",
|
|
107
|
+
label: `${l}.${o}()`,
|
|
108
|
+
data: {
|
|
109
|
+
componentId: s,
|
|
110
|
+
args: r,
|
|
111
|
+
result: i,
|
|
112
|
+
duration: +a.toFixed(3)
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
getSignals() {
|
|
117
|
+
return [...this.signals.values()];
|
|
118
|
+
}
|
|
119
|
+
getComponents() {
|
|
120
|
+
return [...this.components.values()];
|
|
121
|
+
}
|
|
122
|
+
getTimeline() {
|
|
123
|
+
return [...this.timeline];
|
|
124
|
+
}
|
|
125
|
+
getSignalsByComponent(e) {
|
|
126
|
+
return this.getSignals().filter((o) => o.componentId === e);
|
|
127
|
+
}
|
|
128
|
+
pushTimeline(e) {
|
|
129
|
+
const o = {
|
|
130
|
+
id: T(),
|
|
131
|
+
timestamp: Date.now(),
|
|
132
|
+
...e
|
|
133
|
+
};
|
|
134
|
+
this.timeline.push(o), this.timeline.length > H && this.timeline.shift(), this.bus.emit("timeline:push", o);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
f._instance = null;
|
|
138
|
+
let g = f;
|
|
139
|
+
function z({ message: t }) {
|
|
140
|
+
return /* @__PURE__ */ d("div", { class: "flex flex-col items-center justify-center gap-2 py-12", children: [
|
|
141
|
+
/* @__PURE__ */ n("span", { class: "text-subtle text-[20px] leading-none select-none font-mono", children: "—" }),
|
|
142
|
+
/* @__PURE__ */ n("p", { class: "text-subtle text-[11px] text-center leading-relaxed max-w-[200px]", children: t })
|
|
143
|
+
] });
|
|
144
|
+
}
|
|
145
|
+
function A({
|
|
146
|
+
children: t,
|
|
147
|
+
width: e = "280px"
|
|
148
|
+
}) {
|
|
149
|
+
return /* @__PURE__ */ n(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
class: "shrink-0 border-l border-border flex flex-col overflow-hidden",
|
|
153
|
+
style: { width: e },
|
|
154
|
+
children: t
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function M(t) {
|
|
159
|
+
if (t === null) return "null";
|
|
160
|
+
if (t === void 0) return "undefined";
|
|
161
|
+
if (typeof t == "string") return `"${t}"`;
|
|
162
|
+
if (typeof t == "object")
|
|
163
|
+
try {
|
|
164
|
+
return JSON.stringify(t);
|
|
165
|
+
} catch {
|
|
166
|
+
return "[object]";
|
|
167
|
+
}
|
|
168
|
+
return String(t);
|
|
169
|
+
}
|
|
170
|
+
function v({
|
|
171
|
+
k: t,
|
|
172
|
+
v: e,
|
|
173
|
+
signal: o
|
|
174
|
+
}) {
|
|
175
|
+
return /* @__PURE__ */ d("div", { class: "flex justify-between items-center px-3 py-2 border-b border-border gap-3", children: [
|
|
176
|
+
/* @__PURE__ */ n(
|
|
177
|
+
"span",
|
|
178
|
+
{
|
|
179
|
+
class: `text-[11px] font-mono shrink-0 ${o ? "text-accent" : "text-muted"}`,
|
|
180
|
+
children: t
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ n("span", { class: "text-[11px] text-text font-mono truncate text-right", children: e })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
function k({
|
|
187
|
+
label: t,
|
|
188
|
+
children: e
|
|
189
|
+
}) {
|
|
190
|
+
return /* @__PURE__ */ d("div", { class: "border-b border-border", children: [
|
|
191
|
+
/* @__PURE__ */ n("div", { class: "px-3 py-[4px] text-[9px] text-subtle font-bold tracking-[0.12em] uppercase bg-section border-b border-border", children: t }),
|
|
192
|
+
e
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
function R({ status: t }) {
|
|
196
|
+
return /* @__PURE__ */ n(
|
|
197
|
+
"span",
|
|
198
|
+
{
|
|
199
|
+
class: `inline-block w-[6px] h-[6px] rounded-full shrink-0 ${t === "mounted" ? "bg-success" : "bg-subtle"}`,
|
|
200
|
+
style: t === "mounted" ? { boxShadow: "0 0 6px rgba(14,165,122,0.7)" } : void 0
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function G({
|
|
205
|
+
entry: t,
|
|
206
|
+
signals: e
|
|
207
|
+
}) {
|
|
208
|
+
return /* @__PURE__ */ d(A, { children: [
|
|
209
|
+
/* @__PURE__ */ d("div", { class: "px-3 py-2 border-b border-border flex items-center gap-2 bg-bg shrink-0", children: [
|
|
210
|
+
/* @__PURE__ */ n(R, { status: t.status }),
|
|
211
|
+
/* @__PURE__ */ d("span", { class: "text-accent font-mono text-[11px] font-semibold truncate pl-1", children: [
|
|
212
|
+
"<",
|
|
213
|
+
t.name,
|
|
214
|
+
">"
|
|
215
|
+
] })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ d("div", { class: "flex-1 overflow-y-auto", children: [
|
|
218
|
+
/* @__PURE__ */ d(k, { label: "Stats", children: [
|
|
219
|
+
/* @__PURE__ */ n(v, { k: "renders", v: String(t.renderCount) }),
|
|
220
|
+
/* @__PURE__ */ n(
|
|
221
|
+
v,
|
|
222
|
+
{
|
|
223
|
+
k: "last render",
|
|
224
|
+
v: `${t.lastRenderDuration.toFixed(3)}ms`
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ n(v, { k: "status", v: t.status })
|
|
228
|
+
] }),
|
|
229
|
+
e.length > 0 && /* @__PURE__ */ n(k, { label: "State", children: e.map((o) => /* @__PURE__ */ n(
|
|
230
|
+
v,
|
|
231
|
+
{
|
|
232
|
+
k: o.label,
|
|
233
|
+
v: M(o.value),
|
|
234
|
+
signal: !0
|
|
235
|
+
},
|
|
236
|
+
o.id
|
|
237
|
+
)) }),
|
|
238
|
+
t.lifecycle.length > 0 && /* @__PURE__ */ n(k, { label: "Lifecycle", children: [...t.lifecycle].reverse().slice(0, 20).map((o, r) => /* @__PURE__ */ d(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
class: "px-3 py-2 flex justify-between items-center border-b border-border",
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ n("span", { class: "text-[11px] text-text font-mono", children: o.hook }),
|
|
244
|
+
/* @__PURE__ */ n("span", { class: "text-[10px] text-subtle tabular-nums", children: new Date(o.timestamp).toLocaleTimeString() })
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
String(r)
|
|
248
|
+
)) })
|
|
249
|
+
] })
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
252
|
+
function X({
|
|
253
|
+
entry: t,
|
|
254
|
+
selected: e,
|
|
255
|
+
onClick: o
|
|
256
|
+
}) {
|
|
257
|
+
return /* @__PURE__ */ d(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
onClick: o,
|
|
261
|
+
class: () => `relative flex items-center gap-2 px-3 py-2 cursor-pointer border-b border-border transition-colors duration-100 ${e() ? "bg-selected" : "hover:bg-section"}`,
|
|
262
|
+
children: [
|
|
263
|
+
() => e() && /* @__PURE__ */ n("span", { class: "absolute left-0 top-0 bottom-0 w-[2px] bg-accent rounded-r" }),
|
|
264
|
+
/* @__PURE__ */ n(R, { status: t.status }),
|
|
265
|
+
/* @__PURE__ */ d("span", { class: "text-accent font-mono text-[11px] flex-1 truncate pl-1", children: [
|
|
266
|
+
"<",
|
|
267
|
+
t.name,
|
|
268
|
+
">"
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ d("span", { class: "text-muted text-[11px] tabular-nums", children: [
|
|
271
|
+
"×",
|
|
272
|
+
t.renderCount
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ d(
|
|
275
|
+
"span",
|
|
276
|
+
{
|
|
277
|
+
class: `text-[10px] tabular-nums w-12 text-right ${t.lastRenderDuration > 16 ? "text-warn" : "text-subtle"}`,
|
|
278
|
+
children: [
|
|
279
|
+
t.lastRenderDuration.toFixed(1),
|
|
280
|
+
"ms"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
function Y({ registry: t }) {
|
|
289
|
+
const e = b(t.getComponents()), o = b(null), r = b([]), i = P(() => {
|
|
290
|
+
const l = o();
|
|
291
|
+
r.set(l ? t.getSignalsByComponent(l) : []);
|
|
292
|
+
});
|
|
293
|
+
let a = [];
|
|
294
|
+
return C(() => {
|
|
295
|
+
const l = () => {
|
|
296
|
+
e.set(t.getComponents());
|
|
297
|
+
const s = U(o);
|
|
298
|
+
s && r.set(t.getSignalsByComponent(s));
|
|
299
|
+
};
|
|
300
|
+
a = [
|
|
301
|
+
"component:registered",
|
|
302
|
+
"component:render",
|
|
303
|
+
"component:unmount",
|
|
304
|
+
"lifecycle",
|
|
305
|
+
"signal:registered",
|
|
306
|
+
"signal:changed"
|
|
307
|
+
].map((s) => t.bus.on(s, l));
|
|
308
|
+
}), I(() => {
|
|
309
|
+
i(), a.forEach((l) => {
|
|
310
|
+
l();
|
|
311
|
+
});
|
|
312
|
+
}), /* @__PURE__ */ d("div", { class: "flex h-full overflow-hidden", children: [
|
|
313
|
+
/* @__PURE__ */ d("div", { class: "flex-1 flex flex-col overflow-hidden min-w-0", children: [
|
|
314
|
+
/* @__PURE__ */ d("div", { class: "flex items-center px-3 h-7 text-[9px] text-subtle font-bold tracking-[0.12em] uppercase border-b border-border bg-section gap-2 shrink-0", children: [
|
|
315
|
+
/* @__PURE__ */ n("span", { class: "flex-1", children: "Component" }),
|
|
316
|
+
/* @__PURE__ */ n("span", { children: "Renders" }),
|
|
317
|
+
/* @__PURE__ */ n("span", { class: "w-12 text-right", children: "Last" })
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ n("div", { class: "flex-1 overflow-y-auto", children: () => e().length === 0 ? /* @__PURE__ */ n(z, { message: "No components tracked. Add @Trace() to component classes." }) : e().map((l) => /* @__PURE__ */ n(
|
|
320
|
+
X,
|
|
321
|
+
{
|
|
322
|
+
entry: l,
|
|
323
|
+
selected: () => o() === l.id,
|
|
324
|
+
onClick: () => {
|
|
325
|
+
o.update((s) => s === l.id ? null : l.id);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
l.id
|
|
329
|
+
)) })
|
|
330
|
+
] }),
|
|
331
|
+
() => {
|
|
332
|
+
const l = o(), s = l ? e().find((u) => u.id === l) ?? null : null;
|
|
333
|
+
return s ? /* @__PURE__ */ n(G, { entry: s, signals: r() }) : null;
|
|
334
|
+
}
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
const J = {
|
|
338
|
+
id: "components",
|
|
339
|
+
label: "Components",
|
|
340
|
+
component: Y
|
|
341
|
+
};
|
|
342
|
+
function q({
|
|
343
|
+
placeholder: t,
|
|
344
|
+
onInput: e
|
|
345
|
+
}) {
|
|
346
|
+
return /* @__PURE__ */ n(
|
|
347
|
+
"input",
|
|
348
|
+
{
|
|
349
|
+
type: "text",
|
|
350
|
+
placeholder: t,
|
|
351
|
+
class: "w-full bg-input border border-border rounded-lg text-text text-[11px] px-3 py-[5px] outline-none box-border transition-shadow duration-150",
|
|
352
|
+
onInput: (o) => {
|
|
353
|
+
e(o.target.value);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function K({
|
|
359
|
+
label: t,
|
|
360
|
+
children: e
|
|
361
|
+
}) {
|
|
362
|
+
return /* @__PURE__ */ d("div", { class: "border-b border-border", children: [
|
|
363
|
+
/* @__PURE__ */ n("div", { class: "px-3 py-[4px] text-[9px] text-subtle font-bold tracking-[0.12em] uppercase bg-section border-b border-border", children: t }),
|
|
364
|
+
e
|
|
365
|
+
] });
|
|
366
|
+
}
|
|
367
|
+
function L(t, e) {
|
|
368
|
+
const o = e ? ` ${e}` : "", r = Date.now() - t;
|
|
369
|
+
return r < 1e3 ? `${r.toString()}ms${o}` : r < 6e4 ? `${(r / 1e3).toFixed(1)}s${o}` : `${Math.floor(r / 6e4).toString()}m${o}`;
|
|
370
|
+
}
|
|
371
|
+
function Z({ entry: t }) {
|
|
372
|
+
return /* @__PURE__ */ n(A, { width: "260px", children: /* @__PURE__ */ n(K, { label: "History", children: /* @__PURE__ */ d("div", { class: "overflow-y-auto", children: [
|
|
373
|
+
[...t.history].reverse().map((e, o) => /* @__PURE__ */ d(
|
|
374
|
+
"div",
|
|
375
|
+
{
|
|
376
|
+
class: "px-3 py-2 border-b border-border flex justify-between items-center gap-3",
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ n("span", { class: "font-mono text-[11px] text-text truncate", children: M(e.value) }),
|
|
379
|
+
/* @__PURE__ */ n("span", { class: "text-[10px] text-subtle shrink-0 tabular-nums", children: L(e.timestamp, "ago") })
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
String(o)
|
|
383
|
+
)),
|
|
384
|
+
t.history.length === 0 && /* @__PURE__ */ n("p", { class: "px-3 py-6 text-[11px] text-subtle text-center", children: "No history yet." })
|
|
385
|
+
] }) }) });
|
|
386
|
+
}
|
|
387
|
+
function Q({
|
|
388
|
+
entry: t,
|
|
389
|
+
selected: e,
|
|
390
|
+
onClick: o
|
|
391
|
+
}) {
|
|
392
|
+
return /* @__PURE__ */ d(
|
|
393
|
+
"div",
|
|
394
|
+
{
|
|
395
|
+
onClick: o,
|
|
396
|
+
class: `relative grid grid-cols-[1.2fr_0.8fr_1fr_auto] items-center px-3 py-2 cursor-pointer border-b border-border transition-colors duration-100 ${e ? "bg-selected" : "hover:bg-section"}`,
|
|
397
|
+
children: [
|
|
398
|
+
e && /* @__PURE__ */ n("span", { class: "absolute left-0 top-0 bottom-0 w-[2px] bg-accent rounded-r" }),
|
|
399
|
+
/* @__PURE__ */ n("span", { class: "text-accent font-mono text-[11px] truncate pl-1", children: t.label }),
|
|
400
|
+
/* @__PURE__ */ n("span", { class: "text-muted text-[11px] truncate", children: t.componentName }),
|
|
401
|
+
/* @__PURE__ */ n("span", { class: "text-text font-mono text-[11px] truncate", children: M(t.value) }),
|
|
402
|
+
/* @__PURE__ */ n("span", { class: "text-subtle text-[10px] text-right tabular-nums", children: L(t.changedAt, "ago") })
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
function V({ registry: t }) {
|
|
408
|
+
const e = b(t.getSignals()), o = b(""), r = b(null);
|
|
409
|
+
let i = [];
|
|
410
|
+
return C(() => {
|
|
411
|
+
i = [
|
|
412
|
+
t.bus.on("signal:registered", () => {
|
|
413
|
+
e.set(t.getSignals());
|
|
414
|
+
}),
|
|
415
|
+
t.bus.on("signal:changed", () => {
|
|
416
|
+
e.set(t.getSignals());
|
|
417
|
+
})
|
|
418
|
+
];
|
|
419
|
+
}), I(() => {
|
|
420
|
+
i.forEach((a) => {
|
|
421
|
+
a();
|
|
422
|
+
});
|
|
423
|
+
}), /* @__PURE__ */ d("div", { class: "flex h-full overflow-hidden", children: [
|
|
424
|
+
/* @__PURE__ */ d("div", { class: "flex-1 flex flex-col overflow-hidden min-w-0", children: [
|
|
425
|
+
/* @__PURE__ */ n("div", { class: "px-3 py-2 border-b border-border bg-bg shrink-0", children: /* @__PURE__ */ n(
|
|
426
|
+
q,
|
|
427
|
+
{
|
|
428
|
+
placeholder: "Search signals…",
|
|
429
|
+
onInput: (a) => {
|
|
430
|
+
o.set(a);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
) }),
|
|
434
|
+
/* @__PURE__ */ d("div", { class: "grid grid-cols-[1.2fr_0.8fr_1fr_auto] items-center px-3 h-7 text-[9px] text-subtle font-bold tracking-[0.12em] uppercase border-b border-border bg-section gap-2 shrink-0", children: [
|
|
435
|
+
/* @__PURE__ */ n("span", { children: "Signal" }),
|
|
436
|
+
/* @__PURE__ */ n("span", { children: "Component" }),
|
|
437
|
+
/* @__PURE__ */ n("span", { children: "Value" }),
|
|
438
|
+
/* @__PURE__ */ n("span", { children: "Age" })
|
|
439
|
+
] }),
|
|
440
|
+
/* @__PURE__ */ n("div", { class: "flex-1 overflow-y-auto", children: () => {
|
|
441
|
+
const a = o().toLowerCase(), l = a === "" ? e() : e().filter(
|
|
442
|
+
(s) => s.label.toLowerCase().includes(a) || s.componentName.toLowerCase().includes(a)
|
|
443
|
+
);
|
|
444
|
+
return l.length === 0 ? /* @__PURE__ */ n(
|
|
445
|
+
z,
|
|
446
|
+
{
|
|
447
|
+
message: e().length === 0 ? "No signals tracked. Add @Debug() on top of @State() properties." : "No signals match your search."
|
|
448
|
+
}
|
|
449
|
+
) : l.map((s) => /* @__PURE__ */ n(
|
|
450
|
+
Q,
|
|
451
|
+
{
|
|
452
|
+
entry: s,
|
|
453
|
+
selected: r() === s.id,
|
|
454
|
+
onClick: () => {
|
|
455
|
+
r.update((u) => u === s.id ? null : s.id);
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
s.id
|
|
459
|
+
));
|
|
460
|
+
} })
|
|
461
|
+
] }),
|
|
462
|
+
() => {
|
|
463
|
+
const a = r(), l = a ? e().find((s) => s.id === a) ?? null : null;
|
|
464
|
+
return l ? /* @__PURE__ */ n(Z, { entry: l }) : null;
|
|
465
|
+
}
|
|
466
|
+
] });
|
|
467
|
+
}
|
|
468
|
+
const ee = {
|
|
469
|
+
id: "signals",
|
|
470
|
+
label: "Signals",
|
|
471
|
+
component: V
|
|
472
|
+
}, te = {
|
|
473
|
+
"signal:change": { label: "signal", cls: "text-[#9b90e6] bg-[rgba(155,144,230,0.14)]" },
|
|
474
|
+
"component:render": { label: "render", cls: "text-[#4ade80] bg-[rgba(74,222,128,0.12)]" },
|
|
475
|
+
"component:mount": { label: "mount", cls: "text-[#0ea57a] bg-[rgba(14,165,122,0.14)]" },
|
|
476
|
+
"component:unmount": { label: "unmount", cls: "text-[#dc2626] bg-[rgba(220,38,38,0.14)]" },
|
|
477
|
+
lifecycle: { label: "lifecycle", cls: "text-[#d97706] bg-[rgba(217,119,6,0.14)]" },
|
|
478
|
+
"method:call": { label: "method", cls: "text-[#7c6dd6] bg-[rgba(124,109,214,0.14)]" }
|
|
479
|
+
}, ne = [
|
|
480
|
+
{ value: "all", label: "All" },
|
|
481
|
+
{ value: "signal:change", label: "Signals" },
|
|
482
|
+
{ value: "component:render", label: "Renders" },
|
|
483
|
+
{ value: "component:mount", label: "Mount" },
|
|
484
|
+
{ value: "lifecycle", label: "Lifecycle" },
|
|
485
|
+
{ value: "method:call", label: "Methods" }
|
|
486
|
+
];
|
|
487
|
+
function oe({ type: t }) {
|
|
488
|
+
const e = te[t];
|
|
489
|
+
return /* @__PURE__ */ n(
|
|
490
|
+
"span",
|
|
491
|
+
{
|
|
492
|
+
class: `text-[9px] px-[6px] py-[2px] rounded font-bold uppercase tracking-[0.07em] shrink-0 ${e.cls}`,
|
|
493
|
+
children: e.label
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
function re({ entry: t }) {
|
|
498
|
+
const e = b(!1), o = Object.keys(t.data).length > 0;
|
|
499
|
+
return /* @__PURE__ */ d("div", { class: "border-b border-border", children: [
|
|
500
|
+
/* @__PURE__ */ d(
|
|
501
|
+
"div",
|
|
502
|
+
{
|
|
503
|
+
onClick: () => {
|
|
504
|
+
o && e.update((r) => !r);
|
|
505
|
+
},
|
|
506
|
+
class: `flex items-center gap-2 px-3 py-2 transition-colors duration-100 ${o ? "cursor-pointer hover:bg-section" : "cursor-default"}`,
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ n("span", { class: "text-subtle text-[10px] w-10 shrink-0 text-right tabular-nums font-mono", children: L(t.timestamp) }),
|
|
509
|
+
/* @__PURE__ */ n(oe, { type: t.type }),
|
|
510
|
+
/* @__PURE__ */ n("span", { class: "flex-1 text-text font-mono text-[11px] truncate", children: t.label }),
|
|
511
|
+
o && /* @__PURE__ */ n("span", { class: "text-subtle text-[11px] shrink-0 w-4 text-center", children: () => e() ? "▾" : "▸" })
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
() => e() && o ? /* @__PURE__ */ n("div", { class: "px-3 py-2 pl-[56px] font-mono text-[11px] bg-section border-t border-border", children: Object.entries(t.data).map(([r, i]) => /* @__PURE__ */ d("div", { class: "flex gap-3 py-[3px]", children: [
|
|
516
|
+
/* @__PURE__ */ d("span", { class: "text-accent shrink-0", children: [
|
|
517
|
+
r,
|
|
518
|
+
":"
|
|
519
|
+
] }),
|
|
520
|
+
/* @__PURE__ */ n("span", { class: "text-muted truncate", children: typeof i == "object" ? JSON.stringify(i) : String(i) })
|
|
521
|
+
] }, r)) }) : null
|
|
522
|
+
] });
|
|
523
|
+
}
|
|
524
|
+
function ie({ registry: t }) {
|
|
525
|
+
const e = b(t.getTimeline()), o = b("all"), r = b(!1);
|
|
526
|
+
let i = [];
|
|
527
|
+
return C(() => {
|
|
528
|
+
i = [
|
|
529
|
+
t.bus.on("timeline:push", () => {
|
|
530
|
+
r() || e.set(t.getTimeline());
|
|
531
|
+
})
|
|
532
|
+
];
|
|
533
|
+
}), I(() => {
|
|
534
|
+
i.forEach((a) => {
|
|
535
|
+
a();
|
|
536
|
+
});
|
|
537
|
+
}), /* @__PURE__ */ d("div", { class: "flex flex-col h-full overflow-hidden", children: [
|
|
538
|
+
/* @__PURE__ */ d("div", { class: "flex items-center gap-[3px] px-2 py-2 border-b border-border bg-bg shrink-0 flex-wrap", children: [
|
|
539
|
+
ne.map((a) => /* @__PURE__ */ n(
|
|
540
|
+
"button",
|
|
541
|
+
{
|
|
542
|
+
onClick: () => {
|
|
543
|
+
o.set(a.value);
|
|
544
|
+
},
|
|
545
|
+
class: () => o() === a.value ? "text-[11px] px-2 py-[3px] rounded cursor-pointer font-sans bg-soft text-accent font-semibold" : "text-[11px] px-2 py-[3px] rounded cursor-pointer font-sans text-muted hover:text-text hover:bg-section transition-colors duration-150",
|
|
546
|
+
children: a.label
|
|
547
|
+
},
|
|
548
|
+
a.value
|
|
549
|
+
)),
|
|
550
|
+
/* @__PURE__ */ n("div", { class: "flex-1" }),
|
|
551
|
+
/* @__PURE__ */ n(
|
|
552
|
+
"button",
|
|
553
|
+
{
|
|
554
|
+
onClick: () => {
|
|
555
|
+
r() && e.set(t.getTimeline()), r.update((a) => !a);
|
|
556
|
+
},
|
|
557
|
+
class: () => `text-[11px] px-2 py-[3px] rounded cursor-pointer font-sans border border-border transition-colors duration-150 ${r() ? "text-warn border-warn" : "text-muted hover:text-text"}`,
|
|
558
|
+
children: () => r() ? "Resume" : "Pause"
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ n(
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
onClick: () => {
|
|
565
|
+
e.set([]);
|
|
566
|
+
},
|
|
567
|
+
class: "text-[11px] px-2 py-[3px] rounded cursor-pointer font-sans border border-border text-muted hover:text-text transition-colors duration-150",
|
|
568
|
+
children: "Clear"
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
] }),
|
|
572
|
+
/* @__PURE__ */ n("div", { class: "flex-1 overflow-y-auto", children: () => {
|
|
573
|
+
const a = o(), l = a === "all" ? e() : e().filter(
|
|
574
|
+
(s) => s.type === a || a === "component:mount" && s.type === "component:unmount"
|
|
575
|
+
);
|
|
576
|
+
return l.length === 0 ? /* @__PURE__ */ n(z, { message: "No events yet. Interact with your app to see the timeline." }) : [...l].reverse().map((s) => /* @__PURE__ */ n(re, { entry: s }, s.id));
|
|
577
|
+
} })
|
|
578
|
+
] });
|
|
579
|
+
}
|
|
580
|
+
const se = {
|
|
581
|
+
id: "timeline",
|
|
582
|
+
label: "Timeline",
|
|
583
|
+
component: ie
|
|
584
|
+
}, ae = '*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}';
|
|
585
|
+
function le() {
|
|
586
|
+
return /* @__PURE__ */ d(
|
|
587
|
+
"svg",
|
|
588
|
+
{
|
|
589
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
590
|
+
width: "24",
|
|
591
|
+
height: "24",
|
|
592
|
+
viewBox: "0 0 24 24",
|
|
593
|
+
fill: "none",
|
|
594
|
+
stroke: "currentColor",
|
|
595
|
+
"stroke-width": "2",
|
|
596
|
+
"stroke-linecap": "round",
|
|
597
|
+
"stroke-linejoin": "round",
|
|
598
|
+
class: "lucide lucide-ellipsis-vertical-icon lucide-ellipsis-vertical",
|
|
599
|
+
children: [
|
|
600
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "1" }),
|
|
601
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "5", r: "1" }),
|
|
602
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "19", r: "1" })
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
function ce() {
|
|
608
|
+
return /* @__PURE__ */ d(
|
|
609
|
+
"svg",
|
|
610
|
+
{
|
|
611
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
612
|
+
width: "24",
|
|
613
|
+
height: "24",
|
|
614
|
+
viewBox: "0 0 24 24",
|
|
615
|
+
fill: "none",
|
|
616
|
+
stroke: "currentColor",
|
|
617
|
+
"stroke-width": "2",
|
|
618
|
+
"stroke-linecap": "round",
|
|
619
|
+
"stroke-linejoin": "round",
|
|
620
|
+
class: "lucide lucide-panel-bottom-icon lucide-panel-bottom",
|
|
621
|
+
children: [
|
|
622
|
+
/* @__PURE__ */ n("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
623
|
+
/* @__PURE__ */ n("path", { d: "M3 15h18" })
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
function de() {
|
|
629
|
+
return /* @__PURE__ */ d(
|
|
630
|
+
"svg",
|
|
631
|
+
{
|
|
632
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
633
|
+
width: "24",
|
|
634
|
+
height: "24",
|
|
635
|
+
viewBox: "0 0 24 24",
|
|
636
|
+
fill: "none",
|
|
637
|
+
stroke: "currentColor",
|
|
638
|
+
"stroke-width": "2",
|
|
639
|
+
"stroke-linecap": "round",
|
|
640
|
+
"stroke-linejoin": "round",
|
|
641
|
+
class: "lucide lucide-panel-left-icon lucide-panel-left",
|
|
642
|
+
children: [
|
|
643
|
+
/* @__PURE__ */ n("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
644
|
+
/* @__PURE__ */ n("path", { d: "M9 3v18" })
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
function ue() {
|
|
650
|
+
return /* @__PURE__ */ d(
|
|
651
|
+
"svg",
|
|
652
|
+
{
|
|
653
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
654
|
+
width: "24",
|
|
655
|
+
height: "24",
|
|
656
|
+
viewBox: "0 0 24 24",
|
|
657
|
+
fill: "none",
|
|
658
|
+
stroke: "currentColor",
|
|
659
|
+
"stroke-width": "2",
|
|
660
|
+
"stroke-linecap": "round",
|
|
661
|
+
"stroke-linejoin": "round",
|
|
662
|
+
class: "lucide lucide-panel-right-icon lucide-panel-right",
|
|
663
|
+
children: [
|
|
664
|
+
/* @__PURE__ */ n("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
665
|
+
/* @__PURE__ */ n("path", { d: "M15 3v18" })
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
function pe() {
|
|
671
|
+
return /* @__PURE__ */ d(
|
|
672
|
+
"svg",
|
|
673
|
+
{
|
|
674
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
675
|
+
width: "24",
|
|
676
|
+
height: "24",
|
|
677
|
+
viewBox: "0 0 24 24",
|
|
678
|
+
fill: "none",
|
|
679
|
+
stroke: "currentColor",
|
|
680
|
+
"stroke-width": "2",
|
|
681
|
+
"stroke-linecap": "round",
|
|
682
|
+
"stroke-linejoin": "round",
|
|
683
|
+
class: "lucide lucide-panel-top-icon lucide-panel-top",
|
|
684
|
+
children: [
|
|
685
|
+
/* @__PURE__ */ n("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
686
|
+
/* @__PURE__ */ n("path", { d: "M3 9h18" })
|
|
687
|
+
]
|
|
688
|
+
}
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
function he() {
|
|
692
|
+
return /* @__PURE__ */ d(
|
|
693
|
+
"svg",
|
|
694
|
+
{
|
|
695
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
696
|
+
width: "24",
|
|
697
|
+
height: "24",
|
|
698
|
+
viewBox: "0 0 24 24",
|
|
699
|
+
fill: "none",
|
|
700
|
+
stroke: "currentColor",
|
|
701
|
+
"stroke-width": "2",
|
|
702
|
+
"stroke-linecap": "round",
|
|
703
|
+
"stroke-linejoin": "round",
|
|
704
|
+
class: "lucide lucide-x-icon lucide-x",
|
|
705
|
+
children: [
|
|
706
|
+
/* @__PURE__ */ n("path", { d: "M18 6 6 18" }),
|
|
707
|
+
/* @__PURE__ */ n("path", { d: "m6 6 12 12" })
|
|
708
|
+
]
|
|
709
|
+
}
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
function S({
|
|
713
|
+
title: t,
|
|
714
|
+
active: e,
|
|
715
|
+
icon: o,
|
|
716
|
+
onClick: r
|
|
717
|
+
}) {
|
|
718
|
+
return /* @__PURE__ */ n(
|
|
719
|
+
"button",
|
|
720
|
+
{
|
|
721
|
+
title: t,
|
|
722
|
+
onClick: r,
|
|
723
|
+
class: () => `w-[22px] h-[22px] flex items-center justify-center rounded-md text-[11px] cursor-pointer transition-colors duration-150 ${(typeof e == "function" ? e() : e) ? "text-accent bg-soft color-white" : "text-subtle hover:color-muted hover:bg-section"}`,
|
|
724
|
+
children: /* @__PURE__ */ n(o, {})
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
const _ = 180, be = 300, E = 240, ge = 380, xe = {
|
|
729
|
+
bottom: ce,
|
|
730
|
+
top: pe,
|
|
731
|
+
left: de,
|
|
732
|
+
right: ue
|
|
733
|
+
};
|
|
734
|
+
function me({ plugins: t, registry: e, onClose: o }) {
|
|
735
|
+
const r = b(t[0]?.id ?? ""), i = b("bottom"), a = b(!1), l = b(be), s = b(ge);
|
|
736
|
+
return /* @__PURE__ */ d(
|
|
737
|
+
"div",
|
|
738
|
+
{
|
|
739
|
+
class: () => {
|
|
740
|
+
const c = i();
|
|
741
|
+
return c === "top" ? "flex flex-col-reverse fixed top-0 left-0 w-full z-[2147483647]" : c === "left" ? "flex flex-row-reverse fixed left-0 top-0 h-screen z-[2147483647]" : c === "right" ? "flex fixed right-0 top-0 h-screen z-[2147483647]" : "flex flex-col fixed bottom-0 left-0 w-full z-[2147483647]";
|
|
742
|
+
},
|
|
743
|
+
children: [
|
|
744
|
+
/* @__PURE__ */ n(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
class: () => {
|
|
748
|
+
const c = i();
|
|
749
|
+
return c === "bottom" || c === "top" ? "h-1 cursor-[ns-resize] bg-transparent hover:bg-accent transition-colors duration-200" : "w-1 cursor-[ew-resize] bg-transparent hover:bg-accent transition-colors duration-200";
|
|
750
|
+
},
|
|
751
|
+
onMouseDown: (c) => {
|
|
752
|
+
c.preventDefault();
|
|
753
|
+
const h = c.clientX, p = c.clientY, x = i(), m = x === "bottom" || x === "top" ? l() : s(), D = (w) => {
|
|
754
|
+
const y = i();
|
|
755
|
+
y === "bottom" ? l.set(
|
|
756
|
+
Math.max(
|
|
757
|
+
_,
|
|
758
|
+
Math.min(
|
|
759
|
+
window.innerHeight * 0.85,
|
|
760
|
+
m + (p - w.clientY)
|
|
761
|
+
)
|
|
762
|
+
)
|
|
763
|
+
) : y === "top" ? l.set(
|
|
764
|
+
Math.max(
|
|
765
|
+
_,
|
|
766
|
+
Math.min(
|
|
767
|
+
window.innerHeight * 0.85,
|
|
768
|
+
m + (w.clientY - p)
|
|
769
|
+
)
|
|
770
|
+
)
|
|
771
|
+
) : y === "left" ? s.set(
|
|
772
|
+
Math.max(
|
|
773
|
+
E,
|
|
774
|
+
Math.min(
|
|
775
|
+
window.innerWidth * 0.6,
|
|
776
|
+
m + (w.clientX - h)
|
|
777
|
+
)
|
|
778
|
+
)
|
|
779
|
+
) : s.set(
|
|
780
|
+
Math.max(
|
|
781
|
+
E,
|
|
782
|
+
Math.min(
|
|
783
|
+
window.innerWidth * 0.6,
|
|
784
|
+
m + (h - w.clientX)
|
|
785
|
+
)
|
|
786
|
+
)
|
|
787
|
+
);
|
|
788
|
+
}, $ = () => {
|
|
789
|
+
document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", $);
|
|
790
|
+
};
|
|
791
|
+
document.addEventListener("mousemove", D), document.addEventListener("mouseup", $);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
),
|
|
795
|
+
/* @__PURE__ */ n(
|
|
796
|
+
"div",
|
|
797
|
+
{
|
|
798
|
+
class: () => {
|
|
799
|
+
const c = i();
|
|
800
|
+
return c === "top" ? "w-full h-full bg-bg border-b border-border" : c === "left" ? "w-full h-full bg-bg border-r border-border" : c === "right" ? "w-full h-full bg-bg border-l border-border" : "w-full h-full bg-bg border-t border-border";
|
|
801
|
+
},
|
|
802
|
+
style: () => {
|
|
803
|
+
const c = i();
|
|
804
|
+
return c === "bottom" || c === "top" ? { height: `${l().toString()}px` } : { width: `${s().toString()}px` };
|
|
805
|
+
},
|
|
806
|
+
children: /* @__PURE__ */ d("div", { class: "flex flex-col flex-1 w-full h-full overflow-hidden", children: [
|
|
807
|
+
/* @__PURE__ */ d("div", { class: "flex h-10 items-stretch border-b border-border bg-header shrink-0 px-2 gap-[2px]", children: [
|
|
808
|
+
/* @__PURE__ */ d("div", { class: "flex items-center gap-[6px] pr-3 mr-[2px] border-r border-border shrink-0", children: [
|
|
809
|
+
/* @__PURE__ */ n("img", { class: "h-[13px] w-[13px]", src: N }),
|
|
810
|
+
/* @__PURE__ */ n("span", { class: "text-[10px] font-bold text-accent tracking-widest uppercase", children: "praxisjs" })
|
|
811
|
+
] }),
|
|
812
|
+
/* @__PURE__ */ n("div", { class: "flex items-stretch flex-1", children: t.map((c) => /* @__PURE__ */ d(
|
|
813
|
+
"button",
|
|
814
|
+
{
|
|
815
|
+
class: () => r() === c.id ? "relative flex items-center px-3 text-[11px] font-semibold text-accent cursor-pointer" : "flex items-center px-3 text-[11px] text-muted cursor-pointer hover:text-text transition-colors duration-150",
|
|
816
|
+
onClick: () => {
|
|
817
|
+
r.set(c.id);
|
|
818
|
+
},
|
|
819
|
+
children: [
|
|
820
|
+
c.label,
|
|
821
|
+
() => r() === c.id ? /* @__PURE__ */ n("span", { class: "absolute bottom-0 left-0 right-0 h-[2px] bg-accent" }) : null
|
|
822
|
+
]
|
|
823
|
+
},
|
|
824
|
+
c.id
|
|
825
|
+
)) }),
|
|
826
|
+
/* @__PURE__ */ d("div", { class: "flex items-center gap-[2px] shrink-0", children: [
|
|
827
|
+
/* @__PURE__ */ d("div", { class: "relative", children: [
|
|
828
|
+
/* @__PURE__ */ n(
|
|
829
|
+
S,
|
|
830
|
+
{
|
|
831
|
+
title: "Dock position",
|
|
832
|
+
icon: le,
|
|
833
|
+
active: () => a(),
|
|
834
|
+
onClick: () => {
|
|
835
|
+
a.set(!a());
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
() => a() ? /* @__PURE__ */ n("div", { class: "absolute right-0 top-full mt-1 flex gap-[2px] bg-bg border border-border rounded-md shadow-lg p-1 z-10", children: ["bottom", "top", "left", "right"].map(
|
|
840
|
+
(c) => /* @__PURE__ */ n(
|
|
841
|
+
S,
|
|
842
|
+
{
|
|
843
|
+
title: `Dock ${c}`,
|
|
844
|
+
active: () => i() === c,
|
|
845
|
+
icon: xe[c],
|
|
846
|
+
onClick: () => {
|
|
847
|
+
i.set(c), a.set(!1);
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
c
|
|
851
|
+
)
|
|
852
|
+
) }) : null
|
|
853
|
+
] }),
|
|
854
|
+
/* @__PURE__ */ n("div", { class: "w-px h-3 bg-border mx-1" }),
|
|
855
|
+
/* @__PURE__ */ n(S, { title: "Close", icon: he, onClick: o })
|
|
856
|
+
] })
|
|
857
|
+
] }),
|
|
858
|
+
/* @__PURE__ */ n("div", { class: "flex-1 overflow-hidden flex flex-col", children: () => {
|
|
859
|
+
const h = t.find((p) => p.id === r())?.component;
|
|
860
|
+
return h ? /* @__PURE__ */ n(h, { registry: e }) : null;
|
|
861
|
+
} })
|
|
862
|
+
] })
|
|
863
|
+
}
|
|
864
|
+
)
|
|
865
|
+
]
|
|
866
|
+
}
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
const fe = [
|
|
870
|
+
ee,
|
|
871
|
+
J,
|
|
872
|
+
se
|
|
873
|
+
];
|
|
874
|
+
function B({
|
|
875
|
+
plugins: t,
|
|
876
|
+
registry: e
|
|
877
|
+
}) {
|
|
878
|
+
const o = b(!1);
|
|
879
|
+
return /* @__PURE__ */ n("div", { children: () => o() ? /* @__PURE__ */ n(
|
|
880
|
+
me,
|
|
881
|
+
{
|
|
882
|
+
plugins: t,
|
|
883
|
+
registry: e,
|
|
884
|
+
onClose: () => {
|
|
885
|
+
o.set(!1);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
) : /* @__PURE__ */ d(
|
|
889
|
+
"button",
|
|
890
|
+
{
|
|
891
|
+
onClick: () => {
|
|
892
|
+
o.set(!0);
|
|
893
|
+
},
|
|
894
|
+
class: "fixed bottom-5 right-5 z-[2147483647] flex items-center gap-1 pl-[10px] pr-[14px] h-[32px] rounded-xl font-sans font-semibold text-[12px] text-accent bg-header border border-border cursor-pointer select-none shadow-[0_8px_32px_rgba(0,0,0,0.7)] transition-all duration-200 hover:border-accent hover:bg-soft hover:shadow-[0_8px_32px_rgba(56,189,248,0.1)]",
|
|
895
|
+
children: [
|
|
896
|
+
/* @__PURE__ */ n("img", { class: "h-[13px] w-[13px]", src: N }),
|
|
897
|
+
/* @__PURE__ */ n("span", { class: "text-[10px] font-bold text-accent tracking-widest uppercase", children: "devtools" })
|
|
898
|
+
]
|
|
899
|
+
}
|
|
900
|
+
) });
|
|
901
|
+
}
|
|
902
|
+
const Se = {
|
|
903
|
+
plugins: [...fe],
|
|
904
|
+
host: null,
|
|
905
|
+
cleanup: null,
|
|
906
|
+
init(t = {}) {
|
|
907
|
+
if (this.host) return;
|
|
908
|
+
t.plugins && (this.plugins = t.plugins), this.plugins.forEach((a) => a.setup?.(g.instance));
|
|
909
|
+
const e = document.createElement("div");
|
|
910
|
+
e.id = "praxisjs-devtools", document.body.appendChild(e), this.host = e;
|
|
911
|
+
const o = e.attachShadow({ mode: "open" }), r = document.createElement("style");
|
|
912
|
+
r.textContent = ae + F, o.appendChild(r);
|
|
913
|
+
const i = document.createElement("div");
|
|
914
|
+
o.appendChild(i), this.cleanup = j(
|
|
915
|
+
/* @__PURE__ */ n(B, { plugins: this.plugins, registry: g.instance }),
|
|
916
|
+
i
|
|
917
|
+
);
|
|
918
|
+
},
|
|
919
|
+
registerPlugin(t) {
|
|
920
|
+
this.plugins.find((e) => e.id === t.id) || (t.setup?.(g.instance), this.plugins.push(t), this.remount());
|
|
921
|
+
},
|
|
922
|
+
get registry() {
|
|
923
|
+
return g.instance;
|
|
924
|
+
},
|
|
925
|
+
remount() {
|
|
926
|
+
if (!this.host) return;
|
|
927
|
+
const e = this.host.shadowRoot.querySelector("div:last-child");
|
|
928
|
+
this.cleanup?.(), this.cleanup = j(
|
|
929
|
+
/* @__PURE__ */ n(B, { plugins: this.plugins, registry: g.instance }),
|
|
930
|
+
e
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
function we(t) {
|
|
935
|
+
return typeof t == "function" && typeof t.subscribe == "function" && !("set" in t);
|
|
936
|
+
}
|
|
937
|
+
function Ce(t = {}) {
|
|
938
|
+
return function(e, o, r) {
|
|
939
|
+
const i = e.constructor.name, a = t.label ?? o;
|
|
940
|
+
if (r && typeof r.value == "function") {
|
|
941
|
+
const u = r.value;
|
|
942
|
+
r.value = function(...c) {
|
|
943
|
+
const h = performance.now();
|
|
944
|
+
let p, x = !1;
|
|
945
|
+
try {
|
|
946
|
+
p = u.apply(this, c);
|
|
947
|
+
} catch (m) {
|
|
948
|
+
throw x = !0, p = m, m;
|
|
949
|
+
} finally {
|
|
950
|
+
const m = performance.now() - h;
|
|
951
|
+
g.instance.recordMethodCall(
|
|
952
|
+
this,
|
|
953
|
+
a,
|
|
954
|
+
c,
|
|
955
|
+
x ? `throw ${String(p)}` : p,
|
|
956
|
+
m,
|
|
957
|
+
i
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
return p;
|
|
961
|
+
};
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
const l = Object.getOwnPropertyDescriptor(e, o);
|
|
965
|
+
if (l?.get && l.set) {
|
|
966
|
+
const u = l.get.bind(l), c = l.set.bind(l), h = /* @__PURE__ */ new WeakSet();
|
|
967
|
+
Object.defineProperty(e, o, {
|
|
968
|
+
get() {
|
|
969
|
+
return u.call(this);
|
|
970
|
+
},
|
|
971
|
+
set(p) {
|
|
972
|
+
if (!h.has(this))
|
|
973
|
+
h.add(this), c.call(this, p), g.instance.registerSignal(
|
|
974
|
+
this,
|
|
975
|
+
a,
|
|
976
|
+
p,
|
|
977
|
+
i
|
|
978
|
+
);
|
|
979
|
+
else {
|
|
980
|
+
const x = u.call(this);
|
|
981
|
+
c.call(this, p), g.instance.updateSignal(this, a, p, x);
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
enumerable: !0,
|
|
985
|
+
configurable: !0
|
|
986
|
+
});
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
const s = /* @__PURE__ */ new WeakMap();
|
|
990
|
+
Object.defineProperty(e, o, {
|
|
991
|
+
get() {
|
|
992
|
+
return s.get(this)?.computed;
|
|
993
|
+
},
|
|
994
|
+
set(u) {
|
|
995
|
+
if (s.get(this)?.unsub(), !we(u)) {
|
|
996
|
+
console.warn(
|
|
997
|
+
`[PraxisJS DevTools] @Debug() on "${i}.${o}": expected a computed() value but got ${typeof u}. Skipping.`
|
|
998
|
+
);
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
let c = !0, h = u();
|
|
1002
|
+
const p = u.subscribe((x) => {
|
|
1003
|
+
if (c) {
|
|
1004
|
+
c = !1;
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
g.instance.updateSignal(this, a, x, h), h = x;
|
|
1008
|
+
});
|
|
1009
|
+
s.set(this, { computed: u, unsub: p }), g.instance.registerSignal(this, a, h, i);
|
|
1010
|
+
},
|
|
1011
|
+
enumerable: !0,
|
|
1012
|
+
configurable: !0
|
|
1013
|
+
});
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
function Ie() {
|
|
1017
|
+
return function(t) {
|
|
1018
|
+
const e = t.name, o = g.instance, r = t.prototype, i = r.render;
|
|
1019
|
+
i && (r.render = function(...s) {
|
|
1020
|
+
const u = performance.now(), c = i.call(this, ...s), h = performance.now() - u;
|
|
1021
|
+
return o.recordRender(this, h), c;
|
|
1022
|
+
});
|
|
1023
|
+
const a = r.onBeforeMount;
|
|
1024
|
+
r.onBeforeMount = function(...s) {
|
|
1025
|
+
return o.registerComponent(this, e), o.recordLifecycle(this, "onBeforeMount"), a?.call(this, ...s);
|
|
1026
|
+
};
|
|
1027
|
+
const l = [
|
|
1028
|
+
"onMount",
|
|
1029
|
+
"onUnmount",
|
|
1030
|
+
"onBeforeUpdate",
|
|
1031
|
+
"onUpdate",
|
|
1032
|
+
"onAfterUpdate"
|
|
1033
|
+
];
|
|
1034
|
+
for (const s of l) {
|
|
1035
|
+
const u = r[s];
|
|
1036
|
+
r[s] = function(...c) {
|
|
1037
|
+
return o.recordLifecycle(this, s), u?.call(this, ...c);
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
return t;
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
export {
|
|
1044
|
+
J as ComponentsPlugin,
|
|
1045
|
+
Ce as Debug,
|
|
1046
|
+
Se as DevTools,
|
|
1047
|
+
g as Registry,
|
|
1048
|
+
ee as SignalsPlugin,
|
|
1049
|
+
se as TimelinePlugin,
|
|
1050
|
+
Ie as Trace
|
|
1051
|
+
};
|