@stacksjs/stx 0.2.863 → 0.2.864

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 (126) hide show
  1. package/dist/{chunk-gp8hgpt9.js → chunk-01mwbg1r.js} +3 -3
  2. package/dist/{chunk-fnv94wc6.js → chunk-0v2yj490.js} +1 -1
  3. package/dist/chunk-0zxzcrns.js +2 -0
  4. package/dist/chunk-18qvx7b0.js +2 -0
  5. package/dist/{chunk-zr22gtpf.js → chunk-1smbjj34.js} +1 -1
  6. package/dist/chunk-28nk2zej.js +2 -0
  7. package/dist/chunk-2mgajzam.js +2 -0
  8. package/dist/{chunk-k7dxm48r.js → chunk-4w8a7f8t.js} +1 -1
  9. package/dist/chunk-53797jvm.js +2 -0
  10. package/dist/{chunk-zsnmk5me.js → chunk-5dvkphbe.js} +1 -1
  11. package/dist/{chunk-v408qsze.js → chunk-5kkq2eqr.js} +1 -1
  12. package/dist/{chunk-xfd3yqgj.js → chunk-6mhj42gz.js} +12 -12
  13. package/dist/chunk-6nzdsh2c.js +2 -0
  14. package/dist/{chunk-ks5p5w6z.js → chunk-6y066pr2.js} +1 -1
  15. package/dist/chunk-709hfmpj.js +2 -0
  16. package/dist/{chunk-8502xb4n.js → chunk-79y9amt1.js} +7 -7
  17. package/dist/{chunk-8v1zpdef.js → chunk-7chzhef2.js} +1 -1
  18. package/dist/{chunk-5s1fb8z4.js → chunk-7wpk300q.js} +1 -1
  19. package/dist/{chunk-sj3ry5ck.js → chunk-7xhwqc0c.js} +7 -1
  20. package/dist/{chunk-z383x16t.js → chunk-8010hzhm.js} +1 -1
  21. package/dist/{chunk-yhc1c4tr.js → chunk-83qwwnye.js} +52 -52
  22. package/dist/{chunk-mfa07erx.js → chunk-83tvkw4y.js} +1 -1
  23. package/dist/{chunk-1grdbpsk.js → chunk-8ay0nq31.js} +2 -2
  24. package/dist/{chunk-2c18y094.js → chunk-8v8eawjw.js} +1 -1
  25. package/dist/{chunk-5p1k2h5q.js → chunk-8yybk485.js} +1 -1
  26. package/dist/chunk-9cwag0tk.js +2 -0
  27. package/dist/{chunk-vwwpbhd2.js → chunk-a98jgxkb.js} +1 -1
  28. package/dist/chunk-aef82ns3.js +2 -0
  29. package/dist/{chunk-ztbexx3h.js → chunk-axkgbc0k.js} +1 -1
  30. package/dist/chunk-az12j7cr.js +2 -0
  31. package/dist/{chunk-46ddesnf.js → chunk-b666d8m6.js} +1 -1
  32. package/dist/{chunk-y190sh29.js → chunk-brs63ht2.js} +9 -9
  33. package/dist/chunk-byve4g2y.js +2 -0
  34. package/dist/{chunk-jfmj0wsy.js → chunk-cdbmfe7d.js} +1 -1
  35. package/dist/{chunk-az5xw3w8.js → chunk-cjy9cdm0.js} +1 -1
  36. package/dist/chunk-cwjt04kc.js +2 -0
  37. package/dist/chunk-d10cq130.js +2 -0
  38. package/dist/{chunk-32ty2zx6.js → chunk-df0ry01a.js} +1 -1
  39. package/dist/{chunk-qxw9h564.js → chunk-ehd68fc7.js} +1 -1
  40. package/dist/{chunk-yr1zx78b.js → chunk-epct9fqd.js} +2 -2
  41. package/dist/{chunk-reeaknf2.js → chunk-eq40b4n4.js} +1 -1
  42. package/dist/{chunk-58sh82aj.js → chunk-ez6e7rh1.js} +1 -1
  43. package/dist/chunk-f0b3ca2n.js +2 -0
  44. package/dist/chunk-f52b9hjv.js +2 -0
  45. package/dist/{chunk-bx5d87xx.js → chunk-f6ypmk8x.js} +1 -1
  46. package/dist/{chunk-s9df8srx.js → chunk-fd1bpv35.js} +3 -3
  47. package/dist/{chunk-wk4wg6sn.js → chunk-fh8jzm4b.js} +2 -2
  48. package/dist/{chunk-0xtda6aw.js → chunk-fmzyrg2e.js} +1 -1
  49. package/dist/{chunk-qa5y30sy.js → chunk-g0xn80gz.js} +7 -7
  50. package/dist/{chunk-gw7t6a3t.js → chunk-gheba4nb.js} +1 -1
  51. package/dist/{chunk-hc6111md.js → chunk-h4rjzbek.js} +4 -4
  52. package/dist/{chunk-w468n41y.js → chunk-hpfq5qe4.js} +18 -18
  53. package/dist/{chunk-xymr4ys9.js → chunk-jbgj2hph.js} +1 -1
  54. package/dist/{chunk-15m7jnc0.js → chunk-jwghpcqn.js} +1 -1
  55. package/dist/{chunk-x512h2gv.js → chunk-kh6njq2r.js} +2 -2
  56. package/dist/{chunk-jgra00m8.js → chunk-kh7hbgx6.js} +1 -1
  57. package/dist/{chunk-d0afg5f7.js → chunk-ma1tf68v.js} +1 -1
  58. package/dist/{chunk-wtfamngc.js → chunk-mrw6vmqy.js} +4 -4
  59. package/dist/{chunk-dtarm8x9.js → chunk-nack2xs5.js} +4 -4
  60. package/dist/{chunk-ntbe5q5x.js → chunk-ndez5ee8.js} +2 -2
  61. package/dist/{chunk-h816ta81.js → chunk-p8x0a0fp.js} +2 -2
  62. package/dist/{chunk-pyckafsb.js → chunk-pfs0gv2a.js} +1 -1
  63. package/dist/{chunk-gjngg182.js → chunk-pghp2tkv.js} +8 -8
  64. package/dist/{chunk-g4gcf4jn.js → chunk-ppfp1w98.js} +1 -1
  65. package/dist/{chunk-xcjvx6zt.js → chunk-ptxptv29.js} +1 -1
  66. package/dist/{chunk-021tjkd6.js → chunk-q22fpqtr.js} +1 -1
  67. package/dist/chunk-qcvfzskb.js +2 -0
  68. package/dist/{chunk-5zzrrxns.js → chunk-qjbjn6vz.js} +4 -4
  69. package/dist/{chunk-dpmayc2w.js → chunk-r0v2chpn.js} +2 -2
  70. package/dist/{chunk-b6w0f610.js → chunk-rme1a5qv.js} +19 -19
  71. package/dist/{chunk-669b2bya.js → chunk-rw5492e2.js} +3 -3
  72. package/dist/{chunk-czca8yds.js → chunk-sxdzpv90.js} +1 -1
  73. package/dist/{chunk-2n932qtv.js → chunk-syzggy76.js} +1 -1
  74. package/dist/{chunk-nttsc0aw.js → chunk-t2a6j64z.js} +5 -5
  75. package/dist/{chunk-qmkaqjba.js → chunk-t9r644tq.js} +1 -1
  76. package/dist/{chunk-x3p4emdp.js → chunk-tbq6msyc.js} +1 -1
  77. package/dist/chunk-v7jjrz5k.js +2 -0
  78. package/dist/{chunk-prrvggcy.js → chunk-vkj9fem6.js} +1 -1
  79. package/dist/chunk-w463vqkh.js +2 -0
  80. package/dist/{chunk-p0tkhd12.js → chunk-w8qr5414.js} +1 -1
  81. package/dist/{chunk-y036cwc7.js → chunk-wcvzsyf1.js} +2 -2
  82. package/dist/chunk-wxng15a3.js +2 -0
  83. package/dist/{chunk-yakdcak2.js → chunk-x5n2jc6m.js} +1 -1
  84. package/dist/{chunk-qbghf76y.js → chunk-x64afx6z.js} +2 -2
  85. package/dist/chunk-xsscsar3.js +3 -0
  86. package/dist/{chunk-r4v4vswq.js → chunk-y69k2fww.js} +1 -1
  87. package/dist/chunk-yrstc4z4.js +2 -0
  88. package/dist/chunk-z6c4c951.js +2 -0
  89. package/dist/{chunk-85zmxbt0.js → chunk-zdrn7wp0.js} +4 -4
  90. package/dist/cli.js +13 -13
  91. package/dist/client/signals-component-props-runtime.js +7 -1
  92. package/dist/craft-entry.js +2 -2
  93. package/dist/craft.js +2 -2
  94. package/dist/native/floating-actions-web.d.ts +20 -0
  95. package/dist/native/floating-actions-web.js +177 -0
  96. package/dist/native/floating-actions.d.ts +8 -1
  97. package/dist/native/floating-actions.js +1 -1
  98. package/dist/native/primitives/FloatingActions.stx +22 -2
  99. package/dist/pwa.js +3 -3
  100. package/dist/site-builder/build.d.ts +6 -0
  101. package/dist/site-builder/build.js +13 -3
  102. package/dist/site-builder/types.d.ts +3 -0
  103. package/dist/ssg.js +4 -4
  104. package/package.json +5 -5
  105. package/dist/chunk-0bfgsv31.js +0 -2
  106. package/dist/chunk-36j129p1.js +0 -2
  107. package/dist/chunk-7mjf144y.js +0 -2
  108. package/dist/chunk-a4cn8rf4.js +0 -2
  109. package/dist/chunk-ap84eenm.js +0 -2
  110. package/dist/chunk-as2ffje6.js +0 -2
  111. package/dist/chunk-c0t2tdfk.js +0 -2
  112. package/dist/chunk-caxqwrnc.js +0 -2
  113. package/dist/chunk-d9vzfbdp.js +0 -2
  114. package/dist/chunk-e634vffz.js +0 -3
  115. package/dist/chunk-g65dptx2.js +0 -2
  116. package/dist/chunk-kw11yydy.js +0 -2
  117. package/dist/chunk-ns04v3am.js +0 -2
  118. package/dist/chunk-p2etn78y.js +0 -2
  119. package/dist/chunk-r23zq8yk.js +0 -2
  120. package/dist/chunk-rqmb09ss.js +0 -2
  121. package/dist/chunk-sz6d3v6b.js +0 -2
  122. package/dist/chunk-va07zs9v.js +0 -2
  123. package/dist/chunk-vc42mvjn.js +0 -2
  124. package/dist/chunk-xzdkjkyp.js +0 -2
  125. package/dist/chunk-ybkwnscv.js +0 -2
  126. package/dist/chunk-z3gz5fy4.js +0 -2
