@stacksjs/stx 0.2.83 → 0.2.84

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 (52) hide show
  1. package/dist/app-shell.js +6 -6
  2. package/dist/build-assets.js +6 -6
  3. package/dist/build-mode-detector.js +6 -6
  4. package/dist/build-views.js +6 -6
  5. package/dist/build.js +6 -6
  6. package/dist/caching.js +6 -6
  7. package/dist/cli.js +7 -7
  8. package/dist/component-processing.js +6 -6
  9. package/dist/component-renderer.js +6 -6
  10. package/dist/components.js +6 -6
  11. package/dist/dev-server/index.js +6 -6
  12. package/dist/dev-server/serve-app.js +6 -6
  13. package/dist/dev-server/serve-file.js +6 -6
  14. package/dist/dev-server/serve-markdown.js +6 -6
  15. package/dist/dev-server/serve-multi.js +6 -6
  16. package/dist/dev-server.js +6 -6
  17. package/dist/docs.js +6 -6
  18. package/dist/dynamic-components.js +6 -6
  19. package/dist/includes.js +6 -6
  20. package/dist/index.js +6 -6
  21. package/dist/interactive.js +6 -6
  22. package/dist/lazy-loader.js +6 -6
  23. package/dist/plugin.js +6 -6
  24. package/dist/process.js +6 -6
  25. package/dist/production-builder.js +6 -6
  26. package/dist/production-server.js +6 -6
  27. package/dist/pwa/index.js +6 -6
  28. package/dist/pwa/offline.js +6 -6
  29. package/dist/pwa.js +6 -6
  30. package/dist/render.js +6 -6
  31. package/dist/runtime-injection.js +6 -6
  32. package/dist/serve.js +6 -6
  33. package/dist/signal-processing.js +6 -6
  34. package/dist/signals.js +6 -6
  35. package/dist/site-builder/build.js +6 -6
  36. package/dist/site-builder/index.js +6 -6
  37. package/dist/ssg.js +6 -6
  38. package/dist/ssr.js +6 -6
  39. package/dist/story/cli.js +6 -6
  40. package/dist/story/commands/dev.js +6 -6
  41. package/dist/story/commands/index.js +6 -6
  42. package/dist/story/index.js +6 -6
  43. package/dist/story/renderer.js +6 -6
  44. package/dist/story/server.js +6 -6
  45. package/dist/story/visual-testing.js +6 -6
  46. package/dist/streaming.js +6 -6
  47. package/dist/template-compiler.js +6 -6
  48. package/dist/template-hydrator.js +6 -6
  49. package/dist/testing.js +6 -6
  50. package/dist/utils.js +6 -6
  51. package/dist/web-components.js +6 -6
  52. package/package.json +5 -5
package/dist/app-shell.js CHANGED
@@ -8714,10 +8714,10 @@ else {
8714
8714
  var root = scriptEl ? scriptEl.nextElementSibling : null;
8715
8715
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
8716
8716
 
8717
- // SPA fallback: during router navigation, script is appended to <body>
8717
+ // SPA fallback: during router navigation, script is appended to body>
8718
8718
  // (not inside the content container), so nextElementSibling won't find the page content.
8719
8719
  // Only use fallback when we genuinely couldn't find a suitable root element.
8720
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
8720
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
8721
8721
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
8722
8722
  var needsFallback = !root || root === document.body
8723
8723
  || (root && root.tagName === 'SCRIPT');
@@ -9036,7 +9036,7 @@ else {
9036
9036
  mountCallbacks.forEach(fn => fn());
9037
9037
  });
9038
9038
 
9039
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
9039
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
9040
9040
  // top-level element with data-stx (signal-processing.ts marks one element),
9041
9041
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
9042
9042
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -9133,7 +9133,7 @@ else {
9133
9133
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
9134
9134
  });
9135
9135
 
9136
- // Process <head> elements (title, meta) that may contain {{ }} expressions
9136
+ // Process head> elements (title, meta) that may contain {{ }} expressions
9137
9137
  // Use componentScope which now contains variables from processed components
9138
9138
  const headElements = document.querySelectorAll('head title, head meta[content]');
