@absolutejs/absolute 0.19.0-beta.808 → 0.19.0-beta.809

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 (260) hide show
  1. package/dist/angular/browser.js +9801 -57
  2. package/dist/angular/browser.js.map +246 -4
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +14877 -60
  6. package/dist/angular/index.js.map +281 -4
  7. package/dist/angular/server.js +5610 -45
  8. package/dist/angular/server.js.map +51 -3
  9. package/dist/build.js +18092 -45
  10. package/dist/build.js.map +99 -3
  11. package/dist/cli/index.js +317 -86
  12. package/dist/client/index.js +1100 -40
  13. package/dist/client/index.js.map +24 -4
  14. package/dist/core/streamingSlotRegistrar.js +108 -11
  15. package/dist/core/streamingSlotRegistrar.js.map +4 -3
  16. package/dist/core/streamingSlotRegistry.js +169 -7
  17. package/dist/core/streamingSlotRegistry.js.map +5 -3
  18. package/dist/index.js +19957 -547
  19. package/dist/index.js.map +116 -3
  20. package/dist/islands/browser.js +228 -9
  21. package/dist/islands/browser.js.map +9 -4
  22. package/dist/islands/index.js +1908 -17
  23. package/dist/islands/index.js.map +27 -3
  24. package/dist/react/browser.js +328 -12
  25. package/dist/react/browser.js.map +12 -4
  26. package/dist/react/components/index.js +167 -16
  27. package/dist/react/components/index.js.map +6 -3
  28. package/dist/react/hooks/index.js +183 -8
  29. package/dist/react/hooks/index.js.map +7 -3
  30. package/dist/react/index.js +3627 -36
  31. package/dist/react/index.js.map +45 -4
  32. package/dist/react/jsxDevRuntimeCompat.js +61 -2
  33. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  34. package/dist/react/server.js +1789 -18
  35. package/dist/react/server.js.map +21 -3
  36. package/dist/src/angular/injectorPatch.d.ts +1 -0
  37. package/dist/src/index.d.ts +1 -0
  38. package/dist/svelte/browser.js +247 -12
  39. package/dist/svelte/browser.js.map +10 -3
  40. package/dist/svelte/index.js +3732 -37
  41. package/dist/svelte/index.js.map +47 -4
  42. package/dist/svelte/server.js +2794 -21
  43. package/dist/svelte/server.js.map +27 -3
  44. package/dist/vue/browser.js +348 -12
  45. package/dist/vue/browser.js.map +12 -4
  46. package/dist/vue/components/Image.js +240 -7
  47. package/dist/vue/components/Image.js.map +6 -3
  48. package/dist/vue/components/index.js +544 -11
  49. package/dist/vue/components/index.js.map +9 -3
  50. package/dist/vue/index.js +4212 -52
  51. package/dist/vue/index.js.map +50 -4
  52. package/dist/vue/server.js +1849 -18
  53. package/dist/vue/server.js.map +21 -3
  54. package/package.json +1 -1
  55. package/dist/chunk-0867j0r0.js +0 -136
  56. package/dist/chunk-0867j0r0.js.map +0 -10
  57. package/dist/chunk-0kdc6r16.js +0 -20
  58. package/dist/chunk-0kdc6r16.js.map +0 -10
  59. package/dist/chunk-102fp7xe.js +0 -63
  60. package/dist/chunk-102fp7xe.js.map +0 -10
  61. package/dist/chunk-11zpfqz6.js +0 -19
  62. package/dist/chunk-11zpfqz6.js.map +0 -10
  63. package/dist/chunk-1rfh7hw9.js +0 -319
  64. package/dist/chunk-1rfh7hw9.js.map +0 -11
  65. package/dist/chunk-25v9t56f.js +0 -29
  66. package/dist/chunk-25v9t56f.js.map +0 -11
  67. package/dist/chunk-2f21eenc.js +0 -21
  68. package/dist/chunk-2f21eenc.js.map +0 -10
  69. package/dist/chunk-2ga2znex.js +0 -13
  70. package/dist/chunk-2ga2znex.js.map +0 -9
  71. package/dist/chunk-30yrw0f6.js +0 -33
  72. package/dist/chunk-30yrw0f6.js.map +0 -10
  73. package/dist/chunk-38jwhqcw.js +0 -4410
  74. package/dist/chunk-38jwhqcw.js.map +0 -28
  75. package/dist/chunk-3g91wb4f.js +0 -358
  76. package/dist/chunk-3g91wb4f.js.map +0 -10
  77. package/dist/chunk-3yjzpcne.js +0 -34
  78. package/dist/chunk-3yjzpcne.js.map +0 -10
  79. package/dist/chunk-41bf6aqt.js +0 -17
  80. package/dist/chunk-41bf6aqt.js.map +0 -9
  81. package/dist/chunk-4d39r92n.js +0 -81
  82. package/dist/chunk-4d39r92n.js.map +0 -10
  83. package/dist/chunk-5003emhv.js +0 -17
  84. package/dist/chunk-5003emhv.js.map +0 -10
  85. package/dist/chunk-5f67rsed.js +0 -466
  86. package/dist/chunk-5f67rsed.js.map +0 -10
  87. package/dist/chunk-5fhp1jap.js +0 -9169
  88. package/dist/chunk-5fhp1jap.js.map +0 -236
  89. package/dist/chunk-6pdj08z3.js +0 -73
  90. package/dist/chunk-6pdj08z3.js.map +0 -12
  91. package/dist/chunk-6qjbrt0k.js +0 -13
  92. package/dist/chunk-6qjbrt0k.js.map +0 -9
  93. package/dist/chunk-6sccb4jr.js +0 -14
  94. package/dist/chunk-6sccb4jr.js.map +0 -9
  95. package/dist/chunk-798spvzv.js +0 -50
  96. package/dist/chunk-798spvzv.js.map +0 -10
  97. package/dist/chunk-7fw6x3js.js +0 -131
  98. package/dist/chunk-7fw6x3js.js.map +0 -11
  99. package/dist/chunk-7kjj42xm.js +0 -11
  100. package/dist/chunk-7kjj42xm.js.map +0 -10
  101. package/dist/chunk-7mtstdqn.js +0 -90
  102. package/dist/chunk-7mtstdqn.js.map +0 -10
  103. package/dist/chunk-851whwc7.js +0 -17
  104. package/dist/chunk-851whwc7.js.map +0 -10
  105. package/dist/chunk-85n68sy6.js +0 -103
  106. package/dist/chunk-85n68sy6.js.map +0 -10
  107. package/dist/chunk-8kcfffry.js +0 -35
  108. package/dist/chunk-8kcfffry.js.map +0 -10
  109. package/dist/chunk-8qqxc1h2.js +0 -426
  110. package/dist/chunk-8qqxc1h2.js.map +0 -14
  111. package/dist/chunk-92fsjfpp.js +0 -1731
  112. package/dist/chunk-92fsjfpp.js.map +0 -11
  113. package/dist/chunk-93sqk7be.js +0 -139
  114. package/dist/chunk-93sqk7be.js.map +0 -12
  115. package/dist/chunk-94gvx0hg.js +0 -28
  116. package/dist/chunk-94gvx0hg.js.map +0 -10
  117. package/dist/chunk-9c5tj4k3.js +0 -130
  118. package/dist/chunk-9c5tj4k3.js.map +0 -10
  119. package/dist/chunk-9ve9jq72.js +0 -203
  120. package/dist/chunk-9ve9jq72.js.map +0 -10
  121. package/dist/chunk-9xrsjeem.js +0 -12
  122. package/dist/chunk-9xrsjeem.js.map +0 -9
  123. package/dist/chunk-a9mvyp04.js +0 -87
  124. package/dist/chunk-a9mvyp04.js.map +0 -10
  125. package/dist/chunk-b3gbnrwe.js +0 -21
  126. package/dist/chunk-b3gbnrwe.js.map +0 -10
  127. package/dist/chunk-bmgqm774.js +0 -65
  128. package/dist/chunk-bmgqm774.js.map +0 -9
  129. package/dist/chunk-bxfghpma.js +0 -69
  130. package/dist/chunk-bxfghpma.js.map +0 -10
  131. package/dist/chunk-c1jfjnka.js +0 -74
  132. package/dist/chunk-c1jfjnka.js.map +0 -10
  133. package/dist/chunk-cbkrwmvh.js +0 -80
  134. package/dist/chunk-cbkrwmvh.js.map +0 -10
  135. package/dist/chunk-cdxd7sy2.js +0 -71
  136. package/dist/chunk-cdxd7sy2.js.map +0 -10
  137. package/dist/chunk-cg95827x.js +0 -21
  138. package/dist/chunk-cg95827x.js.map +0 -10
  139. package/dist/chunk-cm0g4q6w.js +0 -149
  140. package/dist/chunk-cm0g4q6w.js.map +0 -10
  141. package/dist/chunk-cwfy538a.js +0 -51
  142. package/dist/chunk-cwfy538a.js.map +0 -9
  143. package/dist/chunk-d7mwkzry.js +0 -261
  144. package/dist/chunk-d7mwkzry.js.map +0 -10
  145. package/dist/chunk-d8w0qm28.js +0 -184
  146. package/dist/chunk-d8w0qm28.js.map +0 -11
  147. package/dist/chunk-d9c0am65.js +0 -12
  148. package/dist/chunk-d9c0am65.js.map +0 -10
  149. package/dist/chunk-daqghmg8.js +0 -12
  150. package/dist/chunk-daqghmg8.js.map +0 -9
  151. package/dist/chunk-e3r9fxaa.js +0 -149
  152. package/dist/chunk-e3r9fxaa.js.map +0 -10
  153. package/dist/chunk-e8eecyrq.js +0 -244
  154. package/dist/chunk-e8eecyrq.js.map +0 -10
  155. package/dist/chunk-ex2hxe0v.js +0 -160
  156. package/dist/chunk-ex2hxe0v.js.map +0 -11
  157. package/dist/chunk-fak944et.js +0 -91
  158. package/dist/chunk-fak944et.js.map +0 -10
  159. package/dist/chunk-ff70rnhd.js +0 -672
  160. package/dist/chunk-ff70rnhd.js.map +0 -15
  161. package/dist/chunk-fygx2ymm.js +0 -118
  162. package/dist/chunk-fygx2ymm.js.map +0 -12
  163. package/dist/chunk-g15qj669.js +0 -271
  164. package/dist/chunk-g15qj669.js.map +0 -11
  165. package/dist/chunk-gd6wmknh.js +0 -121
  166. package/dist/chunk-gd6wmknh.js.map +0 -11
  167. package/dist/chunk-gf0ygptk.js +0 -85
  168. package/dist/chunk-gf0ygptk.js.map +0 -11
  169. package/dist/chunk-gytkmthr.js +0 -220
  170. package/dist/chunk-gytkmthr.js.map +0 -10
  171. package/dist/chunk-h5bbfn3n.js +0 -28
  172. package/dist/chunk-h5bbfn3n.js.map +0 -11
  173. package/dist/chunk-h6mye9r3.js +0 -93
  174. package/dist/chunk-h6mye9r3.js.map +0 -10
  175. package/dist/chunk-hcsmxw1v.js +0 -85
  176. package/dist/chunk-hcsmxw1v.js.map +0 -10
  177. package/dist/chunk-hyjs4bqs.js +0 -8
  178. package/dist/chunk-hyjs4bqs.js.map +0 -10
  179. package/dist/chunk-j88z31ep.js +0 -25
  180. package/dist/chunk-j88z31ep.js.map +0 -10
  181. package/dist/chunk-jn91vzkh.js +0 -66
  182. package/dist/chunk-jn91vzkh.js.map +0 -10
  183. package/dist/chunk-jpkjdgsk.js +0 -167
  184. package/dist/chunk-jpkjdgsk.js.map +0 -11
  185. package/dist/chunk-jwxt8gnp.js +0 -13
  186. package/dist/chunk-jwxt8gnp.js.map +0 -9
  187. package/dist/chunk-kk8w9rh5.js +0 -195
  188. package/dist/chunk-kk8w9rh5.js.map +0 -10
  189. package/dist/chunk-m97ze5hz.js +0 -46
  190. package/dist/chunk-m97ze5hz.js.map +0 -10
  191. package/dist/chunk-mbazhahf.js +0 -60
  192. package/dist/chunk-mbazhahf.js.map +0 -10
  193. package/dist/chunk-mgfwq18r.js +0 -15
  194. package/dist/chunk-mgfwq18r.js.map +0 -9
  195. package/dist/chunk-mtgf69xn.js +0 -88
  196. package/dist/chunk-mtgf69xn.js.map +0 -10
  197. package/dist/chunk-mtxzyxpg.js +0 -102
  198. package/dist/chunk-mtxzyxpg.js.map +0 -10
  199. package/dist/chunk-nehhtthw.js +0 -225
  200. package/dist/chunk-nehhtthw.js.map +0 -10
  201. package/dist/chunk-p5504p14.js +0 -16
  202. package/dist/chunk-p5504p14.js.map +0 -10
  203. package/dist/chunk-pnscgw95.js +0 -90
  204. package/dist/chunk-pnscgw95.js.map +0 -10
  205. package/dist/chunk-pvpp4pvs.js +0 -17
  206. package/dist/chunk-pvpp4pvs.js.map +0 -10
  207. package/dist/chunk-qh75agse.js +0 -95
  208. package/dist/chunk-qh75agse.js.map +0 -10
  209. package/dist/chunk-qxq2zcty.js +0 -52
  210. package/dist/chunk-qxq2zcty.js.map +0 -10
  211. package/dist/chunk-r6e8pytx.js +0 -22
  212. package/dist/chunk-r6e8pytx.js.map +0 -9
  213. package/dist/chunk-r7jmgqnw.js +0 -114
  214. package/dist/chunk-r7jmgqnw.js.map +0 -10
  215. package/dist/chunk-s6defjk2.js +0 -116
  216. package/dist/chunk-s6defjk2.js.map +0 -10
  217. package/dist/chunk-sd39p726.js +0 -619
  218. package/dist/chunk-sd39p726.js.map +0 -10
  219. package/dist/chunk-swrnzs4c.js +0 -63
  220. package/dist/chunk-swrnzs4c.js.map +0 -10
  221. package/dist/chunk-tfe3sb44.js +0 -33
  222. package/dist/chunk-tfe3sb44.js.map +0 -10
  223. package/dist/chunk-tjr0kcev.js +0 -41
  224. package/dist/chunk-tjr0kcev.js.map +0 -9
  225. package/dist/chunk-tx9edm1x.js +0 -34
  226. package/dist/chunk-tx9edm1x.js.map +0 -10
  227. package/dist/chunk-txhm2vb5.js +0 -18
  228. package/dist/chunk-txhm2vb5.js.map +0 -9
  229. package/dist/chunk-v5vmsxmy.js +0 -526
  230. package/dist/chunk-v5vmsxmy.js.map +0 -12
  231. package/dist/chunk-vjhxm8n2.js +0 -29
  232. package/dist/chunk-vjhxm8n2.js.map +0 -9
  233. package/dist/chunk-vkrpm7kc.js +0 -247
  234. package/dist/chunk-vkrpm7kc.js.map +0 -12
  235. package/dist/chunk-w3m4m5we.js +0 -4925
  236. package/dist/chunk-w3m4m5we.js.map +0 -12
  237. package/dist/chunk-wrxtn9ve.js +0 -18
  238. package/dist/chunk-wrxtn9ve.js.map +0 -10
  239. package/dist/chunk-wwzvp0zn.js +0 -192
  240. package/dist/chunk-wwzvp0zn.js.map +0 -10
  241. package/dist/chunk-x09cskqd.js +0 -377
  242. package/dist/chunk-x09cskqd.js.map +0 -10
  243. package/dist/chunk-xnt8c6h2.js +0 -576
  244. package/dist/chunk-xnt8c6h2.js.map +0 -10
  245. package/dist/chunk-xw0tx842.js +0 -13
  246. package/dist/chunk-xw0tx842.js.map +0 -9
  247. package/dist/chunk-xx5b6b9m.js +0 -69
  248. package/dist/chunk-xx5b6b9m.js.map +0 -10
  249. package/dist/chunk-xz1kdswj.js +0 -21
  250. package/dist/chunk-xz1kdswj.js.map +0 -9
  251. package/dist/chunk-y84qnsd3.js +0 -32
  252. package/dist/chunk-y84qnsd3.js.map +0 -10
  253. package/dist/chunk-ywjn0rad.js +0 -14
  254. package/dist/chunk-ywjn0rad.js.map +0 -9
  255. package/dist/chunk-z9nvhm6r.js +0 -13
  256. package/dist/chunk-z9nvhm6r.js.map +0 -9
  257. package/dist/chunk-zhmvdpk6.js +0 -15
  258. package/dist/chunk-zhmvdpk6.js.map +0 -9
  259. package/dist/chunk-zrg9d4zw.js +0 -784
  260. package/dist/chunk-zrg9d4zw.js.map +0 -10