@@ -0,0 +1,177 @@
1
+ import { floatingActions } from "./floating-actions.js";
2
+ const GLASS = "background:var(--stx-floating-actions-background,color-mix(in srgb,Canvas 78%,transparent));backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);box-shadow:inset 0 0 0 .5px color-mix(in srgb,currentColor 18%,transparent),0 8px 24px rgba(0,0,0,.18)", TINT = "var(--stx-floating-actions-tint,#007aff)", G = "[data-floating-actions-web", A = ":where([data-floating-action])";
3
+ export const FLOATING_ACTIONS_CSS = [
4
+ `:where(${G}]){position:fixed;z-index:var(--stx-floating-actions-z,40);inset-inline-end:var(--stx-floating-actions-inset-end,16px);bottom:var(--stx-floating-actions-bottom,calc(16px + env(safe-area-inset-bottom)));display:flex;flex-direction:column;color:var(--stx-floating-actions-color,CanvasText)}`,
5
+ `:where(${G}="horizontal"],${G}="separate"]){flex-direction:row}`,
6
+ `:where(${G}="separate"]){gap:10px}`,
7
+ `:where(${G}="vertical"],${G}="horizontal"]){border-radius:24px;${GLASS}}`,
8
+ `${A}{position:relative;display:flex;align-items:center;justify-content:center;min-width:48px;height:48px;flex-shrink:0;margin:0;padding:0;border:0;border-radius:24px;background:transparent;color:inherit;font:inherit;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}`,
9
+ `:where(${G}="vertical"]) ${A}{height:55px}`,
10
+ `:where(${G}="horizontal"]) ${A}{min-width:55px}`,
11
+ `:where(${G}="separate"]) ${A}{${GLASS}}`,
12
+ `:where(${G}="vertical"]) :where([data-floating-action][data-first]){margin-top:-3.5px}`,
13
+ `:where(${G}="vertical"]) :where([data-floating-action][data-last]){margin-bottom:-3.5px}`,
14
+ `:where(${G}="horizontal"]) :where([data-floating-action][data-first]){margin-inline-start:-3.5px}`,
15
+ `:where(${G}="horizontal"]) :where([data-floating-action][data-last]){margin-inline-end:-3.5px}`,
16
+ `:where([data-floating-action][data-on]){color:${TINT}}`,
17
+ ":where([data-floating-action-symbol]){display:block;width:24px;height:24px;flex-shrink:0}",
18
+ ":where([data-floating-action-name]){font-size:12px;font-weight:600;line-height:1;padding:0 6px;white-space:nowrap}",
19
+ `:where([data-floating-action-badge]){position:absolute;top:4px;inset-inline-end:2px;display:flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:${TINT};color:#fff;font-size:11px;font-weight:600;line-height:1}`,
20
+ `:where([data-floating-actions-menu]){position:absolute;inset-inline-end:0;bottom:calc(100% + 8px);display:flex;flex-direction:column;width:max-content;min-width:200px;max-width:min(280px,calc(100vw - 32px));padding:6px;border-radius:18px;color:inherit;${GLASS}}`,
21
+ ":where([data-floating-actions-choice]){display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:12px;color:inherit;text-decoration:none;font-size:16px;line-height:20px}",
22
+ ":where([data-floating-actions-choice]) :where([data-floating-action-symbol]){width:20px;height:20px}"
23
+ ].join(`
24
+ `);
25
+ function badgeText(badge) {
26
+ if (typeof badge === "number")
27
+ return badge > 99 ? "99+" : badge > 0 ? String(Math.floor(badge)) : null;
28
+ return badge ? String(badge).slice(0, 8) : null;
29
+ }
30
+ function sitePath(value, fallback) {
31
+ return typeof value === "string" && value.startsWith("/") && !value.startsWith("//") ? value : fallback;
32
+ }
33
+ export function mountFloatingActionsWeb(doc = document) {
34
+ let group = null, closeMenu = null, classes = {};
35
+ const rules = () => {
36
+ if (doc.querySelector("style[data-floating-actions-style]"))
37
+ return;
38
+ const style = doc.createElement("style");
39
+ style.setAttribute("data-floating-actions-style", "");
40
+ style.textContent = FLOATING_ACTIONS_CSS;
41
+ (doc.head || doc.body).append(style);
42
+ }, symbol = (icon, label) => {
43
+ const mark = doc.createElement("span");
44
+ mark.setAttribute("aria-hidden", "true");
45
+ if (icon) {
46
+ mark.setAttribute("data-floating-action-symbol", "");
47
+ mark.className = icon;
48
+ } else {
49
+ mark.setAttribute("data-floating-action-name", "");
50
+ mark.textContent = label;
51
+ }
52
+ return mark;
53
+ }, openMenu = (button, action) => {
54
+ closeMenu?.();
55
+ const choices = (action.menu || []).slice(0, 12).filter((choice) => choice.title && sitePath(choice.path, "") !== "");
56
+ if (!choices.length || !group)
57
+ return;
58
+ const menu = doc.createElement("div");
59
+ menu.setAttribute("data-floating-actions-menu", "");
60
+ menu.setAttribute("role", "menu");
61
+ menu.setAttribute("aria-label", button.getAttribute("aria-label") || action.label);
62
+ if (classes.menu)
63
+ menu.className = classes.menu;
64
+ for (const choice of choices) {
65
+ const link = doc.createElement("a");
66
+ link.setAttribute("role", "menuitem");
67
+ link.href = sitePath(choice.href, choice.path);
68
+ link.setAttribute("data-floating-actions-choice", choice.path);
69
+ if (choice.icon)
70
+ link.append(symbol(choice.icon, choice.title));
71
+ const title = doc.createElement("span");
72
+ title.textContent = choice.title;
73
+ link.append(title);
74
+ link.addEventListener("click", () => closeMenu?.());
75
+ menu.append(link);
76
+ }
77
+ const view = doc.defaultView, outside = (event) => {
78
+ const target = event.target;
79
+ if (target && (menu.contains(target) || button.contains(target)))
80
+ return;
81
+ closeMenu?.();
82
+ }, keys = (event) => {
83
+ const key = event.key;
84
+ if (key === "Escape") {
85
+ closeMenu?.();
86
+ button.focus();
87
+ return;
88
+ }
89
+ if (key !== "ArrowDown" && key !== "ArrowUp")
90
+ return;
91
+ event.preventDefault();
92
+ const items = [...menu.querySelectorAll('[role="menuitem"]')], at = items.indexOf(doc.activeElement);
93
+ items[(at + (key === "ArrowDown" ? 1 : items.length - 1)) % items.length]?.focus();
94
+ };
95
+ closeMenu = () => {
96
+ closeMenu = null;
97
+ menu.remove();
98
+ button.setAttribute("aria-expanded", "false");
99
+ view?.removeEventListener("pointerdown", outside, !0);
100
+ view?.removeEventListener("keydown", keys, !0);
101
+ };
102
+ group.append(menu);
103
+ button.setAttribute("aria-expanded", "true");
104
+ view?.addEventListener("pointerdown", outside, !0);
105
+ view?.addEventListener("keydown", keys, !0);
106
+ menu.querySelector('[role="menuitem"]')?.focus();
107
+ }, clear = () => {
108
+ closeMenu?.();
109
+ group?.remove();
110
+ group = null;
111
+ };
112
+ return {
113
+ get element() {
114
+ return group;
115
+ },
116
+ update(actions, layout = "vertical", given = "") {
117
+ const accessory = floatingActions(actions, layout);
118
+ clear();
119
+ if (!accessory)
120
+ return;
121
+ classes = typeof given === "string" ? { group: given } : given || {};
122
+ rules();
123
+ const list = actions.filter(Boolean);
124
+ group = doc.createElement("div");
125
+ group.setAttribute("data-floating-actions-web", layout);
126
+ group.setAttribute("role", "group");
127
+ group.setAttribute("aria-label", accessory.accessibilityLabel || accessory.title);
128
+ if (classes.group)
129
+ group.className = classes.group;
130
+ const here = doc.defaultView?.location?.pathname?.replace(/\/$/, "") || "/";
131
+ list.forEach((action, index) => {
132
+ const href = sitePath(action.href, action.path), offers = Boolean(action.menu?.length), control = doc.createElement(offers ? "button" : "a"), badge = index === list.length - 1 ? badgeText(action.badge) : null;
133
+ control.setAttribute("data-floating-action", action.path);
134
+ if (index === 0)
135
+ control.setAttribute("data-first", "");
136
+ if (index === list.length - 1)
137
+ control.setAttribute("data-last", "");
138
+ control.setAttribute("aria-label", `${action.accessibilityLabel || action.label}${badge ? `, ${badge}` : ""}`);
139
+ control.title = action.label;
140
+ const current = href.split("?")[0].replace(/\/$/, "") === here;
141
+ if (action.active || current)
142
+ control.setAttribute("data-on", "");
143
+ if (offers) {
144
+ const button = control;
145
+ button.type = "button";
146
+ button.setAttribute("aria-haspopup", "menu");
147
+ button.setAttribute("aria-expanded", "false");
148
+ if (action.active)
149
+ button.setAttribute("aria-pressed", "true");
150
+ button.addEventListener("click", () => {
151
+ if (closeMenu)
152
+ closeMenu();
153
+ else
154
+ openMenu(button, action);
155
+ });
156
+ } else {
157
+ control.href = href;
158
+ if (current)
159
+ control.setAttribute("aria-current", "page");
160
+ }
161
+ control.append(symbol(action.icon, action.label));
162
+ if (badge) {
163
+ const count = doc.createElement("span");
164
+ count.setAttribute("data-floating-action-badge", "");
165
+ count.setAttribute("aria-hidden", "true");
166
+ if (classes.badge)
167
+ count.className = classes.badge;
168
+ count.textContent = badge;
169
+ control.append(count);
170
+ }
171
+ group.append(control);
172
+ });
173
+ doc.body.append(group);
174
+ },
175
+ dispose: clear
176
+ };
177
+ }
@@ -35,10 +35,17 @@ export declare interface NativeFloatingAction {
35
35
  accessibilityLabel?: string
36
36
  active?: boolean
37
37
  badge?: string | number | null
38
- menu?: NativeAccessoryMenuItem[]
38
+ menu?: NativeFloatingActionChoice[]
39
+ icon?: string
40
+ href?: string
39
41
  }
