@stacksjs/stx 0.2.607 → 0.2.612

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 (236) hide show
  1. package/dist/chunk-07rryvyt.js +2 -0
  2. package/dist/chunk-0dkd5z22.js +2 -0
  3. package/dist/chunk-0fgp13q4.js +2 -0
  4. package/dist/chunk-0hpng9by.js +2 -0
  5. package/dist/chunk-0nfysn6e.js +2 -0
  6. package/dist/{chunk-dxqwm8tr.js → chunk-0s6shhb3.js} +5 -5
  7. package/dist/chunk-0vmwp37n.js +2 -0
  8. package/dist/chunk-0x72g1jn.js +2 -0
  9. package/dist/{chunk-6xsm53pz.js → chunk-0zx1400y.js} +4 -4
  10. package/dist/{chunk-5j29466h.js → chunk-13xvn7vh.js} +2 -2
  11. package/dist/chunk-15wmzj8j.js +2 -0
  12. package/dist/{chunk-azpkje69.js → chunk-1c0zvjt3.js} +34 -10
  13. package/dist/chunk-1p7v0ytv.js +2 -0
  14. package/dist/{chunk-6by8dtan.js → chunk-1q06tw66.js} +2 -2
  15. package/dist/{chunk-sswjv8p9.js → chunk-2bcp699b.js} +2 -2
  16. package/dist/chunk-32y8adx3.js +2 -0
  17. package/dist/chunk-34a1jdhq.js +3 -0
  18. package/dist/{chunk-tydv84gj.js → chunk-34tbh570.js} +2 -2
  19. package/dist/chunk-3fb3m640.js +2 -0
  20. package/dist/chunk-3njhzgqa.js +2 -0
  21. package/dist/{chunk-jsktg3ab.js → chunk-45gz1yff.js} +5 -5
  22. package/dist/{chunk-r69jfs59.js → chunk-4h62y8dn.js} +1 -1
  23. package/dist/{chunk-y54fz9rk.js → chunk-4rtxkqwh.js} +2 -2
  24. package/dist/{chunk-bspryr4a.js → chunk-4x5zryhk.js} +9 -9
  25. package/dist/chunk-5003ncbh.js +2 -0
  26. package/dist/chunk-514ykzna.js +2 -0
  27. package/dist/{chunk-dmdhbwmn.js → chunk-58s20ceb.js} +3 -3
  28. package/dist/chunk-5fa9g7x1.js +2850 -0
  29. package/dist/{chunk-td30jg06.js → chunk-5fxh7fc3.js} +2 -2
  30. package/dist/{chunk-s4pjf2pc.js → chunk-5rtatjwq.js} +2 -2
  31. package/dist/{chunk-1jxdkp8x.js → chunk-5vs12p6m.js} +6 -6
  32. package/dist/{chunk-bsy8v1xj.js → chunk-66e4ga0z.js} +3 -3
  33. package/dist/chunk-6fmcs19t.js +18 -0
  34. package/dist/chunk-6jjbmfy0.js +2 -0
  35. package/dist/chunk-6pg74bkj.js +2 -0
  36. package/dist/{chunk-20k77e2a.js → chunk-6rd762vj.js} +4 -4
  37. package/dist/chunk-6ta850w8.js +3 -0
  38. package/dist/{chunk-81qmj3sd.js → chunk-6w0h6vpd.js} +7 -7
  39. package/dist/chunk-6yn7pc5s.js +2 -0
  40. package/dist/{chunk-y8h823cb.js → chunk-74j18qk0.js} +28 -28
  41. package/dist/chunk-792sscsk.js +2 -0
  42. package/dist/chunk-7ed685cs.js +2 -0
  43. package/dist/chunk-7mee8bte.js +2 -0
  44. package/dist/chunk-7mgbh13b.js +2 -0
  45. package/dist/chunk-7yjyzzcp.js +2 -0
  46. package/dist/{chunk-qh07a85k.js → chunk-83h5ydvw.js} +3 -3
  47. package/dist/chunk-851cd8sc.js +2 -0
  48. package/dist/{chunk-td5100fz.js → chunk-8dq3r6xw.js} +7 -7
  49. package/dist/{chunk-t9t66sz4.js → chunk-8jqdb1qr.js} +6 -6
  50. package/dist/{chunk-60wedefh.js → chunk-8n306p92.js} +2 -2
  51. package/dist/chunk-8vdsewsa.js +43 -0
  52. package/dist/chunk-8xp2r8s0.js +2 -0
  53. package/dist/{chunk-tbsjg23k.js → chunk-970j89r5.js} +4 -4
  54. package/dist/chunk-97ht3bw3.js +2 -0
  55. package/dist/{chunk-wzjf33es.js → chunk-99rfdydy.js} +2 -2
  56. package/dist/{chunk-1dd4qefr.js → chunk-adn5r0r4.js} +2 -2
  57. package/dist/{chunk-efy3038a.js → chunk-azj2cj8h.js} +2 -2
  58. package/dist/chunk-be89da2e.js +2 -0
  59. package/dist/chunk-bemx44n4.js +2 -0
  60. package/dist/{chunk-53y4z4p2.js → chunk-bgcn01mr.js} +3 -3
  61. package/dist/{chunk-vntpfbwy.js → chunk-bm632aaj.js} +1 -1
  62. package/dist/{chunk-0cb00ys2.js → chunk-btcc95hq.js} +5 -5
  63. package/dist/{chunk-x8q5przn.js → chunk-c9jav70j.js} +11 -11
  64. package/dist/chunk-cg8hg6cs.js +3 -0
  65. package/dist/chunk-cxv6mhky.js +2 -0
  66. package/dist/{chunk-cfpenvc7.js → chunk-d16jgsyv.js} +3 -3
  67. package/dist/{chunk-z2xrwmjr.js → chunk-d5nxsg1p.js} +11 -11
  68. package/dist/{chunk-yzj55rfs.js → chunk-dcs87qta.js} +3 -3
  69. package/dist/{chunk-vp3fzjsc.js → chunk-det49x62.js} +2 -2
  70. package/dist/{chunk-8fq6bvnw.js → chunk-ej2ka6g6.js} +33 -33
  71. package/dist/chunk-ejqt0kh2.js +2 -0
  72. package/dist/chunk-ekd11w9t.js +2 -0
  73. package/dist/chunk-ekfmad19.js +2 -0
  74. package/dist/{chunk-m9h7pmkh.js → chunk-ewmpbxhv.js} +5 -5
  75. package/dist/{chunk-jpxekhdh.js → chunk-f6pjf3tb.js} +3 -3
  76. package/dist/chunk-f8kh3s0k.js +2 -0
  77. package/dist/chunk-fdkr055a.js +2 -0
  78. package/dist/{chunk-aestp72s.js → chunk-frvn6psn.js} +2 -2
  79. package/dist/{chunk-ev6w9c69.js → chunk-g18pwk0t.js} +1 -1
  80. package/dist/chunk-g8hwrejy.js +2 -0
  81. package/dist/chunk-gmqr7v81.js +2 -0
  82. package/dist/chunk-h476qqq9.js +2 -0
  83. package/dist/chunk-h94znyac.js +2 -0
  84. package/dist/chunk-hjp38m0w.js +3 -0
  85. package/dist/{chunk-z8fhtym2.js → chunk-hw97qw4k.js} +2 -2
  86. package/dist/{chunk-tcd2zez3.js → chunk-j18z5nxq.js} +2 -2
  87. package/dist/chunk-j2gvr4n6.js +2 -0
  88. package/dist/{chunk-mvwcf4xy.js → chunk-j4smj8cr.js} +4 -4
  89. package/dist/{chunk-r4h8fg1x.js → chunk-j6nn0c5r.js} +1 -1
  90. package/dist/chunk-j7vjfzjx.js +2 -0
  91. package/dist/chunk-j9pcvc0z.js +2 -0
  92. package/dist/chunk-jahkmmhh.js +2 -0
  93. package/dist/{chunk-vw62fjpv.js → chunk-jbaedjyk.js} +3 -3
  94. package/dist/{chunk-79edpvb2.js → chunk-jskaacqy.js} +7 -7
  95. package/dist/chunk-jx1p2eza.js +2 -0
  96. package/dist/chunk-k1hpxgzq.js +40 -0
  97. package/dist/{chunk-c65q0svd.js → chunk-ktg9khmj.js} +5 -5
  98. package/dist/{chunk-w8g2ppnr.js → chunk-kwfwc32d.js} +2 -2
  99. package/dist/chunk-m4k7f63m.js +2 -0
  100. package/dist/chunk-mfh61qdr.js +127 -0
  101. package/dist/chunk-mg9931y0.js +2 -0
  102. package/dist/{chunk-rmv35cx0.js → chunk-mm8jdb4p.js} +2 -2
  103. package/dist/chunk-mtm39290.js +2 -0
  104. package/dist/{chunk-0v89nfz1.js → chunk-n1zyt21h.js} +2 -2
  105. package/dist/chunk-n4z6evey.js +2 -0
  106. package/dist/{chunk-bhf9yt2w.js → chunk-nmh4pn44.js} +2 -2
  107. package/dist/chunk-pjh4kftn.js +2 -0
  108. package/dist/chunk-pjqrcbtt.js +2 -0
  109. package/dist/{chunk-vehtypx0.js → chunk-q3a13hvc.js} +2 -2
  110. package/dist/{chunk-dnqq1ze0.js → chunk-q4t49t6z.js} +3 -3
  111. package/dist/{chunk-g63ye3fe.js → chunk-qh3b1w7q.js} +2 -2
  112. package/dist/{chunk-77kpsnf6.js → chunk-qkczk53w.js} +87 -87
  113. package/dist/{chunk-kxjd6e2h.js → chunk-qxr7e0y2.js} +2 -2
  114. package/dist/{chunk-67tpacz0.js → chunk-qzfq8342.js} +1 -1
  115. package/dist/chunk-rbwhdwa9.js +2 -0
  116. package/dist/{chunk-4tj0ap61.js → chunk-s43pj9n6.js} +5 -5
  117. package/dist/chunk-spkwmfbm.js +2 -0
  118. package/dist/chunk-swv69q75.js +4 -0
  119. package/dist/chunk-t535swnv.js +2 -0
  120. package/dist/{chunk-ktvr45qg.js → chunk-t61vdbje.js} +6 -6
  121. package/dist/chunk-t9pnkbg6.js +2 -0
  122. package/dist/{chunk-cp901m61.js → chunk-tawfv519.js} +1 -1
  123. package/dist/{chunk-xjxc4q3w.js → chunk-th4x1wbc.js} +21 -21
  124. package/dist/chunk-trah2z70.js +2 -0
  125. package/dist/{chunk-k3f4044e.js → chunk-twmq5m6r.js} +2 -2
  126. package/dist/{chunk-wqmm1qsz.js → chunk-vbzpc1yz.js} +5 -5
  127. package/dist/chunk-vrnb2xat.js +2 -0
  128. package/dist/{chunk-ghdyqt98.js → chunk-wn3d4gd6.js} +2 -2
  129. package/dist/{chunk-tfjcs55e.js → chunk-wy93yhce.js} +12 -12
  130. package/dist/{chunk-7095f0hb.js → chunk-x7jmchd5.js} +9 -9
  131. package/dist/chunk-xncqjkjm.js +2 -0
  132. package/dist/chunk-xq9f9ftz.js +2 -0
  133. package/dist/chunk-xv9qre1x.js +2 -0
  134. package/dist/{chunk-5e182xqt.js → chunk-xz7h73ra.js} +1 -1
  135. package/dist/{chunk-g04y5wyn.js → chunk-z83p4bme.js} +4 -4
  136. package/dist/chunk-zar7fhqr.js +2 -0
  137. package/dist/chunk-zhe35k6k.js +2 -0
  138. package/dist/{chunk-5s47qfp6.js → chunk-zsqfvwwf.js} +2 -2
  139. package/dist/chunk-zy266h8p.js +2 -0
  140. package/dist/cli.js +46 -46
  141. package/dist/craft-entry.js +2 -2
  142. package/dist/craft.js +2 -2
  143. package/dist/expressions.d.ts +0 -23
  144. package/dist/expressions.js +14 -11
  145. package/dist/includes.js +6 -0
  146. package/dist/loops.js +4 -3
  147. package/dist/native/compiler/component-mapping.js +1 -0
  148. package/dist/native/compiler/headwind-to-style.js +17 -0
  149. package/dist/native/compiler/html-to-ir.js +1 -0
  150. package/dist/native/compiler/inline-style.js +2 -0
  151. package/dist/native/compiler/ir.d.ts +2 -0
  152. package/dist/native/components/primitives.d.ts +33 -9
  153. package/dist/native/components/primitives.js +1 -0
  154. package/dist/native/primitives/MapPolygon.stx +2 -0
  155. package/dist/native/prop-names.js +1 -3
  156. package/dist/native/runtime/craft-bridge.js +22 -1
  157. package/dist/native/runtime/craft.d.ts +10 -0
  158. package/dist/process.js +3 -2
  159. package/dist/pwa.js +3 -3
  160. package/dist/safe-evaluator.d.ts +16 -0
  161. package/dist/safe-evaluator.js +10 -4
  162. package/dist/script-validation.js +4 -4
  163. package/dist/serve.js +5 -1
  164. package/dist/ssg.js +13 -13
  165. package/dist/utils.js +15 -2
  166. package/package.json +5 -5
  167. package/dist/chunk-06wv8qwy.js +0 -40
  168. package/dist/chunk-0d6b3eeb.js +0 -2
  169. package/dist/chunk-0mgth7cm.js +0 -2
  170. package/dist/chunk-1fdrhfc0.js +0 -2
  171. package/dist/chunk-2n59ahd9.js +0 -2
  172. package/dist/chunk-2pwjnydp.js +0 -2
  173. package/dist/chunk-2r4an7bh.js +0 -2
  174. package/dist/chunk-304vaxnk.js +0 -2
  175. package/dist/chunk-32hr3qq7.js +0 -2
  176. package/dist/chunk-36n8yz6t.js +0 -2
  177. package/dist/chunk-39pgf5z3.js +0 -2
  178. package/dist/chunk-3xwzd9wp.js +0 -2845
  179. package/dist/chunk-3yttgk0s.js +0 -2
  180. package/dist/chunk-4ck2xc8m.js +0 -2
  181. package/dist/chunk-4jasfhh6.js +0 -2
  182. package/dist/chunk-4szajb1z.js +0 -2
  183. package/dist/chunk-61ztfana.js +0 -127
  184. package/dist/chunk-7f63z4xx.js +0 -2
  185. package/dist/chunk-7renf4zp.js +0 -2
  186. package/dist/chunk-8bzx0r0x.js +0 -2
  187. package/dist/chunk-974dxazw.js +0 -2
  188. package/dist/chunk-9fpnnfr3.js +0 -2
  189. package/dist/chunk-9sgt7v77.js +0 -2
  190. package/dist/chunk-9zzhpp2a.js +0 -2
  191. package/dist/chunk-aan7601v.js +0 -2
  192. package/dist/chunk-b4tbqz8r.js +0 -2
  193. package/dist/chunk-bakxqwnz.js +0 -2
  194. package/dist/chunk-be2kmw0p.js +0 -2
  195. package/dist/chunk-bnpb6ez9.js +0 -2
  196. package/dist/chunk-c48mh4d6.js +0 -18
  197. package/dist/chunk-dzbkgsv8.js +0 -4
  198. package/dist/chunk-ewkza45r.js +0 -2
  199. package/dist/chunk-exd1h9sd.js +0 -2
  200. package/dist/chunk-fcgf8d5k.js +0 -2
  201. package/dist/chunk-gw2dvp35.js +0 -2
  202. package/dist/chunk-h9drxwva.js +0 -2
  203. package/dist/chunk-hrr7k1qc.js +0 -2
  204. package/dist/chunk-j04brkj0.js +0 -2
  205. package/dist/chunk-jbvwg4gs.js +0 -2
  206. package/dist/chunk-jshj69dy.js +0 -2
  207. package/dist/chunk-k4wkfhvz.js +0 -2
  208. package/dist/chunk-km9a5gp4.js +0 -2
  209. package/dist/chunk-m95zjk91.js +0 -3
  210. package/dist/chunk-mgj0ngyq.js +0 -2
  211. package/dist/chunk-myqhdz1w.js +0 -2
  212. package/dist/chunk-n35yc890.js +0 -3
  213. package/dist/chunk-n39ezmxz.js +0 -2
  214. package/dist/chunk-n8eavnxf.js +0 -2
  215. package/dist/chunk-p8sv5fqs.js +0 -2
  216. package/dist/chunk-pghtgep5.js +0 -2
  217. package/dist/chunk-pt7e0be5.js +0 -2
  218. package/dist/chunk-q40ahbjs.js +0 -2
  219. package/dist/chunk-qjxxhdv7.js +0 -2
  220. package/dist/chunk-rp93n4z7.js +0 -3
  221. package/dist/chunk-rrw2jg26.js +0 -2
  222. package/dist/chunk-rxja040z.js +0 -2
  223. package/dist/chunk-sx0qbekt.js +0 -2
  224. package/dist/chunk-t83acmv2.js +0 -2
  225. package/dist/chunk-tc176d93.js +0 -2
  226. package/dist/chunk-wjhhb6dn.js +0 -2
  227. package/dist/chunk-wm8w2721.js +0 -2
  228. package/dist/chunk-wtax276j.js +0 -2
  229. package/dist/chunk-wy53pys4.js +0 -43
  230. package/dist/chunk-x49qdt4c.js +0 -2
  231. package/dist/chunk-y0zyzbjf.js +0 -2
  232. package/dist/chunk-yn2d8x8m.js +0 -3
  233. package/dist/chunk-z8mdsjzw.js +0 -2
  234. package/dist/chunk-zg87pybq.js +0 -2
  235. package/dist/chunk-zq345s76.js +0 -2
  236. package/dist/chunk-zs3ezqy3.js +0 -2
