@jqhtml/core 2.3.59 → 2.3.64
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/dist/boot.d.ts +0 -0
- package/dist/boot.d.ts.map +0 -0
- package/dist/cache-key-serializer.d.ts +0 -0
- package/dist/cache-key-serializer.d.ts.map +0 -0
- package/dist/component-cache.d.ts +0 -0
- package/dist/component-cache.d.ts.map +0 -0
- package/dist/component-events.d.ts +0 -0
- package/dist/component-events.d.ts.map +0 -0
- package/dist/component-name.d.ts +13 -0
- package/dist/component-name.d.ts.map +1 -0
- package/dist/component-queue.d.ts +0 -0
- package/dist/component-queue.d.ts.map +0 -0
- package/dist/component-registry.d.ts +0 -0
- package/dist/component-registry.d.ts.map +1 -1
- package/dist/component.d.ts +2 -6
- package/dist/component.d.ts.map +1 -1
- package/dist/config.d.ts +0 -0
- package/dist/config.d.ts.map +0 -0
- package/dist/data-proxy.d.ts +0 -0
- package/dist/data-proxy.d.ts.map +0 -0
- package/dist/debug-entry.d.ts +0 -0
- package/dist/debug-entry.d.ts.map +0 -0
- package/dist/debug.d.ts +0 -0
- package/dist/debug.d.ts.map +0 -0
- package/dist/index.cjs +60 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -45
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts +2 -1
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +59 -46
- 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 +1 -1
- package/dist/lifecycle-manager.d.ts +0 -0
- package/dist/lifecycle-manager.d.ts.map +0 -0
- package/dist/load-coordinator.d.ts +0 -0
- package/dist/load-coordinator.d.ts.map +0 -0
- package/dist/local-storage.d.ts +0 -0
- package/dist/local-storage.d.ts.map +0 -0
- package/dist/preload-data.d.ts +0 -0
- package/dist/preload-data.d.ts.map +0 -0
- package/dist/template-renderer.d.ts +0 -0
- package/dist/template-renderer.d.ts.map +0 -0
- package/dist/viewport.d.ts +0 -0
- package/dist/viewport.d.ts.map +0 -0
- package/package.json +1 -1
- package/dist/boot.js +0 -130
- package/dist/boot.js.map +0 -1
- package/dist/cache-key-serializer.js +0 -140
- package/dist/cache-key-serializer.js.map +0 -1
- package/dist/component-cache.js +0 -270
- package/dist/component-cache.js.map +0 -1
- package/dist/component-events.js +0 -141
- package/dist/component-events.js.map +0 -1
- package/dist/component-queue.js +0 -118
- package/dist/component-queue.js.map +0 -1
- package/dist/component-registry.js +0 -298
- package/dist/component-registry.js.map +0 -1
- package/dist/component.js +0 -1892
- package/dist/component.js.map +0 -1
- package/dist/config.js +0 -64
- package/dist/config.js.map +0 -1
- package/dist/data-proxy.js +0 -223
- package/dist/data-proxy.js.map +0 -1
- package/dist/debug-entry.js +0 -8
- package/dist/debug-entry.js.map +0 -1
- package/dist/debug.js +0 -203
- package/dist/debug.js.map +0 -1
- package/dist/instruction-processor.js +0 -563
- package/dist/instruction-processor.js.map +0 -1
- package/dist/jquery-plugin.js +0 -472
- package/dist/jquery-plugin.js.map +0 -1
- package/dist/lifecycle-manager.js +0 -201
- package/dist/lifecycle-manager.js.map +0 -1
- package/dist/load-coordinator.js +0 -309
- package/dist/load-coordinator.js.map +0 -1
- package/dist/local-storage.js +0 -699
- package/dist/local-storage.js.map +0 -1
- package/dist/preload-data.js +0 -136
- package/dist/preload-data.js.map +0 -1
- package/dist/template-renderer.js +0 -278
- package/dist/template-renderer.js.map +0 -1
- package/dist/viewport.js +0 -69
- package/dist/viewport.js.map +0 -1
package/dist/boot.d.ts
CHANGED
|
File without changes
|
package/dist/boot.d.ts.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one rule for "is this name a component?"
|
|
3
|
+
*
|
|
4
|
+
* An optional SINGLE leading underscore, then a capital letter, then letters,
|
|
5
|
+
* digits and underscores. The underscore prefix is a namespace reserved for
|
|
6
|
+
* framework-provided components (`_Root_Layout`) so they cannot collide with
|
|
7
|
+
* application components. Two or more leading underscores are not a component
|
|
8
|
+
* name; a lower-case first letter after the optional underscore is an HTML tag.
|
|
9
|
+
*/
|
|
10
|
+
export declare const COMPONENT_NAME_PATTERN: RegExp;
|
|
11
|
+
export declare const COMPONENT_NAME_RULE = "must start with a capital letter, optionally preceded by a single underscore";
|
|
12
|
+
export declare function is_component_name(name: string): boolean;
|
|
13
|
+
//# sourceMappingURL=component-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-name.d.ts","sourceRoot":"","sources":["../src/component-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAA2B,CAAC;AAE/D,eAAO,MAAM,mBAAmB,iFACgD,CAAC;AAEjF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +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;
|
|
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;AAIlD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,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,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;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,oBAAoB,GAAG,IAAI,CAwChF"}
|
package/dist/component.d.ts
CHANGED
|
@@ -485,7 +485,8 @@ export declare class Jqhtml_Component {
|
|
|
485
485
|
* Find closest ancestor component matching selector
|
|
486
486
|
*
|
|
487
487
|
* A bare component name - a plain identifier starting with a capital letter,
|
|
488
|
-
*
|
|
488
|
+
* optionally preceded by a single underscore, such as 'Parent_Dashboard' or
|
|
489
|
+
* '_Root_Layout' - is treated as the component-name class
|
|
489
490
|
* selector '.Parent_Dashboard'. Components carry a CSS class for every name
|
|
490
491
|
* in their prototype chain, so a base class name matches its subclasses too.
|
|
491
492
|
* Every other selector ('.Foo', '#id', '[attr]', 'div > .Component') is
|
|
@@ -497,11 +498,6 @@ export declare class Jqhtml_Component {
|
|
|
497
498
|
*/
|
|
498
499
|
static get_class_hierarchy(): string[];
|
|
499
500
|
private _generate_cid;
|
|
500
|
-
/**
|
|
501
|
-
* Flatten instruction array - converts ['_content', [...]] markers to flat array
|
|
502
|
-
* Recursively flattens nested content from content() calls
|
|
503
|
-
*/
|
|
504
|
-
private _flatten_instructions;
|
|
505
501
|
private _apply_css_classes;
|
|
506
502
|
private _apply_default_attributes;
|
|
507
503
|
private _set_attributes;
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"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AE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAgB9C;;;OAGG;IACH,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIvC;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAa1C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAwBlD;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM,EAAE;IA0CtC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,yBAAyB;IAuHjC,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;CAUnB"}
|
package/dist/config.d.ts
CHANGED
|
File without changes
|
package/dist/config.d.ts.map
CHANGED
|
File without changes
|
package/dist/data-proxy.d.ts
CHANGED
|
File without changes
|
package/dist/data-proxy.d.ts.map
CHANGED
|
File without changes
|
package/dist/debug-entry.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/debug.d.ts
CHANGED
|
File without changes
|
package/dist/debug.d.ts.map
CHANGED
|
File without changes
|
package/dist/index.cjs
CHANGED
|
@@ -203,6 +203,21 @@ class LifecycleManager {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
/**
|
|
207
|
+
* The one rule for "is this name a component?"
|
|
208
|
+
*
|
|
209
|
+
* An optional SINGLE leading underscore, then a capital letter, then letters,
|
|
210
|
+
* digits and underscores. The underscore prefix is a namespace reserved for
|
|
211
|
+
* framework-provided components (`_Root_Layout`) so they cannot collide with
|
|
212
|
+
* application components. Two or more leading underscores are not a component
|
|
213
|
+
* name; a lower-case first letter after the optional underscore is an HTML tag.
|
|
214
|
+
*/
|
|
215
|
+
const COMPONENT_NAME_PATTERN = /^_?[A-Z][A-Za-z0-9_]*$/;
|
|
216
|
+
const COMPONENT_NAME_RULE = 'must start with a capital letter, optionally preceded by a single underscore';
|
|
217
|
+
function is_component_name(name) {
|
|
218
|
+
return COMPONENT_NAME_PATTERN.test(name);
|
|
219
|
+
}
|
|
220
|
+
|
|
206
221
|
/**
|
|
207
222
|
* JQHTML v2 Component Registry
|
|
208
223
|
*
|
|
@@ -249,9 +264,9 @@ function register_component(nameOrClass, component_class, template) {
|
|
|
249
264
|
if (!component_class) {
|
|
250
265
|
throw new Error('Component class is required when registering by name');
|
|
251
266
|
}
|
|
252
|
-
// Validate component name
|
|
253
|
-
if (
|
|
254
|
-
throw new Error(`Component name '${name}'
|
|
267
|
+
// Validate component name against the shared rule
|
|
268
|
+
if (!is_component_name(name)) {
|
|
269
|
+
throw new Error(`Component name '${name}' ${COMPONENT_NAME_RULE}. Convention is First_Letter_With_Underscores.`);
|
|
255
270
|
}
|
|
256
271
|
component_classes.set(name, component_class);
|
|
257
272
|
// If template provided, register it
|
|
@@ -320,9 +335,9 @@ function register_template(template_def) {
|
|
|
320
335
|
if (!name) {
|
|
321
336
|
throw new Error('Template must have a name property');
|
|
322
337
|
}
|
|
323
|
-
// Validate template name
|
|
324
|
-
if (
|
|
325
|
-
throw new Error(`Template name '${name}'
|
|
338
|
+
// Validate template name against the shared rule
|
|
339
|
+
if (!is_component_name(name)) {
|
|
340
|
+
throw new Error(`Template name '${name}' ${COMPONENT_NAME_RULE}. Convention is First_Letter_With_Underscores.`);
|
|
326
341
|
}
|
|
327
342
|
// Check for duplicate registration
|
|
328
343
|
if (component_templates.has(name)) {
|
|
@@ -638,7 +653,9 @@ function process_instructions(instructions, target, context, slots) {
|
|
|
638
653
|
if (el) {
|
|
639
654
|
const element = $(el);
|
|
640
655
|
el.removeAttribute('data-tid');
|
|
641
|
-
|
|
656
|
+
// Bind to the component whose template wrote this element, which for
|
|
657
|
+
// spliced content is not the component being rendered.
|
|
658
|
+
apply_attributes(element, tagData.attrs, tagData.context);
|
|
642
659
|
}
|
|
643
660
|
}
|
|
644
661
|
// Third pass: initialize and boot components in parallel
|
|
@@ -664,6 +681,16 @@ function process_instruction_to_html(instruction, html, tagElements, components,
|
|
|
664
681
|
// Raw HTML/text - no escaping, as requested
|
|
665
682
|
html.push(instruction);
|
|
666
683
|
}
|
|
684
|
+
else if (Array.isArray(instruction)) {
|
|
685
|
+
if (instruction[0] !== '_content' || !Array.isArray(instruction[1])) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
// Content written in another template renders in that template's component.
|
|
689
|
+
const definer = instruction[2] || context;
|
|
690
|
+
for (const item of instruction[1]) {
|
|
691
|
+
process_instruction_to_html(item, html, tagElements, components, definer, slots);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
667
694
|
else if ('tag' in instruction) {
|
|
668
695
|
// HTML tag
|
|
669
696
|
process_tag_to_html(instruction, html, tagElements, components, context);
|
|
@@ -1839,7 +1866,7 @@ Load_Coordinator._registry = new Map();
|
|
|
1839
1866
|
const class_registry = Object.create(null);
|
|
1840
1867
|
// Markers for serialized class instances (unique to avoid collisions with user data)
|
|
1841
1868
|
// Replaced at build time by rollup (see rollup.config.js).
|
|
1842
|
-
const CORE_VERSION = '2.3.
|
|
1869
|
+
const CORE_VERSION = '2.3.64';
|
|
1843
1870
|
const CLASS_MARKER = '__jqhtml_class__';
|
|
1844
1871
|
const PROPS_MARKER = '__jqhtml_props__';
|
|
1845
1872
|
/**
|
|
@@ -3848,10 +3875,10 @@ class Jqhtml_Component {
|
|
|
3848
3875
|
// Create a content function that invokes child slots
|
|
3849
3876
|
// When parent calls content('slotName'), it invokes the child's slot function
|
|
3850
3877
|
const childSlots = instructions._slots;
|
|
3851
|
-
const contentFunction = (slotName,
|
|
3878
|
+
const contentFunction = (slotName, ...slotArgs) => {
|
|
3852
3879
|
if (childSlots[slotName] && typeof childSlots[slotName] === 'function') {
|
|
3853
|
-
// Invoke the slot function with
|
|
3854
|
-
const [slotInstructions, slotContext] = childSlots[slotName](
|
|
3880
|
+
// Invoke the slot function with everything content() was given
|
|
3881
|
+
const [slotInstructions, slotContext] = childSlots[slotName](...slotArgs);
|
|
3855
3882
|
// Return in render function format: [instructions, context]
|
|
3856
3883
|
// The template expression handler expects this format
|
|
3857
3884
|
return [slotInstructions, slotContext];
|
|
@@ -3876,12 +3903,11 @@ class Jqhtml_Component {
|
|
|
3876
3903
|
instructions = [];
|
|
3877
3904
|
}
|
|
3878
3905
|
}
|
|
3879
|
-
//
|
|
3880
|
-
//
|
|
3881
|
-
|
|
3882
|
-
// Process instructions to generate DOM
|
|
3906
|
+
// Process instructions to generate DOM. ['_content', ...] markers from
|
|
3907
|
+
// content() are handled by the processor, which renders them in the
|
|
3908
|
+
// component that wrote them.
|
|
3883
3909
|
// This kicks off child component boots but doesn't wait for them
|
|
3884
|
-
process_instructions(
|
|
3910
|
+
process_instructions(instructions, this.$, this);
|
|
3885
3911
|
}
|
|
3886
3912
|
// Don't update ready state here - let phases complete in order
|
|
3887
3913
|
this._update_debug_attrs();
|
|
@@ -4975,7 +5001,8 @@ class Jqhtml_Component {
|
|
|
4975
5001
|
* Find closest ancestor component matching selector
|
|
4976
5002
|
*
|
|
4977
5003
|
* A bare component name - a plain identifier starting with a capital letter,
|
|
4978
|
-
*
|
|
5004
|
+
* optionally preceded by a single underscore, such as 'Parent_Dashboard' or
|
|
5005
|
+
* '_Root_Layout' - is treated as the component-name class
|
|
4979
5006
|
* selector '.Parent_Dashboard'. Components carry a CSS class for every name
|
|
4980
5007
|
* in their prototype chain, so a base class name matches its subclasses too.
|
|
4981
5008
|
* Every other selector ('.Foo', '#id', '[attr]', 'div > .Component') is
|
|
@@ -5041,26 +5068,6 @@ class Jqhtml_Component {
|
|
|
5041
5068
|
_generate_cid() {
|
|
5042
5069
|
return uid();
|
|
5043
5070
|
}
|
|
5044
|
-
/**
|
|
5045
|
-
* Flatten instruction array - converts ['_content', [...]] markers to flat array
|
|
5046
|
-
* Recursively flattens nested content from content() calls
|
|
5047
|
-
*/
|
|
5048
|
-
_flatten_instructions(instructions) {
|
|
5049
|
-
const result = [];
|
|
5050
|
-
for (const instruction of instructions) {
|
|
5051
|
-
// Check if this is a _content marker: ['_content', [...]]
|
|
5052
|
-
if (Array.isArray(instruction) && instruction[0] === '_content' && Array.isArray(instruction[1])) {
|
|
5053
|
-
// Recursively flatten the content instructions
|
|
5054
|
-
const contentInstructions = this._flatten_instructions(instruction[1]);
|
|
5055
|
-
result.push(...contentInstructions);
|
|
5056
|
-
}
|
|
5057
|
-
else {
|
|
5058
|
-
// Regular instruction - keep as is
|
|
5059
|
-
result.push(instruction);
|
|
5060
|
-
}
|
|
5061
|
-
}
|
|
5062
|
-
return result;
|
|
5063
|
-
}
|
|
5064
5071
|
_apply_css_classes() {
|
|
5065
5072
|
const hierarchy = this.constructor.get_class_hierarchy();
|
|
5066
5073
|
// If component name differs from class name, add component name to hierarchy
|
|
@@ -5072,14 +5079,16 @@ class Jqhtml_Component {
|
|
|
5072
5079
|
// Add component name at the beginning (most specific)
|
|
5073
5080
|
classesToAdd.unshift(this.args._component_name);
|
|
5074
5081
|
}
|
|
5075
|
-
// Filter out private classes (starting with _) and invalid class names
|
|
5082
|
+
// Filter out private/mangled classes (starting with _) and invalid class names.
|
|
5083
|
+
// A component name with the reserved single-underscore prefix (_Root_Layout)
|
|
5084
|
+
// is public and is kept - see component-name.ts.
|
|
5076
5085
|
const publicClasses = classesToAdd.filter(className => {
|
|
5077
5086
|
// Guard against undefined, null, or non-string values
|
|
5078
5087
|
if (!className || typeof className !== 'string') {
|
|
5079
5088
|
console.warn('[JQHTML] Filtered out invalid class name:', className);
|
|
5080
5089
|
return false;
|
|
5081
5090
|
}
|
|
5082
|
-
return !className.startsWith('_');
|
|
5091
|
+
return !className.startsWith('_') || is_component_name(className);
|
|
5083
5092
|
});
|
|
5084
5093
|
if (publicClasses.length > 0) {
|
|
5085
5094
|
this.$.addClass(publicClasses.join(' '));
|
|
@@ -5285,7 +5294,7 @@ class Jqhtml_Component {
|
|
|
5285
5294
|
// Static properties
|
|
5286
5295
|
Jqhtml_Component.__jqhtml_component = true; // Marker for unified register() detection
|
|
5287
5296
|
// A bare component name, as accepted by closest() in place of a class selector
|
|
5288
|
-
Jqhtml_Component.COMPONENT_NAME_PATTERN =
|
|
5297
|
+
Jqhtml_Component.COMPONENT_NAME_PATTERN = COMPONENT_NAME_PATTERN;
|
|
5289
5298
|
|
|
5290
5299
|
/**
|
|
5291
5300
|
* JQHTML v2 Template Renderer
|
|
@@ -5807,16 +5816,20 @@ function init_jquery_plugin(jQuery) {
|
|
|
5807
5816
|
catch (error) {
|
|
5808
5817
|
console.warn('[JQHTML] Error stopping existing component during replacement:', error);
|
|
5809
5818
|
}
|
|
5810
|
-
// Remove component classes (any class starting with capital letter,
|
|
5819
|
+
// Remove component classes (any class starting with a capital letter, or a
|
|
5820
|
+
// component name with the reserved underscore prefix - except BEM classes)
|
|
5811
5821
|
const classes = element.attr('class');
|
|
5812
5822
|
if (classes) {
|
|
5813
5823
|
const classList = classes.split(/\s+/);
|
|
5814
5824
|
const nonComponentClasses = classList.filter((cls) => {
|
|
5815
5825
|
// Keep class if:
|
|
5816
5826
|
// 1. It's empty
|
|
5817
|
-
// 2. It
|
|
5827
|
+
// 2. It is neither capital-first nor a component name (see component-name.ts)
|
|
5818
5828
|
// 3. It's a BEM-style class (contains __) - these persist across reinitialization
|
|
5819
|
-
|
|
5829
|
+
if (!cls || cls.includes('__'))
|
|
5830
|
+
return true;
|
|
5831
|
+
const capital_first = cls[0] === cls[0].toUpperCase() && cls[0] !== cls[0].toLowerCase();
|
|
5832
|
+
return !capital_first && !is_component_name(cls);
|
|
5820
5833
|
});
|
|
5821
5834
|
element.attr('class', nonComponentClasses.join(' '));
|
|
5822
5835
|
}
|
|
@@ -6182,7 +6195,7 @@ function init(jQuery, config) {
|
|
|
6182
6195
|
}
|
|
6183
6196
|
}
|
|
6184
6197
|
// Version - will be replaced during build with actual version from package.json
|
|
6185
|
-
const version = '2.3.
|
|
6198
|
+
const version = '2.3.64';
|
|
6186
6199
|
// Default export with all functionality
|
|
6187
6200
|
const jqhtml = {
|
|
6188
6201
|
// Core
|
|
@@ -6318,6 +6331,8 @@ if (typeof window !== 'undefined' && !window.jqhtml) {
|
|
|
6318
6331
|
}
|
|
6319
6332
|
}
|
|
6320
6333
|
|
|
6334
|
+
exports.COMPONENT_NAME_PATTERN = COMPONENT_NAME_PATTERN;
|
|
6335
|
+
exports.COMPONENT_NAME_RULE = COMPONENT_NAME_RULE;
|
|
6321
6336
|
exports.Jqhtml_Component = Jqhtml_Component;
|
|
6322
6337
|
exports.Jqhtml_LifecycleManager = LifecycleManager;
|
|
6323
6338
|
exports.Jqhtml_Local_Storage = Jqhtml_Local_Storage;
|
|
@@ -6345,6 +6360,7 @@ exports.has_component = has_component;
|
|
|
6345
6360
|
exports.init = init;
|
|
6346
6361
|
exports.init_jquery_plugin = init_jquery_plugin;
|
|
6347
6362
|
exports.isSequentialProcessing = isSequentialProcessing;
|
|
6363
|
+
exports.is_component_name = is_component_name;
|
|
6348
6364
|
exports.list_components = list_components;
|
|
6349
6365
|
exports.logDataChange = logDataChange;
|
|
6350
6366
|
exports.logDispatch = logDispatch;
|