@praxisjs/devtools 0.2.33 → 0.3.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 +40 -0
- package/assets/uno.generated.css +5 -0
- package/dist/assets/logo.svg.js +4 -0
- package/dist/assets/tailwind-v4.css.js +4 -0
- package/dist/assets/uno.generated.css.js +4 -0
- package/dist/core/event-bus.js +21 -0
- package/dist/core/profiler.js +79 -0
- package/dist/core/registry.js +147 -0
- package/dist/decorators/debug.js +126 -0
- package/dist/decorators/trace.js +45 -0
- package/dist/icons/ellipsis-vertical.js +38 -0
- package/dist/icons/panel-bottom.js +28 -0
- package/dist/icons/panel-left.js +28 -0
- package/dist/icons/panel-right.js +28 -0
- package/dist/icons/panel-top.js +28 -0
- package/dist/icons/x.js +22 -0
- package/dist/index.d.ts +96 -3
- package/dist/index.js +10 -1157
- package/dist/plugins/components/components/component-detail.js +53 -0
- package/dist/plugins/components/components/component-row.js +22 -0
- package/dist/plugins/components/components/detail-row.js +15 -0
- package/dist/plugins/components/components/detail-section.js +14 -0
- package/dist/plugins/components/components/status-dot.js +15 -0
- package/dist/plugins/components/components-tab.js +54 -0
- package/dist/plugins/components/index.js +9 -0
- package/dist/plugins/performance/index.js +9 -0
- package/dist/plugins/performance/performance-tab.js +62 -0
- package/dist/plugins/signals/components/signal-detail.js +29 -0
- package/dist/plugins/signals/components/signal-row.js +17 -0
- package/dist/plugins/signals/index.js +9 -0
- package/dist/plugins/signals/signals-tab.js +53 -0
- package/dist/plugins/timeline/components/badge.js +16 -0
- package/dist/plugins/timeline/components/timeline-row.js +33 -0
- package/dist/plugins/timeline/constants.js +54 -0
- package/dist/plugins/timeline/index.js +9 -0
- package/dist/plugins/timeline/timeline-tab.js +46 -0
- package/dist/ui/dev-tools.js +74 -0
- package/dist/ui/panel.js +106 -0
- package/dist/ui/shared/empty-state.js +14 -0
- package/dist/ui/shared/icon-button.js +17 -0
- package/dist/ui/shared/panel-section.js +14 -0
- package/dist/ui/shared/search-input.js +17 -0
- package/dist/ui/shared/side-panel.js +15 -0
- package/dist/utils/format-time.js +7 -0
- package/dist/utils/format-value.js +14 -0
- package/package.json +14 -6
- package/src/core/profiler.ts +162 -0
- package/src/core/registry.ts +23 -21
- package/src/decorators/debug.ts +96 -32
- package/src/decorators/index.ts +1 -0
- package/src/decorators/trace.ts +27 -4
- package/src/index.ts +5 -0
- package/src/plugins/performance/index.ts +9 -0
- package/src/plugins/performance/performance-tab.tsx +111 -0
- package/src/ui/dev-tools.tsx +5 -0
- package/src/__tests__/debug.test.ts +0 -333
- package/src/__tests__/event-bus.test.ts +0 -123
- package/src/__tests__/format-time.test.ts +0 -52
- package/src/__tests__/format-value.test.ts +0 -46
- package/src/__tests__/plugins.test.ts +0 -101
- package/src/__tests__/registry.test.ts +0 -386
- package/src/__tests__/trace.test.ts +0 -200
- package/tsconfig.json +0 -21
- package/uno.config.ts +0 -57
- package/vite.config.ts +0 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @praxisjs/devtools
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 75115a9: DevTools: a Performance panel and `profiler` that record signal writes, effect runs and computed recomputations with their cost, grouped by the component that created each effect; `@Debug({ log, break })`, reactive observation of accessor fields (props included), promise-aware method timing, `@Trace({ slow })`, inert decorators in production builds, and a faster registry. Core exposes the observer hooks the profiler uses (`setReactiveObserver`, `setCurrentOwner`, `getEffectOwner` in `@praxisjs/core/internal`), which cost one null check while no observer is installed; the runtime marks the rendering component as the owner of the effects it creates.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 75115a9: Published packages no longer contain their tests: package builds compile `src` without `src/**/__tests__` (through a `tsconfig.build.json`), and each package's `files` leaves test sources and stale compiled tests out of the tarball. `pnpm typecheck` still type-checks the tests.
|
|
12
|
+
- 75115a9: Smaller production bundles. The framework and feature packages are marked `"sideEffects": false`, so bundlers leave out the modules an app does not use (`For`/`Index` and `selector()` were kept in every bundle by their shape keepers). `@praxisjs/core`'s graph gates its observer instrumentation on a boolean that minifiers fold away when no observer is ever installed. `@praxisjs/runtime` passes `Index`'s positional update to the list view, so `For`-only apps leave it out, and builds its event prop table from camel-case names. `@praxisjs/devtools` is built one file per module and its decorators check `process.env.NODE_ENV` inline, so `@Trace`/`@Debug` in production code no longer bundle the registry and the panel. `@praxisjs/vite-plugin` serves TypeScript's decorator helpers and the claimed fields' helper from one virtual module (`virtual:praxisjs/decorators`) instead of writing them into every decorated file, and replaces the identical copies `tsc` wrote into ES module libraries.
|
|
13
|
+
- Updated dependencies [75115a9]
|
|
14
|
+
- Updated dependencies [75115a9]
|
|
15
|
+
- Updated dependencies [75115a9]
|
|
16
|
+
- Updated dependencies [75115a9]
|
|
17
|
+
- Updated dependencies [75115a9]
|
|
18
|
+
- Updated dependencies [75115a9]
|
|
19
|
+
- Updated dependencies [75115a9]
|
|
20
|
+
- Updated dependencies [75115a9]
|
|
21
|
+
- Updated dependencies [75115a9]
|
|
22
|
+
- Updated dependencies [75115a9]
|
|
23
|
+
- Updated dependencies [75115a9]
|
|
24
|
+
- Updated dependencies [75115a9]
|
|
25
|
+
- Updated dependencies [75115a9]
|
|
26
|
+
- Updated dependencies [75115a9]
|
|
27
|
+
- Updated dependencies [75115a9]
|
|
28
|
+
- Updated dependencies [75115a9]
|
|
29
|
+
- @praxisjs/decorators@2.0.0
|
|
30
|
+
- @praxisjs/runtime@0.8.0
|
|
31
|
+
- @praxisjs/core@2.3.0
|
|
32
|
+
- @praxisjs/jsx@0.8.0
|
|
33
|
+
- @praxisjs/shared@0.3.2
|
|
34
|
+
|
|
35
|
+
## 0.2.34
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [7720b22]
|
|
40
|
+
- @praxisjs/runtime@0.7.1
|
|
41
|
+
- @praxisjs/jsx@0.7.7
|
|
42
|
+
|
|
3
43
|
## 0.2.33
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/assets/uno.generated.css
CHANGED
|
@@ -53,12 +53,15 @@
|
|
|
53
53
|
.z-10{z-index:10;}
|
|
54
54
|
.grid{display:grid;}
|
|
55
55
|
.grid-cols-\[1\.2fr_0\.8fr_1fr_auto\]{grid-template-columns:1.2fr 0.8fr 1fr auto;}
|
|
56
|
+
.grid-cols-\[1\.4fr_0\.6fr_0\.8fr_0\.8fr\]{grid-template-columns:1.4fr 0.6fr 0.8fr 0.8fr;}
|
|
57
|
+
.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr));}
|
|
56
58
|
.m6{margin:1.5rem;}
|
|
57
59
|
.mx-1{margin-left:0.25rem;margin-right:0.25rem;}
|
|
58
60
|
.mr-\[2px\]{margin-right:2px;}
|
|
59
61
|
.ms{margin-inline-start:1rem;}
|
|
60
62
|
.mt-1{margin-top:0.25rem;}
|
|
61
63
|
.box-border{box-sizing:border-box;}
|
|
64
|
+
.inline{display:inline;}
|
|
62
65
|
.inline-block{display:inline-block;}
|
|
63
66
|
.h-\[13px\]{height:13px;}
|
|
64
67
|
.h-\[22px\]{height:22px;}
|
|
@@ -108,6 +111,7 @@
|
|
|
108
111
|
.gap-1{gap:0.25rem;}
|
|
109
112
|
.gap-2{gap:0.5rem;}
|
|
110
113
|
.gap-3{gap:0.75rem;}
|
|
114
|
+
.gap-px{gap:1px;}
|
|
111
115
|
.overflow-hidden{overflow:hidden;}
|
|
112
116
|
.overflow-y-auto{overflow-y:auto;}
|
|
113
117
|
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
@@ -168,6 +172,7 @@
|
|
|
168
172
|
.text-\[10px\]{font-size:10px;}
|
|
169
173
|
.text-\[11px\]{font-size:11px;}
|
|
170
174
|
.text-\[12px\]{font-size:12px;}
|
|
175
|
+
.text-\[13px\]{font-size:13px;}
|
|
171
176
|
.text-\[20px\]{font-size:20px;}
|
|
172
177
|
.text-\[9px\]{font-size:9px;}
|
|
173
178
|
.text-\[\#0ea57a\]{--un-text-opacity:1;color:rgb(14 165 122 / var(--un-text-opacity)) /* #0ea57a */;}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region assets/logo.svg
|
|
2
|
+
var e = "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";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../../node_modules/.pnpm/@unocss+reset@66.6.7/node_modules/@unocss/reset/tailwind-v4.css?inline
|
|
2
|
+
var e = "*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region assets/uno.generated.css?inline
|
|
2
|
+
var e = "*,:before,:after,::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 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--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;font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;display:block}*{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:0 0}::-webkit-scrollbar-thumb{background:#9b90e633;border-radius:2px}::-webkit-scrollbar-thumb:hover{background:#9b90e666}.container{width:100%}@media (width>=640px){.container{max-width:640px}}@media (width>=768px){.container{max-width:768px}}@media (width>=1024px){.container{max-width:1024px}}@media (width>=1280px){.container{max-width:1280px}}@media (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}.grid-cols-\\[1\\.4fr_0\\.6fr_0\\.8fr_0\\.8fr\\]{grid-template-columns:1.4fr .6fr .8fr .8fr}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.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{display:inline}.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,.h1{height:.25rem}.h-10{height:2.5rem}.h-3,.h3{height:.75rem}.h-7{height:1.75rem}.h-full{height:100%}.h-screen{height:100vh}.h2{height:.5rem}.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}.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}.gap-px{gap:1px}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.b,.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:#0000}.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-\\[13px\\]{font-size:13px}.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)}.tab{tab-size:4}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color,#0000001a),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color,#0000001a);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,#000000b3);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,#0000001a),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color,#0000001a);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,#38bdf81a);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.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-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/core/event-bus.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
handlers = /* @__PURE__ */ new Map();
|
|
4
|
+
on(e, t) {
|
|
5
|
+
return this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set()), this.handlers.get(e).add(t), () => this.handlers.get(e)?.delete(t);
|
|
6
|
+
}
|
|
7
|
+
emit(e, t) {
|
|
8
|
+
let n = this.handlers.get(e);
|
|
9
|
+
if (!n) return;
|
|
10
|
+
let r = [];
|
|
11
|
+
for (let e of n) try {
|
|
12
|
+
e(t);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
r.push(e);
|
|
15
|
+
}
|
|
16
|
+
if (r.length === 1) throw r[0];
|
|
17
|
+
if (r.length > 1) throw AggregateError(r, "Multiple event handler errors");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as EventBus };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { EventBus as e } from "./event-bus.js";
|
|
2
|
+
import { setReactiveObserver as t } from "@praxisjs/core/internal";
|
|
3
|
+
//#region src/core/profiler.ts
|
|
4
|
+
var n = "(no component)", r = class {
|
|
5
|
+
bus = new e();
|
|
6
|
+
recording = !1;
|
|
7
|
+
startedAt = 0;
|
|
8
|
+
stoppedAt = 0;
|
|
9
|
+
writes = 0;
|
|
10
|
+
effectRuns = 0;
|
|
11
|
+
effectMs = 0;
|
|
12
|
+
computeRuns = 0;
|
|
13
|
+
computeMs = 0;
|
|
14
|
+
byOwner = /* @__PURE__ */ new Map();
|
|
15
|
+
previous = null;
|
|
16
|
+
notifyScheduled = !1;
|
|
17
|
+
mutedDepth = 0;
|
|
18
|
+
get isRecording() {
|
|
19
|
+
return this.recording;
|
|
20
|
+
}
|
|
21
|
+
muted(e) {
|
|
22
|
+
this.mutedDepth++;
|
|
23
|
+
try {
|
|
24
|
+
return e();
|
|
25
|
+
} finally {
|
|
26
|
+
this.mutedDepth--;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
start() {
|
|
30
|
+
this.recording || (this.reset(), this.recording = !0, this.startedAt = performance.now(), this.previous = t(this), this.changed());
|
|
31
|
+
}
|
|
32
|
+
stop() {
|
|
33
|
+
this.recording && (this.recording = !1, this.stoppedAt = performance.now(), t(this.previous), this.previous = null, this.changed());
|
|
34
|
+
}
|
|
35
|
+
reset() {
|
|
36
|
+
this.writes = 0, this.effectRuns = 0, this.effectMs = 0, this.computeRuns = 0, this.computeMs = 0, this.byOwner.clear(), this.startedAt = this.stoppedAt = performance.now(), this.changed();
|
|
37
|
+
}
|
|
38
|
+
write(e) {
|
|
39
|
+
this.mutedDepth > 0 || (this.writes++, this.changed());
|
|
40
|
+
}
|
|
41
|
+
compute(e, t) {
|
|
42
|
+
this.mutedDepth > 0 || (this.computeRuns++, this.computeMs += t, this.changed());
|
|
43
|
+
}
|
|
44
|
+
effect(e, t, r) {
|
|
45
|
+
if (this.mutedDepth > 0) return;
|
|
46
|
+
this.effectRuns++, this.effectMs += t;
|
|
47
|
+
let i = this.byOwner.get(r);
|
|
48
|
+
i === void 0 && (i = {
|
|
49
|
+
name: r === void 0 ? n : r.constructor.name,
|
|
50
|
+
effectRuns: 0,
|
|
51
|
+
effectMs: 0,
|
|
52
|
+
maxMs: 0
|
|
53
|
+
}, this.byOwner.set(r, i)), i.effectRuns++, i.effectMs += t, t > i.maxMs && (i.maxMs = t), this.changed();
|
|
54
|
+
}
|
|
55
|
+
snapshot() {
|
|
56
|
+
let e = /* @__PURE__ */ new Map();
|
|
57
|
+
for (let t of this.byOwner.values()) {
|
|
58
|
+
let n = e.get(t.name);
|
|
59
|
+
n === void 0 ? e.set(t.name, { ...t }) : (n.effectRuns += t.effectRuns, n.effectMs += t.effectMs, n.maxMs = Math.max(n.maxMs, t.maxMs));
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
recording: this.recording,
|
|
63
|
+
duration: (this.recording ? performance.now() : this.stoppedAt) - this.startedAt,
|
|
64
|
+
writes: this.writes,
|
|
65
|
+
effectRuns: this.effectRuns,
|
|
66
|
+
effectMs: this.effectMs,
|
|
67
|
+
computeRuns: this.computeRuns,
|
|
68
|
+
computeMs: this.computeMs,
|
|
69
|
+
owners: [...e.values()].sort((e, t) => t.effectMs - e.effectMs || t.effectRuns - e.effectRuns)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
changed() {
|
|
73
|
+
this.notifyScheduled || (this.notifyScheduled = !0, setTimeout(() => {
|
|
74
|
+
this.notifyScheduled = !1, this.bus.emit("profile:changed", null);
|
|
75
|
+
}, 0));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { r as Profiler };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { EventBus as e } from "./event-bus.js";
|
|
2
|
+
import { Profiler as t } from "./profiler.js";
|
|
3
|
+
//#region src/core/registry.ts
|
|
4
|
+
var n = 20, r = 200, i = 0;
|
|
5
|
+
function a() {
|
|
6
|
+
return `v${(++i).toString()}_${Date.now().toString(36)}`;
|
|
7
|
+
}
|
|
8
|
+
var o = class i {
|
|
9
|
+
static _instance = null;
|
|
10
|
+
static get instance() {
|
|
11
|
+
return i._instance ??= new i(), i._instance;
|
|
12
|
+
}
|
|
13
|
+
bus = new e();
|
|
14
|
+
profiler = new t();
|
|
15
|
+
instanceIds = /* @__PURE__ */ new WeakMap();
|
|
16
|
+
signals = /* @__PURE__ */ new Map();
|
|
17
|
+
signalsByComponent = /* @__PURE__ */ new Map();
|
|
18
|
+
components = /* @__PURE__ */ new Map();
|
|
19
|
+
timeline = [];
|
|
20
|
+
getInstanceId(e) {
|
|
21
|
+
return this.instanceIds.has(e) || this.instanceIds.set(e, a()), this.instanceIds.get(e);
|
|
22
|
+
}
|
|
23
|
+
registerSignal(e, t, n, r) {
|
|
24
|
+
let i = this.getInstanceId(e), a = `${i}:${t}`, o = {
|
|
25
|
+
id: a,
|
|
26
|
+
label: t,
|
|
27
|
+
componentId: i,
|
|
28
|
+
componentName: r,
|
|
29
|
+
value: n,
|
|
30
|
+
history: [{
|
|
31
|
+
value: n,
|
|
32
|
+
timestamp: Date.now()
|
|
33
|
+
}],
|
|
34
|
+
changedAt: Date.now()
|
|
35
|
+
};
|
|
36
|
+
this.signals.set(a, o);
|
|
37
|
+
let s = this.signalsByComponent.get(i);
|
|
38
|
+
s === void 0 && (s = /* @__PURE__ */ new Set(), this.signalsByComponent.set(i, s)), s.add(a), this.bus.emit("signal:registered", o);
|
|
39
|
+
}
|
|
40
|
+
updateSignal(e, t, r, i) {
|
|
41
|
+
let a = `${this.getInstanceId(e)}:${t}`, o = this.signals.get(a);
|
|
42
|
+
if (!o) return;
|
|
43
|
+
let s = Date.now();
|
|
44
|
+
o.history.push({
|
|
45
|
+
value: r,
|
|
46
|
+
timestamp: s
|
|
47
|
+
}), o.history.length > n && o.history.shift(), o.value = r, o.changedAt = s, this.bus.emit("signal:changed", {
|
|
48
|
+
entry: o,
|
|
49
|
+
oldValue: i
|
|
50
|
+
}), this.pushTimeline({
|
|
51
|
+
type: "signal:change",
|
|
52
|
+
label: `${o.componentName}.${t}`,
|
|
53
|
+
data: {
|
|
54
|
+
old: i,
|
|
55
|
+
new: r,
|
|
56
|
+
signalId: a
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
registerComponent(e, t) {
|
|
61
|
+
let n = this.getInstanceId(e), r = {
|
|
62
|
+
id: n,
|
|
63
|
+
name: t,
|
|
64
|
+
renderCount: 0,
|
|
65
|
+
lastRenderDuration: 0,
|
|
66
|
+
mountedAt: Date.now(),
|
|
67
|
+
status: "mounted",
|
|
68
|
+
lifecycle: []
|
|
69
|
+
};
|
|
70
|
+
this.components.set(n, r), this.bus.emit("component:registered", r);
|
|
71
|
+
}
|
|
72
|
+
recordRender(e, t) {
|
|
73
|
+
let n = this.getInstanceId(e), r = this.components.get(n);
|
|
74
|
+
r && (r.renderCount++, r.lastRenderDuration = t, this.bus.emit("component:render", { ...r }), this.pushTimeline({
|
|
75
|
+
type: "component:render",
|
|
76
|
+
label: `<${r.name}>`,
|
|
77
|
+
data: {
|
|
78
|
+
componentId: n,
|
|
79
|
+
duration: +t.toFixed(3),
|
|
80
|
+
renderCount: r.renderCount
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
recordLifecycle(e, t) {
|
|
85
|
+
let n = this.getInstanceId(e), r = this.components.get(n);
|
|
86
|
+
if (!r) return;
|
|
87
|
+
let i = {
|
|
88
|
+
hook: t,
|
|
89
|
+
timestamp: Date.now()
|
|
90
|
+
};
|
|
91
|
+
r.lifecycle.push(i), this.bus.emit("lifecycle", {
|
|
92
|
+
componentId: n,
|
|
93
|
+
name: r.name,
|
|
94
|
+
hook: t
|
|
95
|
+
});
|
|
96
|
+
let a = t === "onUnmount" ? "component:unmount" : t === "onBeforeMount" ? "component:mount" : "lifecycle";
|
|
97
|
+
if (this.pushTimeline({
|
|
98
|
+
type: a,
|
|
99
|
+
label: `<${r.name}>.${t}`,
|
|
100
|
+
data: {
|
|
101
|
+
componentId: n,
|
|
102
|
+
hook: t
|
|
103
|
+
}
|
|
104
|
+
}), t === "onUnmount") {
|
|
105
|
+
r.status = "unmounted", this.bus.emit("component:unmount", { ...r }), this.components.delete(n);
|
|
106
|
+
for (let e of this.signalsByComponent.get(n) ?? []) this.signals.delete(e);
|
|
107
|
+
this.signalsByComponent.delete(n);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
recordMethodCall(e, t, n, r, i, a) {
|
|
111
|
+
let o = this.getInstanceId(e);
|
|
112
|
+
this.pushTimeline({
|
|
113
|
+
type: "method:call",
|
|
114
|
+
label: `${a}.${t}()`,
|
|
115
|
+
data: {
|
|
116
|
+
componentId: o,
|
|
117
|
+
args: n,
|
|
118
|
+
result: r,
|
|
119
|
+
duration: +i.toFixed(3)
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
getSignals() {
|
|
124
|
+
return [...this.signals.values()];
|
|
125
|
+
}
|
|
126
|
+
getComponents() {
|
|
127
|
+
return [...this.components.values()];
|
|
128
|
+
}
|
|
129
|
+
getTimeline() {
|
|
130
|
+
return [...this.timeline];
|
|
131
|
+
}
|
|
132
|
+
getSignalsByComponent(e) {
|
|
133
|
+
let t = [];
|
|
134
|
+
for (let n of this.signalsByComponent.get(e) ?? []) t.push(this.signals.get(n));
|
|
135
|
+
return t;
|
|
136
|
+
}
|
|
137
|
+
pushTimeline(e) {
|
|
138
|
+
let t = {
|
|
139
|
+
id: a(),
|
|
140
|
+
timestamp: Date.now(),
|
|
141
|
+
...e
|
|
142
|
+
};
|
|
143
|
+
this.timeline.push(t), this.timeline.length > r && this.timeline.shift(), this.bus.emit("timeline:push", t);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
export { o as Registry };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Registry as e } from "../core/registry.js";
|
|
2
|
+
import { computed as t, effect as n, untrack as r } from "@praxisjs/core/internal";
|
|
3
|
+
import { createFieldDecorator as i, createGetterObserverDecorator as a, createMethodDecorator as o } from "@praxisjs/decorators";
|
|
4
|
+
//#region src/decorators/debug.ts
|
|
5
|
+
function s(e) {
|
|
6
|
+
return typeof e == "function" && typeof e.subscribe == "function" && !("set" in e);
|
|
7
|
+
}
|
|
8
|
+
function c(e) {
|
|
9
|
+
return e.constructor.name;
|
|
10
|
+
}
|
|
11
|
+
function l(e) {
|
|
12
|
+
return (typeof e == "object" || typeof e == "function") && e !== null && typeof e.then == "function";
|
|
13
|
+
}
|
|
14
|
+
function u(e) {
|
|
15
|
+
let { log: t, break: n } = e;
|
|
16
|
+
return !t && !n ? null : (e, i, a) => {
|
|
17
|
+
r(() => {
|
|
18
|
+
if (t === "trace" ? console.trace(`[PraxisJS] ${e}`, i, a) : t && console.log(`[PraxisJS] ${e}`, i, a), n === !0 || typeof n == "function" && n(i, a)) debugger;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function d(d = {}) {
|
|
23
|
+
if (process.env.NODE_ENV === "production") return (() => void 0);
|
|
24
|
+
let f = u(d);
|
|
25
|
+
return function(u, p) {
|
|
26
|
+
let m = d.label ?? p.name;
|
|
27
|
+
if (p.kind === "method") {
|
|
28
|
+
let t = u;
|
|
29
|
+
o({ wrap(n, r, i) {
|
|
30
|
+
return function(...n) {
|
|
31
|
+
let r = c(this);
|
|
32
|
+
f?.(`${r}.${m}()`, n, void 0);
|
|
33
|
+
let i = performance.now(), a = (t) => {
|
|
34
|
+
e.instance.recordMethodCall(this, m, n, t, performance.now() - i, r);
|
|
35
|
+
}, o;
|
|
36
|
+
try {
|
|
37
|
+
o = t.apply(this, n);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
throw a(`throw ${String(e)}`), e;
|
|
40
|
+
}
|
|
41
|
+
return l(o) ? o.then((e) => {
|
|
42
|
+
a(e);
|
|
43
|
+
}, (e) => {
|
|
44
|
+
a(`reject ${String(e)}`);
|
|
45
|
+
}) : a(o), o;
|
|
46
|
+
};
|
|
47
|
+
} })(t, p);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (p.kind === "getter") {
|
|
51
|
+
let n = u;
|
|
52
|
+
a({ observe(n, r, i) {
|
|
53
|
+
let a = c(r);
|
|
54
|
+
queueMicrotask(() => {
|
|
55
|
+
let i = t(() => n.call(r)), o = !0, s = i();
|
|
56
|
+
e.instance.registerSignal(r, m, s, a), i.subscribe((t) => {
|
|
57
|
+
if (o) {
|
|
58
|
+
o = !1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
e.instance.updateSignal(r, m, t, s), f?.(`${a}.${m}`, t, s), s = t;
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
} })(n, p);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
i({ bind(t, i, a) {
|
|
68
|
+
let o = c(t);
|
|
69
|
+
if (Object.getOwnPropertyDescriptor(t, i)?.get !== void 0) {
|
|
70
|
+
let a = () => t[i], s, c = !0;
|
|
71
|
+
return { onUnmount: n(() => {
|
|
72
|
+
let n = a();
|
|
73
|
+
if (c) {
|
|
74
|
+
c = !1, s = n, r(() => {
|
|
75
|
+
e.instance.registerSignal(t, m, n, o);
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (Object.is(n, s)) return;
|
|
80
|
+
let i = s;
|
|
81
|
+
s = n, r(() => {
|
|
82
|
+
e.instance.updateSignal(t, m, n, i);
|
|
83
|
+
}), f?.(`${o}.${m}`, n, i);
|
|
84
|
+
}) };
|
|
85
|
+
}
|
|
86
|
+
let l = a;
|
|
87
|
+
if (!s(l)) return l !== void 0 && console.warn(`[PraxisJS DevTools] @Debug() on "${o}.${i}": expected a computed() value but got ${typeof l}. Skipping.`), {};
|
|
88
|
+
let u;
|
|
89
|
+
function d(n) {
|
|
90
|
+
let r = !0, i = n(), a = n.subscribe((n) => {
|
|
91
|
+
if (r) {
|
|
92
|
+
r = !1;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
e.instance.updateSignal(t, m, n, i), f?.(`${o}.${m}`, n, i), i = n;
|
|
96
|
+
});
|
|
97
|
+
return e.instance.registerSignal(t, m, i, o), a;
|
|
98
|
+
}
|
|
99
|
+
return u = {
|
|
100
|
+
computed: l,
|
|
101
|
+
unsub: d(l)
|
|
102
|
+
}, {
|
|
103
|
+
descriptor: {
|
|
104
|
+
get() {
|
|
105
|
+
return u.computed;
|
|
106
|
+
},
|
|
107
|
+
set(e) {
|
|
108
|
+
if (u.unsub(), !s(e)) {
|
|
109
|
+
console.warn(`[PraxisJS DevTools] @Debug() on "${o}.${i}": expected a computed() value but got ${typeof e}. Skipping.`);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
u = {
|
|
113
|
+
computed: e,
|
|
114
|
+
unsub: d(e)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
onUnmount() {
|
|
119
|
+
u.unsub();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
} })(void 0, p);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { d as Debug };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Registry as e } from "../core/registry.js";
|
|
2
|
+
import { ClassBehavior as t, createClassDecorator as n } from "@praxisjs/decorators";
|
|
3
|
+
//#region src/decorators/trace.ts
|
|
4
|
+
var r = [
|
|
5
|
+
"onBeforeUpdate",
|
|
6
|
+
"onUpdate",
|
|
7
|
+
"onAfterUpdate"
|
|
8
|
+
], i = class extends t {
|
|
9
|
+
slow;
|
|
10
|
+
constructor(e) {
|
|
11
|
+
super(), this.slow = e;
|
|
12
|
+
}
|
|
13
|
+
create(t) {
|
|
14
|
+
let n = e.instance, r = this.slow;
|
|
15
|
+
return {
|
|
16
|
+
onMount() {
|
|
17
|
+
n.recordLifecycle(t, "onMount");
|
|
18
|
+
},
|
|
19
|
+
onUnmount() {
|
|
20
|
+
n.recordLifecycle(t, "onUnmount");
|
|
21
|
+
},
|
|
22
|
+
render(e) {
|
|
23
|
+
let i = performance.now(), a = e(), o = performance.now() - i;
|
|
24
|
+
return n.recordRender(t, o), r !== void 0 && o > r && console.warn(`[PraxisJS DevTools] <${t.constructor.name}> rendered in ${o.toFixed(1)} ms (over ${String(r)} ms).`), a;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
initialize(t, n) {
|
|
29
|
+
let i = n.name, a = e.instance, o = t.prototype, s = o.onBeforeMount;
|
|
30
|
+
o.onBeforeMount = function(...e) {
|
|
31
|
+
return a.registerComponent(this, i), a.recordLifecycle(this, "onBeforeMount"), s?.call(this, ...e);
|
|
32
|
+
};
|
|
33
|
+
for (let e of r) {
|
|
34
|
+
let t = o[e];
|
|
35
|
+
o[e] = function(...n) {
|
|
36
|
+
return a.recordLifecycle(this, e), t?.call(this, ...n);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, a;
|
|
41
|
+
function o(e = {}) {
|
|
42
|
+
return process.env.NODE_ENV === "production" ? (e, t) => e : n(e.slow === void 0 ? a ??= new i(void 0) : new i(e.slow));
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { o as Trace };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { _$element as e, _$template as t } from "@praxisjs/runtime";
|
|
2
|
+
import { StatelessComponent as n } from "@praxisjs/core";
|
|
3
|
+
import { Component as r } from "@praxisjs/decorators";
|
|
4
|
+
//#region src/icons/ellipsis-vertical.tsx
|
|
5
|
+
var i = /* @__PURE__ */ t(() => e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
class: "lucide lucide-ellipsis-vertical-icon lucide-ellipsis-vertical"
|
|
16
|
+
}, [
|
|
17
|
+
e("circle", {
|
|
18
|
+
cx: "12",
|
|
19
|
+
cy: "12",
|
|
20
|
+
r: "1"
|
|
21
|
+
}, null),
|
|
22
|
+
e("circle", {
|
|
23
|
+
cx: "12",
|
|
24
|
+
cy: "5",
|
|
25
|
+
r: "1"
|
|
26
|
+
}, null),
|
|
27
|
+
e("circle", {
|
|
28
|
+
cx: "12",
|
|
29
|
+
cy: "19",
|
|
30
|
+
r: "1"
|
|
31
|
+
}, null)
|
|
32
|
+
])), a = @r() class extends n {
|
|
33
|
+
render() {
|
|
34
|
+
return i();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { a as EllipsisVerticalIcon };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { _$element as e, _$template as t } from "@praxisjs/runtime";
|
|
2
|
+
import { StatelessComponent as n } from "@praxisjs/core";
|
|
3
|
+
import { Component as r } from "@praxisjs/decorators";
|
|
4
|
+
//#region src/icons/panel-bottom.tsx
|
|
5
|
+
var i = /* @__PURE__ */ t(() => e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
class: "lucide lucide-panel-bottom-icon lucide-panel-bottom"
|
|
16
|
+
}, [e("rect", {
|
|
17
|
+
width: "18",
|
|
18
|
+
height: "18",
|
|
19
|
+
x: "3",
|
|
20
|
+
y: "3",
|
|
21
|
+
rx: "2"
|
|
22
|
+
}, null), e("path", { d: "M3 15h18" }, null)])), a = @r() class extends n {
|
|
23
|
+
render() {
|
|
24
|
+
return i();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { a as PanelBottomIcon };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { _$element as e, _$template as t } from "@praxisjs/runtime";
|
|
2
|
+
import { StatelessComponent as n } from "@praxisjs/core";
|
|
3
|
+
import { Component as r } from "@praxisjs/decorators";
|
|
4
|
+
//#region src/icons/panel-left.tsx
|
|
5
|
+
var i = /* @__PURE__ */ t(() => e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
class: "lucide lucide-panel-left-icon lucide-panel-left"
|
|
16
|
+
}, [e("rect", {
|
|
17
|
+
width: "18",
|
|
18
|
+
height: "18",
|
|
19
|
+
x: "3",
|
|
20
|
+
y: "3",
|
|
21
|
+
rx: "2"
|
|
22
|
+
}, null), e("path", { d: "M9 3v18" }, null)])), a = @r() class extends n {
|
|
23
|
+
render() {
|
|
24
|
+
return i();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { a as PanelLeftIcon };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { _$element as e, _$template as t } from "@praxisjs/runtime";
|
|
2
|
+
import { StatelessComponent as n } from "@praxisjs/core";
|
|
3
|
+
import { Component as r } from "@praxisjs/decorators";
|
|
4
|
+
//#region src/icons/panel-right.tsx
|
|
5
|
+
var i = /* @__PURE__ */ t(() => e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
class: "lucide lucide-panel-right-icon lucide-panel-right"
|
|
16
|
+
}, [e("rect", {
|
|
17
|
+
width: "18",
|
|
18
|
+
height: "18",
|
|
19
|
+
x: "3",
|
|
20
|
+
y: "3",
|
|
21
|
+
rx: "2"
|
|
22
|
+
}, null), e("path", { d: "M15 3v18" }, null)])), a = @r() class extends n {
|
|
23
|
+
render() {
|
|
24
|
+
return i();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { a as PanelRightIcon };
|