@jqhtml/core 2.2.222

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -0
  3. package/dist/component-registry.d.ts +64 -0
  4. package/dist/component-registry.d.ts.map +1 -0
  5. package/dist/component.d.ts +336 -0
  6. package/dist/component.d.ts.map +1 -0
  7. package/dist/debug-entry.d.ts +36 -0
  8. package/dist/debug-entry.d.ts.map +1 -0
  9. package/dist/debug-overlay.d.ts +61 -0
  10. package/dist/debug-overlay.d.ts.map +1 -0
  11. package/dist/debug.d.ts +19 -0
  12. package/dist/debug.d.ts.map +1 -0
  13. package/dist/index.cjs +4384 -0
  14. package/dist/index.cjs.map +1 -0
  15. package/dist/index.d.ts +91 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +4347 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/instruction-processor.d.ts +31 -0
  20. package/dist/instruction-processor.d.ts.map +1 -0
  21. package/dist/jqhtml-core.esm.js +4352 -0
  22. package/dist/jqhtml-core.esm.js.map +1 -0
  23. package/dist/jqhtml-debug.esm.js +575 -0
  24. package/dist/jqhtml-debug.esm.js.map +1 -0
  25. package/dist/jquery-plugin.d.ts +30 -0
  26. package/dist/jquery-plugin.d.ts.map +1 -0
  27. package/dist/lifecycle-manager.d.ts +34 -0
  28. package/dist/lifecycle-manager.d.ts.map +1 -0
  29. package/dist/load-coordinator.d.ts +79 -0
  30. package/dist/load-coordinator.d.ts.map +1 -0
  31. package/dist/local-storage.d.ts +147 -0
  32. package/dist/local-storage.d.ts.map +1 -0
  33. package/dist/template-renderer.d.ts +17 -0
  34. package/dist/template-renderer.d.ts.map +1 -0
  35. package/laravel-bridge/README.md +242 -0
  36. package/laravel-bridge/autoload.php +51 -0
  37. package/laravel-bridge/composer.json +34 -0
  38. package/laravel-bridge/config/jqhtml.php +82 -0
  39. package/laravel-bridge/examples/node-integration.js +201 -0
  40. package/laravel-bridge/src/JqhtmlErrorFormatter.php +187 -0
  41. package/laravel-bridge/src/JqhtmlException.php +173 -0
  42. package/laravel-bridge/src/JqhtmlExceptionRenderer.php +93 -0
  43. package/laravel-bridge/src/JqhtmlServiceProvider.php +72 -0
  44. package/laravel-bridge/src/Middleware/JqhtmlErrorMiddleware.php +90 -0
  45. package/laravel-bridge/tests/ExceptionFormattingTest.php +219 -0
  46. package/package.json +74 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 JQHTML Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @jqhtml/core