@@ -1,130 +0,0 @@
1
- // @bun
2
- import {
3
- DEFAULT_QUALITY,
4
- buildOptimizedUrl,
5
- generateBlurSvg,
6
- generateSrcSet
7
- } from "./chunk-798spvzv.js";
8
-
9
- // src/vue/components/Image.ts
10
- import { computed, defineComponent, h, ref } from "vue";
11
- var fillWrapperStyle = {
12
- display: "block",
13
- height: "100%",
14
- overflow: "hidden",
15
- position: "relative",
16
- width: "100%"
17
- };
18
- var Image = defineComponent({
19
- name: "AbsoluteImage",
20
- props: {
21
- alt: { required: true, type: String },
22
- blurDataURL: { default: undefined, type: String },
23
- className: { default: undefined, type: String },
24
- crossOrigin: { default: undefined, type: String },
25
- fetchPriority: { default: undefined, type: String },
26
- fill: { default: false, type: Boolean },
27
- height: { default: undefined, type: Number },
28
- loader: { default: undefined, type: Function },
29
- loading: { default: "lazy", type: String },
30
- onError: { default: undefined, type: Function },
31
- onLoad: { default: undefined, type: Function },
32
- overrideSrc: { default: undefined, type: String },
33
- placeholder: { default: undefined, type: String },
34
- priority: { default: false, type: Boolean },
35
- quality: { default: DEFAULT_QUALITY, type: Number },
36
- referrerPolicy: { default: undefined, type: String },
37
- sizes: { default: undefined, type: String },
38
- src: { required: true, type: String },
39
- style: { default: undefined, type: Object },
40
- unoptimized: { default: false, type: Boolean },
41
- width: { default: undefined, type: Number }
42
- },
43
- setup(props) {
44
- const blurRemoved = ref(false);
45
- const resolvedSrc = computed(() => {
46
- if (props.overrideSrc)
47
- return props.overrideSrc;
48
- if (props.unoptimized)
49
- return props.src;
50
- if (props.loader) {
51
- return props.loader({
52
- quality: props.quality ?? DEFAULT_QUALITY,
53
- src: props.src,
54
- width: props.width ?? 0
55
- });
56
- }
57
- if (!props.width) {
58
- return buildOptimizedUrl(props.src, 0, props.quality ?? DEFAULT_QUALITY);
59
- }
60
- return buildOptimizedUrl(props.src, props.width, props.quality ?? DEFAULT_QUALITY);
61
- });
62
- const srcSet = computed(() => props.unoptimized ? undefined : generateSrcSet(props.src, props.width, props.sizes));
63
- const resolvedSizes = computed(() => props.sizes ?? (props.fill ? "100vw" : undefined));
64
- const resolvedLoading = computed(() => props.priority ? "eager" : props.loading ?? "lazy");
65
- const resolvedFetchPriority = computed(() => props.priority ? "high" : props.fetchPriority);
66
- const hasBlur = computed(() => props.placeholder === "blur" || typeof props.placeholder === "string" && props.placeholder !== "empty" && props.placeholder.startsWith("data:"));
67
- const blurBackground = computed(() => {
68
- if (!hasBlur.value || blurRemoved.value)
69
- return;
70
- if (typeof props.placeholder === "string" && props.placeholder !== "blur" && props.placeholder.startsWith("data:")) {
71
- return generateBlurSvg(props.placeholder);
72
- }
73
- if (props.blurDataURL)
74
- return generateBlurSvg(props.blurDataURL);
75
- return;
76
- });
77
- const imgStyle = computed(() => {
78
- const base = {
79
- ...props.style ?? {},
80
- color: "transparent"
81
- };
82
- if (blurBackground.value) {
83
- base.backgroundImage = blurBackground.value;
84
- base.backgroundPosition = "center";
85
- base.backgroundRepeat = "no-repeat";
86
- base.backgroundSize = "cover";
87
- }
88
- if (props.fill) {
89
- base.height = "100%";
90
- base.inset = "0";
91
- base.objectFit = "cover";
92
- base.position = "absolute";
93
- base.width = "100%";
94
- }
95
- return base;
96
- });
97
- const handleLoad = (event) => {
98
- blurRemoved.value = true;
99
- props.onLoad?.(event);
100
- };
101
- const handleError = (event) => {
102
- props.onError?.(event);
103
- };
104
- return () => {
105
- const imgNode = h("img", {
106
- alt: props.alt,
107
- class: props.className,
108
- crossorigin: props.crossOrigin,
109
- decoding: "async",
110
- fetchpriority: resolvedFetchPriority.value,
111
- height: props.fill ? undefined : props.height,
112
- loading: resolvedLoading.value,
113
- onError: handleError,
114
- onLoad: handleLoad,
115
- referrerpolicy: props.referrerPolicy,
116
- sizes: resolvedSizes.value,
117
- src: resolvedSrc.value,
118
- srcset: srcSet.value,
119
- style: imgStyle.value,
120
- width: props.fill ? undefined : props.width
121
- });
122
- return props.fill ? h("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
123
- };
124
- }
125
- });
126
-
127
- export { Image };
128
-
129
- //# debugId=6AAC1DE77C755A8164756E2164756E21
130
- //# sourceMappingURL=chunk-9c5tj4k3.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/vue/components/Image.ts"],
4
- "sourcesContent": [
5
- "import { computed, defineComponent, h, ref } from 'vue';\nimport {\n\tDEFAULT_QUALITY,\n\tbuildOptimizedUrl,\n\tgenerateBlurSvg,\n\tgenerateSrcSet\n} from '../../utils/imageClient';\n\ntype ImageLoader = (params: {\n\tsrc: string;\n\twidth: number;\n\tquality: number;\n}) => string;\n\ntype ImageStyle = Record<string, string | number>;\n\ntype ImageProps = {\n\tsrc: string;\n\talt: string;\n\twidth?: number;\n\theight?: number;\n\tfill?: boolean;\n\tquality?: number;\n\tsizes?: string;\n\tloader?: ImageLoader;\n\tunoptimized?: boolean;\n\tloading?: 'lazy' | 'eager';\n\tpriority?: boolean;\n\tplaceholder?: string;\n\tblurDataURL?: string;\n\tclassName?: string;\n\tstyle?: ImageStyle;\n\tonLoad?: (() => void) | ((event: Event) => void);\n\tonError?: (() => void) | ((event: Event) => void);\n\tcrossOrigin?: 'anonymous' | 'use-credentials' | '';\n\treferrerPolicy?:\n\t\t| ''\n\t\t| 'no-referrer'\n\t\t| 'no-referrer-when-downgrade'\n\t\t| 'origin'\n\t\t| 'origin-when-cross-origin'\n\t\t| 'same-origin'\n\t\t| 'strict-origin'\n\t\t| 'strict-origin-when-cross-origin'\n\t\t| 'unsafe-url';\n\tfetchPriority?: 'high' | 'low' | 'auto';\n\toverrideSrc?: string;\n};\n\nconst fillWrapperStyle: ImageStyle = {\n\tdisplay: 'block',\n\theight: '100%',\n\toverflow: 'hidden',\n\tposition: 'relative',\n\twidth: '100%'\n};\n\nexport const Image = defineComponent({\n\tname: 'AbsoluteImage',\n\tprops: {\n\t\talt: { required: true, type: String },\n\t\tblurDataURL: { default: undefined, type: String },\n\t\tclassName: { default: undefined, type: String },\n\t\tcrossOrigin: { default: undefined, type: String },\n\t\tfetchPriority: { default: undefined, type: String },\n\t\tfill: { default: false, type: Boolean },\n\t\theight: { default: undefined, type: Number },\n\t\tloader: { default: undefined, type: Function },\n\t\tloading: { default: 'lazy', type: String },\n\t\tonError: { default: undefined, type: Function },\n\t\tonLoad: { default: undefined, type: Function },\n\t\toverrideSrc: { default: undefined, type: String },\n\t\tplaceholder: { default: undefined, type: String },\n\t\tpriority: { default: false, type: Boolean },\n\t\tquality: { default: DEFAULT_QUALITY, type: Number },\n\t\treferrerPolicy: { default: undefined, type: String },\n\t\tsizes: { default: undefined, type: String },\n\t\tsrc: { required: true, type: String },\n\t\tstyle: { default: undefined, type: Object },\n\t\tunoptimized: { default: false, type: Boolean },\n\t\twidth: { default: undefined, type: Number }\n\t},\n\tsetup(props: ImageProps) {\n\t\tconst blurRemoved = ref(false);\n\n\t\tconst resolvedSrc = computed(() => {\n\t\t\tif (props.overrideSrc) return props.overrideSrc;\n\t\t\tif (props.unoptimized) return props.src;\n\t\t\tif (props.loader) {\n\t\t\t\treturn props.loader({\n\t\t\t\t\tquality: props.quality ?? DEFAULT_QUALITY,\n\t\t\t\t\tsrc: props.src,\n\t\t\t\t\twidth: props.width ?? 0\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!props.width) {\n\t\t\t\treturn buildOptimizedUrl(\n\t\t\t\t\tprops.src,\n\t\t\t\t\t0,\n\t\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn buildOptimizedUrl(\n\t\t\t\tprops.src,\n\t\t\t\tprops.width,\n\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t);\n\t\t});\n\n\t\tconst srcSet = computed(() =>\n\t\t\tprops.unoptimized\n\t\t\t\t? undefined\n\t\t\t\t: generateSrcSet(props.src, props.width, props.sizes)\n\t\t);\n\n\t\tconst resolvedSizes = computed(\n\t\t\t() => props.sizes ?? (props.fill ? '100vw' : undefined)\n\t\t);\n\n\t\tconst resolvedLoading = computed(() =>\n\t\t\tprops.priority ? 'eager' : (props.loading ?? 'lazy')\n\t\t);\n\n\t\tconst resolvedFetchPriority = computed(() =>\n\t\t\tprops.priority ? 'high' : props.fetchPriority\n\t\t);\n\n\t\tconst hasBlur = computed(\n\t\t\t() =>\n\t\t\t\tprops.placeholder === 'blur' ||\n\t\t\t\t(typeof props.placeholder === 'string' &&\n\t\t\t\t\tprops.placeholder !== 'empty' &&\n\t\t\t\t\tprops.placeholder.startsWith('data:'))\n\t\t);\n\n\t\tconst blurBackground = computed(() => {\n\t\t\tif (!hasBlur.value || blurRemoved.value) return undefined;\n\t\t\tif (\n\t\t\t\ttypeof props.placeholder === 'string' &&\n\t\t\t\tprops.placeholder !== 'blur' &&\n\t\t\t\tprops.placeholder.startsWith('data:')\n\t\t\t) {\n\t\t\t\treturn generateBlurSvg(props.placeholder);\n\t\t\t}\n\t\t\tif (props.blurDataURL) return generateBlurSvg(props.blurDataURL);\n\n\t\t\treturn undefined;\n\t\t});\n\n\t\tconst imgStyle = computed(() => {\n\t\t\tconst base: ImageStyle = {\n\t\t\t\t...(props.style ?? {}),\n\t\t\t\tcolor: 'transparent'\n\t\t\t};\n\t\t\tif (blurBackground.value) {\n\t\t\t\tbase.backgroundImage = blurBackground.value;\n\t\t\t\tbase.backgroundPosition = 'center';\n\t\t\t\tbase.backgroundRepeat = 'no-repeat';\n\t\t\t\tbase.backgroundSize = 'cover';\n\t\t\t}\n\t\t\tif (props.fill) {\n\t\t\t\tbase.height = '100%';\n\t\t\t\tbase.inset = '0';\n\t\t\t\tbase.objectFit = 'cover';\n\t\t\t\tbase.position = 'absolute';\n\t\t\t\tbase.width = '100%';\n\t\t\t}\n\n\t\t\treturn base;\n\t\t});\n\n\t\tconst handleLoad = (event: Event) => {\n\t\t\tblurRemoved.value = true;\n\t\t\tprops.onLoad?.(event);\n\t\t};\n\n\t\tconst handleError = (event: Event) => {\n\t\t\tprops.onError?.(event);\n\t\t};\n\n\t\treturn () => {\n\t\t\tconst imgNode = h('img', {\n\t\t\t\talt: props.alt,\n\t\t\t\tclass: props.className,\n\t\t\t\tcrossorigin: props.crossOrigin,\n\t\t\t\tdecoding: 'async',\n\t\t\t\tfetchpriority: resolvedFetchPriority.value,\n\t\t\t\theight: props.fill ? undefined : props.height,\n\t\t\t\tloading: resolvedLoading.value,\n\t\t\t\tonError: handleError,\n\t\t\t\tonLoad: handleLoad,\n\t\t\t\treferrerpolicy: props.referrerPolicy,\n\t\t\t\tsizes: resolvedSizes.value,\n\t\t\t\tsrc: resolvedSrc.value,\n\t\t\t\tsrcset: srcSet.value,\n\t\t\t\tstyle: imgStyle.value,\n\t\t\t\twidth: props.fill ? undefined : props.width\n\t\t\t});\n\n\t\t\treturn props.fill\n\t\t\t\t? h('span', { style: fillWrapperStyle }, [imgNode])\n\t\t\t\t: imgNode;\n\t\t};\n\t}\n});\n"
6
- ],
7
- "mappings": ";;;;;;;;;AAAA;AAiDA,IAAM,mBAA+B;AAAA,EACpC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AACR;AAEO,IAAM,QAAQ,gBAAgB;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,IACN,KAAK,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACpC,aAAa,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAChD,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,aAAa,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAChD,eAAe,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAClD,MAAM,EAAE,SAAS,OAAO,MAAM,QAAQ;AAAA,IACtC,QAAQ,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC3C,QAAQ,EAAE,SAAS,WAAW,MAAM,SAAS;AAAA,IAC7C,SAAS,EAAE,SAAS,QAAQ,MAAM,OAAO;AAAA,IACzC,SAAS,EAAE,SAAS,WAAW,MAAM,SAAS;AAAA,IAC9C,QAAQ,EAAE,SAAS,WAAW,MAAM,SAAS;AAAA,IAC7C,a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tB,OAAO,MAAM;AAAA,MACZ,MAAM,UAAU,EAAE,OAAO;AAAA,QACxB,KAAK,MAAM;AAAA,QACX,OAAO,MAAM;AAAA,QACb,aAAa,MAAM;AAAA,QACnB,UAAU;AAAA,QACV,eAAe,sBAAsB;AAAA,QACrC,QAAQ,MAAM,OAAO,YAAY,MAAM;AAAA,QACvC,SAAS,gBAAgB;AAAA,QACzB,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB,MAAM;AAAA,QACtB,OAAO,cAAc;AAAA,QACrB,KAAK,YAAY;AAAA,QACjB,QAAQ,OAAO;AAAA,QACf,OAAO,SAAS;AAAA,QAChB,OAAO,MAAM,OAAO,YAAY,MAAM;AAAA,MACvC,CAAC;AAAA,MAED,OAAO,MAAM,OACV,EAAE,QAAQ,EAAE,OAAO,iBAAiB,GAAG,CAAC,OAAO,CAAC,IAChD;AAAA;AAAA;AAGN,CAAC;",
8
- "debugId": "6AAC1DE77C755A8164756E2164756E21",
9
- "names": []
10
- }
@@ -1,203 +0,0 @@
1
- // @bun
2
- import {
3
- lowerSvelteAwaitSlotSyntax,
4
- lowerSvelteIslandSyntax
5
- } from "./chunk-7fw6x3js.js";
6
- import {
7
- resolvePackageImport
8
- } from "./chunk-mbazhahf.js";
9
- import {
10
- createSvelteStylePreprocessor
11
- } from "./chunk-xnt8c6h2.js";
12
- import {
13
- __require
14
- } from "./chunk-bmgqm774.js";
15
-
16
- // src/core/svelteServerModule.ts
17
- import { mkdir, readdir } from "fs/promises";
18
- import { basename, dirname, extname, join, relative, resolve } from "path";
19
- var serverCacheRoot = join(process.cwd(), ".absolutejs", "islands", "svelte");
20
- var compiledModuleCache = new Map;
21
- var originalSourcePathCache = new Map;
22
- var transpiler = new Bun.Transpiler({
23
- loader: "ts",
24
- target: "browser"
25
- });
26
- var ensureRelativeImportPath = (from, target) => {
27
- const importPath = relative(dirname(from), target).replace(/\\/g, "/");
28
- return importPath.startsWith(".") ? importPath : `./${importPath}`;
29
- };
30
- var processDirectoryEntries = (entries, dir, targetFileName, stack) => {
31
- for (const entry of entries) {
32
- const entryPath = join(dir, entry.name);
33
- if (entry.isDirectory())
34
- stack.push(entryPath);
35
- if (entry.isFile() && entry.name === targetFileName) {
36
- return entryPath;
37
- }
38
- }
39
- return null;
40
- };
41
- var searchDirectoryLevel = async (dirs, targetFileName) => {
42
- if (dirs.length === 0)
43
- return null;
44
- const nextStack = [];
45
- const dirEntries = await Promise.all(dirs.map(async (dir) => ({
46
- dir,
47
- entries: await readdir(dir, {
48
- encoding: "utf-8",
49
- withFileTypes: true
50
- })
51
- })));
52
- for (const { dir, entries } of dirEntries) {
53
- const found = processDirectoryEntries(entries, dir, targetFileName, nextStack);
54
- if (found)
55
- return found;
56
- }
57
- return searchDirectoryLevel(nextStack, targetFileName);
58
- };
59
- var findSourceFileByBasename = async (searchRoot, targetFileName) => searchDirectoryLevel([searchRoot], targetFileName);
60
- var normalizeBuiltSvelteFileName = (sourcePath) => basename(sourcePath).replace(/-[a-z0-9]{6,}(?=\.svelte$)/i, "");
61
- var resolveOriginalSourcePath = async (sourcePath) => {
62
- const cachedPath = originalSourcePathCache.get(sourcePath);
63
- if (cachedPath !== undefined) {
64
- return cachedPath;
65
- }
66
- if (!sourcePath.includes(`${join(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
67
- originalSourcePathCache.set(sourcePath, sourcePath);
68
- return sourcePath;
69
- }
70
- const resolvedSourcePath = await findSourceFileByBasename(join(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
71
- const nextPath = resolvedSourcePath ?? sourcePath;
72
- originalSourcePathCache.set(sourcePath, nextPath);
73
- return nextPath;
74
- };
75
- var resolveRelativeModule = async (spec, from) => {
76
- if (!spec.startsWith(".")) {
77
- return null;
78
- }
79
- const basePath = resolve(dirname(from), spec);
80
- const candidates = [
81
- basePath,
82
- `${basePath}.ts`,
83
- `${basePath}.js`,
84
- `${basePath}.mjs`,
85
- `${basePath}.cjs`,
86
- `${basePath}.json`,
87
- join(basePath, "index.ts"),
88
- join(basePath, "index.js"),
89
- join(basePath, "index.mjs"),
90
- join(basePath, "index.cjs"),
91
- join(basePath, "index.json")
92
- ];
93
- const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
94
- const foundIndex = existResults.indexOf(true);
95
- return foundIndex >= 0 ? candidates[foundIndex] ?? null : null;
96
- };
97
- var getCachedModulePath = (sourcePath) => {
98
- const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
99
- const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
100
- return join(serverCacheRoot, `${normalizedSourcePath}.server.js`);
101
- };
102
- var resolveSvelteImport = async (spec, from) => {
103
- if (!spec.startsWith(".") && !spec.startsWith("/")) {
104
- const resolved = resolvePackageImport(spec);
105
- return resolved && resolved.endsWith(".svelte") ? resolved : null;
106
- }
107
- if (spec.startsWith("/")) {
108
- return spec;
109
- }
110
- if (!spec.startsWith(".")) {
111
- return null;
112
- }
113
- const explicitPath = resolve(dirname(from), spec);
114
- if (extname(explicitPath) === ".svelte") {
115
- return explicitPath;
116
- }
117
- const candidate = `${explicitPath}.svelte`;
118
- if (await Bun.file(candidate).exists() === true) {
119
- return candidate;
120
- }
121
- return null;
122
- };
123
- var writeIfChanged = async (path, content) => {
124
- const targetFile = Bun.file(path);
125
- const exists = await targetFile.exists();
126
- if (exists) {
127
- const currentContent = await targetFile.text();
128
- if (currentContent === content) {
129
- return;
130
- }
131
- }
132
- await Bun.write(path, content);
133
- };
134
- var compileSvelteServerModule = async (sourcePath) => {
135
- const cachedModulePath = compiledModuleCache.get(sourcePath);
136
- if (cachedModulePath) {
137
- return cachedModulePath;
138
- }
139
- const resolutionSourcePath = await resolveOriginalSourcePath(sourcePath);
140
- const source = await Bun.file(sourcePath).text();
141
- const { compile, preprocess } = await import("svelte/compiler");
142
- const loweredAwaitSource = lowerSvelteAwaitSlotSyntax(source);
143
- const loweredSource = lowerSvelteIslandSyntax(loweredAwaitSource.code, "server");
144
- const preprocessed = await preprocess(loweredSource.code, createSvelteStylePreprocessor());
145
- let transpiled = sourcePath.endsWith(".ts") || sourcePath.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed.code) : preprocessed.code;
146
- const childImportSpecs = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((value) => value !== undefined);
147
- const resolvedChildModules = await Promise.all(childImportSpecs.map((spec) => resolveSvelteImport(spec, resolutionSourcePath)));
148
- const resolvedModuleImports = await Promise.all(childImportSpecs.map((spec) => resolveRelativeModule(spec, resolutionSourcePath)));
149
- const childModulePaths = new Map;
150
- const rewrittenModulePaths = new Map;
151
- const compiledChildren = await Promise.all(childImportSpecs.map(async (spec, index) => {
152
- const resolvedChild = resolvedChildModules[index];
153
- if (!spec || !resolvedChild)
154
- return null;
155
- return {
156
- compiledPath: await compileSvelteServerModule(resolvedChild),
157
- resolvedChild,
158
- spec
159
- };
160
- }));
161
- for (const result of compiledChildren) {
162
- if (!result)
163
- continue;
164
- childModulePaths.set(result.spec, result.compiledPath);
165
- childModulePaths.set(result.resolvedChild, result.compiledPath);
166
- }
167
- for (let index = 0;index < childImportSpecs.length; index += 1) {
168
- const spec = childImportSpecs[index];
169
- const resolvedModuleImport = resolvedModuleImports[index];
170
- if (!spec || !resolvedModuleImport)
171
- continue;
172
- if (resolvedChildModules[index])
173
- continue;
174
- rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), resolvedModuleImport));
175
- }
176
- for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
177
- transpiled = transpiled.replaceAll(spec, resolvedModuleImport);
178
- }
179
- let compiledCode = compile(transpiled, {
180
- css: "injected",
181
- experimental: {
182
- async: loweredAwaitSource.transformed || loweredSource.transformed
183
- },
184
- filename: resolutionSourcePath,
185
- generate: "server"
186
- }).js.code;
187
- for (const [spec, compiledChildPath] of childModulePaths) {
188
- compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
189
- }
190
- for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
191
- compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
192
- }
193
- const compiledModulePath = getCachedModulePath(sourcePath);
194
- await mkdir(dirname(compiledModulePath), { recursive: true });
195
- await writeIfChanged(compiledModulePath, compiledCode);
196
- compiledModuleCache.set(sourcePath, compiledModulePath);
197
- return compiledModulePath;
198
- };
199
-
200
- export { compileSvelteServerModule };
201
-
202
- //# debugId=7E4C5416175915DB64756E2164756E21
203
- //# sourceMappingURL=chunk-9ve9jq72.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core/svelteServerModule.ts"],
4
- "sourcesContent": [
5
- "import type { Dirent } from 'node:fs';\nimport { mkdir, readdir } from 'node:fs/promises';\nimport { basename, dirname, extname, join, relative, resolve } from 'node:path';\nimport { resolvePackageImport } from '../build/resolvePackageImport';\nimport { lowerSvelteIslandSyntax } from '../svelte/lowerIslandSyntax';\nimport { lowerSvelteAwaitSlotSyntax } from '../svelte/lowerAwaitSlotSyntax';\nimport { createSvelteStylePreprocessor } from '../build/stylePreprocessor';\n\nconst serverCacheRoot = join(process.cwd(), '.absolutejs', 'islands', 'svelte');\n\nconst compiledModuleCache = new Map<string, string>();\nconst originalSourcePathCache = new Map<string, string>();\n\nconst transpiler = new Bun.Transpiler({\n\tloader: 'ts',\n\ttarget: 'browser'\n});\n\nconst ensureRelativeImportPath = (from: string, target: string) => {\n\tconst importPath = relative(dirname(from), target).replace(/\\\\/g, '/');\n\n\treturn importPath.startsWith('.') ? importPath : `./${importPath}`;\n};\n\nconst processDirectoryEntries = (\n\tentries: Dirent<string>[],\n\tdir: string,\n\ttargetFileName: string,\n\tstack: string[]\n) => {\n\tfor (const entry of entries) {\n\t\tconst entryPath = join(dir, entry.name);\n\t\tif (entry.isDirectory()) stack.push(entryPath);\n\n\t\tif (entry.isFile() && entry.name === targetFileName) {\n\t\t\treturn entryPath;\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst searchDirectoryLevel = async (dirs: string[], targetFileName: string) => {\n\tif (dirs.length === 0) return null;\n\n\tconst nextStack: string[] = [];\n\tconst dirEntries = await Promise.all(\n\t\tdirs.map(async (dir) => ({\n\t\t\tdir,\n\t\t\tentries: await readdir(dir, {\n\t\t\t\tencoding: 'utf-8',\n\t\t\t\twithFileTypes: true\n\t\t\t})\n\t\t}))\n\t);\n\n\tfor (const { dir, entries } of dirEntries) {\n\t\tconst found = processDirectoryEntries(\n\t\t\tentries,\n\t\t\tdir,\n\t\t\ttargetFileName,\n\t\t\tnextStack\n\t\t);\n\t\tif (found) return found;\n\t}\n\n\treturn searchDirectoryLevel(nextStack, targetFileName);\n};\n\nconst findSourceFileByBasename = async (\n\tsearchRoot: string,\n\ttargetFileName: string\n) => searchDirectoryLevel([searchRoot], targetFileName);\n\nconst normalizeBuiltSvelteFileName = (sourcePath: string) =>\n\tbasename(sourcePath).replace(/-[a-z0-9]{6,}(?=\\.svelte$)/i, '');\n\nconst resolveOriginalSourcePath = async (sourcePath: string) => {\n\tconst cachedPath = originalSourcePathCache.get(sourcePath);\n\tif (cachedPath !== undefined) {\n\t\treturn cachedPath;\n\t}\n\n\tif (\n\t\t!sourcePath.includes(\n\t\t\t`${join(process.cwd(), 'build')}${process.platform === 'win32' ? '' : '/'}`\n\t\t) &&\n\t\t!sourcePath.includes('/build/')\n\t) {\n\t\toriginalSourcePathCache.set(sourcePath, sourcePath);\n\n\t\treturn sourcePath;\n\t}\n\n\tconst resolvedSourcePath = await findSourceFileByBasename(\n\t\tjoin(process.cwd(), 'src'),\n\t\tnormalizeBuiltSvelteFileName(sourcePath)\n\t);\n\tconst nextPath = resolvedSourcePath ?? sourcePath;\n\toriginalSourcePathCache.set(sourcePath, nextPath);\n\n\treturn nextPath;\n};\n\nconst resolveRelativeModule = async (spec: string, from: string) => {\n\tif (!spec.startsWith('.')) {\n\t\treturn null;\n\t}\n\n\tconst basePath = resolve(dirname(from), spec);\n\tconst candidates = [\n\t\tbasePath,\n\t\t`${basePath}.ts`,\n\t\t`${basePath}.js`,\n\t\t`${basePath}.mjs`,\n\t\t`${basePath}.cjs`,\n\t\t`${basePath}.json`,\n\t\tjoin(basePath, 'index.ts'),\n\t\tjoin(basePath, 'index.js'),\n\t\tjoin(basePath, 'index.mjs'),\n\t\tjoin(basePath, 'index.cjs'),\n\t\tjoin(basePath, 'index.json')\n\t];\n\n\tconst existResults = await Promise.all(\n\t\tcandidates.map((candidate) => Bun.file(candidate).exists())\n\t);\n\tconst foundIndex = existResults.indexOf(true);\n\n\treturn foundIndex >= 0 ? (candidates[foundIndex] ?? null) : null;\n};\n\nconst getCachedModulePath = (sourcePath: string) => {\n\tconst relativeSourcePath = relative(process.cwd(), sourcePath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\tconst normalizedSourcePath = relativeSourcePath.startsWith('..')\n\t\t? sourcePath.replace(/[:\\\\/]/g, '_')\n\t\t: relativeSourcePath;\n\n\treturn join(serverCacheRoot, `${normalizedSourcePath}.server.js`);\n};\n\nconst resolveSvelteImport = async (spec: string, from: string) => {\n\tif (!spec.startsWith('.') && !spec.startsWith('/')) {\n\t\tconst resolved = resolvePackageImport(spec);\n\n\t\treturn resolved && resolved.endsWith('.svelte') ? resolved : null;\n\t}\n\n\tif (spec.startsWith('/')) {\n\t\treturn spec;\n\t}\n\n\tif (!spec.startsWith('.')) {\n\t\treturn null;\n\t}\n\n\tconst explicitPath = resolve(dirname(from), spec);\n\tif (extname(explicitPath) === '.svelte') {\n\t\treturn explicitPath;\n\t}\n\n\tconst candidate = `${explicitPath}.svelte`;\n\tif ((await Bun.file(candidate).exists()) === true) {\n\t\treturn candidate;\n\t}\n\n\treturn null;\n};\n\nconst writeIfChanged = async (path: string, content: string) => {\n\tconst targetFile = Bun.file(path);\n\tconst exists = await targetFile.exists();\n\tif (exists) {\n\t\tconst currentContent = await targetFile.text();\n\t\tif (currentContent === content) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tawait Bun.write(path, content);\n};\n\nexport const compileSvelteServerModule = async (sourcePath: string) => {\n\tconst cachedModulePath = compiledModuleCache.get(sourcePath);\n\tif (cachedModulePath) {\n\t\treturn cachedModulePath;\n\t}\n\n\tconst resolutionSourcePath = await resolveOriginalSourcePath(sourcePath);\n\tconst source = await Bun.file(sourcePath).text();\n\tconst { compile, preprocess } = await import('svelte/compiler');\n\tconst loweredAwaitSource = lowerSvelteAwaitSlotSyntax(source);\n\tconst loweredSource = lowerSvelteIslandSyntax(\n\t\tloweredAwaitSource.code,\n\t\t'server'\n\t);\n\tconst preprocessed = await preprocess(\n\t\tloweredSource.code,\n\t\tcreateSvelteStylePreprocessor()\n\t);\n\tlet transpiled =\n\t\tsourcePath.endsWith('.ts') || sourcePath.endsWith('.svelte.ts')\n\t\t\t? transpiler.transformSync(preprocessed.code)\n\t\t\t: preprocessed.code;\n\tconst childImportSpecs = Array.from(\n\t\ttranspiled.matchAll(/from\\s+['\"]([^'\"]+)['\"]/g)\n\t)\n\t\t.map((match) => match[1])\n\t\t.filter((value): value is string => value !== undefined);\n\tconst resolvedChildModules = await Promise.all(\n\t\tchildImportSpecs.map((spec) =>\n\t\t\tresolveSvelteImport(spec, resolutionSourcePath)\n\t\t)\n\t);\n\tconst resolvedModuleImports = await Promise.all(\n\t\tchildImportSpecs.map((spec) =>\n\t\t\tresolveRelativeModule(spec, resolutionSourcePath)\n\t\t)\n\t);\n\tconst childModulePaths = new Map<string, string>();\n\tconst rewrittenModulePaths = new Map<string, string>();\n\n\tconst compiledChildren = await Promise.all(\n\t\tchildImportSpecs.map(async (spec, index) => {\n\t\t\tconst resolvedChild = resolvedChildModules[index];\n\t\t\tif (!spec || !resolvedChild) return null;\n\n\t\t\treturn {\n\t\t\t\tcompiledPath: await compileSvelteServerModule(resolvedChild),\n\t\t\t\tresolvedChild,\n\t\t\t\tspec\n\t\t\t};\n\t\t})\n\t);\n\n\tfor (const result of compiledChildren) {\n\t\tif (!result) continue;\n\t\tchildModulePaths.set(result.spec, result.compiledPath);\n\t\tchildModulePaths.set(result.resolvedChild, result.compiledPath);\n\t}\n\n\tfor (let index = 0; index < childImportSpecs.length; index += 1) {\n\t\tconst spec = childImportSpecs[index];\n\t\tconst resolvedModuleImport = resolvedModuleImports[index];\n\t\tif (!spec || !resolvedModuleImport) continue;\n\t\tif (resolvedChildModules[index]) continue;\n\n\t\trewrittenModulePaths.set(\n\t\t\tspec,\n\t\t\tensureRelativeImportPath(\n\t\t\t\tgetCachedModulePath(sourcePath),\n\t\t\t\tresolvedModuleImport\n\t\t\t)\n\t\t);\n\t}\n\n\tfor (const [spec, resolvedModuleImport] of rewrittenModulePaths) {\n\t\ttranspiled = transpiled.replaceAll(spec, resolvedModuleImport);\n\t}\n\n\tlet compiledCode = compile(transpiled, {\n\t\tcss: 'injected',\n\t\texperimental: {\n\t\t\tasync: loweredAwaitSource.transformed || loweredSource.transformed\n\t\t},\n\t\tfilename: resolutionSourcePath,\n\t\tgenerate: 'server'\n\t}).js.code;\n\n\tfor (const [spec, compiledChildPath] of childModulePaths) {\n\t\tcompiledCode = compiledCode.replaceAll(\n\t\t\tspec,\n\t\t\tensureRelativeImportPath(\n\t\t\t\tgetCachedModulePath(sourcePath),\n\t\t\t\tcompiledChildPath\n\t\t\t)\n\t\t);\n\t}\n\n\tfor (const [spec, resolvedModuleImport] of rewrittenModulePaths) {\n\t\tcompiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);\n\t}\n\n\tconst compiledModulePath = getCachedModulePath(sourcePath);\n\tawait mkdir(dirname(compiledModulePath), { recursive: true });\n\tawait writeIfChanged(compiledModulePath, compiledCode);\n\tcompiledModuleCache.set(sourcePath, compiledModulePath);\n\n\treturn compiledModulePath;\n};\n"
6
- ],
7
- "mappings": ";;;;;;;;;;;;;;;;AACA;AACA;AAMA,IAAM,kBAAkB,KAAK,Q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,YAAY,kBAAkB;AAAA,EAEtD,OAAO;AAAA;",
8
- "debugId": "7E4C5416175915DB64756E2164756E21",
9
- "names": []
10
- }
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- generateReactIndexFiles
4
- } from "./chunk-3g91wb4f.js";
5
- import"./chunk-p5504p14.js";
6
- import"./chunk-bmgqm774.js";
7
- export {
8
- generateReactIndexFiles
9
- };
10
-
11
- //# debugId=8B1CBA3878A33C6264756E2164756E21
12
- //# sourceMappingURL=chunk-9xrsjeem.js.map
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "8B1CBA3878A33C6264756E2164756E21",
8
- "names": []
9
- }
@@ -1,87 +0,0 @@
1
- // @bun
2
- // src/islands/sourceMetadata.ts
3
- var islandFrameworks = [
4
- "react",
5
- "svelte",
6
- "vue",
7
- "angular"
8
- ];
9
- var islandHydrationModes = [
10
- "load",
11
- "idle",
12
- "visible",
13
- "none"
14
- ];
15
- var isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value);
16
- var isIslandHydrate = (value) => islandHydrationModes.some((hydrate) => hydrate === value);
17
- var parseIslandTagAttributes = (attributeString) => {
18
- const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
19
- const componentMatch = attributeString.match(/\bcomponent\s*=\s*["']([^"']+)["']/);
20
- const hydrateMatch = attributeString.match(/\bhydrate\s*=\s*["']([^"']+)["']/);
21
- const framework = frameworkMatch?.[1];
22
- const component = componentMatch?.[1];
23
- if (!framework || !component) {
24
- return null;
25
- }
26
- if (!isIslandFramework(framework)) {
27
- return null;
28
- }
29
- const hydrateCandidate = hydrateMatch?.[1];
30
- return {
31
- component,
32
- framework,
33
- hydrate: hydrateCandidate && isIslandHydrate(hydrateCandidate) ? hydrateCandidate : undefined
34
- };
35
- };
36
- var normalizeUsage = (usage) => `${usage.framework}:${usage.component}:${usage.hydrate ?? ""}`;
37
- var addUsage = (usageMap, usage) => {
38
- if (!usage)
39
- return;
40
- usageMap.set(normalizeUsage(usage), usage);
41
- };
42
- var addRenderCallUsage = (usageMap, match) => {
43
- const [, framework, component, hydrate] = match;
44
- if (!framework || !component || !isIslandFramework(framework)) {
45
- return;
46
- }
47
- addUsage(usageMap, {
48
- component,
49
- framework,
50
- hydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined
51
- });
52
- };
53
- var buildIslandMetadataExports = (source) => {
54
- const usages = extractIslandUsagesFromSource(source);
55
- const serialized = JSON.stringify(usages);
56
- return `
57
- export const __ABSOLUTE_PAGE_ISLANDS__ = ${serialized};
58
- export const __ABSOLUTE_PAGE_HAS_ISLANDS__ = ${usages.length > 0};
59
- `;
60
- };
61
- var extractIslandUsagesFromSource = (source) => {
62
- const usageMap = new Map;
63
- const islandTagRegex = /<Island\b([\s\S]*?)(?:\/>|>(?:[\s\S]*?)<\/Island>)/g;
64
- let islandTagMatch = islandTagRegex.exec(source);
65
- while (islandTagMatch) {
66
- addUsage(usageMap, parseIslandTagAttributes(islandTagMatch[1] ?? ""));
67
- islandTagMatch = islandTagRegex.exec(source);
68
- }
69
- const absoluteIslandTagRegex = /<absolute-island\b([\s\S]*?)(?:\/>|>(?:[\s\S]*?)<\/absolute-island>)/g;
70
- let absoluteIslandMatch = absoluteIslandTagRegex.exec(source);
71
- while (absoluteIslandMatch) {
72
- addUsage(usageMap, parseIslandTagAttributes(absoluteIslandMatch[1] ?? ""));
73
- absoluteIslandMatch = absoluteIslandTagRegex.exec(source);
74
- }
75
- const staticRenderCallRegex = /renderIsland\s*\(\s*\{[\s\S]*?\bframework\s*:\s*['"]([^'"]+)['"][\s\S]*?\bcomponent\s*:\s*['"]([^'"]+)['"](?:[\s\S]*?\bhydrate\s*:\s*['"]([^'"]+)['"])?[\s\S]*?\}\s*\)/g;
76
- let renderMatch = staticRenderCallRegex.exec(source);
77
- while (renderMatch) {
78
- addRenderCallUsage(usageMap, renderMatch);
79
- renderMatch = staticRenderCallRegex.exec(source);
80
- }
81
- return [...usageMap.values()];
82
- };
83
-
84
- export { buildIslandMetadataExports, extractIslandUsagesFromSource };
85
-
86
- //# debugId=25B49EF298EA01EE64756E2164756E21
87
- //# sourceMappingURL=chunk-a9mvyp04.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/islands/sourceMetadata.ts"],
4
- "sourcesContent": [
5
- "import type { IslandFramework, IslandHydrate } from '../../types/island';\n\nexport type PageIslandUsage = {\n\tcomponent: string;\n\tframework: IslandFramework;\n\thydrate?: IslandHydrate;\n\tsource?: string;\n};\n\nconst islandFrameworks: IslandFramework[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nconst islandHydrationModes: IslandHydrate[] = [\n\t'load',\n\t'idle',\n\t'visible',\n\t'none'\n];\n\nconst isIslandFramework = (value: string): value is IslandFramework =>\n\tislandFrameworks.some((framework) => framework === value);\n\nconst isIslandHydrate = (value: string): value is IslandHydrate =>\n\tislandHydrationModes.some((hydrate) => hydrate === value);\n\nconst parseIslandTagAttributes = (attributeString: string) => {\n\tconst frameworkMatch = attributeString.match(\n\t\t/\\bframework\\s*=\\s*[\"']([^\"']+)[\"']/\n\t);\n\tconst componentMatch = attributeString.match(\n\t\t/\\bcomponent\\s*=\\s*[\"']([^\"']+)[\"']/\n\t);\n\tconst hydrateMatch = attributeString.match(\n\t\t/\\bhydrate\\s*=\\s*[\"']([^\"']+)[\"']/\n\t);\n\tconst framework = frameworkMatch?.[1];\n\tconst component = componentMatch?.[1];\n\tif (!framework || !component) {\n\t\treturn null;\n\t}\n\tif (!isIslandFramework(framework)) {\n\t\treturn null;\n\t}\n\n\tconst hydrateCandidate = hydrateMatch?.[1];\n\n\treturn {\n\t\tcomponent,\n\t\tframework,\n\t\thydrate:\n\t\t\thydrateCandidate && isIslandHydrate(hydrateCandidate)\n\t\t\t\t? hydrateCandidate\n\t\t\t\t: undefined\n\t} satisfies PageIslandUsage;\n};\n\nconst normalizeUsage = (usage: PageIslandUsage) =>\n\t`${usage.framework}:${usage.component}:${usage.hydrate ?? ''}`;\n\nconst addUsage = (\n\tusageMap: Map<string, PageIslandUsage>,\n\tusage: PageIslandUsage | null\n) => {\n\tif (!usage) return;\n\tusageMap.set(normalizeUsage(usage), usage);\n};\n\nconst addRenderCallUsage = (\n\tusageMap: Map<string, PageIslandUsage>,\n\tmatch: RegExpExecArray\n) => {\n\tconst [, framework, component, hydrate] = match;\n\tif (!framework || !component || !isIslandFramework(framework)) {\n\t\treturn;\n\t}\n\n\taddUsage(usageMap, {\n\t\tcomponent,\n\t\tframework,\n\t\thydrate: hydrate && isIslandHydrate(hydrate) ? hydrate : undefined\n\t});\n};\n\nexport const buildIslandMetadataExports = (source: string) => {\n\tconst usages = extractIslandUsagesFromSource(source);\n\tconst serialized = JSON.stringify(usages);\n\n\treturn `\\nexport const __ABSOLUTE_PAGE_ISLANDS__ = ${serialized};\\nexport const __ABSOLUTE_PAGE_HAS_ISLANDS__ = ${usages.length > 0};\\n`;\n};\nexport const extractIslandUsagesFromSource = (source: string) => {\n\tconst usageMap = new Map<string, PageIslandUsage>();\n\n\tconst islandTagRegex =\n\t\t/<Island\\b([\\s\\S]*?)(?:\\/>|>(?:[\\s\\S]*?)<\\/Island>)/g;\n\tlet islandTagMatch = islandTagRegex.exec(source);\n\twhile (islandTagMatch) {\n\t\taddUsage(usageMap, parseIslandTagAttributes(islandTagMatch[1] ?? ''));\n\t\tislandTagMatch = islandTagRegex.exec(source);\n\t}\n\n\tconst absoluteIslandTagRegex =\n\t\t/<absolute-island\\b([\\s\\S]*?)(?:\\/>|>(?:[\\s\\S]*?)<\\/absolute-island>)/g;\n\tlet absoluteIslandMatch = absoluteIslandTagRegex.exec(source);\n\twhile (absoluteIslandMatch) {\n\t\taddUsage(\n\t\t\tusageMap,\n\t\t\tparseIslandTagAttributes(absoluteIslandMatch[1] ?? '')\n\t\t);\n\t\tabsoluteIslandMatch = absoluteIslandTagRegex.exec(source);\n\t}\n\n\tconst staticRenderCallRegex =\n\t\t/renderIsland\\s*\\(\\s*\\{[\\s\\S]*?\\bframework\\s*:\\s*['\"]([^'\"]+)['\"][\\s\\S]*?\\bcomponent\\s*:\\s*['\"]([^'\"]+)['\"](?:[\\s\\S]*?\\bhydrate\\s*:\\s*['\"]([^'\"]+)['\"])?[\\s\\S]*?\\}\\s*\\)/g;\n\tlet renderMatch = staticRenderCallRegex.exec(source);\n\twhile (renderMatch) {\n\t\taddRenderCallUsage(usageMap, renderMatch);\n\t\trenderMatch = staticRenderCallRegex.exec(source);\n\t}\n\n\treturn [...usageMap.values()];\n};\nexport const hasIslandUsageInSource = (source: string) =>\n\textractIslandUsagesFromSource(source).length > 0;\n"
6
- ],
7
- "mappings": ";;AASA,IAAM,mBAAsC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,uBAAwC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,oBAAoB,CAAC,UAC1B,iBAAiB,KAAK,CAAC,cAAc,cAAc,KAAK;AAEzD,IAAM,kBAAkB,CAAC,UACxB,qBAAqB,KAAK,CAAC,YAAY,YAAY,KAAK;AAEzD,IAAM,2BAA2B,CAAC,oBAA4B;AAAA,EAC7D,MAAM,iBAAiB,gBAAgB,MACtC,oCACD;AAAA,EACA,MAAM,iBAAiB,gBAAgB,MACtC,oCACD;AAAA,EACA,MAAM,eAAe,gBAAgB,MACpC,kCACD;AAAA,EACA,MAAM,YAAY,iBAAiB;AAAA,EACnC,MAAM,YAAY,iBAAiB;AAAA,EACnC,IAAI,CAAC,aAAa,CAAC,WAAW;AAAA,IAC7B,OAAO;AAAA,EACR;AAAA,EACA,IAAI,CAAC,kBAAkB,SAAS,GAAG;AAAA,IAClC,OAAO;AAAA,EACR;AAAA,EAEA,MAAM,mBAAmB,eAAe;AAAA,EAExC,OAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,SACC,o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A,EACD,IAAI,cAAc,sBAAsB,KAAK,MAAM;AAAA,EACnD,OAAO,aAAa;AAAA,IACnB,mBAAmB,UAAU,WAAW;AAAA,IACxC,cAAc,sBAAsB,KAAK,MAAM;AAAA,EAChD;AAAA,EAEA,OAAO,CAAC,GAAG,SAAS,OAAO,CAAC;AAAA;",
8
- "debugId": "25B49EF298EA01EE64756E2164756E21",
9
- "names": []
10
- }
@@ -1,21 +0,0 @@
1
- // @bun
2
- import {
3
- normalizePath
4
- } from "./chunk-hyjs4bqs.js";
5
-
6
- // src/utils/commonAncestor.ts
7
- var commonAncestor = (paths, fallback) => {
8
- if (paths.length === 0)
9
- return fallback;
10
- const segmentsList = paths.map((p) => normalizePath(p).split("/"));
11
- const [first] = segmentsList;
12
- if (!first)
13
- return fallback;
14
- const commonSegments = first.filter((segment, index) => segmentsList.every((pathSegs) => pathSegs[index] === segment));
15
- return commonSegments.length ? commonSegments.join("/") : fallback;
16
- };
17
-
18
- export { commonAncestor };
19
-
20
- //# debugId=F4964CD05FCFD1BA64756E2164756E21
21
- //# sourceMappingURL=chunk-b3gbnrwe.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/utils/commonAncestor.ts"],
4
- "sourcesContent": [
5
- "import { normalizePath } from './normalizePath';\n\nexport const commonAncestor = (paths: string[], fallback?: string) => {\n\tif (paths.length === 0) return fallback;\n\t// Normalize all paths and split by forward slash for cross-platform compatibility\n\tconst segmentsList = paths.map((p) => normalizePath(p).split('/'));\n\tconst [first] = segmentsList;\n\tif (!first) return fallback;\n\tconst commonSegments = first.filter((segment, index) =>\n\t\tsegmentsList.every((pathSegs) => pathSegs[index] === segment)\n\t);\n\n\t// Always join with forward slash for normalized output\n\treturn commonSegments.length ? commonSegments.join('/') : fallback;\n};\n"
6
- ],
7
- "mappings": ";;;;;;AAEO,IAAM,iBAAiB,CAAC,OAAiB,aAAsB;AAAA,EACrE,IAAI,MAAM,WAAW;AAAA,IAAG,OAAO;AAAA,EAE/B,MAAM,eAAe,MAAM,IAAI,CAAC,MAAM,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC;AAAA,EACjE,OAAO,SAAS;AAAA,EAChB,IAAI,CAAC;AAAA,IAAO,OAAO;AAAA,EACnB,MAAM,iBAAiB,MAAM,OAAO,CAAC,SAAS,UAC7C,aAAa,MAAM,CAAC,aAAa,SAAS,WAAW,OAAO,CAC7D;AAAA,EAGA,OAAO,eAAe,SAAS,eAAe,KAAK,GAAG,IAAI;AAAA;",
8
- "debugId": "F4964CD05FCFD1BA64756E2164756E21",
9
- "names": []
10
- }
@@ -1,65 +0,0 @@
1
- // @bun
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
- var __returnValue = (v) => v;
34
- function __exportSetter(name, newValue) {
35
- this[name] = __returnValue.bind(null, newValue);
36
- }
37
- var __export = (target, all) => {
38
- for (var name in all)
39
- __defProp(target, name, {
40
- get: all[name],
41
- enumerable: true,
42
- configurable: true,
43
- set: __exportSetter.bind(all, name)
44
- });
45
- };
46
- var __legacyDecorateClassTS = function(decorators, target, key, desc) {
47
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
48
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
49
- r = Reflect.decorate(decorators, target, key, desc);
50
- else
51
- for (var i = decorators.length - 1;i >= 0; i--)
52
- if (d = decorators[i])
53
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
54
- return c > 3 && r && Object.defineProperty(target, key, r), r;
55
- };
56
- var __legacyMetadataTS = (k, v) => {
57
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
58
- return Reflect.metadata(k, v);
59
- };
60
- var __require = import.meta.require;
61
-
62
- export { __toESM, __commonJS, __export, __legacyDecorateClassTS, __legacyMetadataTS, __require };
63
-
64
- //# debugId=DFE4B56A8062886B64756E2164756E21
65
- //# sourceMappingURL=chunk-bmgqm774.js.map
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "DFE4B56A8062886B64756E2164756E21",
8
- "names": []
9
- }