@jqhtml/core 2.3.54 → 2.3.59
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/README.md +3 -1
- package/dist/boot.d.ts +0 -0
- package/dist/boot.d.ts.map +0 -0
- package/dist/boot.js +130 -0
- package/dist/boot.js.map +1 -0
- package/dist/cache-key-serializer.d.ts +0 -0
- package/dist/cache-key-serializer.d.ts.map +0 -0
- package/dist/cache-key-serializer.js +140 -0
- package/dist/cache-key-serializer.js.map +1 -0
- package/dist/component-cache.d.ts +0 -0
- package/dist/component-cache.d.ts.map +0 -0
- package/dist/component-cache.js +270 -0
- package/dist/component-cache.js.map +1 -0
- package/dist/component-events.d.ts +0 -0
- package/dist/component-events.d.ts.map +0 -0
- package/dist/component-events.js +141 -0
- package/dist/component-events.js.map +1 -0
- package/dist/component-queue.d.ts +0 -0
- package/dist/component-queue.d.ts.map +0 -0
- package/dist/component-queue.js +118 -0
- package/dist/component-queue.js.map +1 -0
- package/dist/component-registry.d.ts +0 -0
- package/dist/component-registry.d.ts.map +0 -0
- package/dist/component-registry.js +298 -0
- package/dist/component-registry.js.map +1 -0
- package/dist/component.d.ts +8 -0
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +1892 -0
- package/dist/component.js.map +1 -0
- package/dist/config.d.ts +0 -0
- package/dist/config.d.ts.map +0 -0
- package/dist/config.js +64 -0
- package/dist/config.js.map +1 -0
- package/dist/data-proxy.d.ts +0 -0
- package/dist/data-proxy.d.ts.map +0 -0
- package/dist/data-proxy.js +223 -0
- package/dist/data-proxy.js.map +1 -0
- package/dist/debug-entry.d.ts +0 -0
- package/dist/debug-entry.d.ts.map +0 -0
- package/dist/debug-entry.js +8 -0
- package/dist/debug-entry.js.map +1 -0
- package/dist/debug.d.ts +0 -0
- package/dist/debug.d.ts.map +0 -0
- package/dist/debug.js +203 -0
- package/dist/debug.js.map +1 -0
- package/dist/index.cjs +36 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +36 -8
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts +0 -0
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/instruction-processor.js +563 -0
- package/dist/instruction-processor.js.map +1 -0
- package/dist/jqhtml-core.esm.js +37 -9
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jqhtml-debug.esm.js +0 -0
- package/dist/jqhtml-debug.esm.js.map +0 -0
- package/dist/jquery-plugin.d.ts +0 -0
- package/dist/jquery-plugin.d.ts.map +0 -0
- package/dist/jquery-plugin.js +472 -0
- package/dist/jquery-plugin.js.map +1 -0
- package/dist/lifecycle-manager.d.ts +0 -0
- package/dist/lifecycle-manager.d.ts.map +0 -0
- package/dist/lifecycle-manager.js +201 -0
- package/dist/lifecycle-manager.js.map +1 -0
- package/dist/load-coordinator.d.ts +0 -0
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/load-coordinator.js +309 -0
- package/dist/load-coordinator.js.map +1 -0
- package/dist/local-storage.d.ts +0 -0
- package/dist/local-storage.d.ts.map +0 -0
- package/dist/local-storage.js +699 -0
- package/dist/local-storage.js.map +1 -0
- package/dist/preload-data.d.ts +0 -0
- package/dist/preload-data.d.ts.map +0 -0
- package/dist/preload-data.js +136 -0
- package/dist/preload-data.js.map +1 -0
- package/dist/template-renderer.d.ts +0 -0
- package/dist/template-renderer.d.ts.map +0 -0
- package/dist/template-renderer.js +278 -0
- package/dist/template-renderer.js.map +1 -0
- package/dist/viewport.d.ts +0 -0
- package/dist/viewport.d.ts.map +0 -0
- package/dist/viewport.js +69 -0
- package/dist/viewport.js.map +1 -0
- package/package.json +1 -1
package/dist/debug.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JQHTML Debug Module
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive debugging capabilities for JQHTML components
|
|
5
|
+
*/
|
|
6
|
+
// Global debug state
|
|
7
|
+
let debugSettings = {};
|
|
8
|
+
let performanceMetrics = new Map();
|
|
9
|
+
let componentTree = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Development warning helper
|
|
12
|
+
* Warnings are suppressed in production builds or when JQHTML_SUPPRESS_WARNINGS is set
|
|
13
|
+
*/
|
|
14
|
+
export function devWarn(message) {
|
|
15
|
+
// Check if warnings are suppressed
|
|
16
|
+
if (typeof window !== 'undefined' && window.JQHTML_SUPPRESS_WARNINGS) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Check if in production mode
|
|
20
|
+
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production') {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.warn(`[JQHTML Dev Warning] ${message}`);
|
|
24
|
+
}
|
|
25
|
+
// Get global jqhtml object
|
|
26
|
+
function getJqhtml() {
|
|
27
|
+
if (typeof window !== 'undefined' && window.jqhtml) {
|
|
28
|
+
return window.jqhtml;
|
|
29
|
+
}
|
|
30
|
+
// Fallback: try to get from global if available
|
|
31
|
+
if (typeof globalThis !== 'undefined' && globalThis.jqhtml) {
|
|
32
|
+
return globalThis.jqhtml;
|
|
33
|
+
}
|
|
34
|
+
throw new Error('FATAL: window.jqhtml is not defined. The JQHTML runtime must be loaded before using debug features. ' +
|
|
35
|
+
'Import and initialize @jqhtml/core before attempting to use debug functionality.');
|
|
36
|
+
}
|
|
37
|
+
// Synchronous delay helper
|
|
38
|
+
function delay(ms) {
|
|
39
|
+
if (ms <= 0)
|
|
40
|
+
return;
|
|
41
|
+
const start = Date.now();
|
|
42
|
+
while (Date.now() - start < ms) {
|
|
43
|
+
// Busy wait
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Visual flash effect
|
|
47
|
+
function flashComponent(component, eventType) {
|
|
48
|
+
const jqhtml = getJqhtml();
|
|
49
|
+
if (!jqhtml?.debug?.flashComponents)
|
|
50
|
+
return;
|
|
51
|
+
const duration = jqhtml.debug.flashDuration || 500;
|
|
52
|
+
const colors = jqhtml.debug.flashColors || {};
|
|
53
|
+
const color = colors[eventType] || (eventType === 'create' ? '#3498db' :
|
|
54
|
+
eventType === 'render' ? '#27ae60' :
|
|
55
|
+
'#9b59b6');
|
|
56
|
+
// Store original border
|
|
57
|
+
const originalBorder = component.$.css('border');
|
|
58
|
+
// Apply flash border
|
|
59
|
+
component.$.css({
|
|
60
|
+
'border': `2px solid ${color}`,
|
|
61
|
+
'transition': `border ${duration}ms ease-out`
|
|
62
|
+
});
|
|
63
|
+
// Remove after duration
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
component.$.css('border', originalBorder || '');
|
|
66
|
+
}, duration);
|
|
67
|
+
}
|
|
68
|
+
// Log lifecycle event
|
|
69
|
+
export function logLifecycle(component, phase, status) {
|
|
70
|
+
const jqhtml = getJqhtml();
|
|
71
|
+
if (!jqhtml?.debug)
|
|
72
|
+
return;
|
|
73
|
+
const shouldLog = jqhtml.debug.logFullLifecycle ||
|
|
74
|
+
(jqhtml.debug.logCreationReady && (phase === 'create' || phase === 'ready'));
|
|
75
|
+
if (!shouldLog)
|
|
76
|
+
return;
|
|
77
|
+
const componentName = component.constructor.name;
|
|
78
|
+
const timestamp = new Date().toISOString();
|
|
79
|
+
const prefix = `[JQHTML ${timestamp}]`;
|
|
80
|
+
if (status === 'start') {
|
|
81
|
+
console.log(`${prefix} ${componentName}#${component._cid} → ${phase} starting...`);
|
|
82
|
+
// Start performance tracking
|
|
83
|
+
if (jqhtml.debug.profilePerformance) {
|
|
84
|
+
performanceMetrics.set(`${component._cid}_${phase}`, Date.now());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
let message = `${prefix} ${componentName}#${component._cid} ✓ ${phase} complete`;
|
|
89
|
+
// Add performance data
|
|
90
|
+
if (jqhtml.debug.profilePerformance) {
|
|
91
|
+
const startTime = performanceMetrics.get(`${component._cid}_${phase}`);
|
|
92
|
+
if (startTime) {
|
|
93
|
+
const duration = Date.now() - startTime;
|
|
94
|
+
message += ` (${duration}ms)`;
|
|
95
|
+
// Highlight slow renders
|
|
96
|
+
if (phase === 'render' && jqhtml.debug.highlightSlowRenders &&
|
|
97
|
+
duration > jqhtml.debug.highlightSlowRenders) {
|
|
98
|
+
console.warn(`${prefix} SLOW RENDER: ${componentName}#${component._cid} took ${duration}ms`);
|
|
99
|
+
component.$.css('outline', '2px dashed red');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
console.log(message);
|
|
104
|
+
// Visual feedback
|
|
105
|
+
if (jqhtml.debug.flashComponents && (phase === 'create' || phase === 'render' || phase === 'ready')) {
|
|
106
|
+
flashComponent(component, phase);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Update component tree if enabled
|
|
110
|
+
if (jqhtml.debug.showComponentTree) {
|
|
111
|
+
updateComponentTree();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Apply delays based on lifecycle phase
|
|
115
|
+
export function applyDebugDelay(phase) {
|
|
116
|
+
const jqhtml = getJqhtml();
|
|
117
|
+
if (!jqhtml?.debug)
|
|
118
|
+
return;
|
|
119
|
+
let delayMs = 0;
|
|
120
|
+
switch (phase) {
|
|
121
|
+
case 'component':
|
|
122
|
+
delayMs = jqhtml.debug.delayAfterComponent || 0;
|
|
123
|
+
break;
|
|
124
|
+
case 'render':
|
|
125
|
+
delayMs = jqhtml.debug.delayAfterRender || 0;
|
|
126
|
+
break;
|
|
127
|
+
case 'rerender':
|
|
128
|
+
delayMs = jqhtml.debug.delayAfterRerender || 0;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
if (delayMs > 0) {
|
|
132
|
+
console.log(`[JQHTML Debug] Applying ${delayMs}ms delay after ${phase}`);
|
|
133
|
+
delay(delayMs);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Log instruction processing
|
|
137
|
+
export function logInstruction(type, data) {
|
|
138
|
+
const jqhtml = getJqhtml();
|
|
139
|
+
if (!jqhtml?.debug?.logInstructionProcessing)
|
|
140
|
+
return;
|
|
141
|
+
console.log(`[JQHTML Instruction] ${type}:`, data);
|
|
142
|
+
}
|
|
143
|
+
// Log data changes
|
|
144
|
+
export function logDataChange(component, property, oldValue, newValue) {
|
|
145
|
+
const jqhtml = getJqhtml();
|
|
146
|
+
if (!jqhtml?.debug?.traceDataFlow)
|
|
147
|
+
return;
|
|
148
|
+
console.log(`[JQHTML Data] ${component.constructor.name}#${component._cid}.data.${property}:`, { old: oldValue, new: newValue });
|
|
149
|
+
}
|
|
150
|
+
// Update component tree visualization
|
|
151
|
+
function updateComponentTree() {
|
|
152
|
+
// This would update a debug panel if implemented
|
|
153
|
+
// For now, just log the tree structure periodically
|
|
154
|
+
console.log('[JQHTML Tree] Component hierarchy updated');
|
|
155
|
+
}
|
|
156
|
+
// Router dispatch logging
|
|
157
|
+
export function logDispatch(url, route, params, verbose = false) {
|
|
158
|
+
const jqhtml = getJqhtml();
|
|
159
|
+
if (!jqhtml?.debug)
|
|
160
|
+
return;
|
|
161
|
+
const shouldLog = jqhtml.debug.logDispatch || jqhtml.debug.logDispatchVerbose;
|
|
162
|
+
if (!shouldLog)
|
|
163
|
+
return;
|
|
164
|
+
const isVerbose = jqhtml.debug.logDispatchVerbose || verbose;
|
|
165
|
+
if (isVerbose) {
|
|
166
|
+
console.group(`[JQHTML Router] Dispatching: ${url}`);
|
|
167
|
+
console.log('Matched route:', route);
|
|
168
|
+
console.log('Extracted params:', params);
|
|
169
|
+
console.log('Route component:', route.component);
|
|
170
|
+
console.log('Route layout:', route.layout);
|
|
171
|
+
console.log('Route meta:', route.meta);
|
|
172
|
+
console.groupEnd();
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
console.log(`[JQHTML Router] ${url} → ${route.component} (params: ${JSON.stringify(params)})`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Check if sequential processing is enabled
|
|
179
|
+
export function isSequentialProcessing() {
|
|
180
|
+
const jqhtml = getJqhtml();
|
|
181
|
+
return jqhtml?.debug?.sequentialProcessing || false;
|
|
182
|
+
}
|
|
183
|
+
// Error handling with break on error
|
|
184
|
+
export function handleComponentError(component, phase, error) {
|
|
185
|
+
const jqhtml = getJqhtml();
|
|
186
|
+
console.error(`[JQHTML Error] ${component.constructor.name}#${component._cid} failed in ${phase}:`, error);
|
|
187
|
+
if (jqhtml?.debug?.breakOnError) {
|
|
188
|
+
debugger; // This will pause execution in dev tools
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Additional debug suggestions that could be implemented:
|
|
192
|
+
//
|
|
193
|
+
// 1. Component Inspector - Click on any component to see its data/args/state
|
|
194
|
+
// 2. Time Travel Debugging - Record state changes and replay them
|
|
195
|
+
// 3. Network Request Tracking - Log all AJAX calls made during load()
|
|
196
|
+
// 4. Memory Leak Detection - Track component creation/destruction
|
|
197
|
+
// 5. Template Compilation Debugging - Show compiled template functions
|
|
198
|
+
// 6. Event Flow Visualization - Show event bubbling through components
|
|
199
|
+
// 7. Dependency Graph - Show which components depend on which data
|
|
200
|
+
// 8. Hot Reload Support - Reload components without losing state
|
|
201
|
+
// 9. Performance Budgets - Warn when components exceed size/time limits
|
|
202
|
+
// 10. Accessibility Auditing - Check for missing ARIA attributes
|
|
203
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,qBAAqB;AACrB,IAAI,aAAa,GAAkB,EAAE,CAAC;AACtC,IAAI,kBAAkB,GAAqB,IAAI,GAAG,EAAE,CAAC;AACrD,IAAI,aAAa,GAAqB,IAAI,GAAG,EAAE,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,mCAAmC;IACnC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAK,MAAc,CAAC,wBA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AAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,MAAM,KAAK,CAAC,SAAS,aAAa,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,sBAAsB;IACpC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,MAAM,EAAE,KAAK,EAAE,oBAAoB,IAAI,KAAK,CAAC;AACtD,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,oBAAoB,CAAC,SAA2B,EAAE,KAAa,EAAE,KAAY;IAC3F,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CAAC,KAAK,CAAC,kBAAkB,SAAS,CAAC,WAAW,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,cAAc,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC;IAE3G,IAAI,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QAChC,QAAQ,CAAC,CAAC,yCAAyC;IACrD,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,GAAG;AACH,6EAA6E;AAC7E,kEAAkE;AAClE,sEAAsE;AACtE,kEAAkE;AAClE,uEAAuE;AACvE,uEAAuE;AACvE,mEAAmE;AACnE,iEAAiE;AACjE,wEAAwE;AACxE,iEAAiE"}
|
package/dist/index.cjs
CHANGED
|
@@ -860,11 +860,22 @@ function process_rawtag_to_html(instruction, html) {
|
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
html.push('>');
|
|
863
|
-
// Add raw content
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
863
|
+
// Add raw content, preserving whitespace.
|
|
864
|
+
//
|
|
865
|
+
// <textarea> holds text and nothing else, so everything is escaped.
|
|
866
|
+
//
|
|
867
|
+
// <pre> holds phrasing content - <pre><code> is the standard code-block idiom - so
|
|
868
|
+
// markup the author wrote is passed through. A '<' that does not begin a tag is
|
|
869
|
+
// still escaped, which is what the HTML tokenizer itself does with a stray '<' and
|
|
870
|
+
// keeps code samples such as "if (a < b)" rendering as written. Interpolated
|
|
871
|
+
// values are escaped by the compiler before they reach this point.
|
|
872
|
+
const is_raw_html_content = tagName.toLowerCase() === 'pre';
|
|
873
|
+
const escaped_content = is_raw_html_content
|
|
874
|
+
? rawContent.replace(/<(?![a-zA-Z/!?])/g, '<')
|
|
875
|
+
: rawContent
|
|
876
|
+
.replace(/&/g, '&')
|
|
877
|
+
.replace(/</g, '<')
|
|
878
|
+
.replace(/>/g, '>');
|
|
868
879
|
html.push(escaped_content);
|
|
869
880
|
// Close tag
|
|
870
881
|
html.push(`</${tagName}>`);
|
|
@@ -1536,6 +1547,11 @@ class Load_Coordinator {
|
|
|
1536
1547
|
}
|
|
1537
1548
|
if (!uncacheable_property) {
|
|
1538
1549
|
uncacheable_property = key;
|
|
1550
|
+
// This package compiles with strictNullChecks off, and without it
|
|
1551
|
+
// TypeScript will not narrow a discriminated union by its boolean
|
|
1552
|
+
// discriminant - so `serialized` is still the full Serialize_Result
|
|
1553
|
+
// here even though `ok` has been ruled out above. The cast states
|
|
1554
|
+
// what the control flow already guarantees.
|
|
1539
1555
|
uncacheable_reason = serialized.reason;
|
|
1540
1556
|
}
|
|
1541
1557
|
return { key: null, uncacheable_property, uncacheable_reason };
|
|
@@ -1823,7 +1839,7 @@ Load_Coordinator._registry = new Map();
|
|
|
1823
1839
|
const class_registry = Object.create(null);
|
|
1824
1840
|
// Markers for serialized class instances (unique to avoid collisions with user data)
|
|
1825
1841
|
// Replaced at build time by rollup (see rollup.config.js).
|
|
1826
|
-
const CORE_VERSION = '2.3.
|
|
1842
|
+
const CORE_VERSION = '2.3.59';
|
|
1827
1843
|
const CLASS_MARKER = '__jqhtml_class__';
|
|
1828
1844
|
const PROPS_MARKER = '__jqhtml_props__';
|
|
1829
1845
|
/**
|
|
@@ -4957,11 +4973,21 @@ class Jqhtml_Component {
|
|
|
4957
4973
|
}
|
|
4958
4974
|
/**
|
|
4959
4975
|
* Find closest ancestor component matching selector
|
|
4976
|
+
*
|
|
4977
|
+
* A bare component name - a plain identifier starting with a capital letter,
|
|
4978
|
+
* such as 'Parent_Dashboard' - is treated as the component-name class
|
|
4979
|
+
* selector '.Parent_Dashboard'. Components carry a CSS class for every name
|
|
4980
|
+
* in their prototype chain, so a base class name matches its subclasses too.
|
|
4981
|
+
* Every other selector ('.Foo', '#id', '[attr]', 'div > .Component') is
|
|
4982
|
+
* passed to jQuery unchanged.
|
|
4960
4983
|
*/
|
|
4961
4984
|
closest(selector) {
|
|
4985
|
+
const search = Jqhtml_Component.COMPONENT_NAME_PATTERN.test(selector)
|
|
4986
|
+
? `.${selector}`
|
|
4987
|
+
: selector;
|
|
4962
4988
|
let current = this.$.parent();
|
|
4963
4989
|
while (current.length > 0) {
|
|
4964
|
-
if (current.is(
|
|
4990
|
+
if (current.is(search)) {
|
|
4965
4991
|
const comp = current.data('_component');
|
|
4966
4992
|
if (comp instanceof Jqhtml_Component) {
|
|
4967
4993
|
return comp;
|
|
@@ -5258,6 +5284,8 @@ class Jqhtml_Component {
|
|
|
5258
5284
|
}
|
|
5259
5285
|
// Static properties
|
|
5260
5286
|
Jqhtml_Component.__jqhtml_component = true; // Marker for unified register() detection
|
|
5287
|
+
// A bare component name, as accepted by closest() in place of a class selector
|
|
5288
|
+
Jqhtml_Component.COMPONENT_NAME_PATTERN = /^[A-Z][A-Za-z0-9_]*$/;
|
|
5261
5289
|
|
|
5262
5290
|
/**
|
|
5263
5291
|
* JQHTML v2 Template Renderer
|
|
@@ -6154,7 +6182,7 @@ function init(jQuery, config) {
|
|
|
6154
6182
|
}
|
|
6155
6183
|
}
|
|
6156
6184
|
// Version - will be replaced during build with actual version from package.json
|
|
6157
|
-
const version = '2.3.
|
|
6185
|
+
const version = '2.3.59';
|
|
6158
6186
|
// Default export with all functionality
|
|
6159
6187
|
const jqhtml = {
|
|
6160
6188
|
// Core
|