@jqhtml/core 2.3.59 → 2.3.61

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 (87) hide show
  1. package/dist/boot.d.ts +0 -0
  2. package/dist/boot.d.ts.map +0 -0
  3. package/dist/cache-key-serializer.d.ts +0 -0
  4. package/dist/cache-key-serializer.d.ts.map +0 -0
  5. package/dist/component-cache.d.ts +0 -0
  6. package/dist/component-cache.d.ts.map +0 -0
  7. package/dist/component-events.d.ts +0 -0
  8. package/dist/component-events.d.ts.map +0 -0
  9. package/dist/component-queue.d.ts +0 -0
  10. package/dist/component-queue.d.ts.map +0 -0
  11. package/dist/component-registry.d.ts +0 -0
  12. package/dist/component-registry.d.ts.map +0 -0
  13. package/dist/component.d.ts +0 -5
  14. package/dist/component.d.ts.map +1 -1
  15. package/dist/config.d.ts +0 -0
  16. package/dist/config.d.ts.map +0 -0
  17. package/dist/data-proxy.d.ts +0 -0
  18. package/dist/data-proxy.d.ts.map +0 -0
  19. package/dist/debug-entry.d.ts +0 -0
  20. package/dist/debug-entry.d.ts.map +0 -0
  21. package/dist/debug.d.ts +0 -0
  22. package/dist/debug.d.ts.map +0 -0
  23. package/dist/index.cjs +22 -31
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.ts +0 -0
  26. package/dist/index.d.ts.map +0 -0
  27. package/dist/index.js +22 -31
  28. package/dist/index.js.map +1 -1
  29. package/dist/instruction-processor.d.ts +2 -1
  30. package/dist/instruction-processor.d.ts.map +1 -1
  31. package/dist/jqhtml-core.esm.js +23 -32
  32. package/dist/jqhtml-core.esm.js.map +1 -1
  33. package/dist/jqhtml-debug.esm.js +0 -0
  34. package/dist/jqhtml-debug.esm.js.map +0 -0
  35. package/dist/jquery-plugin.d.ts +0 -0
  36. package/dist/jquery-plugin.d.ts.map +0 -0
  37. package/dist/lifecycle-manager.d.ts +0 -0
  38. package/dist/lifecycle-manager.d.ts.map +0 -0
  39. package/dist/load-coordinator.d.ts +0 -0
  40. package/dist/load-coordinator.d.ts.map +0 -0
  41. package/dist/local-storage.d.ts +0 -0
  42. package/dist/local-storage.d.ts.map +0 -0
  43. package/dist/preload-data.d.ts +0 -0
  44. package/dist/preload-data.d.ts.map +0 -0
  45. package/dist/template-renderer.d.ts +0 -0
  46. package/dist/template-renderer.d.ts.map +0 -0
  47. package/dist/viewport.d.ts +0 -0
  48. package/dist/viewport.d.ts.map +0 -0
  49. package/package.json +1 -1
  50. package/dist/boot.js +0 -130
  51. package/dist/boot.js.map +0 -1
  52. package/dist/cache-key-serializer.js +0 -140
  53. package/dist/cache-key-serializer.js.map +0 -1
  54. package/dist/component-cache.js +0 -270
  55. package/dist/component-cache.js.map +0 -1
  56. package/dist/component-events.js +0 -141
  57. package/dist/component-events.js.map +0 -1
  58. package/dist/component-queue.js +0 -118
  59. package/dist/component-queue.js.map +0 -1
  60. package/dist/component-registry.js +0 -298
  61. package/dist/component-registry.js.map +0 -1
  62. package/dist/component.js +0 -1892
  63. package/dist/component.js.map +0 -1
  64. package/dist/config.js +0 -64
  65. package/dist/config.js.map +0 -1
  66. package/dist/data-proxy.js +0 -223
  67. package/dist/data-proxy.js.map +0 -1
  68. package/dist/debug-entry.js +0 -8
  69. package/dist/debug-entry.js.map +0 -1
  70. package/dist/debug.js +0 -203
  71. package/dist/debug.js.map +0 -1
  72. package/dist/instruction-processor.js +0 -563
  73. package/dist/instruction-processor.js.map +0 -1
  74. package/dist/jquery-plugin.js +0 -472
  75. package/dist/jquery-plugin.js.map +0 -1
  76. package/dist/lifecycle-manager.js +0 -201
  77. package/dist/lifecycle-manager.js.map +0 -1
  78. package/dist/load-coordinator.js +0 -309
  79. package/dist/load-coordinator.js.map +0 -1
  80. package/dist/local-storage.js +0 -699
  81. package/dist/local-storage.js.map +0 -1
  82. package/dist/preload-data.js +0 -136
  83. package/dist/preload-data.js.map +0 -1
  84. package/dist/template-renderer.js +0 -278
  85. package/dist/template-renderer.js.map +0 -1
  86. package/dist/viewport.js +0 -69
  87. package/dist/viewport.js.map +0 -1
