@lipsjs/lips 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import type Lips from './lips';
2
- import type { Handler, Metavars, ComponentScope, ComponentOptions, VariableSet, RenderedNode, FGUDependencies } from '.';
2
+ import type { Handler, Metavars, ComponentScope, ComponentOptions, VariableSet, RenderedNode, FGUDependencies } from './types';
3
3
  import Events from './events';
4
4
  import Metrics from './metrics';
5
5
  import { Cash } from 'cash-dom';
@@ -40,7 +40,7 @@ export default class Component<MT extends Metavars> extends Events {
40
40
  private __pathCounter;
41
41
  private __renderDepth;
42
42
  [key: string]: any;
43
- constructor(name: string, template: string, { input, state, context, _static, handler, stylesheet, macros, declaration }: ComponentScope<MT>, options: ComponentOptions);
43
+ constructor(name: string, template: string, { input, state, context, _static, handler, stylesheet, macros, declaration }: ComponentScope<MT>, options: ComponentOptions<any>);
44
44
  setContext(arg: Partial<Record<string, any>> | string, value?: any): void;
45
45
  setInput(input: MT['Input']): void;
46
46
  /**
@@ -1,4 +1,4 @@
1
- import { Metavars } from '.';
1
+ import { Metavars } from './types';
2
2
  import type Component from './component';
3
3
  /**
4
4
  * DOM Watch Service
@@ -1,4 +1,4 @@
1
- import type { EventListener } from '.';
1
+ import type { EventListener } from './types';
2
2
  export type EventOptions = {
3
3
  emit?: boolean;
4
4
  };
@@ -1,3 +1,3 @@
1
- import type { I18nFormat } from '..';
1
+ import type { I18nFormat } from '../types';
2
2
  declare const _default: (type: string, reference: string, value: I18nFormat["value"], params: Record<string, any>, variant?: string) => string | undefined;
3
3
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { Dictionary } from '..';
1
+ import type { Dictionary } from '../types';
2
2
  export default class I18N {
3
3
  private currentLang;
4
4
  private DICTIONARIES;
@@ -1,9 +1,10 @@
1
- import type { LipsConfig, Template, Metavars } from '.';
1
+ import type { LipsConfig, Template, Metavars } from './types';
2
2
  import I18N from './i18n';
3
3
  import IUC from './iuc';
4
4
  import DWS from './dws';
5
5
  import Component from './component';
6
6
  import Stylesheet from './stylesheet';
7
+ export * from './types';
7
8
  export default class Lips<Context extends Object = {}> {
8
9
  debug: boolean;
9
10
  stylesheets: Stylesheet[];
@@ -1,4 +1,4 @@
1
- import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate, VariableSet } from '..';
1
+ import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate, VariableSet } from '../types';
2
2
  export interface Input {
3
3
  await: Promise<any>;
4
4
  then: MeshTemplate;
@@ -1,4 +1,4 @@
1
- import type { Declaration, Handler, Metavars, MeshRenderer } from '..';
1
+ import type { Declaration, Handler, Metavars, MeshRenderer } from '../types';
2
2
  export interface Input {
3
3
  in: Record<string, any> | any[];
4
4
  from?: number;
@@ -1,4 +1,4 @@
1
- import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate } from '..';
1
+ import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate } from '../types';
2
2
  export interface Input {
3
3
  by: boolean;
4
4
  renderer?: MeshRenderer;
@@ -1,4 +1,4 @@
1
- import type { Handler, Metavars, Template } from '..';
1
+ import type { Handler, Metavars, Template } from '../types';
2
2
  type RouteDef<MT extends Metavars> = {
3
3
  path: string;
4
4
  template: Template<MT>;
@@ -1,4 +1,4 @@
1
- import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate } from '..';
1
+ import type { Declaration, Handler, Metavars, MeshRenderer, MeshTemplate } from '../types';
2
2
  export interface Input {
3
3
  by: string;
4
4
  case: (MeshTemplate & {
@@ -0,0 +1,174 @@
1
+ import type { Cash } from 'cash-dom';
2
+ import type Lips from './lips';
3
+ import type Component from './component';
4
+ export interface Metavars<Input extends Object = {}, State extends Object = {}, Static extends Object = {}, Context extends Object = {}> {
5
+ Input: Input;
6
+ State: State;
7
+ Static: Static;
8
+ Context: Context;
9
+ }
10
+ export interface InteractiveMetavars<MT extends Metavars = Metavars> {
11
+ input: MT['Input'];
12
+ state: MT['State'];
13
+ context: MT['Context'];
14
+ }
15
+ export type Variable = {
16
+ value: any;
17
+ type: 'let' | 'const' | 'arg';
18
+ };
19
+ export type VariableSet = Record<string, Variable>;
20
+ export type I18nVariant = Record<string, string>;
21
+ export type I18nFormat = {
22
+ type: string;
23
+ value: string | I18nVariant | Record<string, string | I18nVariant>;
24
+ };
25
+ export type Dictionary = Record<string, string | I18nFormat | I18nVariant>;
26
+ export type DeclarationTagType = 'nexted' | 'child';
27
+ export type DeclarationTag = {
28
+ type: DeclarationTagType;
29
+ many?: boolean;
30
+ optional?: boolean;
31
+ };
32
+ export type Declaration = {
33
+ name: string;
34
+ syntax?: boolean;
35
+ iterator?: boolean;
36
+ contents?: boolean;
37
+ tags?: Record<string, DeclarationTag>;
38
+ };
39
+ export type LifeCycleEventTypes = 'onCreate' | 'onInput' | 'onMount' | 'onRender' | 'onUpdate' | 'onAttach' | 'onDetach' | 'onContext' | 'onDestroy';
40
+ export interface LifecycleEvents<MT extends Metavars> {
41
+ onCreate: (this: Component<MT>) => void;
42
+ onInput: (this: Component<MT>, input: MT['Input']) => void;
43
+ onMount: (this: Component<MT>) => void;
44
+ onRender: (this: Component<MT>) => void;
45
+ onUpdate: (this: Component<MT>) => void;
46
+ onAttach: (this: Component<MT>) => void;
47
+ onDetach: (this: Component<MT>) => void;
48
+ onContext: (this: Component<MT>) => void;
49
+ onDestroy: (this: Component<MT>) => void;
50
+ }
51
+ export type Handler<MT extends Metavars> = Partial<LifecycleEvents<MT>> & {
52
+ [K in string as K extends keyof LifecycleEvents<MT> ? never : K]?: (this: Component<MT>, ...args: any[]) => void;
53
+ };
54
+ export type Template<MT extends Metavars> = {
55
+ default?: string;
56
+ state?: MT['State'];
57
+ _static?: MT['Static'];
58
+ context?: string[];
59
+ macros?: string;
60
+ handler?: Handler<MT>;
61
+ stylesheet?: string;
62
+ declaration?: Declaration;
63
+ };
64
+ export type DynamicTemplate<MT extends Metavars> = {
65
+ name?: string;
66
+ template?: Template<MT>;
67
+ };
68
+ export type ComponentScope<MT extends Metavars> = {
69
+ input?: MT['Input'];
70
+ state?: MT['State'];
71
+ context?: MT['Context'];
72
+ _static?: MT['Static'];
73
+ macros?: string;
74
+ handler?: Handler<MT>;
75
+ stylesheet?: string;
76
+ declaration?: Declaration;
77
+ };
78
+ export type ComponentOptions<Context extends Object> = {
79
+ lips: Lips<Context>;
80
+ debug?: boolean;
81
+ prepath?: string;
82
+ };
83
+ export type LipsConfig<Context extends Object> = {
84
+ debug?: boolean;
85
+ context?: Context;
86
+ stylesheets?: string[];
87
+ };
88
+ export type StyleSettings = {
89
+ sheet?: string;
90
+ meta?: boolean;
91
+ custom?: {
92
+ enabled: boolean;
93
+ allowedRules: string[];
94
+ allowedProperties: string[];
95
+ };
96
+ };
97
+ export type EventListener = (...args: any[]) => void;
98
+ export type Macro = {
99
+ argv: string[];
100
+ $node: Cash;
101
+ };
102
+ export type SyntaxAttributes = {
103
+ literals: Record<string, any>;
104
+ functions: Record<string, any>;
105
+ expressions: Record<string, any>;
106
+ };
107
+ export type VirtualEvent = {
108
+ $fragment: Cash;
109
+ _event: string;
110
+ instruction: string;
111
+ scope?: Record<string, any>;
112
+ };
113
+ export type VirtualEventsRegistry<T> = {
114
+ element: Cash | T;
115
+ _event: string;
116
+ };
117
+ /**
118
+ * (FGU) Fine-Grain Update Dependencies
119
+ */
120
+ export interface FGUSync {
121
+ memo?: VariableSet;
122
+ cleanup?: () => void;
123
+ }
124
+ export interface I18nDependency {
125
+ path: string;
126
+ $fragment: Cash;
127
+ memo: VariableSet;
128
+ update: (memo: VariableSet, by?: string) => FGUSync | void;
129
+ }
130
+ export interface FGUDependency {
131
+ path: string;
132
+ $fragment: Cash | null;
133
+ boundaries?: FragmentBoundaries;
134
+ haslet?: boolean;
135
+ batch?: boolean;
136
+ syntax?: boolean;
137
+ partial?: string[];
138
+ memo: VariableSet;
139
+ update: (memo: VariableSet, by?: string) => FGUSync | void;
140
+ }
141
+ export type FGUDependencies = Map<string, Map<string, FGUDependency>>;
142
+ export type FGUDBatchEntry = {
143
+ dep: string;
144
+ dependent: FGUDependency;
145
+ };
146
+ export type RenderedNode = {
147
+ $log: Cash;
148
+ dependencies: FGUDependencies;
149
+ events?: VirtualEvent[];
150
+ };
151
+ export type FragmentBoundaries = {
152
+ start: Comment;
153
+ end: Comment;
154
+ };
155
+ export interface MeshRenderer {
156
+ path: string | null;
157
+ argv: string[];
158
+ mesh(argvalues?: VariableSet): Cash | null;
159
+ update(deps: string[], argvalues: VariableSet, boundaries?: FragmentBoundaries): void;
160
+ }
161
+ export type MeshTemplate = Record<string, any> & {
162
+ renderer: MeshRenderer;
163
+ };
164
+ export interface MeshWireSetup {
165
+ argv: string[];
166
+ scope: VariableSet;
167
+ declaration?: Declaration;
168
+ useAttributes: boolean;
169
+ xmlns?: boolean;
170
+ $node: Cash;
171
+ meshPath: string | null;
172
+ fragmentPath: string;
173
+ fragmentBoundaries: FragmentBoundaries;
174
+ }
@@ -1,4 +1,4 @@
1
- import type { FGUDBatchEntry, Metavars } from '.';
1
+ import type { FGUDBatchEntry, Metavars } from './types';
2
2
  import type Component from './component';
3
3
  /**
4
4
  * Update Queue System for high-frequency DOM updates
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@lipsjs/lips",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Fast, Lightweight Reactive UI Framework",
5
5
  "main": "./dist/lips.min.js",
6
+ "types": "./dist/types/lips.d.ts",
6
7
  "files": [
7
- "dist/",
8
- "*.d.ts",
9
- "dist/types/**/*"
8
+ "dist/**/*"
10
9
  ],