2
+
3
+ A jQuery-based component framework for people who think in systems, not pixels.
4
+
5
+ ```html
6
+ <Define:User_Card class="card">
7
+ <h3><%= this.data.name %></h3>
8
+ <p><%= this.data.email %></p>
9
+ </Define:User_Card>
10
+ ```
11
+
12
+ Components have a simple lifecycle: `on_load()` fetches data, `on_render()` sets up the DOM, `on_ready()` fires when everything's ready. No virtual DOM, no complex state management - just jQuery under the hood.
13
+
14
+ **vs React/Vue:** JQHTML is for when you want component structure without the SPA complexity. Great for server-rendered apps (Laravel, Rails, Django) where you need interactive islands, not a full frontend framework.
15
+
16
+ ## Status
17
+
18
+ Alpha release. It works and I use it daily, but expect rough edges. Full documentation and framework plugins coming soon.
19
+
20
+ If you try it in a project, I'd love to hear about it.
21
+
22
+ ---
23
+
24
+ **hansonxyz** · [hanson.xyz](https://hanson.xyz/) · [github](https://github.com/hansonxyz)
@@ -0,0 +1,64 @@
1
+ /**
2
+ * JQHTML v2 Component Registry
3
+ *
4
+ * Global registry for component classes and templates
5
+ * Enables dynamic component instantiation and template association
6
+ */
7
+ import { Jqhtml_Component } from './component.js';
8
+ export type TemplateFunction = (this: Jqhtml_Component, data: Record<string, any>, args: Record<string, any>, content: any) => [any[], Jqhtml_Component];
9
+ export interface TemplateDefinition {
10
+ name: string;
11
+ tag: string;
12
+ defaultAttributes?: Record<string, any>;
13
+ extends?: string;
14
+ render: TemplateFunction;
15
+ }
16
+ export type ComponentConstructor = new (args: Record<string, any>, element?: any) => Jqhtml_Component;
17
+ /**
18
+ * Register a component class with optional template
19
+ */
20
+ export declare function register_component(name: string, component_class: ComponentConstructor, template?: TemplateDefinition): void;
21
+ export declare function register_component(component_class: ComponentConstructor): void;
22
+ /**
23
+ * Get a component class by name
24
+ * If no class found, walks the template extends chain to find parent class
25
+ */
26
+ export declare function get_component_class(name: string): ComponentConstructor | undefined;
27
+ /**
28
+ * Register a template - name is extracted from template.name property
29
+ * Returns true if registered, false if duplicate
30
+ */
31
+ export declare function register_template(template_def: TemplateDefinition): boolean;
32
+ /**
33
+ * Get template for a component by name
34
+ */
35
+ export declare function get_template(name: string): TemplateDefinition;
36
+ /**
37
+ * Get template for a component class - walks up inheritance chain
38
+ */
39
+ export declare function get_template_by_class(component_class: ComponentConstructor): TemplateDefinition;
40
+ /**
41
+ * Create a component instance by name
42
+ * If no component class is registered, uses the default Component class
43
+ */
44
+ export declare function create_component(name: string, element?: any, args?: Record<string, any>): Jqhtml_Component;
45
+ /**
46
+ * Check if a component is registered
47
+ */
48
+ export declare function has_component(name: string): boolean;
49
+ /**
50
+ * Get all registered component names
51
+ */
52
+ export declare function get_component_names(): string[];
53
+ /**
54
+ * Get all registered template names
55
+ */
56
+ export declare function get_registered_templates(): string[];
57
+ /**
58
+ * List all registered components with their template status
59
+ */
60
+ export declare function list_components(): Record<string, {
61
+ has_class: boolean;
62
+ has_template: boolean;
63
+ }>;
64
+ //# sourceMappingURL=component-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../src/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,OAAO,EAAE,GAAG,KACT,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAG/B,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAGD,MAAM,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;AAsCtG;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,oBAAoB,EACrC,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,IAAI,CAAC;AACR,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,oBAAoB,GAAG,IAAI,CAAC;AA4ChF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAqClF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,kBAAkB,GAAG,OAAO,CAoC3E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CA0C7D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,oBAAoB,GAAG,kBAAkB,CAwB/F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,GAAG,EACb,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAC7B,gBAAgB,CAGlB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC,CAsB/F"}
@@ -0,0 +1,336 @@
1
+ /**
2
+ * JQHTML v2 Component Base Class
3
+ *
4
+ * Core component implementation following v2 specification:
5
+ * - 5-stage lifecycle coordinated by LifecycleManager
6
+ * - Direct jQuery manipulation (no virtual DOM)
7
+ * - Scoped IDs using _cid pattern
8
+ * - Event emission and CSS class hierarchy
9
+ */
10
+ declare global {
11
+ interface Window {
12
+ JQHTML_DEBUG?: {
13
+ log: (componentName: string, phase: string, message: string, data?: any) => void;
14
+ updateTree: () => void;
15
+ };
16
+ }
17
+ }
18
+ export declare class Jqhtml_Component {
19
+ static template?: any;
20
+ $: any;
21
+ args: Record<string, any>;
22
+ data: Record<string, any>;
23
+ state: Record<string, any>;
24
+ _cid: string;
25
+ _ready_state: number;
26
+ private _lifecycle_manager;
27
+ private _instantiator;
28
+ private _dom_parent;
29
+ private _dom_children;
30
+ private _use_dom_fallback;
31
+ private _stopped;
32
+ private _booted;
33
+ private _data_before_render;
34
+ private _lifecycle_callbacks;
35
+ private _lifecycle_states;
36
+ private __loading;
37
+ private _did_first_render;
38
+ private _render_count;
39
+ private _args_on_last_render;
40
+ private _data_on_last_render;
41
+ private __initial_data_snapshot;
42
+ private __data_frozen;
43
+ private _reload_debounced?;
44
+ private next_reload_force_refresh;
45
+ constructor(element?: any, args?: Record<string, any>);
46
+ /**
47
+ * Boot - Start the full component lifecycle
48
+ * Called immediately after construction by instruction processor
49
+ */
50
+ /**
51
+ * Internal boot method - starts component lifecycle
52
+ * @private
53
+ */
54
+ _boot(): Promise<void>;
55
+ /**
56
+ * Internal render phase - Create DOM structure
57
+ * Called top-down (parent before children) when part of lifecycle
58
+ * This is an internal method - users should call render() instead
59
+ *
60
+ * @param id Optional scoped ID - if provided, delegates to child component's _render()
61
+ * @returns The current _render_count after incrementing (used to detect stale renders)
62
+ * @private
63
+ */
64
+ _render(id?: string | null): number;
65
+ /**
66
+ * Public render method - re-renders component and completes lifecycle
67
+ * This is what users should call when they want to update a component.
68
+ *
69
+ * Lifecycle sequence:
70
+ * 1. _render() - Updates DOM synchronously, calls on_render(), fires 'render' event
71
+ * 2. Async continuation (fire and forget):
72
+ * - _wait_for_children_ready() - Waits for all children to reach ready state
73
+ * - on_ready() - Calls user's ready hook
74
+ * - trigger('ready') - Fires ready event
75
+ *
76
+ * Returns immediately after _render() completes - does NOT wait for children
77
+ */
78
+ render(id?: string | null): void;
79
+ /**
80
+ * Alias for render() - re-renders component with current data
81
+ * Provided for API consistency and clarity
82
+ */
83
+ redraw(id?: string | null): void;
84
+ /**
85
+ * Create phase - Quick setup, prepare UI
86
+ * Called bottom-up (children before parent)
87
+ */
88
+ create(): Promise<void>;
89
+ /**
90
+ * Load phase - Fetch data from APIs
91
+ * Called bottom-up, fully parallel
92
+ * NO DOM MODIFICATIONS ALLOWED IN THIS PHASE
93
+ * @private - Internal lifecycle method, not for external use
94
+ */
95
+ _load(): Promise<void>;
96
+ /**
97
+ * Ready phase - Component fully initialized
98
+ * Called bottom-up (children before parent)
99
+ * @private
100
+ */
101
+ _ready(): Promise<void>;
102
+ /**
103
+ * Public API: Wait for component to be fully ready
104
+ * Returns a promise that resolves when the component reaches ready state.
105
+ * Optionally accepts a callback that executes when ready.
106
+ *
107
+ * @example
108
+ * // Promise pattern
109
+ * await component.ready();
110
+ *
111
+ * @example
112
+ * // Callback pattern
113
+ * component.ready(() => {
114
+ * console.log('Component is ready!');
115
+ * });
116
+ *
117
+ * @example
118
+ * // Both patterns work together
119
+ * await component.ready(() => console.log('Callback fired'));
120
+ *
121
+ * @param callback Optional callback to execute when ready
122
+ */
123
+ ready(callback?: () => void): Promise<void>;
124
+ /**
125
+ * Wait for all child components to reach ready state
126
+ * Ensures bottom-up ordering (children ready before parent)
127
+ * @private
128
+ */
129
+ private _wait_for_children_ready;
130
+ /**
131
+ * Reload component - re-fetch data and re-render (debounced)
132
+ *
133
+ * This is the public API that automatically debounces calls to _reload()
134
+ * Multiple rapid calls to reload() will be coalesced into a single execution
135
+ *
136
+ * @param always_render - If true (default), always re-render after on_load().
137
+ * If false, only re-render if data actually changed.
138
+ */
139
+ reload(always_render?: boolean): Promise<void>;
140
+ /**
141
+ * Refresh component - re-fetch data and re-render only if data changed (debounced)
142
+ *
143
+ * Similar to reload() but only re-renders if the data actually changed after on_load().
144
+ * Useful for checking server for updates without forcing unnecessary re-renders.
145
+ *
146
+ * Uses the same debouncing as reload() and plays nice with it - if reload() is called
147
+ * while refresh() is queued, reload() takes precedence and will always render.
148
+ */
149
+ refresh(): Promise<void>;
150
+ /**
151
+ * Internal reload implementation - re-fetch data and re-render
152
+ *
153
+ * COMPLETE RELOAD PROCESS (Source of Truth):
154
+ *
155
+ * STEP 1: Cache check (if args changed since last render)
156
+ * - Generate cache key from component name + current args
157
+ * - If cached data exists and is non-empty:
158
+ * - Unfreeze this.data (temporarily)
159
+ * - Hydrate this.data with cached data
160
+ * - Re-freeze this.data
161
+ * - Render immediately (stale-while-revalidate)
162
+ * - Set rendered_from_cache flag
163
+ *
164
+ * STEP 2: Call on_load() to fetch fresh data
165
+ * - Unfreeze this.data
166
+ * - Restore this.data to on_create() snapshot
167
+ * - Call on_load() directly (no _load() wrapper)
168
+ * - Freeze this.data after completion
169
+ * - If data changed and non-empty: write to cache
170
+ *
171
+ * STEP 3: Conditionally re-render
172
+ * - If didn't render from cache yet, OR data changed after on_load():
173
+ * - Call render() to update DOM
174
+ *
175
+ * STEP 3.5: Wait for all children to be ready
176
+ * - Bottom-up ordering (children ready before parent)
177
+ * - Same as main lifecycle
178
+ *
179
+ * STEP 4: Call on_ready()
180
+ * - Always call on_ready() after reload completes
181
+ *
182
+ * @private - Use reload() instead (debounced wrapper)
183
+ */
184
+ _reload(): Promise<void>;
185
+ /**
186
+ * Destroy the component and cleanup
187
+ * Called automatically by MutationObserver when component is removed from DOM
188
+ * Can also be called manually for explicit cleanup
189
+ */
190
+ /**
191
+ * Internal stop method - stops just this component (no children)
192
+ * Sets stopped flag, calls lifecycle hooks, but leaves DOM intact
193
+ * @private
194
+ */
195
+ _stop(): void;
196
+ /**
197
+ * Stop component lifecycle - stops all descendant components then self
198
+ * Leaves DOM intact, just stops lifecycle engine and fires cleanup hooks
199
+ */
200
+ stop(): void;
201
+ on_render(): void | Promise<void>;
202
+ on_create(): void | Promise<void>;
203
+ on_load(): Promise<void>;
204
+ on_ready(): Promise<void>;
205
+ on_stop(): void | Promise<void>;
206
+ /**
207
+ * Optional: Override cache key generation
208
+ *
209
+ * By default, cache keys are generated from component name + args.
210
+ * Override this method to provide a custom cache key for this component instance.
211
+ *
212
+ * If this method throws an error, caching will be disabled for this component.
213
+ *
214
+ * @returns Custom cache key string (will be prefixed with component name)
215
+ */
216
+ cache_id?(): string;
217
+ /**
218
+ * Should component re-render after load?
219
+ * By default, only re-renders if data has changed
220
+ * Override to control re-rendering behavior
221
+ */
222
+ /**
223
+ * Internal method to determine if component should re-render after on_load()
224
+ * @private
225
+ */
226
+ _should_rerender(): boolean;
227
+ /**
228
+ * Get component name for debugging
229
+ */
230
+ component_name(): string;
231
+ /**
232
+ * Register event callback
233
+ * Supports lifecycle events ('render', 'create', 'load', 'ready', 'stop') and custom events
234
+ * Lifecycle event callbacks fire after the lifecycle method completes
235
+ * If a lifecycle event has already occurred, the callback fires immediately AND registers for future occurrences
236
+ * Custom events only fire when explicitly triggered via .trigger()
237
+ */
238
+ on(event_name: string, callback: (component: Jqhtml_Component) => void): this;
239
+ /**
240
+ * Trigger a lifecycle event - fires all registered callbacks
241
+ * Marks event as occurred so future .on() calls fire immediately
242
+ */
243
+ trigger(event_name: string): void;
244
+ /**
245
+ * Check if any callbacks are registered for a given event
246
+ * Used to determine if cleanup logic needs to run
247
+ */
248
+ _on_registered(event_name: string): boolean;
249
+ /**
250
+ * Find element by scoped ID
251
+ *
252
+ * Searches for elements with id="local_id:THIS_COMPONENT_CID"
253
+ *
254
+ * Example:
255
+ * Template: <button $sid="save_btn">Save</button>
256
+ * Rendered: <button id="save_btn:abc123" data-sid="save_btn">Save</button>
257
+ * Access: this.$sid('save_btn') // Returns jQuery element
258
+ *
259
+ * Performance: Uses native document.getElementById() when component is in DOM,
260
+ * falls back to jQuery.find() for components not yet attached to DOM.
261
+ *
262
+ * @param local_id The local ID (without _cid suffix)
263
+ * @returns jQuery element with id="local_id:_cid", or empty jQuery object if not found
264
+ */
265
+ $sid(local_id: string): any;
266
+ /**
267
+ * Get component instance by scoped ID
268
+ *
269
+ * Convenience method that finds element by scoped ID and returns the component instance.
270
+ *
271
+ * Example:
272
+ * Template: <User_Card $sid="active_user" />
273
+ * Access: const user = this.sid('active_user'); // Returns User_Card instance
274
+ * user.data.name // Access component's data
275
+ *
276
+ * To get the scoped ID string itself:
277
+ * this.$sid('active_user').attr('id') // Returns "active_user:abc123xyz"
278
+ *
279
+ * @param local_id The local ID (without _cid suffix)
280
+ * @returns Component instance or null if not found or not a component
281
+ */
282
+ sid(local_id: string): Jqhtml_Component | null;
283
+ /**
284
+ * Get the component that instantiated this component (rendered it in their template)
285
+ * Returns null if component was created programmatically via $().component()
286
+ */
287
+ instantiator(): Jqhtml_Component | null;
288
+ /**
289
+ * Find descendant components by CSS selector
290
+ */
291
+ find(selector: string): Jqhtml_Component[];
292
+ /**
293
+ * Find closest ancestor component matching selector
294
+ */
295
+ closest(selector: string): Jqhtml_Component | null;
296
+ /**
297
+ * Get CSS class hierarchy for this component type
298
+ */
299
+ static get_class_hierarchy(): string[];
300
+ private _generate_cid;
301
+ /**
302
+ * Flatten instruction array - converts ['_content', [...]] markers to flat array
303
+ * Recursively flattens nested content from content() calls
304
+ */
305
+ private _flatten_instructions;
306
+ private _apply_css_classes;
307
+ private _apply_default_attributes;
308
+ private _set_attributes;
309
+ private _update_debug_attrs;
310
+ private _find_dom_parent;
311
+ /**
312
+ * Get DOM children (components in DOM subtree)
313
+ * Uses fast _dom_children registry when possible, falls back to DOM traversal for off-DOM components
314
+ * @private - Used internally for lifecycle coordination
315
+ */
316
+ private _get_dom_children;
317
+ private _log_lifecycle;
318
+ private _log_debug;
319
+ /**
320
+ * Creates a debounced function with exclusivity and promise fan-in
321
+ *
322
+ * When invoked, immediately runs the callback exclusively.
323
+ * For subsequent invocations, applies a delay before running the callback exclusively again.
324
+ * The delay starts after the current asynchronous operation resolves.
325
+ *
326
+ * If delay is 0, the function only prevents enqueueing multiple executions,
327
+ * but will still run them immediately in an exclusive sequential manner.
328
+ *
329
+ * The most recent invocation's parameters are used when the function executes.
330
+ * Returns a promise that resolves when the next exclusive execution completes.
331
+ *
332
+ * @private
333
+ */
334
+ private _create_debounced_function;
335
+ }
336
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE;YACb,GAAG,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;YACjF,UAAU,EAAE,MAAM,IAAI,CAAC;SACxB,CAAC;KACH;CACF;AAED,qBAAa,gBAAgB;IAE3B,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGtB,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAK;IAGzB,OAAO,CAAC,kBAAkB,CAAmB;IAC7C,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,oBAAoB,CAAwE;IACpG,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CA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AkB;IA4B1B,OAAO,CAAC,yBAAyB;IAuHjC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;IAUlB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,0BAA0B;CAqEnC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * JQHTML Debug Module
3
+ *
4
+ * Optional debugging utilities for development
5
+ * Import separately to keep production bundles small:
6
+ *
7
+ * import { showDebugOverlay } from '@jqhtml/core/debug';
8
+ */
9
+ export { DebugOverlay, showDebugOverlay, hideDebugOverlay } from './debug-overlay.js';
10
+ export type { DebugOverlayOptions } from './debug-overlay.js';
11
+ export { logLifecycle, applyDebugDelay, logDispatch, logInstruction, logDataChange, isSequentialProcessing, handleComponentError, devWarn } from './debug.js';
12
+ export interface DebugSettings {
13
+ verbose?: boolean;
14
+ logCreationReady?: boolean;
15
+ logFullLifecycle?: boolean;
16
+ logDispatch?: boolean;
17
+ logDispatchVerbose?: boolean;
18
+ delayAfterComponent?: number;
19
+ delayAfterRender?: number;
20
+ delayAfterRerender?: number;
21
+ sequentialProcessing?: boolean;
22
+ flashComponents?: boolean;
23
+ flashDuration?: number;
24
+ flashColors?: {
25
+ create?: string;
26
+ render?: string;
27
+ ready?: string;
28
+ };
29
+ showComponentTree?: boolean;
30
+ profilePerformance?: boolean;
31
+ breakOnError?: boolean;
32
+ traceDataFlow?: boolean;
33
+ logInstructionProcessing?: boolean;
34
+ highlightSlowRenders?: number;
35
+ }
36
+ //# sourceMappingURL=debug-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-entry.d.ts","sourceRoot":"","sources":["../src/debug-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,OAAO,EACR,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,aAAa;IAE5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAG7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAG/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAGF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * JQHTML Debug Overlay
3
+ *
4
+ * Independent debug controls using pure jQuery DOM manipulation.
5
+ * Does NOT use JQHTML components so it works even when components are broken.
6
+ */
7
+ export interface DebugOverlayOptions {
8
+ position?: 'top' | 'bottom';
9
+ theme?: 'dark' | 'light';
10
+ compact?: boolean;
11
+ showStatus?: boolean;
12
+ autoHide?: boolean;
13
+ }
14
+ export declare class DebugOverlay {
15
+ private static instance;
16
+ private $container;
17
+ private $statusIndicator;
18
+ private options;
19
+ private $;
20
+ constructor(options?: DebugOverlayOptions);
21
+ /**
22
+ * Static method to show debug overlay (singleton pattern)
23
+ */
24
+ static show(options?: DebugOverlayOptions): DebugOverlay;
25
+ /**
26
+ * Static method to hide debug overlay
27
+ */
28
+ static hide(): void;
29
+ /**
30
+ * Static method to toggle debug overlay visibility
31
+ */
32
+ static toggle(): void;
33
+ /**
34
+ * Static method to destroy debug overlay
35
+ */
36
+ static destroy(): void;
37
+ /**
38
+ * Display the debug overlay
39
+ */
40
+ private display;
41
+ /**
42
+ * Hide the debug overlay
43
+ */
44
+ hide(): void;
45
+ /**
46
+ * Remove the debug overlay completely
47
+ */
48
+ destroy(): void;
49
+ /**
50
+ * Update the status indicator
51
+ */
52
+ updateStatus(mode: string): void;
53
+ private createOverlay;
54
+ private createStatusIndicator;
55
+ private addStyles;
56
+ private toggle;
57
+ private executeAction;
58
+ }
59
+ export declare function showDebugOverlay(options?: DebugOverlayOptions): DebugOverlay;
60
+ export declare function hideDebugOverlay(): void;
61
+ //# sourceMappingURL=debug-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-overlay.d.ts","sourceRoot":"","sources":["../src/debug-overlay.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA6B;IACpD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,CAAC,CAAM;gBAEH,OAAO,GAAE,mBAAwB;IAgB7C;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,YAAY;IAQxD;;OAEG;IACH,MAAM,CAAC,IAAI,IAAI,IAAI;IAMnB;;OAEG;IACH,MAAM,CAAC,MAAM,IAAI,IAAI;IAYrB;;OAEG;IACH,MAAM,CAAC,OAAO,IAAI,IAAI;IAOtB;;OAEG;IACH,OAAO,CAAC,OAAO;IAYf;;OAEG;IACH,IAAI,IAAI,IAAI;IASZ;;OAEG;IACH,OAAO,IAAI,IAAI;IAWf;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAOhC,OAAO,CAAC,aAAa;IAiDrB,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,CAAC,SAAS;IAoGjB,OAAO,CAAC,MAAM;IAed,OAAO,CAAC,aAAa;CAoEtB;AAGD,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAE5E;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * JQHTML Debug Module
3
+ *
4
+ * Provides comprehensive debugging capabilities for JQHTML components
5
+ */
6
+ import type { Jqhtml_Component } from './component.js';
7
+ /**
8
+ * Development warning helper
9
+ * Warnings are suppressed in production builds or when JQHTML_SUPPRESS_WARNINGS is set
10
+ */
11
+ export declare function devWarn(message: string): void;
12
+ export declare function logLifecycle(component: Jqhtml_Component, phase: string, status: 'start' | 'complete'): void;
13
+ export declare function applyDebugDelay(phase: 'component' | 'render' | 'rerender'): void;
14
+ export declare function logInstruction(type: string, data: any): void;
15
+ export declare function logDataChange(component: Jqhtml_Component, property: string, oldValue: any, newValue: any): void;
16
+ export declare function logDispatch(url: string, route: any, params: any, verbose?: boolean): void;
17
+ export declare function isSequentialProcessing(): boolean;
18
+ export declare function handleComponentError(component: Jqhtml_Component, phase: string, error: Error): void;
19
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQvD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAY7C;AAuDD,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAmD3G;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,IAAI,CAqBhF;AAGD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAK5D;AAGD,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAM/G;AAUD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAE,OAAe,GAAG,IAAI,CAoBhG;AAGD,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAGD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAQnG"}