package/dist/index.d.ts CHANGED
File without changes
File without changes
package/dist/index.js CHANGED
@@ -634,7 +634,9 @@ function process_instructions(instructions, target, context, slots) {
634
634
  if (el) {
635
635
  const element = $(el);
636
636
  el.removeAttribute('data-tid');
637
- apply_attributes(element, tagData.attrs, context);
637
+ // Bind to the component whose template wrote this element, which for
638
+ // spliced content is not the component being rendered.
639
+ apply_attributes(element, tagData.attrs, tagData.context);
638
640
  }
639
641
  }
640
642
  // Third pass: initialize and boot components in parallel
@@ -660,6 +662,16 @@ function process_instruction_to_html(instruction, html, tagElements, components,
660
662
  // Raw HTML/text - no escaping, as requested
661
663
  html.push(instruction);
662
664
  }
665
+ else if (Array.isArray(instruction)) {
666
+ if (instruction[0] !== '_content' || !Array.isArray(instruction[1])) {
667
+ return;
668
+ }
669
+ // Content written in another template renders in that template's component.
670
+ const definer = instruction[2] || context;
671
+ for (const item of instruction[1]) {
672
+ process_instruction_to_html(item, html, tagElements, components, definer, slots);
673
+ }
674
+ }
663
675
  else if ('tag' in instruction) {
664
676
  // HTML tag
665
677
  process_tag_to_html(instruction, html, tagElements, components, context);
@@ -1835,7 +1847,7 @@ Load_Coordinator._registry = new Map();
1835
1847
  const class_registry = Object.create(null);
1836
1848
  // Markers for serialized class instances (unique to avoid collisions with user data)
1837
1849
  // Replaced at build time by rollup (see rollup.config.js).
1838
- const CORE_VERSION = '2.3.59';
1850
+ const CORE_VERSION = '2.3.61';
1839
1851
  const CLASS_MARKER = '__jqhtml_class__';
1840
1852
  const PROPS_MARKER = '__jqhtml_props__';
1841
1853
  /**
@@ -3844,10 +3856,10 @@ class Jqhtml_Component {
3844
3856
  // Create a content function that invokes child slots
3845
3857
  // When parent calls content('slotName'), it invokes the child's slot function
3846
3858
  const childSlots = instructions._slots;
3847
- const contentFunction = (slotName, data) => {
3859
+ const contentFunction = (slotName, ...slotArgs) => {
3848
3860
  if (childSlots[slotName] && typeof childSlots[slotName] === 'function') {
3849
- // Invoke the slot function with data parameter
3850
- const [slotInstructions, slotContext] = childSlots[slotName](data);
3861
+ // Invoke the slot function with everything content() was given
3862
+ const [slotInstructions, slotContext] = childSlots[slotName](...slotArgs);
3851
3863
  // Return in render function format: [instructions, context]
3852
3864
  // The template expression handler expects this format
3853
3865
  return [slotInstructions, slotContext];
@@ -3872,12 +3884,11 @@ class Jqhtml_Component {
3872
3884
  instructions = [];
3873
3885
  }
3874
3886
  }
3875
- // Flatten any nested content instructions before processing
3876
- // Instructions may contain ['_content', [...]] markers from content() calls
3877
- const flattenedInstructions = this._flatten_instructions(instructions);
3878
- // Process instructions to generate DOM
3887
+ // Process instructions to generate DOM. ['_content', ...] markers from
3888
+ // content() are handled by the processor, which renders them in the
3889
+ // component that wrote them.
3879
3890
  // This kicks off child component boots but doesn't wait for them
3880
- process_instructions(flattenedInstructions, this.$, this);
3891
+ process_instructions(instructions, this.$, this);
3881
3892
  }
3882
3893
  // Don't update ready state here - let phases complete in order
3883
3894
  this._update_debug_attrs();
@@ -5037,26 +5048,6 @@ class Jqhtml_Component {
5037
5048
  _generate_cid() {
5038
5049
  return uid();
5039
5050
  }
5040
- /**
5041
- * Flatten instruction array - converts ['_content', [...]] markers to flat array
5042
- * Recursively flattens nested content from content() calls
5043
- */
5044
- _flatten_instructions(instructions) {
5045
- const result = [];
5046
- for (const instruction of instructions) {
5047
- // Check if this is a _content marker: ['_content', [...]]
5048
- if (Array.isArray(instruction) && instruction[0] === '_content' && Array.isArray(instruction[1])) {
5049
- // Recursively flatten the content instructions
5050
- const contentInstructions = this._flatten_instructions(instruction[1]);
5051
- result.push(...contentInstructions);
5052
- }
5053
- else {
5054
- // Regular instruction - keep as is
5055
- result.push(instruction);
5056
- }
5057
- }
5058
- return result;
5059
- }
5060
5051
  _apply_css_classes() {
5061
5052
  const hierarchy = this.constructor.get_class_hierarchy();
5062
5053
  // If component name differs from class name, add component name to hierarchy
@@ -6178,7 +6169,7 @@ function init(jQuery, config) {
6178
6169
  }
6179
6170
  }
6180
6171
  // Version - will be replaced during build with actual version from package.json
6181
- const version = '2.3.59';
6172
+ const version = '2.3.61';
6182
6173
  // Default export with all functionality
6183
6174
  const jqhtml = {
6184
6175
  // Core