@@ -101,29 +101,6 @@ export declare function escapeHtml(unsafe: string): string;
101
101
  * decodes references before anything reads them.
102
102
  */
103
103
  export declare function escapeHtmlValue(unsafe: string): string;
104
- /**
105
- * A zero-width, non-breaking character, written as a reference.
106
- *
107
- * The character references alone stop the *server* reading a value as a
108
- * template, and they are not enough: the browser decodes them, so the DOM text
109
- * says `{{ 6*7 }}` again and the client runtime - which binds by scanning text
110
- * for mustaches - evaluates it in the visitor's browser. Server-side injection
111
- * becomes cross-site scripting, from the same stored value.
112
- *
113
- * A word joiner between the braces breaks the pattern for both sides while
114
- * changing nothing a reader sees: it has no width, no line-breaking behaviour,
115
- * and copies as an invisible character. The alternative is teaching the runtime
116
- * to bind only what the compiler recorded, which is the better shape and a much
117
- * larger change than a security fix should carry.
118
- */
119
- /**
120
- * Check if a template uses signals (state, derived, effect) in its script blocks
121
- * or has reactive attributes (@if, @for) with function call expressions
122
- *
123
- * `filePath` lets a script that factors its signals into an imported module be
124
- * recognised too. Without it the scan is text-only, which is what every caller
125
- * did before and is still correct for a script that declares its own signals.
126
- */
127
104
  export declare function usesSignalsInScript(template: string, filePath?: string): boolean;