11
10
  "exports": {
12
11
  ".": {
13
12
  "import": "./dist/lips.min.js",
14
- "require": "./dist/lips.min.js"
13
+ "require": "./dist/lips.min.js",
14
+ "types": "./dist/types/lips.d.ts"
15
15
  }
16
16
  },
17
17
  "author": "Fabrice K.E.M",
@@ -19,7 +19,7 @@
19
19
  "scripts": {
20
20
  "dev": "bun compile --watch",
21
21
  "compile": "bun build --entrypoints ./test/* ./src/lips.ts --entry-naming [name].min.[ext] --minify --root . --outdir ./dist --target browser --format esm --sourcemap=external",
22
- "build:declaration": "tsc --project tsconfig.types.json && cp ./src/index.d.ts ./dist/types/index.d.ts",
22
+ "build:declaration": "tsc --project tsconfig.types.json",
23
23
  "prepack": "bun compile && bun run build:declaration",
24
24
  "test": "Echo 'Error: No test specified' && exit 1"
25
25
  },
@@ -1,48 +0,0 @@
1
- export interface BenchmarkMetrics {
2
- renderCount: number;
3
- elementCount: number;
4
- renderTime: number;
5
- avgRenderTime: number;
6
- maxRenderTime: number;
7
- componentCount: number;
8
- componentUpdateCount: number;
9
- partialCount: number;
10
- partialUpdateCount: number;
11
- memoryUsage?: number;
12
- domOperations: number;
13
- domInsertsCount: number;
14
- domUpdatesCount: number;
15
- domRemovalsCount: number;
16
- dependencyTrackCount: number;
17
- dependencyUpdateCount: number;
18
- batchSize: number;
19
- batchCount: number;
20
- errorCount: number;
21
- }
22
- export default class Benchmark {
23
- private debug;
24
- private initialStats;
25
- stats: BenchmarkMetrics;
26
- private renderStartTime;
27
- private renderTimes;
28
- private measurementCount;
29
- private maxMeasurements;
30
- private loggingInterval;
31
- private autoSaveInterval?;
32
- constructor(debug?: boolean);
33
- private storeMetrics;
34
- startRender(): void;
35
- endRender(): void;
36
- inc(metric: keyof BenchmarkMetrics): void;
37
- dec(metric: keyof BenchmarkMetrics): void;
38
- record(metric: keyof BenchmarkMetrics, value: number): void;
39
- add(metric: keyof BenchmarkMetrics, value: number): void;
40
- reset(): any;
41
- log(): void;
42
- trackMemory(): void;
43
- trackBatch(size: number): void;
44
- trackError(error: Error): void;
45
- setLoggingInterval(interval: number): void;
46
- getSnapshot(): BenchmarkMetrics;
47
- dispose(): void;
48
- }
@@ -1,15 +0,0 @@
1
- import type { LanguageDictionary } from '.';
2
- export default class I18N {
3
- private default;
4
- private LANGUAGE_DICTIONARIES;
5
- setLang(lang: string): boolean;
6
- setDictionary(id: string, dico: LanguageDictionary): void;
7
- /**
8
- *
9
- */
10
- translate(text: string, lang?: string): {
11
- text: string;
12
- lang: string;
13
- };
14
- format(key: string, params: Record<string, any>, lang?: string): string;
15
- }
@@ -1,182 +0,0 @@
1
- import type Lips from '.'
2
- import type Component from './component'
3
-
4
- export interface Metavars<Input extends Object = {}, State extends Object = {}, Static extends Object = {}, Context extends Object = {}> {
5
- Input: Input
6
- State: State
7
- Static: Static
8
- Context: Context
9
- }
10
- export interface InteractiveMetavars<MT extends Metavars = Metavars> {
11
- input: MT['Input']
12
- state: MT['State']
13
- context: MT['Context']
14
- }
15
- export type Variable = {
16
- value: any
17
- type: 'let' | 'const' | 'arg'
18
- }
19
- export type VariableSet = Record<string, Variable>
20
-
21
- export type I18nVariant = Record<string, string>
22
- export type I18nFormat = {
23
- type: string
24
- value: string | I18nVariant | Record<string, string | I18nVariant>
25
- }
26
- export type Dictionary = Record<string, string | I18nFormat | I18nVariant>
27
-
28
- export type DeclarationTagType = 'nexted' | 'child'
29
- export type DeclarationTag = {
30
- type: DeclarationTagType
31
- many?: boolean
32
- optional?: boolean
33
- }
34
- export type Declaration = {
35
- name: string
36
- syntax?: boolean
37
- iterator?: boolean
38
- contents?: boolean
39
- tags?: Record<string, DeclarationTag>
40
- }
41
-
42
- export interface Handler<MT extends Metavars> {
43
- onCreate?: ( this: Component<MT> ) => void
44
- onInput?: ( this: Component<MT>, input: MT['Input'] ) => void
45
- onMount?: ( this: Component<MT> ) => void
46
- onRender?: ( this: Component<MT> ) => void
47
- onUpdate?: ( this: Component<MT> ) => void
48
- onAttach?: ( this: Component<MT> ) => void
49
- onDetach?: ( this: Component<MT> ) => void
50
- onContext?: ( this: Component<MT> ) => void
51
-
52
- [method: string]: ( this: Component<MT>, ...args: any[] ) => void
53
- }
54
- export type Template<MT extends Metavars> = {
55
- default?: string
56
- state?: MT['State']
57
- _static?: MT['Static']
58
- context?: string[]
59
- macros?: string
60
- handler?: Handler<MT>
61
- stylesheet?: string
62
- declaration?: Declaration
63
- }
64
- export type DynamicTemplate<MT extends Metavars> = {
65
- name?: string,
66
- template?: Template<MT>
67
- }
68
- export type ComponentScope<MT extends Metavars> = {
69
- input?: MT['Input']
70
- state?: MT['State']
71
- context?: MT['Context']
72
- _static?: MT['Static']
73
- macros?: string
74
- handler?: Handler<MT>
75
- stylesheet?: string
76
- declaration?: Declaration
77
- }
78
- export type ComponentOptions = {
79
- lips: Lips
80
- debug?: boolean
81
- prepath?: string
82
- }
83
- export type LipsConfig<Context extends Object> = {
84
- debug?: boolean
85
- context?: Context
86
- stylesheets?: string[]
87
- }
88
- export type StyleSettings = {
89
- sheet?: string
90
- meta?: boolean
91
- custom?: {
92
- enabled: boolean
93
- allowedRules: string[]
94
- allowedProperties: string[]
95
- }
96
- }
97
- export type EventListener = ( ...args: any[] ) => void
98
-
99
- export type Macro = {
100
- argv: string[]
101
- $node: Cash
102
- }
103
-
104
- export type SyntaxAttributes = {
105
- literals: Record<string, any>
106
- functions: Record<string, any>
107
- expressions: Record<string, any>
108
- }
109
-
110
- export type VirtualEvent = {
111
- $fragment: Cash
112
- _event: string
113
- instruction: string
114
- scope?: Record<string, any>
115
- }
116
- export type VirtualEventsRegistry<T> = {
117
- element: Cash | T
118
- _event: string
119
- }
120
-
121
- /**
122
- * (FGU) Fine-Grain Update Dependencies
123
- */
124
- export interface FGUSync {
125
- // $fragment?: Cash
126
- memo?: VariableSet
127
- cleanup?: () => void
128
- }
129
- export interface I18nDependency {
130
- $fragment: Cash
131
- memo: VariableSet
132
- update: ( memo: VariableSet, by?: string ) => FGUSync | void
133
- }
134
- export interface FGUDependency {
135
- path: string
136
- $fragment: Cash | null
137
- boundaries?: FragmentBoundaries
138
- haslet?: boolean
139
- batch?: boolean
140
- syntax?: boolean
141
- partial?: string[]
142
- memo: VariableSet
143
- update: ( memo: VariableSet, by?: string ) => FGUSync | void
144
- }
145
- export type FGUDependencies = Map<string, Map<string, FGUDependency>>
146
- export type FGUDBatchEntry = {
147
- dep: string
148
- dependent: FGUDependency
149
- }
150
-
151
- export type RenderedNode = {
152
- $log: Cash
153
- dependencies: FGUDependencies
154
- events?: VirtualEvent[]
155
- }
156
- export type FragmentBoundaries = {
157
- start: Comment
158
- end: Comment
159
- }
160
-
161
- export interface MeshRenderer {
162
- path: string | null
163
- argv: string[]
164
- mesh( argvalues?: VariableSet ): Cash
165
- update( deps: string[], argvalues: VariableSet, boundaries?: FragmentBoundaries ): Cash
166
- }
167
- export type MeshTemplate = Record<string, any> & {
168
- renderer: MeshRenderer
169
- }
170
- export interface MeshWireSetup {
171
- argv: string[] = []
172
- scope: VariableSet = {}
173
- declaration?: Declaration
174
- useAttributes: boolean
175
- xmlns?: boolean
176
-
177
- $node: Cash
178
- meshPath: string | null
179
-
180
- fragmentPath: string
181
- fragmentBoundaries: FragmentBoundaries
182
- }
@@ -1,31 +0,0 @@
1
- import type { Handler, Metavars } from '..';
2
- /**
3
- * Performance Dashboard
4
- */
5
- export interface Input {
6
- }
7
- export interface State {
8
- metricsHistory: Array<{
9
- timestamp: number;
10
- metrics: any;
11
- }>;
12
- activeTab: string;
13
- isVisible: boolean;
14
- }
15
- export interface Static {
16
- refreshInterval: number;
17
- keyboardShortcut: string;
18
- }
19
- export declare const state: {
20
- metricsHistory: never[];
21
- activeTab: string;
22
- isVisible: boolean;
23
- };
24
- export declare const _static: {
25
- refreshInterval: number;
26
- keyboardShortcut: string;
27
- };
28
- export declare const handler: Handler<Metavars<Input, State, Static>>;
29
- declare const _default: "\n <div class=\"perf-dashboard\" style=\"{ display: state.isVisible ? 'block' : 'none' }\">\n <div class=\"perf-dashboard-header\">\n <h3 class=\"perf-dashboard-title\">Lips Performance Dashboard</h3>\n <div class=\"perf-dashboard-controls\">\n <button class=\"clear\" on-click(clearMetrics)>Clear</button>\n <button on-click(toggleVisibility)>Close</button>\n </div>\n </div>\n \n <div class=\"perf-dashboard-tabs\">\n <button class=\"perf-dashboard-tab {state.activeTab === 'rendering' ? 'active' : ''}\" \n on-click(setActiveTab, 'rendering')>Rendering</button>\n <button class=\"perf-dashboard-tab {state.activeTab === 'components' ? 'active' : ''}\" \n on-click(setActiveTab, 'components')>Components</button>\n <button class=\"perf-dashboard-tab {state.activeTab === 'dom' ? 'active' : ''}\" \n on-click(setActiveTab, 'dom')>DOM</button>\n <button class=\"perf-dashboard-tab {state.activeTab === 'memory' ? 'active' : ''}\" \n on-click(setActiveTab, 'memory')>Memory</button>\n </div>\n \n <!-- Rendering Tab -->\n <div style=\"{ display: state.activeTab === 'rendering' ? 'block' : 'none' }\">\n <div class=\"perf-dashboard-chart\">\n <for [point, i] in=state.metricsHistory.slice(-30)>\n <div class=\"perf-dashboard-chart-bar render-avg\" \n style=\"{ height: (point.metrics.avgRenderTime * 2)+'px', left: (i * (100/30))+'%' }\"></div>\n <div class=\"perf-dashboard-chart-bar render-max\" \n style=\"{ height: (point.metrics.maxRenderTime * 2)+'px', left: (i * (100/30))+'%' }\"></div>\n </for>\n <div class=\"perf-dashboard-legend\">Render Time (ms): Avg (green), Max (orange)</div>\n </div>\n \n <table class=\"perf-dashboard-metrics\">\n <tr>\n <th>Metric</th>\n <th>Value</th>\n </tr>\n\n <if( state.metricsHistory.length > 0 )>\n <let latest=self.getLatestMetrics()/>\n\n <tr>\n <td>Avg Render Time</td>\n <td>{self.getLatestMetrics()?.avgRenderTime.toFixed(2)} ms</td>\n </tr>\n <tr>\n <td>Max Render Time</td>\n <td>{self.getLatestMetrics()?.maxRenderTime.toFixed(2)} ms</td>\n </tr>\n <tr>\n <td>Render Count</td>\n <td>{self.getLatestMetrics()?.renderCount}</td>\n </tr>\n <tr>\n <td>Element Count</td>\n <td>{self.getLatestMetrics()?.elementCount}</td>\n </tr>\n </if>\n </table>\n </div>\n \n <!-- Components Tab -->\n <div style=\"{ display: state.activeTab === 'components' ? 'block' : 'none' }\">\n <div class=\"perf-dashboard-chart\">\n <for [point, i] in=state.metricsHistory.slice(-30)>\n <div class=\"perf-dashboard-chart-bar component-updates\" \n style=\"{ height: (point.metrics.componentUpdateCount)+'px', left: (i * (100/30))+'%' }\"></div>\n </for>\n <div class=\"perf-dashboard-legend\">Component Updates</div>\n </div>\n \n <table class=\"perf-dashboard-metrics\">\n <tr>\n <th>Metric</th>\n <th>Value</th>\n </tr>\n\n <if( state.metricsHistory.length > 0 )>\n <let latest=self.getLatestMetrics()/>\n <tr>\n <td>Component Count</td>\n <td>{latest?.componentCount}</td>\n </tr>\n <tr>\n <td>Component Updates</td>\n <td>{latest?.componentUpdateCount}</td>\n </tr>\n <tr>\n <td>Dependency Tracks</td>\n <td>{latest?.dependencyTrackCount}</td>\n </tr>\n <tr>\n <td>Dependency Updates</td>\n <td>{latest?.dependencyUpdateCount}</td>\n </tr>\n </if>\n </table>\n </div>\n \n <!-- DOM Tab -->\n <div style=\"{ display: state.activeTab === 'dom' ? 'block' : 'none' }\">\n <div class=\"perf-dashboard-chart\">\n <for [point, i] in=state.metricsHistory.slice(-30)>\n <div class=\"perf-dashboard-chart-bar dom-ops\" \n style=\"{ height: (point.metrics.domOperations / 5)+'px', left: (i * (100/30))+'%' }\"></div>\n </for>\n <div class=\"perf-dashboard-legend\">DOM Operations</div>\n </div>\n \n <table class=\"perf-dashboard-metrics\">\n <tr>\n <th>Metric</th>\n <th>Value</th>\n </tr>\n\n <if( state.metricsHistory.length > 0 )>\n <let latest=\"self.getLatestMetrics()\"/>\n <tr>\n <td>DOM Operations</td>\n <td>{latest?.domOperations}</td>\n </tr>\n <tr>\n <td>DOM Inserts</td>\n <td>{latest?.domInsertsCount}</td>\n </tr>\n <tr>\n <td>DOM Updates</td>\n <td>{latest?.domUpdatesCount}</td>\n </tr>\n <tr>\n <td>DOM Removals</td>\n <td>{latest?.domRemovalsCount}</td>\n </tr>\n </if>\n </table>\n </div>\n \n <!-- Memory Tab -->\n <div style=\"{ display: state.activeTab === 'memory' ? 'block' : 'none' }\">\n <div class=\"perf-dashboard-chart\">\n <for [point, i] in=state.metricsHistory.slice(-30)>\n <div class=\"perf-dashboard-chart-bar memory\" \n style=\"{ height: (point.metrics.memoryUsage ? point.metrics.memoryUsage * 2 : 0)+'px', left: (i * (100/30))+'%' }\"></div>\n </for>\n <div class=\"perf-dashboard-legend\">Memory Usage (MB)</div>\n </div>\n \n <table class=\"perf-dashboard-metrics\">\n <tr>\n <th>Metric</th>\n <th>Value</th>\n </tr>\n\n <if( state.metricsHistory.length > 0 )>\n <let latest=\"self.getLatestMetrics()\"/>\n <tr>\n <td>Memory Usage</td>\n <td>{latest?.memoryUsage ? latest.memoryUsage.toFixed(2) + ' MB' : 'N/A'}</td>\n </tr>\n <tr>\n <td>Batch Count</td>\n <td>{latest?.batchCount}</td>\n </tr>\n <tr>\n <td>Average Batch Size</td>\n <td>{latest?.batchCount > 0 ? (latest.batchSize / latest.batchCount).toFixed(2) : '0'}</td>\n </tr>\n <tr>\n <td>Error Count</td>\n <td>{latest?.errorCount}</td>\n </tr>\n </if>\n </table>\n </div>\n \n <div class=\"perf-dashboard-footer\">\n Press Ctrl+Shift+{static.keyboardShortcut} to toggle dashboard\n </div>\n </div>\n";
30
- export default _default;
31
- export declare const stylesheet = "\n .perf-dashboard {\n position: fixed;\n bottom: 0;\n right: 0;\n width: 400px;\n max-height: 400px;\n background: rgba(0, 0, 0, 0.85);\n color: white;\n padding: 10px;\n border-top-left-radius: 8px;\n z-index: 9999;\n font-family: monospace;\n overflow: auto;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);\n }\n \n .perf-dashboard-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n border-bottom: 1px solid #444;\n padding-bottom: 5px;\n }\n \n .perf-dashboard-title {\n margin: 0; \n font-size: 14px;\n font-weight: bold;\n }\n \n .perf-dashboard-controls button {\n background: #555;\n color: white;\n border: none;\n border-radius: 3px;\n padding: 3px 8px;\n font-size: 10px;\n cursor: pointer;\n margin-left: 5px;\n }\n \n .perf-dashboard-controls button.clear {\n background: #f44336;\n }\n \n .perf-dashboard-tabs {\n display: flex;\n margin-bottom: 10px;\n }\n \n .perf-dashboard-tab {\n flex: 1;\n border: none;\n padding: 5px;\n font-size: 12px;\n cursor: pointer;\n border-radius: 0;\n background: #555;\n color: white;\n }\n \n .perf-dashboard-tab.active {\n background: #4CAF50;\n }\n \n .perf-dashboard-tab:first-child {\n border-radius: 3px 0 0 3px;\n }\n \n .perf-dashboard-tab:last-child {\n border-radius: 0 3px 3px 0;\n }\n \n .perf-dashboard-chart {\n height: 150px;\n background: #222;\n margin-bottom: 10px;\n position: relative;\n border: 1px solid #444;\n }\n \n .perf-dashboard-chart-bar {\n position: absolute;\n width: 2px;\n bottom: 0;\n transform: translateX(-50%);\n }\n \n .perf-dashboard-chart-bar.render-avg {\n background: #4CAF50;\n }\n \n .perf-dashboard-chart-bar.render-max {\n background: #FF5722;\n }\n \n .perf-dashboard-chart-bar.component-updates {\n background: #2196F3;\n }\n \n .perf-dashboard-chart-bar.dom-ops {\n background: #9C27B0;\n }\n \n .perf-dashboard-chart-bar.memory {\n background: #FFC107;\n }\n \n .perf-dashboard-legend {\n position: absolute;\n bottom: 5px;\n left: 5px;\n font-size: 10px;\n color: #aaa;\n }\n \n .perf-dashboard-metrics {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n }\n \n .perf-dashboard-metrics th {\n text-align: left;\n padding: 4px;\n border-bottom: 1px solid #444;\n }\n \n .perf-dashboard-metrics td {\n padding: 3px;\n border-bottom: 1px solid #333;\n }\n \n .perf-dashboard-metrics td:last-child {\n text-align: right;\n }\n \n .perf-dashboard-footer {\n font-size: 10px;\n margin-top: 10px;\n text-align: center;\n color: #888;\n }\n";