9139
9139
  headElements.forEach(el => {
@@ -9329,7 +9329,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9329
9329
 
9330
9330
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
9331
9331
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
9332
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
9332
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
9333
9333
  var usedLatestSetup = false;
9334
9334
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
9335
9335
  try {
@@ -9413,7 +9413,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9413
9413
 
9414
9414
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
9415
9415
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
9416
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
9416
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
9417
9417
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
9418
9418
  if (!container.__stx_scope) {
9419
9419
  // Dispose previous effects on the container (from prior navigation)
@@ -4443,10 +4443,10 @@ else {
4443
4443
  var root = scriptEl ? scriptEl.nextElementSibling : null;
4444
4444
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
4445
4445
 
4446
- // SPA fallback: during router navigation, script is appended to <body>
4446
+ // SPA fallback: during router navigation, script is appended to body>
4447
4447
  // (not inside the content container), so nextElementSibling won't find the page content.
4448
4448
  // Only use fallback when we genuinely couldn't find a suitable root element.
4449
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
4449
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
4450
4450
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
4451
4451
  var needsFallback = !root || root === document.body
4452
4452
  || (root && root.tagName === 'SCRIPT');
@@ -4765,7 +4765,7 @@ else {
4765
4765
  mountCallbacks.forEach(fn => fn());
4766
4766
  });
4767
4767
 
4768
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
4768
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
4769
4769
  // top-level element with data-stx (signal-processing.ts marks one element),
4770
4770
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
4771
4771
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -4862,7 +4862,7 @@ else {
4862
4862
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
4863
4863
  });
4864
4864
 
4865
- // Process <head> elements (title, meta) that may contain {{ }} expressions
4865
+ // Process head> elements (title, meta) that may contain {{ }} expressions
4866
4866
  // Use componentScope which now contains variables from processed components
4867
4867
  const headElements = document.querySelectorAll('head title, head meta[content]');
4868
4868
  headElements.forEach(el => {
@@ -5058,7 +5058,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
5058
5058
 
5059
5059
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
5060
5060
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
5061
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
5061
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
5062
5062
  var usedLatestSetup = false;
5063
5063
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
5064
5064
  try {
@@ -5142,7 +5142,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
5142
5142
 
5143
5143
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
5144
5144
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
5145
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
5145
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
5146
5146
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
5147
5147
  if (!container.__stx_scope) {
5148
5148
  // Dispose previous effects on the container (from prior navigation)
@@ -8736,10 +8736,10 @@ else {
8736
8736
  var root = scriptEl ? scriptEl.nextElementSibling : null;
8737
8737
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
8738
8738
 
8739
- // SPA fallback: during router navigation, script is appended to <body>
8739
+ // SPA fallback: during router navigation, script is appended to body>
8740
8740
  // (not inside the content container), so nextElementSibling won't find the page content.
8741
8741
  // Only use fallback when we genuinely couldn't find a suitable root element.
8742
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
8742
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
8743
8743
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
8744
8744
  var needsFallback = !root || root === document.body
8745
8745
  || (root && root.tagName === 'SCRIPT');
@@ -9058,7 +9058,7 @@ else {
9058
9058
  mountCallbacks.forEach(fn => fn());
9059
9059
  });
9060
9060
 
9061
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
9061
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
9062
9062
  // top-level element with data-stx (signal-processing.ts marks one element),
9063
9063
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
9064
9064
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -9155,7 +9155,7 @@ else {
9155
9155
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
9156
9156
  });
9157
9157
 
9158
- // Process <head> elements (title, meta) that may contain {{ }} expressions
9158
+ // Process head> elements (title, meta) that may contain {{ }} expressions
9159
9159
  // Use componentScope which now contains variables from processed components
9160
9160
  const headElements = document.querySelectorAll('head title, head meta[content]');
9161
9161
  headElements.forEach(el => {
@@ -9351,7 +9351,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9351
9351
 
9352
9352
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
9353
9353
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
9354
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
9354
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
9355
9355
  var usedLatestSetup = false;
9356
9356
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
9357
9357
  try {
@@ -9435,7 +9435,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9435
9435
 
9436
9436
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
9437
9437
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
9438
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
9438
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
9439
9439
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
9440
9440
  if (!container.__stx_scope) {
9441
9441
  // Dispose previous effects on the container (from prior navigation)
@@ -8736,10 +8736,10 @@ else {
8736
8736
  var root = scriptEl ? scriptEl.nextElementSibling : null;
8737
8737
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
8738
8738
 
8739
- // SPA fallback: during router navigation, script is appended to <body>
8739
+ // SPA fallback: during router navigation, script is appended to body>
8740
8740
  // (not inside the content container), so nextElementSibling won't find the page content.
8741
8741
  // Only use fallback when we genuinely couldn't find a suitable root element.
8742
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
8742
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
8743
8743
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
8744
8744
  var needsFallback = !root || root === document.body
8745
8745
  || (root && root.tagName === 'SCRIPT');
@@ -9058,7 +9058,7 @@ else {
9058
9058
  mountCallbacks.forEach(fn => fn());
9059
9059
  });
9060
9060
 
9061
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
9061
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
9062
9062
  // top-level element with data-stx (signal-processing.ts marks one element),
9063
9063
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
9064
9064
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -9155,7 +9155,7 @@ else {
9155
9155
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
9156
9156
  });
9157
9157
 
9158
- // Process <head> elements (title, meta) that may contain {{ }} expressions
9158
+ // Process head> elements (title, meta) that may contain {{ }} expressions
9159
9159
  // Use componentScope which now contains variables from processed components
9160
9160
  const headElements = document.querySelectorAll('head title, head meta[content]');
9161
9161
  headElements.forEach(el => {
@@ -9351,7 +9351,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9351
9351
 
9352
9352
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
9353
9353
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
9354
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
9354
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
9355
9355
  var usedLatestSetup = false;
9356
9356
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
9357
9357
  try {
@@ -9435,7 +9435,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9435
9435
 
9436
9436
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
9437
9437
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
9438
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
9438
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
9439
9439
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
9440
9440
  if (!container.__stx_scope) {
9441
9441
  // Dispose previous effects on the container (from prior navigation)
package/dist/build.js CHANGED
@@ -6486,10 +6486,10 @@ else {
6486
6486
  var root = scriptEl ? scriptEl.nextElementSibling : null;
6487
6487
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
6488
6488
 
6489
- // SPA fallback: during router navigation, script is appended to <body>
6489
+ // SPA fallback: during router navigation, script is appended to body>
6490
6490
  // (not inside the content container), so nextElementSibling won't find the page content.
6491
6491
  // Only use fallback when we genuinely couldn't find a suitable root element.
6492
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
6492
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
6493
6493
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
6494
6494
  var needsFallback = !root || root === document.body
6495
6495
  || (root && root.tagName === 'SCRIPT');
@@ -6808,7 +6808,7 @@ else {
6808
6808
  mountCallbacks.forEach(fn => fn());
6809
6809
  });
6810
6810
 
6811
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
6811
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
6812
6812
  // top-level element with data-stx (signal-processing.ts marks one element),
6813
6813
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
6814
6814
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -6905,7 +6905,7 @@ else {
6905
6905
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
6906
6906
  });
6907
6907
 
6908
- // Process <head> elements (title, meta) that may contain {{ }} expressions
6908
+ // Process head> elements (title, meta) that may contain {{ }} expressions
6909
6909
  // Use componentScope which now contains variables from processed components
6910
6910
  const headElements = document.querySelectorAll('head title, head meta[content]');
6911
6911
  headElements.forEach(el => {
@@ -7101,7 +7101,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7101
7101
 
7102
7102
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
7103
7103
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
7104
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
7104
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
7105
7105
  var usedLatestSetup = false;
7106
7106
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
7107
7107
  try {
@@ -7185,7 +7185,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7185
7185
 
7186
7186
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
7187
7187
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
7188
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
7188
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
7189
7189
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
7190
7190
  if (!container.__stx_scope) {
7191
7191
  // Dispose previous effects on the container (from prior navigation)
package/dist/caching.js CHANGED
@@ -5703,10 +5703,10 @@ else {
5703
5703
  var root = scriptEl ? scriptEl.nextElementSibling : null;
5704
5704
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
5705
5705
 
5706
- // SPA fallback: during router navigation, script is appended to <body>
5706
+ // SPA fallback: during router navigation, script is appended to body>
5707
5707
  // (not inside the content container), so nextElementSibling won't find the page content.
5708
5708
  // Only use fallback when we genuinely couldn't find a suitable root element.
5709
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
5709
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
5710
5710
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
5711
5711
  var needsFallback = !root || root === document.body
5712
5712
  || (root && root.tagName === 'SCRIPT');
@@ -6025,7 +6025,7 @@ else {
6025
6025
  mountCallbacks.forEach(fn => fn());
6026
6026
  });
6027
6027
 
6028
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
6028
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
6029
6029
  // top-level element with data-stx (signal-processing.ts marks one element),
6030
6030
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
6031
6031
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -6122,7 +6122,7 @@ else {
6122
6122
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
6123
6123
  });
6124
6124
 
6125
- // Process <head> elements (title, meta) that may contain {{ }} expressions
6125
+ // Process head> elements (title, meta) that may contain {{ }} expressions
6126
6126
  // Use componentScope which now contains variables from processed components
6127
6127
  const headElements = document.querySelectorAll('head title, head meta[content]');
6128
6128
  headElements.forEach(el => {
@@ -6318,7 +6318,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
6318
6318
 
6319
6319
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
6320
6320
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
6321
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
6321
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
6322
6322
  var usedLatestSetup = false;
6323
6323
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
6324
6324
  try {
@@ -6402,7 +6402,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
6402
6402
 
6403
6403
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
6404
6404
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
6405
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
6405
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
6406
6406
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
6407
6407
  if (!container.__stx_scope) {
6408
6408
  // Dispose previous effects on the container (from prior navigation)
package/dist/cli.js CHANGED
@@ -6726,10 +6726,10 @@ else {
6726
6726
  var root = scriptEl ? scriptEl.nextElementSibling : null;
6727
6727
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
6728
6728
 
6729
- // SPA fallback: during router navigation, script is appended to <body>
6729
+ // SPA fallback: during router navigation, script is appended to body>
6730
6730
  // (not inside the content container), so nextElementSibling won't find the page content.
6731
6731
  // Only use fallback when we genuinely couldn't find a suitable root element.
6732
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
6732
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
6733
6733
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
6734
6734
  var needsFallback = !root || root === document.body
6735
6735
  || (root && root.tagName === 'SCRIPT');
@@ -7048,7 +7048,7 @@ else {
7048
7048
  mountCallbacks.forEach(fn => fn());
7049
7049
  });
7050
7050
 
7051
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
7051
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
7052
7052
  // top-level element with data-stx (signal-processing.ts marks one element),
7053
7053
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
7054
7054
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -7145,7 +7145,7 @@ else {
7145
7145
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
7146
7146
  });
7147
7147
 
7148
- // Process <head> elements (title, meta) that may contain {{ }} expressions
7148
+ // Process head> elements (title, meta) that may contain {{ }} expressions
7149
7149
  // Use componentScope which now contains variables from processed components
7150
7150
  const headElements = document.querySelectorAll('head title, head meta[content]');
7151
7151
  headElements.forEach(el => {
@@ -7341,7 +7341,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7341
7341
 
7342
7342
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
7343
7343
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
7344
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
7344
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
7345
7345
  var usedLatestSetup = false;
7346
7346
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
7347
7347
  try {
@@ -7425,7 +7425,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7425
7425
 
7426
7426
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
7427
7427
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
7428
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
7428
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
7429
7429
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
7430
7430
  if (!container.__stx_scope) {
7431
7431
  // Dispose previous effects on the container (from prior navigation)
@@ -20409,7 +20409,7 @@ else {
20409
20409
  `)}function fN($,Z){let Y=" ".repeat(Z),X=[];for(let[K,W]of Object.entries($.props))if(W.type==="literal"){let U=typeof W.value==="string"?`"${W.value}"`:String(W.value);X.push(`${K}: ${U}`)}let J=X.length>0?`{ ${X.join(", ")} }`:"{}",Q=$.children.map((K)=>K.type==="text"?`"${K.props.text?.type==="literal"?K.props.text.value:""}"`:fN(K,Z+1)),G=Q.length>0?`,
20410
20410
  ${Y} [${Q.join(`,
20411
20411
  ${Y} `)}]`:"";return`Craft.create("${$.zigType}", ${J}${G})`}function Cf($,Z,Y){if(Z.target==="universal"){let X=[];X.push("// Universal entry point"),X.push("");for(let[J,Q]of Y)X.push(`// --- ${J.toUpperCase()} ---`),X.push(`#if ${J.toUpperCase()}`),X.push(Q),X.push("#endif"),X.push("");return X.join(`
20412
- `)}return Y.get(Z.target)||nW($,Z)}function bf($,Z,Y){let X=[];function J(Q){X.push({name:Q.zigType,hash:hN(JSON.stringify(Q.props)),props:Object.keys(Q.props),events:Array.from(Q.events.keys()),slots:[],isNative:Q.zigType.startsWith("craft.")});for(let G of Q.children)J(G)}return J(Z),{version:"1.0.0",components:X,entry:$.id,assets:[],styles:$.styles}}function Pf($,Z){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}function gN(){return`id_${++yf}`}function hN($){let Z=0;for(let Y=0;Y<$.length;Y++){let X=$.charCodeAt(Y);Z=(Z<<5)-Z+X,Z=Z&Z}return Math.abs(Z).toString(36)}function xf($){return $.charAt(0).toUpperCase()+$.slice(1)}function vf($){let Z=[],Y=/<script[^>]*>([\s\S]*?)<\/script>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function ff($){let Z=[],Y=/<style[^>]*>([\s\S]*?)<\/style>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function rW($){let Z=$.type==="component"?1:0;if($.children)for(let Y of $.children)Z+=rW(Y);return Z}function aW($){let Z=$.zigType.startsWith("craft.")?1:0;for(let Y of $.children)Z+=aW(Y);return Z}function dN($){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(Z)=>{console.log(`[craft-compiler] File changed: ${Z}`)}}}var sW,yf=0,gf,hf;var mN=D(()=>{sW=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);gf={compileToNative:bN,createHotReloadServer:dN,NATIVE_COMPONENTS:sW},hf=gf});import{spawn as pN}from"child_process";import y0 from"fs";import df from"os";import Y0 from"path";import v from"process";import{CLI as uf}from"@stacksjs/clapp";var A6="0.2.83";Y$();MW();bG();uG();x4();gG();jW();var __dirname="/home/runner/work/stx/stx/packages/stx/bin",O0=new uf("stx");function cN($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function lN($){try{if(!y0.existsSync($)){let Y=Y0.dirname($),X=Y0.basename($);if(y0.existsSync(Y)){let Q=y0.readdirSync(Y).filter((K)=>K.toLowerCase().includes(X.toLowerCase().substring(0,3))||K.endsWith(".stx")||K.endsWith(".md")),G=Q.length>0?`File not found. Similar files in ${Y}: ${Q.slice(0,3).join(", ")}`:`File not found. Directory ${Y} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${$}`,suggestion:G}}return{isValid:!1,error:`File does not exist: ${$}`,suggestion:"Check the file path and try again"}}if(y0.statSync($).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${$}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${$}`,suggestion:"Check file permissions and path"}}}function oW($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var x5=($)=>$.includes("*")||$.includes("?")||$.includes("{")||$.includes("["),mf=($)=>$.endsWith(".stx")||$.endsWith(".md");function y5($,Z=1){if(console.error(`\u274C ${$.error}`),$.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${$.suggestion}`);v.exit(Z)}async function cf($,Z){try{let Y=["test"],X=[];if($&&$.length>0)for(let W of $)if(x5(W))try{let U=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(U.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(X.push(...U),Z.verbose)console.log(`Found ${U.length} file(s) matching pattern: ${W}`)}catch(U){return console.error(`Error expanding glob pattern ${W}:`,U),!1}else X.push(W);if(X.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(Y.push(...X),Z.filter)Y.push("--pattern",Z.filter);if(Z.timeout)Y.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=Y0.join(df.tmpdir(),`stx-test-report-${Date.now()}.xml`);Y.push("--reporter",Z.reporter),Y.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)Y.push("--coverage");if(Z.watch)Y.push("--watch");Y.push("--preload",Y0.join(__dirname,"../../../test-utils/happy-dom.ts"));let J={...v.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},Q="bun";if(Z.verbose)console.log(`Running: ${Q} ${Y.join(" ")}`);let G=performance.now(),K=pN(Q,Y,{stdio:"inherit",shell:!1,env:J});return new Promise((W)=>{K.on("close",(U)=>{let z=((performance.now()-G)/1000).toFixed(2);if(U===0)W(!0);else W(!1)}),v.on("SIGINT",()=>{console.log(`
20412
+ `)}return Y.get(Z.target)||nW($,Z)}function bf($,Z,Y){let X=[];function J(Q){X.push({name:Q.zigType,hash:hN(JSON.stringify(Q.props)),props:Object.keys(Q.props),events:Array.from(Q.events.keys()),slots:[],isNative:Q.zigType.startsWith("craft.")});for(let G of Q.children)J(G)}return J(Z),{version:"1.0.0",components:X,entry:$.id,assets:[],styles:$.styles}}function Pf($,Z){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}function gN(){return`id_${++yf}`}function hN($){let Z=0;for(let Y=0;Y<$.length;Y++){let X=$.charCodeAt(Y);Z=(Z<<5)-Z+X,Z=Z&Z}return Math.abs(Z).toString(36)}function xf($){return $.charAt(0).toUpperCase()+$.slice(1)}function vf($){let Z=[],Y=/<script[^>]*>([\s\S]*?)<\/script>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function ff($){let Z=[],Y=/<style[^>]*>([\s\S]*?)<\/style>/gi,X;while((X=Y.exec($))!==null)Z.push(X[1]);return Z}function rW($){let Z=$.type==="component"?1:0;if($.children)for(let Y of $.children)Z+=rW(Y);return Z}function aW($){let Z=$.zigType.startsWith("craft.")?1:0;for(let Y of $.children)Z+=aW(Y);return Z}function dN($){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(Z)=>{console.log(`[craft-compiler] File changed: ${Z}`)}}}var sW,yf=0,gf,hf;var mN=D(()=>{sW=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);gf={compileToNative:bN,createHotReloadServer:dN,NATIVE_COMPONENTS:sW},hf=gf});import{spawn as pN}from"child_process";import y0 from"fs";import df from"os";import Y0 from"path";import v from"process";import{CLI as uf}from"@stacksjs/clapp";var A6="0.2.84";Y$();MW();bG();uG();x4();gG();jW();var __dirname="/home/runner/work/stx/stx/packages/stx/bin",O0=new uf("stx");function cN($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function lN($){try{if(!y0.existsSync($)){let Y=Y0.dirname($),X=Y0.basename($);if(y0.existsSync(Y)){let Q=y0.readdirSync(Y).filter((K)=>K.toLowerCase().includes(X.toLowerCase().substring(0,3))||K.endsWith(".stx")||K.endsWith(".md")),G=Q.length>0?`File not found. Similar files in ${Y}: ${Q.slice(0,3).join(", ")}`:`File not found. Directory ${Y} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${$}`,suggestion:G}}return{isValid:!1,error:`File does not exist: ${$}`,suggestion:"Check the file path and try again"}}if(y0.statSync($).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${$}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${$}`,suggestion:"Check file permissions and path"}}}function oW($){let Z=typeof $==="string"?Number.parseInt($,10):$;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var x5=($)=>$.includes("*")||$.includes("?")||$.includes("{")||$.includes("["),mf=($)=>$.endsWith(".stx")||$.endsWith(".md");function y5($,Z=1){if(console.error(`\u274C ${$.error}`),$.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${$.suggestion}`);v.exit(Z)}async function cf($,Z){try{let Y=["test"],X=[];if($&&$.length>0)for(let W of $)if(x5(W))try{let U=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(U.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(X.push(...U),Z.verbose)console.log(`Found ${U.length} file(s) matching pattern: ${W}`)}catch(U){return console.error(`Error expanding glob pattern ${W}:`,U),!1}else X.push(W);if(X.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(Y.push(...X),Z.filter)Y.push("--pattern",Z.filter);if(Z.timeout)Y.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=Y0.join(df.tmpdir(),`stx-test-report-${Date.now()}.xml`);Y.push("--reporter",Z.reporter),Y.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)Y.push("--coverage");if(Z.watch)Y.push("--watch");Y.push("--preload",Y0.join(__dirname,"../../../test-utils/happy-dom.ts"));let J={...v.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},Q="bun";if(Z.verbose)console.log(`Running: ${Q} ${Y.join(" ")}`);let G=performance.now(),K=pN(Q,Y,{stdio:"inherit",shell:!1,env:J});return new Promise((W)=>{K.on("close",(U)=>{let z=((performance.now()-G)/1000).toFixed(2);if(U===0)W(!0);else W(!1)}),v.on("SIGINT",()=>{console.log(`
20413
20413
  Test run interrupted`),K.kill("SIGINT"),v.exit(1)})})}catch(Y){return console.error("Error running tests:",Y instanceof Error?Y.message:String(Y)),!1}}var lf=v.argv.length>=3&&(mf(v.argv[2])&&y0.existsSync(v.argv[2])||x5(v.argv[2]));if(lf){let $=v.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let Y=3;Y<v.argv.length;Y++){let X=v.argv[Y];if(X==="--port"&&Y+1<v.argv.length){let J=cN(v.argv[++Y]);if(!J.isValid)y5(J);Z.port=Number.parseInt(v.argv[Y],10)}else if(X==="--no-watch")Z.watch=!1;else if(X==="--highlight-theme"&&Y+1<v.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=v.argv[++Y]}else if(X==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(X==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(X==="--no-cache")Z.cache=!1;else if(X==="--native")Z.native=!0}if(x5($))try{let Y=await Array.fromAsync(new Bun.Glob($).scan({onlyFiles:!0,absolute:!0})),X=$.endsWith(".stx")?Y.filter((K)=>K.endsWith(".stx")):$.endsWith(".md")?Y.filter((K)=>K.endsWith(".md")):Y.filter((K)=>K.endsWith(".stx")||K.endsWith(".md")),J=$.split("*")[0].replace(/\/$/,"")||".",Q=Y0.resolve(J);try{let K=new Bun.Glob("**/*.stx"),U=(await Array.fromAsync(K.scan({cwd:Q,onlyFiles:!0,absolute:!0}))).filter((_)=>/\[.+\]/.test(Y0.basename(_)));for(let _ of U)if(!X.includes(_))X.push(_)}catch{}if(X.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${$}`),v.exit(1);if(!await l8(X,Z))v.exit(1)}catch(Y){console.error("Failed to process files:",Y),v.exit(1)}else c8($,Z).catch((Y)=>{console.error("Failed to start dev server:",Y),v.exit(1)})}else{let $=function(X,J){let Q=[];for(let G=0;G<=J.length;G++)Q[G]=[G];for(let G=0;G<=X.length;G++)Q[0][G]=G;for(let G=1;G<=J.length;G++)for(let K=1;K<=X.length;K++)if(J.charAt(G-1)===X.charAt(K-1))Q[G][K]=Q[G-1][K-1];else Q[G][K]=Math.min(Q[G-1][K-1]+1,Q[G][K-1]+1,Q[G-1][K]+1);return Q[J.length][X.length]};O0.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(X)=>{try{if(await CG(X))console.log("Documentation generated successfully."),v.exit(0);else console.error("Documentation generation failed."),v.exit(1)}catch(J){console.error("Error generating documentation:",J),v.exit(1)}}),O0.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(X,J)=>{try{let{fetchCollections:Q,generatePackage:G}=await import("@stacksjs/iconify-generator");if(X==="list"){console.log(`
20414
20414
  \uD83D\uDCDA Fetching available icon collections...
20415
20415
  `);let K=await Q(),W=Object.entries(K).sort((U,_)=>_[1].total-U[1].total);console.log(`Available collections:
@@ -7234,10 +7234,10 @@ else {
7234
7234
  var root = scriptEl ? scriptEl.nextElementSibling : null;
7235
7235
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
7236
7236
 
7237
- // SPA fallback: during router navigation, script is appended to <body>
7237
+ // SPA fallback: during router navigation, script is appended to body>
7238
7238
  // (not inside the content container), so nextElementSibling won't find the page content.
7239
7239
  // Only use fallback when we genuinely couldn't find a suitable root element.
7240
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
7240
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
7241
7241
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
7242
7242
  var needsFallback = !root || root === document.body
7243
7243
  || (root && root.tagName === 'SCRIPT');
@@ -7556,7 +7556,7 @@ else {
7556
7556
  mountCallbacks.forEach(fn => fn());
7557
7557
  });
7558
7558
 
7559
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
7559
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
7560
7560
  // top-level element with data-stx (signal-processing.ts marks one element),
7561
7561
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
7562
7562
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -7653,7 +7653,7 @@ else {
7653
7653
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
7654
7654
  });
7655
7655
 
7656
- // Process <head> elements (title, meta) that may contain {{ }} expressions
7656
+ // Process head> elements (title, meta) that may contain {{ }} expressions
7657
7657
  // Use componentScope which now contains variables from processed components
7658
7658
  const headElements = document.querySelectorAll('head title, head meta[content]');
7659
7659
  headElements.forEach(el => {
@@ -7849,7 +7849,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7849
7849
 
7850
7850
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
7851
7851
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
7852
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
7852
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
7853
7853
  var usedLatestSetup = false;
7854
7854
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
7855
7855
  try {
@@ -7933,7 +7933,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7933
7933
 
7934
7934
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
7935
7935
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
7936
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
7936
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
7937
7937
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
7938
7938
  if (!container.__stx_scope) {
7939
7939
  // Dispose previous effects on the container (from prior navigation)
@@ -7196,10 +7196,10 @@ else {
7196
7196
  var root = scriptEl ? scriptEl.nextElementSibling : null;
7197
7197
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
7198
7198
 
7199
- // SPA fallback: during router navigation, script is appended to <body>
7199
+ // SPA fallback: during router navigation, script is appended to body>
7200
7200
  // (not inside the content container), so nextElementSibling won't find the page content.
7201
7201
  // Only use fallback when we genuinely couldn't find a suitable root element.
7202
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
7202
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
7203
7203
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
7204
7204
  var needsFallback = !root || root === document.body
7205
7205
  || (root && root.tagName === 'SCRIPT');
@@ -7518,7 +7518,7 @@ else {
7518
7518
  mountCallbacks.forEach(fn => fn());
7519
7519
  });
7520
7520
 
7521
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
7521
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
7522
7522
  // top-level element with data-stx (signal-processing.ts marks one element),
7523
7523
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
7524
7524
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -7615,7 +7615,7 @@ else {
7615
7615
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
7616
7616
  });
7617
7617
 
7618
- // Process <head> elements (title, meta) that may contain {{ }} expressions
7618
+ // Process head> elements (title, meta) that may contain {{ }} expressions
7619
7619
  // Use componentScope which now contains variables from processed components
7620
7620
  const headElements = document.querySelectorAll('head title, head meta[content]');
7621
7621
  headElements.forEach(el => {
@@ -7811,7 +7811,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7811
7811
 
7812
7812
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
7813
7813
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
7814
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
7814
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
7815
7815
  var usedLatestSetup = false;
7816
7816
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
7817
7817
  try {
@@ -7895,7 +7895,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
7895
7895
 
7896
7896
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
7897
7897
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
7898
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
7898
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
7899
7899
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
7900
7900
  if (!container.__stx_scope) {
7901
7901
  // Dispose previous effects on the container (from prior navigation)
@@ -8736,10 +8736,10 @@ else {
8736
8736
  var root = scriptEl ? scriptEl.nextElementSibling : null;
8737
8737
  if (!root && scriptEl) root = scriptEl.previousElementSibling || scriptEl.parentElement;
8738
8738
 
8739
- // SPA fallback: during router navigation, script is appended to <body>
8739
+ // SPA fallback: during router navigation, script is appended to body>
8740
8740
  // (not inside the content container), so nextElementSibling won't find the page content.
8741
8741
  // Only use fallback when we genuinely couldn't find a suitable root element.
8742
- // Do NOT fallback just because the script is in <body> \u2014 layout scripts in <body>
8742
+ // Do NOT fallback just because the script is in body> \u2014 layout scripts in body>
8743
8743
  // with valid siblings (e.g. sidebar <aside>) should use those siblings as root.
8744
8744
  var needsFallback = !root || root === document.body
8745
8745
  || (root && root.tagName === 'SCRIPT');
@@ -9058,7 +9058,7 @@ else {
9058
9058
  mountCallbacks.forEach(fn => fn());
9059
9059
  });
9060
9060
 
9061
- // Multi-root fragment fix: a no-<body> setup page tags only the FIRST
9061
+ // Multi-root fragment fix: a no-body> setup page tags only the FIRST
9062
9062
  // top-level element with data-stx (signal-processing.ts marks one element),
9063
9063
  // so sibling root elements were orphaned \u2014 their :if / :for / {{ }} / x-text
9064
9064
  // never hydrated, which read as "{{ }} doesn't work under :if/:for". The
@@ -9155,7 +9155,7 @@ else {
9155
9155
  el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
9156
9156
  });
9157
9157
 
9158
- // Process <head> elements (title, meta) that may contain {{ }} expressions
9158
+ // Process head> elements (title, meta) that may contain {{ }} expressions
9159
9159
  // Use componentScope which now contains variables from processed components
9160
9160
  const headElements = document.querySelectorAll('head title, head meta[content]');
9161
9161
  headElements.forEach(el => {
@@ -9351,7 +9351,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9351
9351
 
9352
9352
  // Apply new page's SFC setup function. During SPA navigation, re-executed page
9353
9353
  // scripts set window.stx._latestSetup to the new setup function. This takes priority
9354
- // over the stale data-stx attribute on <body> (which has the PREVIOUS page's function name).
9354
+ // over the stale data-stx attribute on body> (which has the PREVIOUS page's function name).
9355
9355
  var usedLatestSetup = false;
9356
9356
  if (window.stx._latestSetup && typeof window.stx._latestSetup === 'function') {
9357
9357
  try {
@@ -9435,7 +9435,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
9435
9435
 
9436
9436
  // Process the container content \u2014 bind {{ }}, :attr, @event directives.
9437
9437
  // Run synchronously (not in setTimeout) so componentScope is captured correctly.
9438
- // The DOMContentLoaded path processes <body> synchronously \u2014 the SPA path must match.
9438
+ // The DOMContentLoaded path processes body> synchronously \u2014 the SPA path must match.
9439
9439
  console.log('[stx:load] container:', container.tagName, '__stx_scope:', !!container.__stx_scope, 'scope keys:', Object.keys(componentScope).slice(0, 10));
9440
9440
  if (!container.__stx_scope) {
9441
9441
  // Dispose previous effects on the container (from prior navigation)