@stacksjs/stx 0.2.342 → 0.2.344

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 (185) hide show
  1. package/dist/binding-manifest.d.ts +32 -0
  2. package/dist/binding-manifest.js +64 -0
  3. package/dist/caching.js +1 -0
  4. package/dist/chunk-020hpw7m.js +2 -0
  5. package/dist/{chunk-5g9vbhbt.js → chunk-05zfez2g.js} +1 -1
  6. package/dist/{chunk-6nvm939g.js → chunk-0k1mtwby.js} +1 -1
  7. package/dist/chunk-1bct7pfj.js +2 -0
  8. package/dist/{chunk-xec226zb.js → chunk-1c9453w0.js} +1 -1
  9. package/dist/chunk-1exk54qt.js +2 -0
  10. package/dist/{chunk-r46cg4qa.js → chunk-1vt1h19d.js} +1 -1
  11. package/dist/{chunk-cqw3c1xg.js → chunk-1yh6pq6b.js} +1 -1
  12. package/dist/{chunk-0sq5mdrh.js → chunk-34f8c48f.js} +1 -1
  13. package/dist/chunk-39qy76ek.js +2 -0
  14. package/dist/{chunk-hrmxxs0w.js → chunk-3n8avn17.js} +1 -1
  15. package/dist/chunk-3xpk99z4.js +3 -0
  16. package/dist/{chunk-4wpxbkbe.js → chunk-4kbaky4w.js} +1 -1
  17. package/dist/{chunk-c33y19bn.js → chunk-59906baj.js} +1 -1
  18. package/dist/chunk-5apmxb4e.js +2 -0
  19. package/dist/{chunk-j82hfkcf.js → chunk-5atmahe4.js} +319 -321
  20. package/dist/{chunk-mkgbrbr9.js → chunk-5yhv1pe5.js} +1 -1
  21. package/dist/{chunk-p52cm7ch.js → chunk-64n10kpa.js} +1 -1
  22. package/dist/{chunk-anf2y2h5.js → chunk-6h3r8v55.js} +1 -1
  23. package/dist/chunk-6z9pm31g.js +2 -0
  24. package/dist/{chunk-25f0s8t1.js → chunk-72x5v5an.js} +1 -1
  25. package/dist/{chunk-wv8h3d68.js → chunk-72x62kch.js} +2 -2
  26. package/dist/chunk-7d2gfyk8.js +2 -0
  27. package/dist/{chunk-s4mmmwj4.js → chunk-7h9fajgs.js} +1 -1
  28. package/dist/{chunk-gwc54hjc.js → chunk-7kcfbc0j.js} +2 -2
  29. package/dist/{chunk-74r1zw2h.js → chunk-7qp3zphs.js} +1 -1
  30. package/dist/{chunk-1xwfws06.js → chunk-7t6h8crt.js} +2 -2
  31. package/dist/{chunk-sytwy0mg.js → chunk-86c461ca.js} +1 -1
  32. package/dist/chunk-86q2h34b.js +2 -0
  33. package/dist/{chunk-25b8z7xa.js → chunk-89mqnh67.js} +1 -1
  34. package/dist/{chunk-k5b9471y.js → chunk-8cc4vdkh.js} +1 -1
  35. package/dist/chunk-8tjg4wbr.js +2 -0
  36. package/dist/{chunk-1gwbw81h.js → chunk-8v2k21n4.js} +1 -1
  37. package/dist/{chunk-rh7mwwb4.js → chunk-8y1ve8tc.js} +2 -2
  38. package/dist/chunk-94sxzp5x.js +2 -0
  39. package/dist/{chunk-mznr9nyp.js → chunk-99b5tfxc.js} +1 -1
  40. package/dist/{chunk-saqbtgqr.js → chunk-9jbssgem.js} +197 -88
  41. package/dist/{chunk-yr7camcd.js → chunk-9nrgjtah.js} +1 -1
  42. package/dist/chunk-9p5gbhwp.js +2 -0
  43. package/dist/chunk-9yqt0nf2.js +2 -0
  44. package/dist/{chunk-ebd3z4j9.js → chunk-a1ghxrb1.js} +1 -1
  45. package/dist/chunk-a29x23g7.js +2 -0
  46. package/dist/chunk-at622hg0.js +2 -0
  47. package/dist/{chunk-bt8w146r.js → chunk-avwywzsj.js} +2 -2
  48. package/dist/{chunk-m39hb2a2.js → chunk-b5hank5e.js} +1 -1
  49. package/dist/{chunk-ts3wfjh9.js → chunk-bk1zb1xp.js} +1 -1
  50. package/dist/{chunk-ytx17bg2.js → chunk-bpb3xkg4.js} +1 -1
  51. package/dist/{chunk-01ggk8k8.js → chunk-bqdfbwdf.js} +1 -1
  52. package/dist/{chunk-yzv702kk.js → chunk-c30qnb6z.js} +1 -1
  53. package/dist/chunk-cappe4hd.js +2 -0
  54. package/dist/{chunk-drs93sry.js → chunk-cdq28mek.js} +1 -1
  55. package/dist/chunk-cmccdayf.js +2 -0
  56. package/dist/chunk-csv48xrx.js +2 -0
  57. package/dist/{chunk-e0kzyf1g.js → chunk-d86q27j8.js} +1 -1
  58. package/dist/{chunk-yhvrq2qd.js → chunk-dgv43ccd.js} +1 -1
  59. package/dist/{chunk-yq7fc8sa.js → chunk-dsztk2kp.js} +1 -1
  60. package/dist/{chunk-ys56ecvx.js → chunk-dx2s51rr.js} +1 -1
  61. package/dist/{chunk-mbstfjnj.js → chunk-dxkjvajv.js} +1 -1
  62. package/dist/chunk-e4yskgtb.js +2 -0
  63. package/dist/{chunk-8tsr51hj.js → chunk-e631svvs.js} +1 -1
  64. package/dist/{chunk-3b0mgxbk.js → chunk-e7np0h2q.js} +1 -1
  65. package/dist/chunk-efx05ah0.js +2 -0
  66. package/dist/{chunk-p5d8sb50.js → chunk-ejqpq0wc.js} +1 -1
  67. package/dist/chunk-erb294sv.js +2 -0
  68. package/dist/{chunk-k3w3gwm3.js → chunk-evfr2zgg.js} +1 -1
  69. package/dist/chunk-ewpbxy5m.js +2 -0
  70. package/dist/chunk-fs2t4rs3.js +33 -0
  71. package/dist/{chunk-ghd80w8a.js → chunk-g28fs4aa.js} +2 -2
  72. package/dist/chunk-gmm82dst.js +2 -0
  73. package/dist/{chunk-kznb3hdj.js → chunk-gsc2vds7.js} +1 -1
  74. package/dist/chunk-hke0k33t.js +2 -0
  75. package/dist/{chunk-da0tfpa2.js → chunk-hsbbfp0c.js} +1 -1
  76. package/dist/chunk-j5qygdy9.js +2 -0
  77. package/dist/{chunk-c73pyeak.js → chunk-jekrtm2j.js} +1 -1
  78. package/dist/chunk-jzfk5ect.js +2 -0
  79. package/dist/{chunk-rr49zrz6.js → chunk-kfkf9v2d.js} +1 -1
  80. package/dist/chunk-kq30wqp6.js +2 -0
  81. package/dist/{chunk-ntm1761b.js → chunk-krfx5562.js} +10 -10
  82. package/dist/{chunk-48x5bsqv.js → chunk-kw9cgyfc.js} +1 -1
  83. package/dist/{chunk-evtrctj9.js → chunk-m2j5skez.js} +1 -1
  84. package/dist/{chunk-q4cemvkw.js → chunk-mph46gkj.js} +1 -1
  85. package/dist/{chunk-k9ep24bd.js → chunk-mpyjnwje.js} +1 -1
  86. package/dist/{chunk-y956wapy.js → chunk-msywnv5n.js} +1 -1
  87. package/dist/{chunk-d389vyyz.js → chunk-mvat8js5.js} +2 -2
  88. package/dist/{chunk-gkq323fg.js → chunk-mz4breg8.js} +1 -1
  89. package/dist/{chunk-reskzmsb.js → chunk-n5657hm3.js} +1 -1
  90. package/dist/{chunk-4ecv1e3w.js → chunk-nexpxxsa.js} +1 -1
  91. package/dist/{chunk-1t3j8a0q.js → chunk-njx93b4z.js} +1 -1
  92. package/dist/{chunk-fx29n4vc.js → chunk-nm60wh6r.js} +1 -1
  93. package/dist/{chunk-thrv2nbz.js → chunk-ppzz953j.js} +1 -1
  94. package/dist/chunk-q5gzpn1n.js +2 -0
  95. package/dist/{chunk-fm5211ec.js → chunk-rwwfzkz4.js} +1 -1
  96. package/dist/chunk-san1eq0r.js +7 -0
  97. package/dist/chunk-tc4pj651.js +64 -0
  98. package/dist/chunk-tscr6bs8.js +2 -0
  99. package/dist/{chunk-jcbj3xp4.js → chunk-tthrw91n.js} +1 -1
  100. package/dist/{chunk-6nxq8rcw.js → chunk-v6e35j4g.js} +1 -1
  101. package/dist/{chunk-byjy9far.js → chunk-v7aa7v85.js} +1 -1
  102. package/dist/{chunk-r1rfwm01.js → chunk-vhta1be7.js} +1 -1
  103. package/dist/{chunk-hnffkdzc.js → chunk-w5j9tbsk.js} +1 -1
  104. package/dist/{chunk-567g1ttv.js → chunk-wfwj4390.js} +1 -1
  105. package/dist/{chunk-x7dv5rq7.js → chunk-wj21f1e0.js} +1 -1
  106. package/dist/{chunk-tmj45xq5.js → chunk-ws0282jr.js} +1 -1
  107. package/dist/chunk-x054qzma.js +2 -0
  108. package/dist/{chunk-4vcyf1kh.js → chunk-xh9paa2g.js} +2 -2
  109. package/dist/{chunk-f2qbjr3z.js → chunk-xj6bcwqa.js} +1 -1
  110. package/dist/{chunk-hk8j3eps.js → chunk-xvh1k1a4.js} +1 -1
  111. package/dist/{chunk-1spzqjve.js → chunk-y2f41kaq.js} +1 -1
  112. package/dist/{chunk-2swnc8kg.js → chunk-y6xzr30x.js} +1 -1
  113. package/dist/{chunk-beextc84.js → chunk-yg5r7bnm.js} +2 -2
  114. package/dist/{chunk-gbkq5qnw.js → chunk-zkwk82ss.js} +2 -2
  115. package/dist/chunk-zkxnarrh.js +2 -0
  116. package/dist/chunk-zp14ksx1.js +2 -0
  117. package/dist/{chunk-zv4nf0x2.js → chunk-zwhnkxgy.js} +1 -1
  118. package/dist/cli.js +14 -14
  119. package/dist/craft-entry.js +1 -1
  120. package/dist/craft.js +1 -1
  121. package/dist/custom-directives.js +21 -8
  122. package/dist/database.js +1 -1
  123. package/dist/directive-arguments.d.ts +107 -0
  124. package/dist/directive-arguments.js +171 -0
  125. package/dist/expressions.d.ts +1 -1
  126. package/dist/expressions.js +15 -3
  127. package/dist/head.d.ts +7 -30
  128. package/dist/head.js +15 -5
  129. package/dist/includes.js +2 -2
  130. package/dist/meta-arguments.d.ts +52 -0
  131. package/dist/meta-arguments.js +55 -0
  132. package/dist/process.js +1 -1
  133. package/dist/pwa.js +2 -2
  134. package/dist/runtime-globals.d.ts +22 -0
  135. package/dist/runtime-globals.js +46 -0
  136. package/dist/seo.d.ts +39 -17
  137. package/dist/seo.js +221 -255
  138. package/dist/signals.js +193 -84
  139. package/dist/slots.js +3 -3
  140. package/dist/ssg.js +2 -2
  141. package/dist/theme-tokens.d.ts +59 -0
  142. package/dist/theme-tokens.js +77 -17
  143. package/dist/ts-css-config.js +4 -2
  144. package/dist/types/directive-types.d.ts +12 -0
  145. package/dist/utils.d.ts +10 -0
  146. package/dist/utils.js +77 -12
  147. package/dist/variable-extractor.d.ts +1 -1
  148. package/dist/variable-extractor.js +23 -3
  149. package/dist/visual-testing.js +1 -1
  150. package/package.json +5 -5
  151. package/dist/chunk-025z2btp.js +0 -2
  152. package/dist/chunk-19fp0z9s.js +0 -2
  153. package/dist/chunk-23sv24cm.js +0 -2
  154. package/dist/chunk-2p68bkza.js +0 -2
  155. package/dist/chunk-5grrqaqs.js +0 -2
  156. package/dist/chunk-6jx4r94x.js +0 -2
  157. package/dist/chunk-6p6b01kp.js +0 -4
  158. package/dist/chunk-a1rt1fms.js +0 -2
  159. package/dist/chunk-ahpmjg3f.js +0 -64
  160. package/dist/chunk-akp89n3w.js +0 -2
  161. package/dist/chunk-bqhrryqs.js +0 -2
  162. package/dist/chunk-czvzaa42.js +0 -3
  163. package/dist/chunk-de2cfcf5.js +0 -2
  164. package/dist/chunk-exhbc57n.js +0 -2
  165. package/dist/chunk-fhhp6pmx.js +0 -2
  166. package/dist/chunk-fqsrft0a.js +0 -2
  167. package/dist/chunk-gqzccw30.js +0 -2
  168. package/dist/chunk-h47e1c03.js +0 -2
  169. package/dist/chunk-kbemcvp1.js +0 -2
  170. package/dist/chunk-ks4j8fjz.js +0 -2
  171. package/dist/chunk-pbct6nxk.js +0 -2
  172. package/dist/chunk-peerbcwj.js +0 -2
  173. package/dist/chunk-pt1w6vq2.js +0 -2
  174. package/dist/chunk-rgda0gwf.js +0 -2
  175. package/dist/chunk-rwa10jm4.js +0 -2
  176. package/dist/chunk-snsh9ye4.js +0 -2
  177. package/dist/chunk-td39mtts.js +0 -2
  178. package/dist/chunk-trncnwem.js +0 -2
  179. package/dist/chunk-vk2j3vvs.js +0 -2
  180. package/dist/chunk-vph6zpeq.js +0 -2
  181. package/dist/chunk-wa3ks5zv.js +0 -2
  182. package/dist/chunk-xe93ae3r.js +0 -32
  183. package/dist/chunk-xer5kn26.js +0 -2
  184. package/dist/chunk-zv4gb3wb.js +0 -2
  185. package/dist/chunk-zx2krbqf.js +0 -2