40
42
  /**
41
43
  * `vertical` and `horizontal` join the actions in one capsule of glass, as the
42
44
  * map controls in Maps are joined; `separate` keeps a round control each.
43
45
  */
46
+ /** One destination of an action's menu, with what a web page draws and opens for it. */
47
+ export declare interface NativeFloatingActionChoice extends NativeAccessoryMenuItem {
48
+ icon?: string
49
+ href?: string
50
+ }
44
51
  export type NativeFloatingActionsLayout = 'vertical' | 'horizontal' | 'separate';
@@ -36,7 +36,7 @@ export function floatingActions(actions, layout = "vertical") {
36
36
  symbol: action.symbol,
37
37
  ...action.accessibilityLabel ? { accessibilityLabel: action.accessibilityLabel } : {},
38
38
  ...action.active ? { selected: !0 } : {},
39
- ...action.menu?.length ? { menu: action.menu.map((choice) => ({ ...choice })) } : {}
39
+ ...action.menu?.length ? { menu: action.menu.map((choice) => ({ path: choice.path, title: choice.title, ...choice.symbol ? { symbol: choice.symbol } : {} })) } : {}
40
40
  };
41
41
  });
42
42
  return {
@@ -11,19 +11,38 @@
11
11
  `layout` is `vertical` (the default), `horizontal`, or `separate` for a
12
12
  round control each. The host draws them (Liquid Glass on iOS 26), so this
13
13
  takes no room in the screen's own layout; they follow `actions` as it
14
- changes and leave with the screen. For actions every screen shares, pass
14
+ changes and leave with the screen.
15
+
16
+ A web page has no host, so there the component draws the same group itself:
17
+ each action's `icon` (an icon class) in place of its SF Symbol, opening its
18
+ `href` where the website's path differs from the app's. Its look weighs
19
+ nothing against a class: `class` goes on the group (`flex md:hidden` shows
20
+ it on a phone only), `badgeClass` on the badge and `menuClass` on a menu.
21
+ `--stx-floating-actions-*` place and colour it too (floating-actions-web.ts). For actions every screen shares, pass
15
22
  `floatingActions()` from `@stacksjs/stx/native` to `craft.navigation.setChrome`.
16
23
  --}}
