@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
@@ -17,7 +17,8 @@ export interface ComponentInstruction {
17
17
  export interface SlotInstruction {
18
18
  slot: [string, Record<string, any>, (context: any) => [any[], Jqhtml_Component]];
19
19
  }
20
- export type Instruction = TagInstruction | RawTagInstruction | ComponentInstruction | SlotInstruction | string;
20
+ export type ContentInstruction = ['_content', Instruction[], Jqhtml_Component?];
21
+ export type Instruction = TagInstruction | RawTagInstruction | ComponentInstruction | SlotInstruction | ContentInstruction | string;
21
22
  export declare function uid(): string;
22
23
  /**
23
24
  * Process an array of instructions and append to target
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-processor.d.ts","sourceRoot":"","sources":["../src/instruction-processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAClL;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC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,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAClL;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;CAClF;AAQD,MAAM,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEhF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,eAAe,GAAG,kBAAkB,GAAG,MAAM,CAAC;AAqBpI,wBAAgB,GAAG,IAAI,MAAM,CA2C5B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,WAAW,EAAE,EAC3B,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,gBAAgB,EACzB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,IAAI,CA0CN;AAyhBD;;GAEG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAW1F"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * JQHTML Core v2.3.59
2
+ * JQHTML Core v2.3.61
3
3
  * (c) 2025 JQHTML Team
4
4
  * Released under the MIT License
5
5
  */
@@ -639,7 +639,9 @@ function process_instructions(instructions, target, context, slots) {
639
639
  if (el) {
640
640
  const element = $(el);
641
641
  el.removeAttribute('data-tid');
642
- apply_attributes(element, tagData.attrs, context);
642
+ // Bind to the component whose template wrote this element, which for
643
+ // spliced content is not the component being rendered.
644
+ apply_attributes(element, tagData.attrs, tagData.context);
643
645
  }
644
646
  }
645
647
  // Third pass: initialize and boot components in parallel
@@ -665,6 +667,16 @@ function process_instruction_to_html(instruction, html, tagElements, components,
665
667
  // Raw HTML/text - no escaping, as requested
666
668
  html.push(instruction);
667
669
  }
670
+ else if (Array.isArray(instruction)) {
671
+ if (instruction[0] !== '_content' || !Array.isArray(instruction[1])) {
672
+ return;
673
+ }
674
+ // Content written in another template renders in that template's component.
675
+ const definer = instruction[2] || context;
676
+ for (const item of instruction[1]) {
677
+ process_instruction_to_html(item, html, tagElements, components, definer, slots);
678
+ }
679
+ }
668
680
  else if ('tag' in instruction) {
669
681
  // HTML tag
670
682
  process_tag_to_html(instruction, html, tagElements, components, context);
@@ -1840,7 +1852,7 @@ Load_Coordinator._registry = new Map();
1840
1852
  const class_registry = Object.create(null);
1841
1853
  // Markers for serialized class instances (unique to avoid collisions with user data)
1842
1854
  // Replaced at build time by rollup (see rollup.config.js).
1843
- const CORE_VERSION = '2.3.59';
1855
+ const CORE_VERSION = '2.3.61';
1844
1856
  const CLASS_MARKER = '__jqhtml_class__';
1845
1857
  const PROPS_MARKER = '__jqhtml_props__';
1846
1858
  /**
@@ -3849,10 +3861,10 @@ class Jqhtml_Component {
3849
3861
  // Create a content function that invokes child slots
3850
3862
  // When parent calls content('slotName'), it invokes the child's slot function
3851
3863
  const childSlots = instructions._slots;
3852
- const contentFunction = (slotName, data) => {
3864
+ const contentFunction = (slotName, ...slotArgs) => {
3853
3865
  if (childSlots[slotName] && typeof childSlots[slotName] === 'function') {
3854
- // Invoke the slot function with data parameter
3855
- const [slotInstructions, slotContext] = childSlots[slotName](data);
3866
+ // Invoke the slot function with everything content() was given
3867
+ const [slotInstructions, slotContext] = childSlots[slotName](...slotArgs);
3856
3868
  // Return in render function format: [instructions, context]
3857
3869
  // The template expression handler expects this format
3858
3870
  return [slotInstructions, slotContext];
@@ -3877,12 +3889,11 @@ class Jqhtml_Component {
3877
3889
  instructions = [];
3878
3890
  }
3879
3891
  }
3880
- // Flatten any nested content instructions before processing
3881
- // Instructions may contain ['_content', [...]] markers from content() calls
3882
- const flattenedInstructions = this._flatten_instructions(instructions);
3883
- // Process instructions to generate DOM
3892
+ // Process instructions to generate DOM. ['_content', ...] markers from
3893
+ // content() are handled by the processor, which renders them in the
3894
+ // component that wrote them.
3884
3895
  // This kicks off child component boots but doesn't wait for them
3885
- process_instructions(flattenedInstructions, this.$, this);
3896
+ process_instructions(instructions, this.$, this);
3886
3897
  }
3887
3898
  // Don't update ready state here - let phases complete in order
3888
3899
  this._update_debug_attrs();
@@ -5042,26 +5053,6 @@ class Jqhtml_Component {
5042
5053
  _generate_cid() {
5043
5054
  return uid();
5044
5055
  }
5045
- /**
5046
- * Flatten instruction array - converts ['_content', [...]] markers to flat array
5047
- * Recursively flattens nested content from content() calls
5048
- */
5049
- _flatten_instructions(instructions) {
5050
- const result = [];
5051
- for (const instruction of instructions) {
5052
- // Check if this is a _content marker: ['_content', [...]]
5053
- if (Array.isArray(instruction) && instruction[0] === '_content' && Array.isArray(instruction[1])) {
5054
- // Recursively flatten the content instructions
5055
- const contentInstructions = this._flatten_instructions(instruction[1]);
5056
- result.push(...contentInstructions);
5057
- }
5058
- else {
5059
- // Regular instruction - keep as is
5060
- result.push(instruction);
5061
- }
5062
- }
5063
- return result;
5064
- }
5065
5056
  _apply_css_classes() {
5066
5057
  const hierarchy = this.constructor.get_class_hierarchy();
5067
5058
  // If component name differs from class name, add component name to hierarchy
@@ -6183,7 +6174,7 @@ function init(jQuery, config) {
6183
6174
  }
6184
6175
  }
6185
6176
  // Version - will be replaced during build with actual version from package.json
6186
- const version = '2.3.59';
6177
+ const version = '2.3.61';
6187
6178
  // Default export with all functionality
6188
6179
  const jqhtml = {
6189
6180
  // Core