@@ -205,6 +205,52 @@ export const RUNTIME_HANDLED_X_ATTRS = [
205
205
  export function runtimeHandledXAttrsLiteral() {
206
206
  return `{${RUNTIME_HANDLED_X_ATTRS.map((n) => `'${n}':1`).join(",")}}`;
207
207
  }
208
+ export const RUNTIME_DIRECTIVE_NAMES = [
209
+ "class",
210
+ "style",
211
+ "text",
212
+ "html",
213
+ "show",
214
+ "model",
215
+ "if",
216
+ "ref"
217
+ ];
218
+ export function runtimeDirectiveNamesLiteral() {
219
+ return `{${RUNTIME_DIRECTIVE_NAMES.map((n) => n === "if" ? "'if':1" : `${n}:1`).join(",")}}`;
220
+ }
221
+ export const RUNTIME_EVENT_NAMES = [
222
+ "click",
223
+ "dblclick",
224
+ "mousedown",
225
+ "mouseup",
226
+ "mousemove",
227
+ "mouseenter",
228
+ "mouseleave",
229
+ "keydown",
230
+ "keyup",
231
+ "keypress",
232
+ "input",
233
+ "change",
234
+ "submit",
235
+ "focus",
236
+ "blur",
237
+ "scroll",
238
+ "resize",
239
+ "touchstart",
240
+ "touchend",
241
+ "touchmove",
242
+ "contextmenu",
243
+ "wheel",
244
+ "pointerdown",
245
+ "pointerup",
246
+ "pointermove"
247
+ ];
248
+ export function runtimeEventRegexLiteral() {
249
+ return `/^(${RUNTIME_EVENT_NAMES.join("|")})/`;
250
+ }
251
+ export function isRuntimeEventName(name) {
252
+ return RUNTIME_EVENT_NAMES.some((event) => name === event || name.startsWith(`${event}.`));
253
+ }
208
254
  const BLANK_CACHE_MIN_BYTES = 65536, BLANK_CACHE_MAX_ENTRIES = 4, blankCache = new Map;
209
255
  export function clearBlankCache() {
210
256
  blankCache.clear();
package/dist/seo.d.ts CHANGED
@@ -2,10 +2,15 @@
2
2
  * SEO (Search Engine Optimization) Module
3
3
  *
4
4
  * Provides directives and utilities for generating SEO-related HTML:
5
- * - `@meta('name', 'content')` - Generate meta tags
5
+ * - `@meta('name', 'content')` / `@meta('name', expression)` - Generate meta tags
6
6
  * - `@metaTag({ name, property, content })` - Meta tags with full control
7
- * - `@structuredData({ ... })` - JSON-LD structured data
8
- * - `@seo({ title, description, ... })` - Comprehensive SEO generation
7
+ * - `@structuredData({ ... })` / `@structuredData(expression)` - JSON-LD structured data
8
+ * - `@seo({ title, description, ... })` / `@seo(expression)` - Comprehensive SEO generation
9
+ *
10
+ * Every argument is an expression evaluated against the template's context, so
11
+ * a variable, a spread or a function call works wherever a literal does. A
12
+ * directive that cannot produce its tag says so: an inline comment where the
13
+ * tag would have been and a console warning naming the file.
9
14
  *
10
15
  * Also provides:
11
16
  * - Automatic SEO tag injection via `injectSeoTags()`
@@ -56,21 +61,36 @@
56
61
  */
57
62
  import type { CustomDirective, StxOptions } from './types';
58
63
  /**
59
- * Process @meta directive for generating meta tags.
60
- * Supports both simple `@meta('name', 'content')` and
61
- * OpenGraph `@meta('og:title')` formats.
64
+ * Process `@meta(...)` and `@metaTag({...})` in place, emitting the tags where
65
+ * the directives sit.
66
+ *
67
+ * This is the pass a partial's directives go through (a head partial is inside
68
+ * `<head>` already), and the page-level catch-all for any `@meta` the staging
69
+ * directive did not take. Arguments are resolved by `resolveMetaArguments`:
70
+ * `@meta('author', 'Jane')`, `@meta('author', author)`,
71
+ * `@meta('og:title', post.title)`, and the one-argument `@meta('og:title')`.
62
72
  */
63
- export declare function processMetaDirectives(template: string, context: Record<string, any>, _filePath: string, _options: StxOptions): string;
73
+ export declare function processMetaDirectives(template: string, context: Record<string, any>, filePath: string, _options: StxOptions): string;
64
74
  /**
65
- * Process @structuredData directive for JSON-LD.
66
- * Automatically adds schema.org context if not provided.
75
+ * Process `@structuredData(...)` for JSON-LD.
76
+ *
77
+ * The argument is any expression that evaluates to an object, or an array of
78
+ * objects: `@structuredData({ '@type': 'Product', name })`,
79
+ * `@structuredData(product)`, `@structuredData(buildSchema(post))`. schema.org
80
+ * is filled in as the `@context` when the data has none.
67
81
  */
68
- export declare function processStructuredData(template: string, context: Record<string, any>, _filePath: string): string;
82
+ export declare function processStructuredData(template: string, context: Record<string, any>, filePath: string): string;
69
83
  /**
70
- * Process @seo directive for automatic meta tag generation.
71
- * Generates title, description, Open Graph, Twitter, and structured data tags.
84
+ * Process `@seo(...)` for title, description, Open Graph, Twitter and
85
+ * structured data tags.
86
+ *
87
+ * The argument is any expression that evaluates to an object:
88
+ * `@seo({ title, description })`, `@seo(seo)`, `@seo({ ...seo, title })`,
89
+ * `@seo(buildSeo(page))`. `null` or `undefined` from a variable that exists
90
+ * renders nothing; a variable that does not exist, a value that is not an
91
+ * object, and keys `@seo` does not read are all reported.
72
92
  */
73
- export declare function processSeoDirective(template: string, context: Record<string, any>, _filePath: string, _options: StxOptions): string;
93
+ export declare function processSeoDirective(template: string, context: Record<string, any>, filePath: string, _options: StxOptions): string;
74
94
  /**
75
95
  * Injects default SEO tags if no @seo directive is used.
76
96
  * Respects seo.enabled config and skipDefaultSeoTags option.
@@ -87,13 +107,15 @@ export declare function injectSeoTags(html: string, context: Record<string, any>
87
107
  *
88
108
  * This directive shadows `processMetaDirective` in head.ts, since custom
89
109
  * directives run first. It therefore has to do that function's job, which is
90
- * why it resolves unquoted arguments from the context and separates `property`
91
- * from `name` here rather than leaving it to a later pass that will never see
92
- * the directive.
110
+ * why it takes its arguments as written (`rawParams`) and resolves them with
111
+ * the same `resolveMetaArguments` the other two @meta passes use: a quoted
112
+ * value is text, anything else is an expression.
93
113
  */
94
114
  export declare const metaDirective: CustomDirective;
95
115
  /**
96
- * SEO structured data directive for JSON-LD generation
116
+ * SEO structured data directive for JSON-LD generation, the block form:
117
+ * `@structuredData { ... } @endstructuredData`. The body is JSON, not an
118
+ * expression; `@structuredData(expression)` is the form that reads variables.
97
119
  */
98
120
  export declare const structuredDataDirective: CustomDirective;
99
121
  /**