128
105
  /**
129
106
  * Where each client-side loop in `html` is, and the names it binds.
@@ -2,7 +2,7 @@ import fs from "node:fs";
2
2
  import { isDevelopment } from "./env.js";
3
3
  import { stripCommentsAndLiterals } from "./strip-literals.js";
4
4
  import { createSafeFunction, getExpressionSafetyRule, safeEvaluate } from "./safe-evaluator.js";
5
- import { createDetailedErrorMessage } from "./utils.js";
5
+ import { componentClientSignalNames, createDetailedErrorMessage } from "./utils.js";
6
6
  import { createPlaceholder } from "./placeholder.js";
7
7
  import { neutralizeTemplateSyntax } from "./template-syntax-escape.js";
8
8
  import { classifyHtmlInterpolation, UnsafeInterpolationContextError } from "./interpolation-context.js";
@@ -347,13 +347,15 @@ function escapeInterpolatedHtmlValue(source, offset, raw, attributeFragment = !1
347
347
  return UNSAFE_URL_PREFIX + escaped;
348
348
  return sanitizeSubstitutedUrl(schemeWindow(source, offset), raw, escaped);
349
349
  }
350
+ function clientScriptBodies(scripts) {
351
+ return scripts.flatMap((script) => {
352
+ const match = script.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);
353
+ return !match || /\bserver\b|\bsrc\s*=/.test(match[1]) ? [] : [match[2]];
354
+ });
355
+ }
350
356
  export function usesSignalsInScript(template, filePath) {
351
357
  const { scripts } = stashScriptElements(template);
352
- for (const script of scripts) {
353
- const match = script.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);
354
- if (!match || /\bserver\b|\bsrc\s*=/.test(match[1]))
355
- continue;
356
- const content = match[2];
358
+ for (const content of clientScriptBodies(scripts)) {
357
359
  if (/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(content))
358
360
  return !0;
359
361
  if (importsSignalDeclarations(content, filePath))
@@ -565,7 +567,10 @@ export function processExpressions(template, context, filePath) {
565
567
  output = maskInto(output, styleMatcher, styleBlocks, (n) => `<!--__STX_STYLE_${n}__-->`);
566
568
  const scriptBlocks = [];
567
569
  output = maskInto(output, matchScriptElement, scriptBlocks, (n) => `<!--__STX_SCRIPT_EXPR_${n}__-->`);
568
- const hasSignals = context?.__stx_signals_gate === !0 || usesSignalsInScript(template), clientSignalNames = new Set(Array.isArray(context?.__stx_client_signal_names) ? context.__stx_client_signal_names : []), preservedClientExpressions = new Set(Array.isArray(context?.__stx_preserved_client_expressions) ? context.__stx_preserved_client_expressions : []);
570
+ const hasSignals = context?.__stx_signals_gate === !0 || usesSignalsInScript(template), clientSignalNames = new Set([
571
+ ...Array.isArray(context?.__stx_client_signal_names) ? context.__stx_client_signal_names : [],
572
+ ...componentClientSignalNames(clientScriptBodies(scriptBlocks))
573
+ ]), preservedClientExpressions = new Set(Array.isArray(context?.__stx_preserved_client_expressions) ? context.__stx_preserved_client_expressions : []);
569
574
  output = replaceInterpolations(output, (match, expr, offset) => {
570
575
  try {
571
576
  const value = evaluateExpression(expr, context, !1, (r) => warnRejectedExpression(r, match, filePath, template));
@@ -607,13 +612,13 @@ export function processExpressions(template, context, filePath) {
607
612
  const jsBuiltins = ["parseInt", "parseFloat", "String", "Number", "Boolean", "Array", "Object", "JSON", "Math", "Date", "encodeURIComponent", "decodeURIComponent", "encodeURI", "decodeURI", "true", "false", "null", "undefined"], identifierPattern = /^([a-zA-Z_$][a-zA-Z0-9_$]*)/, firstVarName = trimmedExpr.match(identifierPattern)?.[1], firstVarInContext = firstVarName && ((firstVarName in context) || jsBuiltins.includes(firstVarName)), firstVarIsClientSignal = Boolean(firstVarName && clientSignalNames.has(firstVarName)), directFunctionCall = /^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/, directFuncMatch = trimmedExpr.match(directFunctionCall), isLikelySignal = directFuncMatch && !jsBuiltins.includes(directFuncMatch[1]) && !(directFuncMatch[1] in context);
608
613
  if (/^__[A-Z_]+__$/.test(trimmedExpr))
609
614
  return "";
615
+ if (firstVarIsClientSignal)
616
+ return match;
610
617
  let rejection;
611
618
  try {
612
619
  const value = evaluateExpression(expr, context, !1, (r) => {
613
620
  rejection = r;
614
621
  });
615
- if (firstVarIsClientSignal)
616
- return match;
617
622
  if (hasSignals && !expressionUsesOnlyContextVars(trimmedExpr, context))
618
623
  return match;
619
624
  if (rejection)
@@ -627,8 +632,6 @@ export function processExpressions(template, context, filePath) {
627
632
  } catch (error) {
628
633
  if (error instanceof UnsafeInterpolationContextError)
629
634
  throw error;
630
- if (firstVarIsClientSignal)
631
- return match;
632
635
  if (hasSignals && !expressionUsesOnlyContextVars(trimmedExpr, context))
633
636
  return match;
634
637
  if (isLikelySignal)
package/dist/includes.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { StxValidationError } from "./errors/types.js";
2
+ import { validateClientScript } from "./script-validation.js";
1
3
  import { findSfcTemplateBlock } from "./sfc-template.js";
2
4
  import path from "node:path";
3
5
  import { existsSync } from "node:fs";
@@ -663,6 +665,8 @@ export async function processIncludes(template, context, filePath, options, depe
663
665
  if (isDataBlockScript(scriptAttrs))
664
666
  continue;
665
667
  const isServerScript = scriptAttrs.includes("server"), shouldTranspile = shouldTranspileTypeScript(scriptAttrs);
668
+ if (!isServerScript && !/\bsrc\s*=/i.test(scriptAttrs))
669
+ validateClientScript(scriptContent, includeFilePath, options.strict);
666
670
  if (!isServerScript && scriptContent.trim()) {
667
671
  const { interpolateScriptExpressions } = await import("./expressions.js");
668
672
  scriptContent = interpolateScriptExpressions(scriptContent, includeContext, includePath);
@@ -777,6 +781,8 @@ ${scriptContent}`;
777
781
  ` + preservedScript;
778
782
  return processedContent;
779
783
  } catch (error) {
784
+ if (error instanceof StxValidationError)
785
+ throw error;
780
786
  const errorMessage = error instanceof Error ? error.message : String(error);
781
787
  return includeFailure(includePath, `Error processing include ${includePath}: ${errorMessage}`, templateStr, offsetPos);
782
788
  }
package/dist/loops.js CHANGED
@@ -3,7 +3,7 @@ import { processConditionals } from "./conditionals.js";
3
3
  import { ErrorCodes, inlineError } from "./error-handling.js";
4
4
  import { processExpressions } from "./expressions.js";
5
5
  import { findDirectiveBlocks, findMatchingDelimiter } from "./parser/index.js";
6
- import { createSafeFunction, freeIdentifiers, isExpressionSafe, isForExpressionSafe, sanitizeExpression, safeEvaluate, safeEvaluateObject } from "./safe-evaluator.js";
6
+ import { createSafeFunction, freeIdentifiers, isExpressionSafe, isForExpressionSafe, SANITIZE_CACHE, sanitizeExpression, safeEvaluate, safeEvaluateObject } from "./safe-evaluator.js";
7
7
  const DEFAULT_MAX_WHILE_ITERATIONS = 1000, DEFAULT_USE_ALT_LOOP_VARIABLE = !1;
8
8
  function preEvaluateIncludeData(content, ctx) {
9
9
  const pattern = /@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g;
@@ -461,7 +461,7 @@ export function processLoops(template, context, filePath, options, deferWarnings
461
461
  } else
462
462
  itemName = trimmedItemVar;
463
463
  let loopResult = "";
464
- const items = array;
464
+ const items = array, sanitizeCache = ctx[SANITIZE_CACHE] ?? new WeakMap;
465
465
  for (let index = 0;index < items.length; index++) {
466
466
  const item = items[index], loopContext = {
467
467
  index,
@@ -472,7 +472,8 @@ export function processLoops(template, context, filePath, options, deferWarnings
472
472
  }, itemContext = {
473
473
  ...ctx,
474
474
  loop: loopContext,
475
- $loop: loopContext
475
+ $loop: loopContext,
476
+ [SANITIZE_CACHE]: sanitizeCache
476
477
  };
477
478
  if (itemName.startsWith("[") && itemName.endsWith("]")) {
478
479
  const destructuredNames = itemName.slice(1, -1).split(",").map((n) => n.trim());
@@ -12,6 +12,7 @@ const COMPONENT_MAPPING = {
12
12
  video: "Video",
13
13
  map: "Map",
14
14
  mappolyline: "MapPolyline",
15
+ mappolygon: "MapPolygon",
15
16
  mapmarker: "MapMarker",
16
17
  input: "TextInput",
17
18
  textarea: "TextInput",
@@ -503,6 +503,18 @@ const classParsers = {
503
503
  style.flexShrink = 0;
504
504
  return !0;
505
505
  },
506
+ "order-first": (_, style) => {
507
+ style.order = -9999;
508
+ return !0;
509
+ },
510
+ "order-last": (_, style) => {
511
+ style.order = 9999;
512
+ return !0;
513
+ },
514
+ "order-none": (_, style) => {
515
+ style.order = 0;
516
+ return !0;
517
+ },
506
518
  "justify-start": (_, style) => {
507
519
  style.justifyContent = "flex-start";
508
520
  return !0;
@@ -1303,6 +1315,11 @@ export function compileHeadwindToStyle(classes, unknown) {
1303
1315
  continue;
1304
1316
  if (parseGridColumns(className, style))
1305
1317
  continue;
1318
+ const order = /^order-\[(-?\d+)\]$/.exec(className) ?? /^order-(-?\d+)$/.exec(className);
1319
+ if (order) {
1320
+ style.order = Number(order[1]);
1321
+ continue;
1322
+ }
1306
1323
  if (parsePosition(className, style))
1307
1324
  continue;
1308
1325
  if (parseTranslation(className, style))
@@ -66,6 +66,7 @@ const NATIVE_TYPES = new Set([
66
66
  "Video",
67
67
  "Map",
68
68
  "MapPolyline",
69
+ "MapPolygon",
69
70
  "MapMarker",
70
71
  "FlatList",
71
72
  "SectionList",
@@ -16,6 +16,7 @@ const STYLE_KEYS = new Set([
16
16
  "flexBasis",
17
17
  "flexDirection",
18
18
  "flexWrap",
19
+ "order",
19
20
  "justifyContent",
20
21
  "alignItems",
21
22
  "alignSelf",
@@ -102,6 +103,7 @@ const STYLE_KEYS = new Set([
102
103
  "flex",
103
104
  "flexGrow",
104
105
  "flexShrink",
106
+ "order",
105
107
  "zIndex",
106
108
  "aspectRatio",
107
109
  "gap",
@@ -54,6 +54,7 @@ export declare interface STXStyle {
54
54
  flexBasis?: number | string
55
55
  flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
56
56
  flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse'
57
+ order?: number
57
58
  justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'
58
59
  alignItems?: 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'
59
60
  alignSelf?: 'auto' | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'
@@ -215,6 +216,7 @@ export type STXComponentType = | 'Sidebar'
215
216
  | 'Video'
216
217
  | 'Map'
217
218
  | 'MapPolyline'
219
+ | 'MapPolygon'
218
220
  | 'MapMarker'
219
221
  // Lists
220
222
  | 'FlatList'
@@ -23,6 +23,7 @@ export declare const ComponentRegistry: {
23
23
  Video: 'Video';
24
24
  Map: 'Map';
25
25
  MapPolyline: 'MapPolyline';
26
+ MapPolygon: 'MapPolygon';
26
27
  MapMarker: 'MapMarker';
27
28
  FlatList: 'FlatList';
28
29
  SectionList: 'SectionList';
@@ -57,6 +58,7 @@ export declare interface AccessibilityState {
57
58
  // ============================================================================
58
59
  export declare interface ViewProps extends BaseProps {
59
60
  onPress?: () => void
61
+ onClick?: () => void
60
62
  onLongPress?: () => void
61
63
  onLayout?: (event: LayoutEvent) => void
62
64
  }
@@ -68,8 +70,10 @@ export declare interface ScrollViewProps extends ViewProps {
68
70
  alwaysBounceHorizontal?: boolean
69
71
  alwaysBounceVertical?: boolean
70
72
  onScroll?: (event: ScrollEvent) => void
71
- onScrollEndDrag?: () => void
72
- onMomentumScrollEnd?: () => void
73
+ onScrollBeginDrag?: (event: ScrollEvent) => void
74
+ onScrollEndDrag?: (event: ScrollEvent) => void
75
+ onMomentumScrollBegin?: (event: ScrollEvent) => void
76
+ onMomentumScrollEnd?: (event: ScrollEvent) => void
73
77
  contentContainerStyle?: STXStyle
74
78
  keyboardDismissMode?: 'none' | 'on-drag' | 'interactive'
75
79
  keyboardShouldPersistTaps?: 'always' | 'handled' | 'never'
@@ -94,6 +98,7 @@ export declare interface TextProps extends BaseProps {
94
98
  ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip'
95
99
  selectable?: boolean
96
100
  onPress?: () => void
101
+ onClick?: () => void
97
102
  onLongPress?: () => void
98
103
  }
99
104
  export declare interface TextInputProps extends BaseProps {
@@ -128,6 +133,7 @@ export declare interface TextInputProps extends BaseProps {
128
133
  export declare interface ButtonProps extends BaseProps {
129
134
  title?: string
130
135
  onPress?: () => void
136
+ onClick?: () => void
131
137
  disabled?: boolean
132
138
  color?: string
133
139
  }
@@ -137,6 +143,7 @@ export declare interface LinkProps extends BaseProps {
137
143
  to?: string
138
144
  title?: string
139
145
  onPress?: () => void
146
+ onClick?: () => void
140
147
  disabled?: boolean
141
148
  color?: string
142
149
  }
@@ -231,8 +238,6 @@ export declare interface ImageProps extends BaseProps {
231
238
  onLoadStart?: () => void
232
239
  onLoadEnd?: () => void
233
240
  onError?: (event: ImageErrorEvent) => void
234
- blurRadius?: number
235
- fadeDuration?: number
236
241
  defaultSource?: ImageSource
237
242
  }
238
243
  export declare interface ImageErrorEvent {
@@ -290,6 +295,21 @@ export declare interface MapRegion {
290
295
  center: MapCoordinate
291
296
  span: { latitudeDelta: number; longitudeDelta: number }
292
297
  }
298
+ /** A keyed polyline overlay for large map collections. */
299
+ export declare interface MapPolylineOverlay {
300
+ id: string
301
+ geometry: number[]
302
+ strokeColor?: string
303
+ strokeWidth?: number
304
+ }
305
+ /** A keyed marker overlay for large map collections. */
306
+ export declare interface MapMarkerOverlay {
307
+ id: string
308
+ geometry: number[]
309
+ title?: string
310
+ pinColor?: string
311
+ bearing?: number
312
+ }
293
313
  export declare interface MapProps extends BaseProps {
294
314
  region?: MapRegion
295
315
  initialRegion?: MapRegion
@@ -301,11 +321,13 @@ export declare interface MapProps extends BaseProps {
301
321
  zoomEnabled?: boolean
302
322
  rotateEnabled?: boolean
303
323
  pitchEnabled?: boolean
304
- mapType?: 'standard' | 'satellite' | 'hybrid' | 'terrain'
324
+ mapType?: 'standard' | 'satellite' | 'hybrid'
305
325
  showsCompass?: boolean
306
326
  showsScale?: boolean
307
327
  cameraPitch?: number
308
328
  cameraHeading?: number
329
+ polylines?: MapPolylineOverlay[]
330
+ markers?: MapMarkerOverlay[]
309
331
  onPress?: (event: { nativeEvent: MapCoordinate }) => void
310
332
  onRegionChangeComplete?: (event: { nativeEvent: MapRegion & { heading: number, pitch: number } }) => void
311
333
  onMarkerPress?: (event: { nativeEvent: { id: string } }) => void
@@ -315,6 +337,12 @@ export declare interface MapPolylineProps extends BaseProps {
315
337
  strokeColor?: string
316
338
  strokeWidth?: number
317
339
  }
340
+ export declare interface MapPolygonProps extends BaseProps {
341
+ geometry: number[]
342
+ fillColor?: string
343
+ strokeColor?: string
344
+ strokeWidth?: number
345
+ }
318
346
  export declare interface MapMarkerProps extends BaseProps {
319
347
  geometry: number[]
320
348
  id: string
@@ -350,7 +378,6 @@ export declare interface ModalProps extends BaseProps {
350
378
  onRequestClose?: () => void
351
379
  onShow?: () => void
352
380
  onDismiss?: () => void
353
- statusBarTranslucent?: boolean
354
381
  }
355
382
  export declare interface ActivityIndicatorProps extends BaseProps {
356
383
  animating?: boolean
@@ -363,10 +390,7 @@ export declare interface ActivityIndicatorProps extends BaseProps {
363
390
  // ============================================================================
364
391
  export declare interface StatusBarProps {
365
392
  barStyle?: 'default' | 'light-content' | 'dark-content'
366
- backgroundColor?: string
367
393
  hidden?: boolean
368
- animated?: boolean
369
- translucent?: boolean
370
394
  }
371
395
  export declare interface RefreshControlProps {
372
396
  refreshing: boolean
@@ -21,6 +21,7 @@ export const ComponentRegistry = {
21
21
  Video: "Video",
22
22
  Map: "Map",
23
23
  MapPolyline: "MapPolyline",
24
+ MapPolygon: "MapPolygon",
24
25
  MapMarker: "MapMarker",
25
26
  FlatList: "FlatList",
26
27
  SectionList: "SectionList",
@@ -0,0 +1,2 @@
1
+ {{-- MapPolygon: a native map overlay carrying flat coordinate geometry. --}}
2
+ <div data-native="MapPolygon"></div>
@@ -14,13 +14,11 @@ const NATIVE_PROP_NAMES = [
14
14
  "autoComplete",
15
15
  "autoCorrect",
16
16
  "autoFocus",
17
- "blurRadius",
18
17
  "contentContainerStyle",
19
18
  "currentTime",
20
19
  "defaultSource",
21
20
  "defaultValue",
22
21
  "ellipsizeMode",
23
- "fadeDuration",
24
22
  "hidesWhenStopped",
25
23
  "hitSlop",
26
24
  "imageStyle",
@@ -64,7 +62,6 @@ const NATIVE_PROP_NAMES = [
64
62
  "selectionColor",
65
63
  "showsHorizontalScrollIndicator",
66
64
  "showsVerticalScrollIndicator",
67
- "statusBarTranslucent",
68
65
  "stickyHeaderIndices",
69
66
  "testID",
70
67
  "textContentType",
@@ -83,6 +80,7 @@ const NATIVE_PROP_NAMES = [
83
80
  "rotateEnabled",
84
81
  "pitchEnabled",
85
82
  "mapType",
83
+ "fillColor",
86
84
  "strokeColor",
87
85
  "pinColor",
88
86
  "showsCompass",
@@ -48,6 +48,7 @@ function capabilityFlags(capabilities) {
48
48
  deviceInfo: capabilities.has("device"),
49
49
  fetch: capabilities.has("fetch"),
50
50
  badge: capabilities.has("badge"),
51
+ wallet: capabilities.has("wallet"),
51
52
  appReview: !1,
52
53
  health: capabilities.has("health"),
53
54
  dialogs: capabilities.has("dialog"),
@@ -561,7 +562,21 @@ export function installCraftBridge(protocol, nativeBridge, target = globalThis,
561
562
  saveMindfulSession: (session) => request("Health", "saveMindfulSession", [session]),
562
563
  getMindfulSessions: (options = {}) => request("Health", "getMindfulSessions", [options]),
563
564
  startHeartRateUpdates: (options = {}) => request("Health", "startHeartRateUpdates", [{ since: typeof options.since === "number" ? options.since : null }]),
564
- stopHeartRateUpdates: () => request("Health", "stopHeartRateUpdates", [{}])
565
+ stopHeartRateUpdates: () => request("Health", "stopHeartRateUpdates", [{}]),
566
+ startWorkout: (options = {}) => request("Health", "startWorkout", [{
567
+ type: typeof options.type === "string" ? options.type : "",
568
+ ...typeof options.location === "string" ? { location: options.location } : {}
569
+ }]),
570
+ pauseWorkout: () => request("Health", "pauseWorkout", []),
571
+ resumeWorkout: () => request("Health", "resumeWorkout", []),
572
+ endWorkout: () => request("Health", "endWorkout", []),
573
+ onWorkout: (callback) => {
574
+ if (typeof callback !== "function")
575
+ throw TypeError("health.onWorkout needs a function");
576
+ const handler = (event) => callback(event.detail || {});
577
+ target.addEventListener?.("craftHealthWorkout", handler);
578
+ return () => target.removeEventListener?.("craftHealthWorkout", handler);
579
+ }
565
580
  };
566
581
  if (capabilities.has("healthAvailability")) {
567
582
  craft.health.availability = () => request("Health", "availability", []);
@@ -569,6 +584,12 @@ export function installCraftBridge(protocol, nativeBridge, target = globalThis,
569
584
  craft.health.openSettings = () => ask("Health", "openSettings", []).then(Boolean);
570
585
  }
571
586
  }
587
+ if (capabilities.has("wallet"))
588
+ craft.wallet = {
589
+ isAvailable: () => request("Wallet", "isAvailable", []).then(Boolean),
590
+ add: (source) => request("Wallet", "add", [source]).then(Boolean),
591
+ has: (serialNumber) => request("Wallet", "has", [serialNumber]).then(Boolean)
592
+ };
572
593
  craft.scheduleNotification = craft.notifications.schedule;
573
594
  craft.cancelNotification = craft.notifications.cancel;
574
595
  craft.cancelAllNotifications = craft.notifications.cancelAll;
@@ -237,10 +237,20 @@ export declare interface NativeCraft {
237
237
  getMindfulSessions: (options?: { startDate?: number, endDate?: number, limit?: number }) => Promise<Array<Record<string, unknown>>>
238
238
  startHeartRateUpdates: (options?: { since?: number }) => Promise<boolean>
239
239
  stopHeartRateUpdates: () => Promise<boolean>
240
+ startWorkout: (options: { type: string, location?: 'indoor' | 'outdoor' | 'unknown' }) => Promise<{ id: string, type: string, startDate: number }>
241
+ pauseWorkout: () => Promise<boolean>
242
+ resumeWorkout: () => Promise<boolean>
243
+ endWorkout: () => Promise<{ id: string, workoutId: string, endDate: number, durationSeconds: number }>
244
+ onWorkout: (callback: (event: Record<string, unknown>) => unknown) => () => void
240
245
  availability?: () => Promise<'available' | 'updateRequired' | 'unavailable'>
241
246
  grantedTypes?: () => Promise<string[]>
242
247
  openSettings?: () => Promise<boolean>
243
248
  }
249
+ wallet?: {
250
+ isAvailable: () => Promise<boolean>
251
+ add: (source: { data?: string, url?: string }) => Promise<boolean>
252
+ has: (serialNumber: string) => Promise<boolean>
253
+ }
244
254
  scheduledWorkouts?: {
245
255
  isSupported: () => Promise<boolean>
246
256
  authorization: () => Promise<'authorized' | 'denied' | 'notDetermined' | 'restricted' | 'unsupported'>
package/dist/process.js CHANGED
@@ -628,8 +628,9 @@ ${joined}` : joined;
628
628
  ${output}`;
629
629
  return unmaskHtmlComments(output);
630
630
  } catch (error) {
631
- errorLogger.log(error instanceof Error ? error : Error(String(error)), { layoutPath, filePath }, "error");
632
- return `[Error processing layout: ${error instanceof Error ? error.message : String(error)}]`;
631
+ if (error instanceof StxValidationError)
632
+ throw error;
633
+ throw new StxRuntimeError(`Error processing layout ${layoutPath}: ${error instanceof Error ? error.message : String(error)}`, filePath);
633
634
  }
634
635
  return unmaskHtmlComments(await processOtherDirectives(output, context, filePath, resolvedOptions, dependencies));
635
636
  }
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{er,Ve,ri,uc}from"./chunk-tbsjg23k.js";import{Qn,os,ac,cc,lc}from"./chunk-81qmj3sd.js";import{ei,ti,ni,oc,ic}from"./chunk-tydv84gj.js";import{le,kt,is}from"./chunk-dmdhbwmn.js";import{pl,fl,gl,ml,Ar,Nd}from"./chunk-5s47qfp6.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-pghtgep5.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{nr,Ue,oi,pc}from"./chunk-970j89r5.js";import{tr,as,lc,dc,uc}from"./chunk-6w0h6vpd.js";import{ni,ri,si,ac,cc}from"./chunk-34tbh570.js";import{de,_t,cs}from"./chunk-58s20ceb.js";import{fl,gl,ml,hl,Ir,Mu}from"./chunk-zsqfvwwf.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-7ed685cs.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=le(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=er(n,t);if(a){let s=Ve(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 os(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,ti as auditBuildOutput,ei as auditConfig,re as buildPwaAssets,ni as calculateAuditResult,ic as formatAuditResult,is as formatSize,j as generateManifest,_ as generateManifestJson,cc as generateManifestLink,F as generateOfflinePage,le as generatePrecacheManifest,kt as generatePrecacheManifestJs,M as generatePwaIcons,Qn as generatePwaTags,er as generateServiceWorker,uc as generateServiceWorkerAuto,ac as generateSwRegistrationScript,lc as generateThemeColorMeta,N as getExpectedIconPaths,Ve as getServiceWorkerFileName,os as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,ri as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Ar as pwaDirectives,pl as pwaInstallDirective,gl as pwaOfflineDirective,ml as pwaPushDirective,fl as pwaUpdateDirective,Nd as registerPwaDirectives,oc 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=de(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=nr(n,t);if(a){let s=Ue(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 as(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,ri as auditBuildOutput,ni as auditConfig,re as buildPwaAssets,si as calculateAuditResult,cc as formatAuditResult,cs as formatSize,j as generateManifest,_ as generateManifestJson,dc as generateManifestLink,F as generateOfflinePage,de as generatePrecacheManifest,_t as generatePrecacheManifestJs,M as generatePwaIcons,tr as generatePwaTags,nr as generateServiceWorker,pc as generateServiceWorkerAuto,lc as generateSwRegistrationScript,uc as generateThemeColorMeta,N as getExpectedIconPaths,Ue as getServiceWorkerFileName,as as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,oi as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,Ir as pwaDirectives,fl as pwaInstallDirective,ml as pwaOfflineDirective,hl as pwaPushDirective,gl as pwaUpdateDirective,Mu as registerPwaDirectives,ac as runPwaAudit,D as validateManifest};
@@ -64,6 +64,22 @@ export declare function sanitizeExpression(expression: string): string;
64
64
  /**
65
65
  * Create a safer context object that only exposes safe properties
66
66
  */
67
+ /**
68
+ * Where a loop keeps the sanitized copies of the objects its iterations share.
69
+ *
70
+ * Every condition and expression builds a safe context, and building one deep-
71
+ * copies each object in scope. Inside `@foreach` that scope is the page's: an
72
+ * `@if` per row of a 2,287-file commit copied the commit - all 2,287 files of
73
+ * it - once per row, five million objects for one page and eight seconds of a
74
+ * server that does nothing else meanwhile (ReviewOS, 2026-10-20). The rows
75
+ * share those objects, so a loop keeps one copy of each for its duration.
76
+ *
77
+ * A symbol, so it rides along in `{ ...context }` to nested loops and stays out
78
+ * of `Object.entries`, which is what reaches templates. Scoped to the loop
79
+ * rather than the process, so an object changed between requests is never
80
+ * served from an old copy.
81
+ */
82
+ export declare const SANITIZE_CACHE: unique symbol;
67
83
  export declare function createSafeContext(context: Record<string, unknown>): Record<string, unknown>;
68
84
  /**
69
85
  * Safely evaluate an expression with the given context
@@ -291,8 +291,9 @@ export function sanitizeExpression(expression) {
291
291
  prepareExpression(expression);
292
292
  return expression.trim();
293
293
  }
294
+ export const SANITIZE_CACHE = Symbol("stx.sanitizeCache");
294
295
  export function createSafeContext(context) {
295
- const safeContext = {};
296
+ const safeContext = {}, cache = context[SANITIZE_CACHE];
296
297
  safeContext.Math = Math;
297
298
  safeContext.JSON = JSON;
298
299
  safeContext.Date = Date;
@@ -310,9 +311,14 @@ export function createSafeContext(context) {
310
311
  for (const [key, value] of Object.entries(context)) {
311
312
  if (key.startsWith("__") || DANGEROUS_PATTERNS.some((p) => p.test(key)))
312
313
  continue;
313
- if (value && typeof value === "object" && !Array.isArray(value))
314
- safeContext[key] = sanitizeObject(value);
315
- else
314
+ if (value && typeof value === "object" && !Array.isArray(value)) {
315
+ let sanitized = cache?.get(value);
316
+ if (sanitized === void 0) {
317
+ sanitized = sanitizeObject(value);
318
+ cache?.set(value, sanitized);
319
+ }
320
+ safeContext[key] = sanitized;
321
+ } else
316
322
  safeContext[key] = value;
317
323
  }
318
324
  return safeContext;
@@ -1,5 +1,6 @@
1
1
  import { contentKey, renderMemo } from "./render-memo.js";
2
2
  import { stripCommentsAndLiterals } from "./strip-literals.js";
3
+ import { StxValidationError } from "./errors/types.js";
3
4
  const verdicts = renderMemo(256);
4
5
  export const PROHIBITED_DOM_PATTERNS = [
5
6
  {
@@ -215,7 +216,7 @@ export function validateClientScript(content, filePath, strict, originFilePath)
215
216
  const memoKey = contentKey(content, filePath, originFilePath, JSON.stringify(strictConfig)), remembered = verdicts.get(memoKey);
216
217
  if (remembered !== void 0) {
217
218
  if (remembered && strictConfig.failOnViolation)
218
- throw Error(remembered);
219
+ throw new StxValidationError(remembered, originFilePath ?? filePath);
219
220
  return;
220
221
  }
221
222
  const allowPatterns = strictConfig.allowPatterns ?? [], suppressed = parseStrictIgnores(content), errors = [], scannable = stripCommentsAndLiterals(content.replace(/\{\{--[\s\S]*?--\}\}/g, (match) => match.replace(/[^\n]/g, " ")));
@@ -257,8 +258,7 @@ ${errors.join(`
257
258
  `)}
258
259
  Tip: prefer useRef(), navigate(), and composables for component code`;
259
260
  verdicts.set(memoKey, baseMessage);
261
+ console.warn(baseMessage);
260
262
  if (strictConfig.failOnViolation)
261
- throw Error(baseMessage);
262
- else
263
- console.warn(baseMessage);
263
+ throw new StxValidationError(baseMessage, originFilePath ?? filePath);
264
264
  }