@jqhtml/core 2.3.61 → 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/component-name.d.ts +13 -0
- package/dist/component-name.d.ts.map +1 -0
- package/dist/component-registry.d.ts.map +1 -1
- package/dist/component.d.ts +2 -1
- package/dist/component.d.ts.map +1 -1
- package/dist/index.cjs +40 -15
- 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 +38 -16
- package/dist/index.js.map +1 -1
- package/dist/jqhtml-core.esm.js +39 -17
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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"}
|
|
@@ -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,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;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
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwBH,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,kBAAkB,UAAQ;IACjC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGtB,MAAM,CAAC,QAAQ,CAAC,sBAAsB,SAA0B;IAGhE,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,O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AeG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAgB3B;;;;;;;;;;;;;;;OAeG;IACH,GAAG,CAAC,QAAQ,EAAE,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/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)) {
|
|
@@ -1851,7 +1866,7 @@ Load_Coordinator._registry = new Map();
|
|
|
1851
1866
|
const class_registry = Object.create(null);
|
|
1852
1867
|
// Markers for serialized class instances (unique to avoid collisions with user data)
|
|
1853
1868
|
// Replaced at build time by rollup (see rollup.config.js).
|
|
1854
|
-
const CORE_VERSION = '2.3.
|
|
1869
|
+
const CORE_VERSION = '2.3.64';
|
|
1855
1870
|
const CLASS_MARKER = '__jqhtml_class__';
|
|
1856
1871
|
const PROPS_MARKER = '__jqhtml_props__';
|
|
1857
1872
|
/**
|
|
@@ -4986,7 +5001,8 @@ class Jqhtml_Component {
|
|
|
4986
5001
|
* Find closest ancestor component matching selector
|
|
4987
5002
|
*
|
|
4988
5003
|
* A bare component name - a plain identifier starting with a capital letter,
|
|
4989
|
-
*
|
|
5004
|
+
* optionally preceded by a single underscore, such as 'Parent_Dashboard' or
|
|
5005
|
+
* '_Root_Layout' - is treated as the component-name class
|
|
4990
5006
|
* selector '.Parent_Dashboard'. Components carry a CSS class for every name
|
|
4991
5007
|
* in their prototype chain, so a base class name matches its subclasses too.
|
|
4992
5008
|
* Every other selector ('.Foo', '#id', '[attr]', 'div > .Component') is
|
|
@@ -5063,14 +5079,16 @@ class Jqhtml_Component {
|
|
|
5063
5079
|
// Add component name at the beginning (most specific)
|
|
5064
5080
|
classesToAdd.unshift(this.args._component_name);
|
|
5065
5081
|
}
|
|
5066
|
-
// 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.
|
|
5067
5085
|
const publicClasses = classesToAdd.filter(className => {
|
|
5068
5086
|
// Guard against undefined, null, or non-string values
|
|
5069
5087
|
if (!className || typeof className !== 'string') {
|
|
5070
5088
|
console.warn('[JQHTML] Filtered out invalid class name:', className);
|
|
5071
5089
|
return false;
|
|
5072
5090
|
}
|
|
5073
|
-
return !className.startsWith('_');
|
|
5091
|
+
return !className.startsWith('_') || is_component_name(className);
|
|
5074
5092
|
});
|
|
5075
5093
|
if (publicClasses.length > 0) {
|
|
5076
5094
|
this.$.addClass(publicClasses.join(' '));
|
|
@@ -5276,7 +5294,7 @@ class Jqhtml_Component {
|
|
|
5276
5294
|
// Static properties
|
|
5277
5295
|
Jqhtml_Component.__jqhtml_component = true; // Marker for unified register() detection
|
|
5278
5296
|
// A bare component name, as accepted by closest() in place of a class selector
|
|
5279
|
-
Jqhtml_Component.COMPONENT_NAME_PATTERN =
|
|
5297
|
+
Jqhtml_Component.COMPONENT_NAME_PATTERN = COMPONENT_NAME_PATTERN;
|
|
5280
5298
|
|
|
5281
5299
|
/**
|
|
5282
5300
|
* JQHTML v2 Template Renderer
|
|
@@ -5798,16 +5816,20 @@ function init_jquery_plugin(jQuery) {
|
|
|
5798
5816
|
catch (error) {
|
|
5799
5817
|
console.warn('[JQHTML] Error stopping existing component during replacement:', error);
|
|
5800
5818
|
}
|
|
5801
|
-
// 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)
|
|
5802
5821
|
const classes = element.attr('class');
|
|
5803
5822
|
if (classes) {
|
|
5804
5823
|
const classList = classes.split(/\s+/);
|
|
5805
5824
|
const nonComponentClasses = classList.filter((cls) => {
|
|
5806
5825
|
// Keep class if:
|
|
5807
5826
|
// 1. It's empty
|
|
5808
|
-
// 2. It
|
|
5827
|
+
// 2. It is neither capital-first nor a component name (see component-name.ts)
|
|
5809
5828
|
// 3. It's a BEM-style class (contains __) - these persist across reinitialization
|
|
5810
|
-
|
|
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);
|
|
5811
5833
|
});
|
|
5812
5834
|
element.attr('class', nonComponentClasses.join(' '));
|
|
5813
5835
|
}
|
|
@@ -6173,7 +6195,7 @@ function init(jQuery, config) {
|
|
|
6173
6195
|
}
|
|
6174
6196
|
}
|
|
6175
6197
|
// Version - will be replaced during build with actual version from package.json
|
|
6176
|
-
const version = '2.3.
|
|
6198
|
+
const version = '2.3.64';
|
|
6177
6199
|
// Default export with all functionality
|
|
6178
6200
|
const jqhtml = {
|
|
6179
6201
|
// Core
|
|
@@ -6309,6 +6331,8 @@ if (typeof window !== 'undefined' && !window.jqhtml) {
|
|
|
6309
6331
|
}
|
|
6310
6332
|
}
|
|
6311
6333
|
|
|
6334
|
+
exports.COMPONENT_NAME_PATTERN = COMPONENT_NAME_PATTERN;
|
|
6335
|
+
exports.COMPONENT_NAME_RULE = COMPONENT_NAME_RULE;
|
|
6312
6336
|
exports.Jqhtml_Component = Jqhtml_Component;
|
|
6313
6337
|
exports.Jqhtml_LifecycleManager = LifecycleManager;
|
|
6314
6338
|
exports.Jqhtml_Local_Storage = Jqhtml_Local_Storage;
|
|
@@ -6336,6 +6360,7 @@ exports.has_component = has_component;
|
|
|
6336
6360
|
exports.init = init;
|
|
6337
6361
|
exports.init_jquery_plugin = init_jquery_plugin;
|
|
6338
6362
|
exports.isSequentialProcessing = isSequentialProcessing;
|
|
6363
|
+
exports.is_component_name = is_component_name;
|
|
6339
6364
|
exports.list_components = list_components;
|
|
6340
6365
|
exports.logDataChange = logDataChange;
|
|
6341
6366
|
exports.logDispatch = logDispatch;
|