@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
@@ -1,563 +0,0 @@
1
- /**
2
- * JQHTML v2 Instruction Processor
3
- *
4
- * Processes instruction arrays generated by the parser
5
- * Uses v1's HTML string building approach for performance
6
- */
7
- import { Jqhtml_Component } from './component.js';
8
- import { debug_attributes_enabled } from './config.js';
9
- import { get_component_class, get_template } from './component-registry.js';
10
- // Base36 incrementing CID generator
11
- // Format: aa, ab, ..., az, a0, ..., a9, ba, ..., zz, z9, aaa, ...
12
- // First digit must always be a letter (a-z), subsequent digits can be a-z0-9
13
- let _cid_increment = 'aa';
14
- export function uid() {
15
- const current = _cid_increment;
16
- // Increment for next use
17
- const chars = _cid_increment.split('');
18
- let carry = true;
19
- // Process from right to left
20
- for (let i = chars.length - 1; i >= 0 && carry; i--) {
21
- const char = chars[i];
22
- if (char >= 'a' && char < 'z') {
23
- // a-y increments to next letter
24
- chars[i] = String.fromCharCode(char.charCodeAt(0) + 1);
25
- carry = false;
26
- }
27
- else if (char === 'z') {
28
- // z transitions to '0' (start of numeric range)
29
- chars[i] = '0';
30
- carry = false;
31
- }
32
- else if (char >= '0' && char < '9') {
33
- // 0-8 increments to next number
34
- chars[i] = String.fromCharCode(char.charCodeAt(0) + 1);
35
- carry = false;
36
- }
37
- else if (char === '9') {
38
- // 9 wraps back to 'a' with carry
39
- chars[i] = 'a';
40
- carry = true;
41
- }
42
- }
43
- // If we still have carry after processing all digits, we need more digits
44
- if (carry) {
45
- chars.unshift('a'); // Prepend new 'a' (first digit must be letter)
46
- }
47
- // Ensure first digit is never numeric
48
- if (chars[0] >= '0' && chars[0] <= '9') {
49
- chars[0] = 'a';
50
- chars.unshift('a');
51
- }
52
- _cid_increment = chars.join('');
53
- return current;
54
- }
55
- /**
56
- * Process an array of instructions and append to target
57
- * Uses v1 approach: build HTML string, set innerHTML, then initialize
58
- */
59
- export function process_instructions(instructions, target, context, slots) {
60
- // Build HTML string and track elements that need initialization
61
- const html = [];
62
- const tagElements = {};
63
- const components = {};
64
- // Process all instructions to build HTML
65
- for (const instruction of instructions) {
66
- process_instruction_to_html(instruction, html, tagElements, components, context, slots);
67
- }
68
- // Set innerHTML once - this is the performance win
69
- // Use native innerHTML for better performance
70
- target[0].innerHTML = html.join('');
71
- // Second pass: initialize special attributes and events
72
- for (const [tid, tagData] of Object.entries(tagElements)) {
73
- // Use native querySelector for better performance
74
- const el = target[0].querySelector(`[data-tid="${tid}"]`);
75
- if (el) {
76
- const element = $(el);
77
- el.removeAttribute('data-tid');
78
- apply_attributes(element, tagData.attrs, context);
79
- }
80
- }
81
- // Third pass: initialize and boot components in parallel
82
- // Like v1, all sibling components at this level boot simultaneously
83
- // DO NOT await - let children boot in background while parent continues
84
- for (const [cid, compData] of Object.entries(components)) {
85
- // Use native querySelector for better performance
86
- const el = target[0].querySelector(`[data-cid="${cid}"]`);
87
- if (el) {
88
- const element = $(el);
89
- el.removeAttribute('data-cid');
90
- // Boot this component (which will render and boot its children recursively)
91
- // Fire and forget - don't wait for boot to complete
92
- initialize_component(element, compData);
93
- }
94
- }
95
- }
96
- /**
97
- * Process a single instruction into HTML
98
- */
99
- function process_instruction_to_html(instruction, html, tagElements, components, context, slots) {
100
- if (typeof instruction === 'string') {
101
- // Raw HTML/text - no escaping, as requested
102
- html.push(instruction);
103
- }
104
- else if ('tag' in instruction) {
105
- // HTML tag
106
- process_tag_to_html(instruction, html, tagElements, components, context);
107
- }
108
- else if ('comp' in instruction) {
109
- // Component
110
- process_component_to_html(instruction, html, components, context);
111
- }
112
- else if ('slot' in instruction) {
113
- // Slot content
114
- process_slot_to_html(instruction, html, tagElements, components, context, slots);
115
- }
116
- else if ('rawtag' in instruction) {
117
- // Raw content tag (textarea, pre)
118
- process_rawtag_to_html(instruction, html);
119
- }
120
- }
121
- /**
122
- * Process a tag instruction to HTML
123
- */
124
- function process_tag_to_html(instruction, html, tagElements, components, context) {
125
- const [tagName, attrs, selfClosing] = instruction.tag;
126
- // Check if we need to track this element for second pass
127
- const needsTracking = Object.keys(attrs).some(key => key === '$sid' || key.startsWith('$') || key.startsWith('@') ||
128
- key.startsWith('on') ||
129
- key.startsWith('data-bind-') || key.startsWith('data-__-on-'));
130
- // Start building tag
131
- html.push(`<${tagName}`);
132
- // Add tracking ID if needed
133
- let tid = null;
134
- if (needsTracking) {
135
- tid = uid();
136
- html.push(` data-tid="${tid}"`);
137
- tagElements[tid] = { attrs, context };
138
- }
139
- // Add simple string/numeric attributes directly
140
- for (const [key, value] of Object.entries(attrs)) {
141
- if (key === 'data-sid' && !debug_attributes_enabled()) {
142
- continue; // debug-only attribute; the scoped id is what $sid() resolves
143
- }
144
- if (!key.startsWith('$') && !key.startsWith('on') && !key.startsWith('@') &&
145
- !key.startsWith('data-bind-') && !key.startsWith('data-__-on-') &&
146
- (typeof value === 'string' || typeof value === 'number')) {
147
- if (key === 'id' && tid) {
148
- // Special handling for id attribute - scope to parent component's _cid
149
- // This is for regular id="foo" attributes that need scoping (rare case)
150
- // Most scoping happens via $sid attribute which becomes data-sid
151
- // Don't double-scope if already scoped (contains :)
152
- if (typeof value === 'string' && value.includes(':')) {
153
- html.push(` id="${value}"`);
154
- }
155
- else {
156
- html.push(` id="${value}:${context._cid}"`);
157
- }
158
- }
159
- else {
160
- html.push(` ${key}="${value}"`);
161
- }
162
- }
163
- }
164
- // Close opening tag
165
- if (selfClosing) {
166
- html.push(' />');
167
- }
168
- else {
169
- html.push('>');
170
- }
171
- }
172
- /**
173
- * Process a component instruction to HTML
174
- */
175
- function process_component_to_html(instruction, html, components, context) {
176
- const [componentName, originalProps, contentOrSlots] = instruction.comp;
177
- // Propagate lifecycle flags from parent to child if parent has them set
178
- // This allows a parent component with these flags to automatically
179
- // pass this behavior to all child components rendered in its template
180
- let props = originalProps;
181
- const parentArgs = context.args;
182
- // Check if we need to propagate any flags.
183
- // Template-authored flags arrive with the '$' still on the key ($_load_only=false
184
- // compiles to props['$_load_only']) - honor both spellings so a child template can
185
- // opt out of a cascading parent flag with an explicit false.
186
- const own_use_cached_data = props.use_cached_data !== undefined ? props.use_cached_data : props['$use_cached_data'];
187
- const own_load_only = props._load_only !== undefined ? props._load_only : props['$_load_only'];
188
- const own_load_render_only = props._load_render_only !== undefined ? props._load_render_only : props['$_load_render_only'];
189
- const propagate_use_cached_data = parentArgs?.use_cached_data === true && own_use_cached_data === undefined;
190
- const propagate_load_only = parentArgs?._load_only === true && own_load_only === undefined;
191
- const propagate_load_render_only = parentArgs?._load_render_only === true && own_load_render_only === undefined;
192
- if (propagate_use_cached_data || propagate_load_only || propagate_load_render_only) {
193
- props = { ...originalProps };
194
- if (propagate_use_cached_data) {
195
- props.use_cached_data = true;
196
- }
197
- if (propagate_load_only) {
198
- props._load_only = true;
199
- }
200
- if (propagate_load_render_only) {
201
- props._load_render_only = true;
202
- }
203
- }
204
- // Determine if third parameter is a function (default content) or object (named slots)
205
- let contentFn;
206
- let slots;
207
- if (contentOrSlots) {
208
- if (typeof contentOrSlots === 'function') {
209
- // Single function = default content
210
- contentFn = contentOrSlots;
211
- }
212
- else if (typeof contentOrSlots === 'object') {
213
- // Object = named slots
214
- slots = contentOrSlots;
215
- }
216
- }
217
- // Generate unique ID for this component
218
- const cid = uid();
219
- // Get component class (or default) and template to determine tag name
220
- const ComponentClass = get_component_class(componentName) || Jqhtml_Component;
221
- const template = get_template(componentName);
222
- // Get tag name with precedence: _tag (invocation) > tag (template) > 'div'
223
- const tagName = props._tag || template.tag || 'div';
224
- // Create element with tracking ID
225
- html.push(`<${tagName} data-cid="${cid}"`);
226
- // Handle id attributes for components
227
- // The compiled code always generates both 'id' (scoped) and 'data-sid' (base) for $sid attributes
228
- // We just pass through what the compiler gave us - NEVER regenerate
229
- if (props['data-sid']) {
230
- const baseId = props['data-sid'];
231
- // The compiled code ALWAYS sets props['id'] with the correct scoped value
232
- // Just use it directly - it already has the correct parent _cid baked in
233
- // data-sid is debug-only: $sid() resolves via the scoped id, never this.
234
- html.push(debug_attributes_enabled()
235
- ? ` id="${props['id']}" data-sid="${baseId}"`
236
- : ` id="${props['id']}"`);
237
- }
238
- // Regular id passes through unchanged
239
- else if (props['id']) {
240
- html.push(` id="${props['id']}"`);
241
- }
242
- // Close tag - other attributes will be added during initialization
243
- html.push('></' + tagName + '>');
244
- // Track for initialization
245
- components[cid] = {
246
- name: componentName,
247
- props,
248
- contentFn,
249
- slots,
250
- context
251
- };
252
- }
253
- /**
254
- * Process a slot instruction to HTML
255
- */
256
- function process_slot_to_html(instruction, html, tagElements, components, context, parentSlots) {
257
- const [slotName] = instruction.slot;
258
- // Check if parent provided content for this slot
259
- if (parentSlots && slotName in parentSlots) {
260
- const parentSlot = parentSlots[slotName];
261
- const [, slotProps, contentFn] = parentSlot.slot;
262
- // Execute slot content function with props
263
- const [content] = contentFn.call(context, slotProps);
264
- // Process the content to HTML
265
- for (const item of content) {
266
- process_instruction_to_html(item, html, tagElements, components, context);
267
- }
268
- }
269
- else if (slotName === 'default' && instruction.slot[2]) {
270
- // Use default slot content
271
- const [, , defaultFn] = instruction.slot;
272
- const [content] = defaultFn.call(context, {});
273
- for (const item of content) {
274
- process_instruction_to_html(item, html, tagElements, components, context);
275
- }
276
- }
277
- }
278
- /**
279
- * Process a rawtag instruction to HTML
280
- *
281
- * Raw content tags (textarea, pre) preserve exact whitespace without collapsing.
282
- * Content is inserted as textContent (not innerHTML) to prevent any interpretation.
283
- */
284
- function process_rawtag_to_html(instruction, html) {
285
- const [tagName, attrs, rawContent] = instruction.rawtag;
286
- // Build opening tag
287
- html.push(`<${tagName}`);
288
- // Add attributes
289
- for (const [key, value] of Object.entries(attrs)) {
290
- if (typeof value === 'string' || typeof value === 'number') {
291
- const escaped_value = String(value).replace(/"/g, '&quot;');
292
- html.push(` ${key}="${escaped_value}"`);
293
- }
294
- else if (typeof value === 'boolean' && value) {
295
- // Boolean attribute (e.g., disabled, readonly)
296
- html.push(` ${key}`);
297
- }
298
- }
299
- html.push('>');
300
- // Add raw content, preserving whitespace.
301
- //
302
- // <textarea> holds text and nothing else, so everything is escaped.
303
- //
304
- // <pre> holds phrasing content - <pre><code> is the standard code-block idiom - so
305
- // markup the author wrote is passed through. A '<' that does not begin a tag is
306
- // still escaped, which is what the HTML tokenizer itself does with a stray '<' and
307
- // keeps code samples such as "if (a < b)" rendering as written. Interpolated
308
- // values are escaped by the compiler before they reach this point.
309
- const is_raw_html_content = tagName.toLowerCase() === 'pre';
310
- const escaped_content = is_raw_html_content
311
- ? rawContent.replace(/<(?![a-zA-Z/!?])/g, '&lt;')
312
- : rawContent
313
- .replace(/&/g, '&amp;')
314
- .replace(/</g, '&lt;')
315
- .replace(/>/g, '&gt;');
316
- html.push(escaped_content);
317
- // Close tag
318
- html.push(`</${tagName}>`);
319
- }
320
- /**
321
- * Apply attributes with special handling to a DOM element
322
- *
323
- * This function processes various attribute types and applies them to the element:
324
- * - $sid: Creates component-scoped IDs (handled elsewhere in HTML generation)
325
- * - $*: Stored via jQuery .data() only (added to context.args for components)
326
- * - @*: Event handlers with automatic preventDefault and context binding
327
- * - on*: Standard event handlers with context binding
328
- * - data-*: Data attributes (stored both as attributes and via .data(), added to context.args)
329
- * - class: Merges with existing classes (no duplicates)
330
- * - style: Merges with existing styles (rule by rule, new values override)
331
- * - All other attributes: Applied directly to the element as standard HTML attributes
332
- *
333
- * For class and style attributes, merge logic is applied:
334
- * - class: Splits both existing and new, combines without duplicates
335
- * - style: Parses both into property maps, merges (new overrides), rebuilds
336
- *
337
- * Regular HTML attributes (href, title, role, etc.) are applied directly to the DOM
338
- * and are NOT converted to data attributes or added to component args.
339
- */
340
- function apply_attributes(element, attrs, context) {
341
- for (const [key, value] of Object.entries(attrs)) {
342
- if (key === '$sid' || key === 'id') {
343
- // Already handled in HTML generation
344
- continue;
345
- }
346
- else if (key.startsWith('$')) {
347
- // $ attributes: store via jQuery .data() only
348
- // Does NOT create data-* attributes on the DOM element
349
- const dataKey = key.substring(1);
350
- element.data(dataKey, value);
351
- // } else if (key.startsWith('@')) {
352
- // // Event handler with @ prefix (e.g., @click)
353
- // const eventName = key.substring(1); // Remove @ to get 'click'
354
- // if (typeof value === 'function') {
355
- // element.on(eventName, function(e: any) {
356
- // e.preventDefault(); // Auto-preventDefault as per JQHTML design
357
- // // Bind 'this' to the component context and call the function
358
- // value.bind(context)(e, element);
359
- // });
360
- // } else {
361
- // console.warn("(JQHTML) Tried to assign a non function to @ event handler "+key)
362
- // }
363
- }
364
- else if (key.startsWith('data-__-on-')) {
365
- // Event handler
366
- const eventName = key.substring(11); // 'data-__-on-'.length = 11
367
- if (typeof value === 'function') {
368
- element.on(eventName, function (e) {
369
- value.bind(context)(e, element);
370
- });
371
- }
372
- else {
373
- console.warn("(JQHTML) Tried to assign a non function to on event handler " + key);
374
- }
375
- }
376
- else if (key.startsWith('on')) {
377
- // Event handler
378
- const eventName = key.substring(2);
379
- if (typeof value === 'function') {
380
- element.on(eventName, function (e) {
381
- value.bind(context)(e, element);
382
- });
383
- }
384
- else {
385
- console.warn("(JQHTML) Tried to assign a non function to on event handler " + key);
386
- }
387
- }
388
- else if (key.startsWith('data-')) {
389
- // data-sid is debug-only - suppressed entirely in production
390
- if (key === 'data-sid' && !debug_attributes_enabled()) {
391
- continue;
392
- }
393
- // Data attributes - go into DOM
394
- const attrValue = typeof value === "string" ? value.trim() : value;
395
- element.attr(key, attrValue);
396
- // Get version without 'data-' prefix
397
- const dataKey = key.substring(5);
398
- // Always set element.data
399
- element.data(dataKey, value);
400
- }
401
- else if (key === 'class') {
402
- // Handle class attribute with merge logic
403
- const existingClasses = element.attr('class');
404
- // Debug logging
405
- if (window.jqhtml?.debug?.enabled) {
406
- console.log(`[InstructionProcessor] Merging class attribute:`, {
407
- existing: existingClasses,
408
- new: value
409
- });
410
- }
411
- if (!existingClasses) {
412
- // No existing classes - set directly
413
- const attrValue = typeof value === "string" ? value.trim() : value;
414
- element.attr('class', attrValue);
415
- }
416
- else {
417
- // Merge classes - split and add if not present
418
- const existing = existingClasses.split(/\s+/).filter(c => c);
419
- const newClasses = String(value).split(/\s+/).filter(c => c);
420
- for (const newClass of newClasses) {
421
- if (!existing.includes(newClass)) {
422
- existing.push(newClass);
423
- }
424
- }
425
- element.attr('class', existing.join(' '));
426
- }
427
- // Debug logging result
428
- if (window.jqhtml?.debug?.enabled) {
429
- console.log(`[InstructionProcessor] Class after merge:`, element.attr('class'));
430
- }
431
- }
432
- else if (key === 'style') {
433
- // Handle style attribute with merge logic
434
- const existingStyle = element.attr('style');
435
- if (!existingStyle) {
436
- // No existing style - set directly
437
- const attrValue = typeof value === "string" ? value.trim() : value;
438
- element.attr('style', attrValue);
439
- }
440
- else {
441
- // Merge styles rule by rule
442
- // Parse existing styles into map
443
- const styleMap = {};
444
- existingStyle.split(';').forEach(rule => {
445
- const [prop, val] = rule.split(':').map(s => s.trim());
446
- if (prop && val) {
447
- styleMap[prop] = val;
448
- }
449
- });
450
- // Parse and merge new styles
451
- String(value).split(';').forEach(rule => {
452
- const [prop, val] = rule.split(':').map(s => s.trim());
453
- if (prop && val) {
454
- styleMap[prop] = val; // Override existing or add new
455
- }
456
- });
457
- // Rebuild style string
458
- const mergedStyle = Object.entries(styleMap)
459
- .map(([prop, val]) => `${prop}: ${val}`)
460
- .join('; ');
461
- element.attr('style', mergedStyle);
462
- }
463
- }
464
- else {
465
- // Regular HTML attributes - apply directly to the element
466
- // These do NOT become data attributes or go into context.args
467
- // Examples: href, title, role, aria-*, tabindex, etc.
468
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
469
- const attrValue = typeof value === "string" ? value.trim() : String(value);
470
- element.attr(key, attrValue);
471
- }
472
- else if (typeof value === 'object') {
473
- // Complex values can't be DOM attributes, store as jQuery data only
474
- console.warn(`(JQHTML) Unexpected value for '${key}' on`, element);
475
- // element.data(key, value);
476
- }
477
- }
478
- }
479
- }
480
- /**
481
- * Initialize a component on a DOM element
482
- *
483
- * This function sets up a component instance on the given element by:
484
- * 1. Building the component's CSS classes (component name + Jqhtml_Component)
485
- * 2. Applying attributes from Define tag (template.defaultAttributes) first
486
- * 3. Applying attributes from invocation (props) second, which override Define attributes
487
- * 4. Creating the component instance
488
- *
489
- * Attribute handling rules:
490
- * - 'as': Determines tag name (handled in process_component_to_html)
491
- * - 'class': Merged from both Define and invocation
492
- * - 'style': Merged with rule-by-rule precedence (invocation wins conflicts)
493
- * - '$*' and 'data-*': Become data attributes and component args
494
- * - '@*': Event handlers (only allowed in invocation, not Define)
495
- * - All other attributes: Applied directly to DOM element
496
- */
497
- async function initialize_component(element, compData) {
498
- const { name, props, contentFn, slots, context } = compData;
499
- // Get component class (use default Jqhtml_Component if not registered)
500
- const ComponentClass = get_component_class(name) || Jqhtml_Component;
501
- // Apply invocation attributes to the element
502
- // The component constructor will handle defaultAttributes
503
- // Filter out internal props that start with underscore
504
- const invocationAttrs = {};
505
- for (const [key, value] of Object.entries(props)) {
506
- if (!key.startsWith('_')) {
507
- invocationAttrs[key] = value;
508
- }
509
- }
510
- // Debug logging
511
- if (window.jqhtml?.debug?.enabled) {
512
- console.log(`[InstructionProcessor] Applying invocation attributes for ${name}:`, invocationAttrs);
513
- }
514
- // Apply invocation attributes (component constructor will apply defaultAttributes first)
515
- apply_attributes(element, invocationAttrs, context);
516
- // Component will set its own data-cid during construction
517
- // No need to add any tracking attributes here
518
- // Prepare options for component constructor
519
- // Only pass the content function - all other attributes are already on the DOM
520
- const options = {};
521
- if (contentFn) {
522
- options._innerhtml_function = contentFn;
523
- }
524
- // Pass named slots if provided
525
- if (slots) {
526
- options._slots = slots;
527
- }
528
- // Always pass _component_name when component name differs from class name
529
- // This happens when:
530
- // 1. No class registered for component (uses Jqhtml_Component)
531
- // 2. Class inherited from parent via extends chain (uses parent class but child template)
532
- if (ComponentClass.name !== name) {
533
- options._component_name = name;
534
- }
535
- // Pass lifecycle truncation flags via options (not DOM attributes, since _ prefix is filtered).
536
- // Accept both the plain key (cascaded/programmatic) and the '$'-prefixed key (template-authored).
537
- if (props._load_only === true || props['$_load_only'] === true) {
538
- options._load_only = true;
539
- }
540
- if (props._load_render_only === true || props['$_load_render_only'] === true) {
541
- options._load_render_only = true;
542
- }
543
- // Create component instance - element first, then options
544
- const instance = new ComponentClass(element, options);
545
- // Set the instantiator (the component that rendered this one in their template)
546
- instance._instantiator = context;
547
- // Boot the component immediately - this runs its full lifecycle
548
- await instance._boot();
549
- }
550
- /**
551
- * Utility to extract slots from instructions
552
- */
553
- export function extract_slots(instructions) {
554
- const slots = {};
555
- for (const instruction of instructions) {
556
- if (typeof instruction === 'object' && 'slot' in instruction) {
557
- const [name] = instruction.slot;
558
- slots[name] = instruction;
559
- }
560
- }
561
- return slots;
562
- }
563
- //# sourceMappingURL=instruction-processor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instruction-processor.js","sourceRoot":"","sources":["../src/instruction-processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAmC5E,oCAAoC;AACpC,kEAAkE;AAClE,6EAA6E;AAC7E,IAAI,cAAc,GAAG,IAAI,CAAC;AAE1B,MAAM,UAAU,GAAG;IACjB,MAAM,OAAO,GAAG,cAAc,CAAC;IAE/B,yBAAyB;IACzB,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,IAAI,CAAC;IAEjB,6BAA6B;IAC7B,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;YAC9B,gCAAgC;YAChC,KAAK,CA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