17
24
  <script client>
18
25
  import { floatingActions } from '../floating-actions'
26
+ import { mountFloatingActionsWeb } from '../floating-actions-web'
19
27
 
20
28
  const floatingList = useReactiveProp('actions', [])
21
29
  const floatingLayout = useReactiveProp('layout', 'vertical')
22
- // A page drawn by a browser has no host chrome to put them in.
30
+ const floatingClass = useReactiveProp('class', '')
31
+ // `className` as well: a component's `class` can be taken by its own root.
32
+ const floatingClassName = useReactiveProp('className', '')
33
+ const floatingBadgeClass = useReactiveProp('badgeClass', '')
34
+ const floatingMenuClass = useReactiveProp('menuClass', '')
23
35
  const floatingHost = typeof craft !== 'undefined' && craft && craft.navigation ? craft.navigation : null
36
+ // A page drawn by a browser has no host chrome to put them in, so it draws them.
37
+ const floatingPage = !floatingHost && typeof document !== 'undefined' ? mountFloatingActionsWeb(document) : null
24
38
  let floatingSent = ''
25
39
 
26
40
  effect(() => {
41
+ if (floatingPage) {
42
+ const list = floatingList()
43
+ floatingPage.update(Array.isArray(list) ? list : [], String(floatingLayout() || 'vertical'), { group: String(floatingClassName() || floatingClass() || ''), badge: String(floatingBadgeClass() || ''), menu: String(floatingMenuClass() || '') })
44
+ return
45
+ }
27
46
  if (!floatingHost) return
28
47
  const list = floatingList()
29
48
  const accessory = floatingActions(Array.isArray(list) ? list : [], String(floatingLayout() || 'vertical'))
@@ -36,6 +55,7 @@ effect(() => {
36
55
  })
37
56
 
38
57
  onDestroy(() => {
58
+ if (floatingPage) floatingPage.dispose()
39
59
  if (floatingHost && floatingSent && floatingSent !== 'null') floatingHost.setOptions({ tabAccessory: null })
40
60
  })
41
61
  </script>
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{ao,Gt,Dl,Vg}from"./chunk-qbghf76y.js";import{io,Hi,Fg,zg,Hg}from"./chunk-bx5d87xx.js";import{Ol,Nl,Ml,jg,Bg}from"./chunk-dpmayc2w.js";import{Xe,Nn,Vi}from"./chunk-mrh08821.js";import{Ug,Wg,qg,Kg,co,Py}from"./chunk-srgnevws.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
- Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-xzdkjkyp.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
2
+ import{ao,Gt,Ml,Vg}from"./chunk-x64afx6z.js";import{io,Hi,Fg,zg,Hg}from"./chunk-f6ypmk8x.js";import{Ol,Nl,Dl,jg,Bg}from"./chunk-r0v2chpn.js";import{Xe,Nn,Vi}from"./chunk-mrh08821.js";import{Ug,Wg,qg,Kg,co,Py}from"./chunk-srgnevws.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
+ Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-2mgajzam.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
233
233
  }, 5000);
234
234
  </script>
235
235
  </body>
236
- </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Xe(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=ao(n,t);if(a){let s=Gt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Hi(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,Nl as auditBuildOutput,Ol as auditConfig,re as buildPwaAssets,Ml as calculateAuditResult,Bg as formatAuditResult,Vi as formatSize,j as generateManifest,_ as generateManifestJson,zg as generateManifestLink,F as generateOfflinePage,Xe as generatePrecacheManifest,Nn as generatePrecacheManifestJs,M as generatePwaIcons,io as generatePwaTags,ao as generateServiceWorker,Vg as generateServiceWorkerAuto,Fg as generateSwRegistrationScript,Hg as generateThemeColorMeta,N as getExpectedIconPaths,Gt as getServiceWorkerFileName,Hi as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Dl as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,co as pwaDirectives,Ug as pwaInstallDirective,qg as pwaOfflineDirective,Kg as pwaPushDirective,Wg as pwaUpdateDirective,Py as registerPwaDirectives,jg as runPwaAudit,D as validateManifest};
236
+ </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Xe(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=ao(n,t);if(a){let s=Gt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Hi(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,Nl as auditBuildOutput,Ol as auditConfig,re as buildPwaAssets,Dl as calculateAuditResult,Bg as formatAuditResult,Vi as formatSize,j as generateManifest,_ as generateManifestJson,zg as generateManifestLink,F as generateOfflinePage,Xe as generatePrecacheManifest,Nn as generatePrecacheManifestJs,M as generatePwaIcons,io as generatePwaTags,ao as generateServiceWorker,Vg as generateServiceWorkerAuto,Fg as generateSwRegistrationScript,Hg as generateThemeColorMeta,N as getExpectedIconPaths,Gt as getServiceWorkerFileName,Hi as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Ml as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,co as pwaDirectives,Ug as pwaInstallDirective,qg as pwaOfflineDirective,Kg as pwaPushDirective,Wg as pwaUpdateDirective,Py as registerPwaDirectives,jg as runPwaAudit,D as validateManifest};
@@ -10,6 +10,12 @@ import type { BuildOptions, SiteConfig } from './types.js';
10
10
  * 7. Generate sitemap.xml and robots.txt
11
11
  */
12
12
  export declare function buildStaticSite(options: BuildOptions): Promise<BuildResult>;
13
+ /**
14
+ * The component directories a build was given, absolute, in the shape the stx
15
+ * plugin takes. Only what was set is returned, so anything left out still
16
+ * comes from the project's stx config.
17
+ */
18
+ export declare function componentDirOptions(options: Pick<BuildOptions, 'componentsDir' | 'additionalComponentsDirs' | 'fallbackComponentsDir'>, cwd?: string): { componentsDir?: string, additionalComponentsDirs?: string[], fallbackComponentsDir?: string };
13
19
  export declare function defineSiteConfig<T extends SiteConfig>(config: T): T;
14
20
  export declare interface BuildResult {
15
21
  outDir: string
@@ -11,7 +11,7 @@ import {
11
11
  unlinkSync,
12
12
  writeFileSync
13
13
  } from "node:fs";
14
- import { dirname, join, relative } from "node:path";
14
+ import { dirname, join, relative, resolve } from "node:path";
15
15
  import process from "node:process";
16
16
  import stxPlugin from "bun-plugin-stx";
17
17
  import { CONVENTIONAL_ASSET_OUTPUT, resolveConventionalAssetRoot } from "../asset-roots.js";
@@ -49,10 +49,10 @@ export async function buildStaticSite(options) {
49
49
  console.warn(`[stx] ${excluded.length} file(s) under ${pagesDir}/ skipped as non-pages: ${excludeDirs.join(", ")}`);
50
50
  if (entrypoints.length === 0)
51
51
  throw Error(`No .stx files found in ${pagesDir}/`);
52
- const isolated = await buildIsolatingFailures(entrypoints, (subset) => Bun.build({
52
+ const componentOptions = componentDirOptions(options), isolated = await buildIsolatingFailures(entrypoints, (subset) => Bun.build({
53
53
  entrypoints: subset,
54
54
  outdir: outDir,
55
- plugins: [stxPlugin()],
55
+ plugins: [stxPlugin(componentOptions)],
56
56
  naming: { entry: "[name].[ext]" }
57
57
  }));
58
58
  if (isolated.failed.length > 0) {
@@ -125,6 +125,16 @@ export async function buildStaticSite(options) {
125
125
  const builtPages = htmlFiles.map(pathFromFile);
126
126
  return { outDir, pages: builtPages, durationMs: Date.now() - start };
127
127
  }
128
+ export function componentDirOptions(options, cwd = process.cwd()) {
129
+ const resolved = {};
130
+ if (options.componentsDir)
131
+ resolved.componentsDir = resolve(cwd, options.componentsDir);
132
+ if (options.additionalComponentsDirs?.length)
133
+ resolved.additionalComponentsDirs = options.additionalComponentsDirs.map((dir) => resolve(cwd, dir));
134
+ if (options.fallbackComponentsDir)
135
+ resolved.fallbackComponentsDir = resolve(cwd, options.fallbackComponentsDir);
136
+ return resolved;
137
+ }
128
138
  function dirnameOf(p) {
129
139
  return dirname(p);
130
140
  }
@@ -57,6 +57,9 @@ export declare interface PageMeta {
57
57
  }
58
58
  export declare interface BuildOptions extends SiteConfig {
59
59
  noClean?: boolean
60
+ componentsDir?: string
61
+ additionalComponentsDirs?: string[]
62
+ fallbackComponentsDir?: string
60
63
  }
61
64
  /**
62
65
  * SPA router options (subset — see RouterOptions in router.ts).
package/dist/ssg.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import"./chunk-9zrvh3pz.js";import{k,yl}from"./chunk-qa5y30sy.js";import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import{Mt,w}from"./chunk-b6w0f610.js";import"./chunk-k32q90b2.js";import"./chunk-k7dxm48r.js";import"./chunk-tnp2ta5q.js";import{Rt,At,Pt,It,Ot,Nt}from"./chunk-x512h2gv.js";import{a}from"./chunk-yhc1c4tr.js";import{Os}from"./chunk-mfa07erx.js";import"./chunk-669b2bya.js";import"./chunk-wk4wg6sn.js";import{xe,cn,ln}from"./chunk-wtfamngc.js";import"./chunk-021tjkd6.js";import{x}from"./chunk-y190sh29.js";import{kt,i}from"./chunk-xfd3yqgj.js";import"./chunk-czca8yds.js";import"./chunk-hc6111md.js";import{vs}from"./chunk-y036cwc7.js";import"./chunk-ks5p5w6z.js";import"./chunk-q1wxgw5s.js";import{lc,uc,dc}from"./chunk-v4xes880.js";import{on,sr,or}from"./chunk-ymdw4fhd.js";import{an}from"./chunk-58sh82aj.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import{Z,_e}from"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-r4v4vswq.js";import{l}from"./chunk-46pxmpeb.js";import{r,we}from"./chunk-x7redxyd.js";import{f}from"./chunk-s9df8srx.js";import R from"fs";import m from"path";import{createHash as vt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Et(t){return Bun.hash(t).toString(16)}function ct(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Dt,(e,u,g,v)=>{let S=v.trim();if(!S)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)S=$t(S);let p=Et(S);if(!s.has(p))s.set(p,S);let P=n.integrity?` data-stx-integrity="sha384-${vt("sha384").update(S).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Ct=new Set(["visible","idle"]);function lt(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Ct.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=w(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let S=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!S)return t;return t.slice(0,v)+S+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let n of Bt){let s=t[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function ut(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function Ft(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,o);if(!n(c))continue;try{let e=await import(c),u=ut(e.default??e);if(u)return u}catch{}}return null}async function dt(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=ut(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Ft(n);if(c)return{url:c,source:"site.config",via:"url"};let e=jt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function gt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Tt;function Lt(t){let n=r(t),{depths:s}=we(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=k(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=k(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(n))!==null){if(s[c.index]!==0)continue;let u=yl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function pt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=an(s),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Tt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(r(g))&&Mt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let S=await v();n="result";let p=Array.isArray(S)?{paths:S}:S;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=m.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let t=m.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=R.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(R.existsSync(e)){let u=R.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=mt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&vs(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let c=this.getHash(n,s);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return m.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await R.promises.mkdir(m.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(t){let n=m.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await R.promises.unlink(m.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Ut(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await pt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function _t(t){for(let n of mt(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
2
+ import"./chunk-9zrvh3pz.js";import{k,yl}from"./chunk-g0xn80gz.js";import"./chunk-qjey0jk6.js";import"./chunk-farh4p7f.js";import{Dt,w}from"./chunk-rme1a5qv.js";import"./chunk-k32q90b2.js";import"./chunk-4w8a7f8t.js";import"./chunk-tnp2ta5q.js";import{Rt,At,Pt,It,Ot,Nt}from"./chunk-kh6njq2r.js";import{a}from"./chunk-83qwwnye.js";import{Os}from"./chunk-83tvkw4y.js";import"./chunk-rw5492e2.js";import"./chunk-fh8jzm4b.js";import{xe,cn,ln}from"./chunk-mrw6vmqy.js";import"./chunk-q22fpqtr.js";import{x}from"./chunk-brs63ht2.js";import{kt,i}from"./chunk-6mhj42gz.js";import"./chunk-sxdzpv90.js";import"./chunk-h4rjzbek.js";import{vs}from"./chunk-wcvzsyf1.js";import"./chunk-6y066pr2.js";import"./chunk-q1wxgw5s.js";import{lc,uc,dc}from"./chunk-v4xes880.js";import{on,sr,or}from"./chunk-ymdw4fhd.js";import{an}from"./chunk-ez6e7rh1.js";import"./chunk-xsscsar3.js";import"./chunk-jbgj2hph.js";import{Z,_e}from"./chunk-t2a6j64z.js";import"./chunk-5dvkphbe.js";import"./chunk-y69k2fww.js";import{l}from"./chunk-46pxmpeb.js";import{r,we}from"./chunk-x7redxyd.js";import{f}from"./chunk-fd1bpv35.js";import R from"fs";import m from"path";import{createHash as vt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Et=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ct(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Et,(e,u,g,v)=>{let S=v.trim();if(!S)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)S=$t(S);let p=Ct(S);if(!s.has(p))s.set(p,S);let P=n.integrity?` data-stx-integrity="sha384-${vt("sha384").update(S).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),c=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:c}}var Bt=new Set(["visible","idle"]);function lt(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(n.get(u[1])||""))c.add(u[2]);let g=/<\/head\s*>/iy,v=w(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(c.size===0||v===-1)return t;let S=Array.from(c).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!S)return t;return t.slice(0,v)+S+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let n of jt){let s=t[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function ut(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function Tt(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,o);if(!n(c))continue;try{let e=await import(c),u=ut(e.default??e);if(u)return u}catch{}}return null}async function dt(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=ut(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let c=await Tt(n);if(c)return{url:c,source:"site.config",via:"url"};let e=Ft(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function gt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Lt;function Ut(t){let n=r(t),{depths:s}=we(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,c;while((c=o.exec(n))!==null){if(s[c.index]!==0)continue;let u=k(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=k(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(c.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((c=e.exec(n))!==null){if(s[c.index]!==0)continue;let u=yl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function pt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=an(s),c=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of c){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Lt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Ut(u);if(/\bdefineStaticPaths\b/.test(r(g))&&Dt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let S=await v();n="result";let p=Array.isArray(S)?{paths:S}:S;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=m.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await R.promises.mkdir(this.cacheDir,{recursive:!0});let t=m.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=R.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(R.existsSync(e)){let u=R.statSync(e);o+=`:${e}:${u.mtimeMs}`}let c=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);c=(c<<5)-c+u,c=c&c}return Math.abs(c).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=mt(n).some((u)=>R.existsSync(u)),c=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&R.existsSync(u)&&vs(R.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||c)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let c=this.getHash(n,s);this.cache.set(t,{hash:c,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return m.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await R.promises.mkdir(m.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await R.promises.unlink(n)}async invalidatePattern(t){let n=m.join(this.cacheDir,"isr");if(!R.existsSync(n))return;let s=await R.promises.readdir(n);for(let o of s){let c=o.replace(/_/g,"/").replace(".json","");if(t.test(c))await R.promises.unlink(m.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function _t(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await pt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let c of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(c.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:c.params,props:c.props,revalidate:c.revalidate})}}return n}function mt(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let n of mt(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...c}=s;return c}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let c=o[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
4
4
  return (async function getStaticProps() {
5
5
  ${e[1]}
6
6
  })()
7
- `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Ht(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function wt(t,n,s={},o,c){let e=await Bun.file(t.filePath).text(),u=await _t(t.filePath),g=await Gt(e,n,t.filePath),v={...u||{},...g||{},...s,params:n,$route:{path:t.pattern,params:n}},S=new Set,p=[],P=[],C={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(E)=>{p.push(`${m.relative(process.cwd(),E.templatePath)}: ${E.message}
7
+ `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Ht(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function wt(t,n,s={},o,c){let e=await Bun.file(t.filePath).text(),u=await Mt(t.filePath),g=await Gt(e,n,t.filePath),v={...u||{},...g||{},...s,params:n,$route:{path:t.pattern,params:n}},S=new Set,p=[],P=[],C={...c,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(E)=>{p.push(`${m.relative(process.cwd(),E.templatePath)}: ${E.message}
8
8
  resolved against partialsDir: ${E.partialsDir}`)},onServerScriptError:(E)=>{P.push(`${m.relative(process.cwd(),E.sourcePath)} (${E.kind}): ${E.message}`)}};if(Ht(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let b=await i(e,v,t.filePath,C,S);for(let E of[t.filePath,...S])for(let O of xe(E))S.add(O);if(Object.keys(n).length>0){let E=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(b.includes("</head>"))b=f(b,E);else b=`${E}
9
9
  ${b}`}if(b=await _e(b,{router:o.router}),b=await x(b),o.minify!==!1)return{html:zt(b),dependencies:Array.from(S),includeFailures:p,serverScriptFailures:P};return{html:b,dependencies:Array.from(S),includeFailures:p,serverScriptFailures:P}}function zt(t){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=o.exec(t))!==null){let u=t.slice(s,c.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=c[1],v=c[2],S=c[3];v=v.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(g+v+S),s=c.index+c[0].length}let e=t.slice(s);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Wt(t){let n=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function qt(t,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Jt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
10
10
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -36,7 +36,7 @@ ${t.map((o)=>{let c=new URL(o.loc,n).href,e=` <url>
36
36
  ${s.join(`
37
37
  `)}
38
38
  </channel>
39
- </rss>`}async function Kt(t={}){let n=Date.now();ln();let s=await a(process.cwd()),o=s.build||{},c=await dt({explicit:t.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(gt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,S={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&R.existsSync(e.outputDir))await R.promises.rm(e.outputDir,{recursive:!0});await R.promises.mkdir(e.outputDir,{recursive:!0});let C=e.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-gw7t6a3t.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-z383x16t.js"),E=await b(e.publicDir,e.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ft(e.cacheDir,C);if(e.cache)await O.load();try{let{generateCss:d}=await import("./chunk-gw7t6a3t.js");await d('<div class="bg-black"></div>')}catch{}Rt();let yt=s?.routeMiddleware?.dir||"middleware";await Pt(process.cwd(),yt);let V=At();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let St=s?.routeMiddleware?.global||[];dc(s?.layoutsDir,l(process.cwd()));let Q=Z(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await Ut(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??e.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await e.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let _=[],tt=[];for(let d=0;d<U.length;d+=e.concurrency)tt.push(U.slice(d,d+e.concurrency));for(let d of tt)await Promise.all(d.map(async(y)=>{let{route:D,url:h,params:M,props:xt,revalidate:nt}=y;try{await e.hooks.onPageStart?.(h);let G=await Bun.file(D.filePath).text(),A=Zt(G),bt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],it=[...St,...bt];if(it.length>0){let j=It(h,M,A||{}),N=Ot(j,null,void 0,{isServer:!0}),F=await Nt(it,N);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,z=Qt(String(I),h),L=te(h,e);await R.promises.mkdir(m.dirname(L),{recursive:!0}),await Bun.write(L,z),u.successCount++,u.pages.push({route:h,outputPath:L,size:Buffer.byteLength(z),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${I}`);return}}let st=A?.validate;if(typeof st==="function")try{if(!await st({params:M})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let B=null,at=!1;if(e.cache){if(B=O.get(h,D.filePath),B)at=!0,u.cachedCount++}if(!B){let j=await wt(D,M,xt,e,s);if(B=j.html,e.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
39
+ </rss>`}async function Kt(t={}){let n=Date.now();ln();let s=await a(process.cwd()),o=s.build||{},c=await dt({explicit:t.domain||o.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(gt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:c.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||l(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,S={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&R.existsSync(e.outputDir))await R.promises.rm(e.outputDir,{recursive:!0});await R.promises.mkdir(e.outputDir,{recursive:!0});let C=e.cacheSalt;if(!C){let{resolveUserCssConfig:d,fingerprintConfig:y}=await import("./chunk-gheba4nb.js");try{C=y(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-8010hzhm.js"),E=await b(e.publicDir,e.outputDir);if(E.count>0)console.log(`Optimized ${E.count} image(s) for responsive delivery`),C=[C,E.fingerprint].filter(Boolean).join(":");let O=new ft(e.cacheDir,C);if(e.cache)await O.load();try{let{generateCss:d}=await import("./chunk-gheba4nb.js");await d('<div class="bg-black"></div>')}catch{}Rt();let yt=s?.routeMiddleware?.dir||"middleware";await Pt(process.cwd(),yt);let V=At();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let St=s?.routeMiddleware?.global||[];dc(s?.layoutsDir,l(process.cwd()));let Q=Z(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Q.length} routes`);let U=[];for(let d of Q)try{let y=await _t(d);for(let D of y)U.push({route:d,url:D.url,params:D.params,props:D.props,revalidate:D.revalidate??e.revalidate})}catch(y){let D=y instanceof Error?y:Error(String(y));u.failedCount++,u.errors.push({route:d.pattern,error:D}),await e.hooks.onError?.(D,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,D)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let _=[],tt=[];for(let d=0;d<U.length;d+=e.concurrency)tt.push(U.slice(d,d+e.concurrency));for(let d of tt)await Promise.all(d.map(async(y)=>{let{route:D,url:h,params:M,props:xt,revalidate:nt}=y;try{await e.hooks.onPageStart?.(h);let G=await Bun.file(D.filePath).text(),A=Zt(G),bt=A?.middleware?Array.isArray(A.middleware)?A.middleware:[A.middleware]:[],it=[...St,...bt];if(it.length>0){let j=It(h,M,A||{}),N=Ot(j,null,void 0,{isServer:!0}),F=await Nt(it,N);if(F.redirect){let I=typeof F.redirect==="string"?F.redirect:F.redirect.path||F.redirect,z=Qt(String(I),h),L=te(h,e);await R.promises.mkdir(m.dirname(L),{recursive:!0}),await Bun.write(L,z),u.successCount++,u.pages.push({route:h,outputPath:L,size:Buffer.byteLength(z),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${I}`);return}if(F.abort){let I=typeof F.abort==="string"?F.abort:F.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${I}`);return}}let st=A?.validate;if(typeof st==="function")try{if(!await st({params:M})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let B=null,at=!1;if(e.cache){if(B=O.get(h,D.filePath),B)at=!0,u.cachedCount++}if(!B){let j=await wt(D,M,xt,e,s);if(B=j.html,e.failOnIncludeError&&j.includeFailures.length>0)throw Error(`${j.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
40
40
  ${j.includeFailures.join(`
41
41
  `)}
42
42
  Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&j.serverScriptFailures.length>0)throw Error(`${j.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.863",
4
+ "version": "0.2.864",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -127,14 +127,14 @@
127
127
  },
128
128
  "dependencies": {
129
129
  "@stacksjs/clapp": "^0.2.17",
130
- "@stacksjs/desktop": "0.2.863",
131
- "@stacksjs/sanitizer": "0.2.863",
130
+ "@stacksjs/desktop": "0.2.864",
131
+ "@stacksjs/sanitizer": "0.2.864",
132
132
  "@stacksjs/ts-css": "^0.3.21",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
134
  "@types/dom-speech-recognition": "^0.0.12",
135
- "bun-plugin-stx": "0.2.863",
135
+ "bun-plugin-stx": "0.2.864",
136
136
  "bunfig": "^0.15.21",
137
- "stx-router": "0.2.863",
137
+ "stx-router": "0.2.864",
138
138
  "ts-broadcasting": "^0.0.13",
139
139
  "ts-images": "^0.2.22",
140
140
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Mm,Dm,Lm,jm,Bm}from"./chunk-gp8hgpt9.js";export{Dm as defineAsyncComponent,jm as generateAsyncComponentCSS,Bm as generateAsyncComponentRuntime,Lm as isAsyncComponent,Mm as processAsyncDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{lm}from"./chunk-prrvggcy.js";import"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-021tjkd6.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{lm as startInteractive};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ao,Gt,Dl,Vg}from"./chunk-qbghf76y.js";export{ao as generateServiceWorker,Vg as generateServiceWorkerAuto,Gt as getServiceWorkerFileName,Dl as isWorkboxEnabled};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ym,Aa,_u,Zm,Qm,eh,th,nh,Cu,Eu,rh,sh,oh,ih}from"./chunk-32ty2zx6.js";import"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-021tjkd6.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{_u as SUSPENSE_RESOLVER_RUNTIME,Aa as buildSuspenseResolveScript,nh as createStreamRenderer,eh as extractStreamBoundaries,ih as generateHydrationRuntime,Eu as islandDirective,sh as processSectionDirectives,Qm as processStreamDirectives,rh as registerStreamingDirectives,Zm as renderStreamingPage,Ym as streamTemplate,th as streamTemplateSimple,oh as streamToResponse,Cu as streamingSuspenseDirective};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Nf,Mf,xe,Df,pc,cn,ln,Fh,fc,un,ir,Lf,jf,Bf,ds,Ff,zf,gc,dn,Hf,pn,mc,zh}from"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ir as MODULE_SPECIFIER_PREFIX,gc as assertBundleBuildCanSettle,Nf as bundleCacheDir,Mf as bundleCacheEntryLimit,zh as bundleClientEntriesSplit,pn as bundleClientScript,ln as clearBundleFailures,xe as clientBundleDependencies,cn as getBundleFailures,un as hasUserImports,zf as isWithinBundlerCallback,dn as moduleSubstitutionKey,jf as normalizeRegistrySpecifiers,Hf as queueClientBundleBuild,pc as recordBundleFailure,Lf as registryIdForPath,fc as resolveBundlerFallback,Bf as rewriteRegistryImports,Fh as setBundlerFallbackMode,Df as shouldLogBundlerDiagnostics,mc as tempBuildName,ds as withModuleSubstitutes,Ff as withinBundlerCallback};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{V,rg,ri,$c,a,D,iy,ay}from"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{D as config,V as defaultConfig,iy as defineStxConfig,ri as discoverConfig,a as loadStxConfig,$c as resolveInstalledPackage,rg as resolveStxDirectories,ay as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Jh,Yh,Xf,bs}from"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import"./chunk-zsnmk5me.js";import{Ar}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import{ut}from"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ut as freeIdentifiers,bs as processComponents,Xf as processESImports,Ar as rendersAsElement,Jh as resetMarginStackWarnings,Yh as resetTemplateLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{La,ja,Ba,Fa,Bh}from"./chunk-gjngg182.js";import"./chunk-8502xb4n.js";import"./chunk-ntbe5q5x.js";import"./chunk-vvzys1x7.js";import"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-021tjkd6.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{La as buildNative,Bh as default,ja as findCraftBinary,Fa as getAvailableFormats,Ba as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xh,Co,Sh,kh,_h,Ch}from"./chunk-5p1k2h5q.js";import"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Ch as clearStoreCache,xh as getStoreScript,_h as getStoreScriptFor,kh as pageStoresAll,Co as storesRead,Sh as storesReadInFiles};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{G}from"./chunk-b6w0f610.js";function n(t){return G(t)}
3
- export{n};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ws,Jf,Ko,Yf}from"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import{jt}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Yf as declareBareLoopHead,jt as parseLoopBinding,Jf as processLoops,Ko as processLoopsAsync,ws as reportDeferredLoopWarnings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ol,Nl,Ml,jg,Bg}from"./chunk-dpmayc2w.js";export{Nl as auditBuildOutput,Ol as auditConfig,Ml as calculateAuditResult,Bg as formatAuditResult,jg as runPwaAudit};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{um}from"./chunk-jgra00m8.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{um as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{io,Hi,Fg,zg,Hg}from"./chunk-bx5d87xx.js";import"./chunk-qbghf76y.js";export{zg as generateManifestLink,io as generatePwaTags,Fg as generateSwRegistrationScript,Hg as generateThemeColorMeta,Hi as injectPwaTags};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qh,Gf,tt,wc,Kh,gs,ms,hs}from"./chunk-hc6111md.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-xymr4ys9.js";import"./chunk-zsnmk5me.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kh as clearOnceStore,wc as onceStore,tt as partialsCache,gs as processIncludes,ms as processStackPushDirectives,hs as processStackReplacements,qh as resetUnscopedSignalWarnings,Gf as topLevelElements};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fl,zl}from"./chunk-w468n41y.js";import"./chunk-v37zmez0.js";import"./chunk-prrvggcy.js";import"./chunk-jgra00m8.js";import"./chunk-yr1zx78b.js";import"./chunk-dtarm8x9.js";import"./chunk-mcnwvh06.js";import"./chunk-2n932qtv.js";import"./chunk-5s1fb8z4.js";import"./chunk-85zmxbt0.js";import"./chunk-6ftee542.js";import"./chunk-gd56arnm.js";import"./chunk-ew5cey88.js";import"./chunk-vwwpbhd2.js";import"./chunk-8me8hamk.js";import"./chunk-ysfeg3cn.js";import"./chunk-gp8hgpt9.js";import"./chunk-55zq2ha8.js";import"./chunk-hev4t4d5.js";import"./chunk-1mqcttg3.js";import"./chunk-yakdcak2.js";import"./chunk-32ty2zx6.js";import"./chunk-qcxrcypb.js";import"./chunk-gbtbfg7e.js";import"./chunk-cqhwzd9y.js";import"./chunk-j1efsjsb.js";import"./chunk-5p1k2h5q.js";import"./chunk-15m7jnc0.js";import"./chunk-sj3ry5ck.js";import"./chunk-ntbe5q5x.js";import"./chunk-vvzys1x7.js";import"./chunk-v4xes880.js";import{an}from"./chunk-58sh82aj.js";import{Ff}from"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import{Ne,i}from"./chunk-xfd3yqgj.js";import"./chunk-y190sh29.js";import"./chunk-hc6111md.js";import"./chunk-q1wxgw5s.js";import"./chunk-czca8yds.js";import"./chunk-e634vffz.js";import"./chunk-ks5p5w6z.js";import"./chunk-xymr4ys9.js";import"./chunk-y036cwc7.js";import{_e}from"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import{hr,yr}from"./chunk-021tjkd6.js";import{$s,V,a}from"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import{h,He}from"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";import{Ui}from"./chunk-s9df8srx.js";import"./chunk-6m6y9bbx.js";import"./chunk-z512gt4v.js";export{$s as buildWebComponents,yr as cacheTemplate,hr as checkCache,an as classifyAllScripts,Fl as createMiddleware,zl as createRoute,V as defaultConfig,h as extractVariables,_e as injectRouterScript,Ui as insertBeforeBodyClose,a as loadStxConfig,He as processClientScript,i as processDirectives,Ne as readMarkdownFile,Ff as withinBundlerCallback};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Eo,Eh,Th}from"./chunk-15m7jnc0.js";import"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Th as clearComposableCache,Eh as getComposableScript,Eo as listComposableModules};