@stacksjs/stx 0.1.16 → 0.2.3

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 (277) hide show
  1. package/dist/a11y.d.ts +109 -5
  2. package/dist/analytics.d.ts +40 -0
  3. package/dist/animation.d.ts +91 -1
  4. package/dist/app.d.ts +51 -0
  5. package/dist/ast.d.ts +286 -0
  6. package/dist/async-components.d.ts +101 -0
  7. package/dist/auth.d.ts +1 -3
  8. package/dist/browser-composables.d.ts +314 -0
  9. package/dist/build-optimizer.d.ts +126 -0
  10. package/dist/build-views.d.ts +37 -0
  11. package/dist/bundle-analyzer/collector.d.ts +66 -0
  12. package/dist/bundle-analyzer/index.d.ts +60 -0
  13. package/dist/bundle-analyzer/report.d.ts +39 -0
  14. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  15. package/dist/bundle-analyzer.js +499 -0
  16. package/dist/caching.d.ts +7 -0
  17. package/dist/cli.js +10885 -1203
  18. package/dist/client/directive.d.ts +10 -0
  19. package/dist/client/index.d.ts +7 -0
  20. package/dist/client/router.d.ts +36 -0
  21. package/dist/client/stx-router.browser.d.ts +0 -0
  22. package/dist/client-script.d.ts +22 -0
  23. package/dist/component-hmr.d.ts +120 -0
  24. package/dist/components.d.ts +23 -1
  25. package/dist/composables/index.d.ts +277 -0
  26. package/dist/composables/use-battery.d.ts +46 -0
  27. package/dist/composables/use-broadcast-channel.d.ts +58 -0
  28. package/dist/composables/use-clipboard.d.ts +34 -0
  29. package/dist/composables/use-cookie.d.ts +70 -0
  30. package/dist/composables/use-device-orientation.d.ts +109 -0
  31. package/dist/composables/use-event-source.d.ts +77 -0
  32. package/dist/composables/use-eye-dropper.d.ts +107 -0
  33. package/dist/composables/use-fetch.d.ts +84 -0
  34. package/dist/composables/use-fullscreen.d.ts +47 -0
  35. package/dist/composables/use-geolocation.d.ts +62 -0
  36. package/dist/composables/use-idle.d.ts +84 -0
  37. package/dist/composables/use-intersection-observer.d.ts +81 -0
  38. package/dist/composables/use-keyboard.d.ts +100 -0
  39. package/dist/composables/use-media-query.d.ts +56 -0
  40. package/dist/composables/use-mouse.d.ts +64 -0
  41. package/dist/composables/use-mutation-observer.d.ts +101 -0
  42. package/dist/composables/use-network.d.ts +40 -0
  43. package/dist/composables/use-notification.d.ts +89 -0
  44. package/dist/composables/use-permissions.d.ts +109 -0
  45. package/dist/composables/use-resize-observer.d.ts +60 -0
  46. package/dist/composables/use-share.d.ts +70 -0
  47. package/dist/composables/use-speech.d.ts +117 -0
  48. package/dist/composables/use-storage.d.ts +64 -0
  49. package/dist/composables/use-text-selection.d.ts +97 -0
  50. package/dist/composables/use-wake-lock.d.ts +85 -0
  51. package/dist/composables/use-websocket.d.ts +69 -0
  52. package/dist/composables/use-window.d.ts +84 -0
  53. package/dist/composables.d.ts +268 -0
  54. package/dist/composition-api.d.ts +190 -0
  55. package/dist/computed.d.ts +137 -0
  56. package/dist/conditionals.d.ts +14 -2
  57. package/dist/config.d.ts +36 -3
  58. package/dist/craft-bridge.d.ts +319 -0
  59. package/dist/craft-compiler.d.ts +229 -0
  60. package/dist/craft-components.d.ts +411 -0
  61. package/dist/craft-entry.d.ts +5 -0
  62. package/dist/craft-ssr.d.ts +134 -0
  63. package/dist/craft.js +1553 -0
  64. package/dist/csp.d.ts +229 -0
  65. package/dist/database.d.ts +407 -0
  66. package/dist/database.js +5 -0
  67. package/dist/defer.d.ts +4 -0
  68. package/dist/deploy/config-generators.d.ts +75 -0
  69. package/dist/deploy/index.d.ts +84 -0
  70. package/dist/deploy/netlify.d.ts +109 -0
  71. package/dist/dev-server/crosswind.d.ts +54 -0
  72. package/dist/dev-server/index.d.ts +7 -0
  73. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  74. package/dist/dev-server/native-window.d.ts +40 -0
  75. package/dist/dev-server/port-utils.d.ts +27 -0
  76. package/dist/dev-server/terminal-colors.d.ts +60 -0
  77. package/dist/dev-server/theme-selector.d.ts +32 -0
  78. package/dist/dev-server/types.d.ts +92 -0
  79. package/dist/dev-server.d.ts +21 -0
  80. package/dist/devtools.d.ts +142 -0
  81. package/dist/directive-api.d.ts +111 -0
  82. package/dist/dynamic-components.d.ts +14 -0
  83. package/dist/edge-runtime.d.ts +200 -0
  84. package/dist/env.d.ts +9 -0
  85. package/dist/error-boundaries.d.ts +71 -0
  86. package/dist/error-handling.d.ts +1 -101
  87. package/dist/errors/codes.d.ts +99 -0
  88. package/dist/errors/formatter.d.ts +64 -0
  89. package/dist/errors/index.d.ts +56 -0
  90. package/dist/errors/logger.d.ts +74 -0
  91. package/dist/errors/sanitizer.d.ts +43 -0
  92. package/dist/errors/types.d.ts +79 -0
  93. package/dist/events.d.ts +106 -0
  94. package/dist/expressions.d.ts +86 -11
  95. package/dist/formatter.d.ts +4 -0
  96. package/dist/forms-validation.d.ts +173 -0
  97. package/dist/forms.d.ts +157 -8
  98. package/dist/head.d.ts +225 -0
  99. package/dist/heatmap.d.ts +125 -0
  100. package/dist/hot-reload.d.ts +87 -0
  101. package/dist/hydration-runtime.d.ts +47 -0
  102. package/dist/hydration.d.ts +161 -0
  103. package/dist/i18n.d.ts +240 -4
  104. package/dist/image-optimization/build-plugin.d.ts +53 -0
  105. package/dist/image-optimization/component.d.ts +46 -0
  106. package/dist/image-optimization/directive.d.ts +30 -0
  107. package/dist/image-optimization/index.d.ts +86 -0
  108. package/dist/image-optimization/processor.d.ts +112 -0
  109. package/dist/includes.d.ts +94 -9
  110. package/dist/index.d.ts +63 -3
  111. package/dist/index.js +11604 -1318
  112. package/dist/init.d.ts +32 -2
  113. package/dist/interactive.d.ts +14 -0
  114. package/dist/internal-markdown.d.ts +22 -0
  115. package/dist/jsx-runtime.d.ts +110 -0
  116. package/dist/keep-alive.d.ts +87 -0
  117. package/dist/lazy-loader.d.ts +122 -0
  118. package/dist/loading-indicator.d.ts +40 -0
  119. package/dist/loops.d.ts +22 -1
  120. package/dist/media/client/blur-up.d.ts +65 -0
  121. package/dist/media/client/index.d.ts +77 -0
  122. package/dist/media/client/lazy-load.d.ts +73 -0
  123. package/dist/media/client/upload-handler.d.ts +79 -0
  124. package/dist/media/image/component.d.ts +46 -0
  125. package/dist/media/image/directive.d.ts +9 -0
  126. package/dist/media/image/editing.d.ts +212 -0
  127. package/dist/media/image/index.d.ts +118 -0
  128. package/dist/media/image/placeholder.d.ts +78 -0
  129. package/dist/media/image/processor/cache.d.ts +32 -0
  130. package/dist/media/image/processor/index.d.ts +12 -0
  131. package/dist/media/image/processor/optimizer.d.ts +13 -0
  132. package/dist/media/image/processor/responsive.d.ts +17 -0
  133. package/dist/media/image/srcset.d.ts +158 -0
  134. package/dist/media/index.d.ts +295 -0
  135. package/dist/media/manager/embed.d.ts +25 -0
  136. package/dist/media/protected/component.d.ts +34 -0
  137. package/dist/media/protected/index.d.ts +34 -0
  138. package/dist/media/protected/signature.d.ts +72 -0
  139. package/dist/media/shared/cache.d.ts +54 -0
  140. package/dist/media/shared/hash.d.ts +24 -0
  141. package/dist/media/shared/index.d.ts +2 -0
  142. package/dist/media/types.d.ts +1051 -0
  143. package/dist/media/upload/component.d.ts +23 -0
  144. package/dist/media/upload/index.d.ts +1 -0
  145. package/dist/media/video/directive.d.ts +9 -0
  146. package/dist/media/video/index.d.ts +47 -0
  147. package/dist/media/video/processor/cache.d.ts +33 -0
  148. package/dist/media/video/processor/index.d.ts +21 -0
  149. package/dist/media/video/processor/streaming.d.ts +19 -0
  150. package/dist/media/video/processor/thumbnail.d.ts +28 -0
  151. package/dist/media/video/processor/transcoder.d.ts +9 -0
  152. package/dist/middleware.d.ts +42 -3
  153. package/dist/native-build.d.ts +74 -0
  154. package/dist/parser/directive-parser.d.ts +79 -0
  155. package/dist/parser/expression-parser.d.ts +59 -0
  156. package/dist/parser/index.d.ts +35 -0
  157. package/dist/parser/tokenizer.d.ts +81 -0
  158. package/dist/partial-hydration.d.ts +88 -0
  159. package/dist/performance-utils.d.ts +146 -3
  160. package/dist/plugin-system.d.ts +128 -0
  161. package/dist/plugin.d.ts +1 -0
  162. package/dist/precompiler.d.ts +108 -0
  163. package/dist/production-build.d.ts +199 -0
  164. package/dist/props.d.ts +199 -0
  165. package/dist/pwa/audit.d.ts +42 -0
  166. package/dist/pwa/directives.d.ts +29 -0
  167. package/dist/pwa/icons.d.ts +39 -0
  168. package/dist/pwa/index.d.ts +59 -0
  169. package/dist/pwa/inject.d.ts +22 -0
  170. package/dist/pwa/manifest.d.ts +104 -0
  171. package/dist/pwa/offline.d.ts +8 -0
  172. package/dist/pwa/precache.d.ts +29 -0
  173. package/dist/pwa/service-worker.d.ts +21 -0
  174. package/dist/pwa/workbox-strategies.d.ts +100 -0
  175. package/dist/pwa/workbox.d.ts +52 -0
  176. package/dist/pwa.d.ts +51 -0
  177. package/dist/pwa.js +8124 -0
  178. package/dist/reactive-bindings.d.ts +24 -0
  179. package/dist/reactive.d.ts +100 -0
  180. package/dist/reactivity.d.ts +253 -0
  181. package/dist/route-middleware.d.ts +232 -0
  182. package/dist/router.d.ts +31 -0
  183. package/dist/routes.d.ts +0 -7
  184. package/dist/runtime.d.ts +140 -0
  185. package/dist/safe-evaluator.d.ts +117 -3
  186. package/dist/scaffolding.d.ts +113 -0
  187. package/dist/seo.d.ts +120 -7
  188. package/dist/server-components.d.ts +134 -0
  189. package/dist/signals.d.ts +501 -0
  190. package/dist/slots.d.ts +63 -0
  191. package/dist/source-maps.d.ts +117 -0
  192. package/dist/ssg.d.ts +157 -0
  193. package/dist/ssg.js +6831 -0
  194. package/dist/ssr.d.ts +107 -0
  195. package/dist/state-management.d.ts +324 -0
  196. package/dist/stores-client.d.ts +70 -0
  197. package/dist/story/addons.d.ts +123 -0
  198. package/dist/story/analytics.d.ts +92 -0
  199. package/dist/story/auto-stories.d.ts +38 -0
  200. package/dist/story/bookmarks.d.ts +53 -0
  201. package/dist/story/bun-test.d.ts +44 -0
  202. package/dist/story/cli.d.ts +34 -0
  203. package/dist/story/collect/analyzer.d.ts +33 -0
  204. package/dist/story/collect/index.d.ts +27 -0
  205. package/dist/story/collect/parser.d.ts +17 -0
  206. package/dist/story/collect/scanner.d.ts +13 -0
  207. package/dist/story/collect/tree.d.ts +17 -0
  208. package/dist/story/commands/build.d.ts +14 -0
  209. package/dist/story/commands/dev.d.ts +16 -0
  210. package/dist/story/commands/index.d.ts +6 -0
  211. package/dist/story/commands/preview.d.ts +15 -0
  212. package/dist/story/compiled-output.d.ts +26 -0
  213. package/dist/story/composition.d.ts +47 -0
  214. package/dist/story/config-watcher.d.ts +26 -0
  215. package/dist/story/config.d.ts +26 -0
  216. package/dist/story/context.d.ts +21 -0
  217. package/dist/story/controls/index.d.ts +54 -0
  218. package/dist/story/crosswind.d.ts +29 -0
  219. package/dist/story/desktop-preview.d.ts +34 -0
  220. package/dist/story/docs-generator.d.ts +30 -0
  221. package/dist/story/errors.d.ts +47 -0
  222. package/dist/story/figma-export.d.ts +169 -0
  223. package/dist/story/generator.d.ts +21 -0
  224. package/dist/story/hmr.d.ts +64 -0
  225. package/dist/story/hot-swap.d.ts +35 -0
  226. package/dist/story/index.d.ts +51 -0
  227. package/dist/story/interactions.d.ts +52 -0
  228. package/dist/story/keyboard-shortcuts.d.ts +34 -0
  229. package/dist/story/output.d.ts +85 -0
  230. package/dist/story/performance.d.ts +76 -0
  231. package/dist/story/presets.d.ts +62 -0
  232. package/dist/story/props-validation.d.ts +45 -0
  233. package/dist/story/renderer.d.ts +53 -0
  234. package/dist/story/search-index.d.ts +47 -0
  235. package/dist/story/search.d.ts +45 -0
  236. package/dist/story/server.d.ts +21 -0
  237. package/dist/story/setup.d.ts +47 -0
  238. package/dist/story/snapshots.d.ts +65 -0
  239. package/dist/story/testing.d.ts +58 -0
  240. package/dist/story/theme.d.ts +68 -0
  241. package/dist/story/types.d.ts +249 -0
  242. package/dist/story/ui/code-panel.d.ts +42 -0
  243. package/dist/story/ui/controls-panel.d.ts +25 -0
  244. package/dist/story/ui/index.d.ts +4 -0
  245. package/dist/story/ui/navigation.d.ts +55 -0
  246. package/dist/story/ui/preview.d.ts +46 -0
  247. package/dist/story/visual-testing.d.ts +45 -0
  248. package/dist/streaming.d.ts +82 -2
  249. package/dist/suspense.d.ts +83 -0
  250. package/dist/teleport.d.ts +9 -0
  251. package/dist/testing.d.ts +289 -0
  252. package/dist/transitions.d.ts +87 -0
  253. package/dist/type-checker.d.ts +109 -0
  254. package/dist/types/component-types.d.ts +129 -0
  255. package/dist/types/config-types.d.ts +336 -0
  256. package/dist/types/context-types.d.ts +99 -0
  257. package/dist/types/csp-types.d.ts +79 -0
  258. package/dist/types/directive-types.d.ts +259 -0
  259. package/dist/types/index.d.ts +98 -0
  260. package/dist/types/pwa-types.d.ts +218 -0
  261. package/dist/types.d.ts +1 -315
  262. package/dist/typescript-templates.d.ts +178 -0
  263. package/dist/utils.d.ts +52 -6
  264. package/dist/validator.d.ts +77 -0
  265. package/dist/variable-extractor.d.ts +39 -0
  266. package/dist/view-composers.d.ts +154 -9
  267. package/dist/virtual-scrolling.d.ts +103 -0
  268. package/dist/visual-editor.d.ts +209 -0
  269. package/dist/visual-testing.d.ts +109 -0
  270. package/dist/visual-testing.js +126 -0
  271. package/dist/vue-template.d.ts +16 -0
  272. package/dist/web-components/css-scoping.d.ts +54 -0
  273. package/dist/web-components/index.d.ts +20 -0
  274. package/dist/web-components/reactive-generator.d.ts +72 -0
  275. package/dist/web-components.d.ts +222 -2
  276. package/dist/x-element.d.ts +35 -0
  277. package/package.json +41 -10
@@ -0,0 +1,411 @@
1
+ /**
2
+ * Parse @craft-* component directives from stx template
3
+ */
4
+ export declare function processCraftComponents(content: string, config?: CraftComponentConfig): string;
5
+ /**
6
+ * Register a custom Craft component
7
+ */
8
+ export declare function registerCraftComponent(name: string, definition: CraftComponentDefinition): void;
9
+ /**
10
+ * Get all registered Craft components
11
+ */
12
+ export declare function getCraftComponents(): Record<string, CraftComponentDefinition>;
13
+ /**
14
+ * Built-in Craft component definitions
15
+ */
16
+ export declare const CRAFT_COMPONENTS: {
17
+ // Input Components
18
+ button: {
19
+ nativeType: 'craft-button';
20
+ fallbackTag: 'button';
21
+ fallbackClasses: 'craft-button';
22
+ nativeProps: readonly ['variant', 'size', 'disabled', 'loading']
23
+ };
24
+ 'text-input': {
25
+ nativeType: 'craft-text-input';
26
+ fallbackTag: 'input';
27
+ fallbackClasses: 'craft-text-input';
28
+ nativeProps: readonly ['placeholder', 'value', 'type', 'disabled', 'readonly']
29
+ };
30
+ textarea: {
31
+ nativeType: 'craft-textarea';
32
+ fallbackTag: 'textarea';
33
+ fallbackClasses: 'craft-textarea';
34
+ nativeProps: readonly ['placeholder', 'value', 'rows', 'disabled', 'readonly']
35
+ };
36
+ checkbox: { nativeType: 'craft-checkbox'; fallbackTag: 'input'; fallbackClasses: 'craft-checkbox'; nativeProps: readonly ['checked', 'disabled', 'label']; render: (props, children) => unknown };
37
+ radio: {
38
+ nativeType: 'craft-radio';
39
+ fallbackTag: 'input';
40
+ fallbackClasses: 'craft-radio';
41
+ nativeProps: readonly ['checked', 'disabled', 'name', 'value', 'label']
42
+ };
43
+ select: {
44
+ nativeType: 'craft-select';
45
+ fallbackTag: 'select';
46
+ fallbackClasses: 'craft-select';
47
+ nativeProps: readonly ['value', 'disabled', 'options', 'placeholder']
48
+ };
49
+ slider: { nativeType: 'craft-slider'; fallbackTag: 'input'; fallbackClasses: 'craft-slider'; nativeProps: readonly ['value', 'min', 'max', 'step', 'disabled']; render: (props, _children) => unknown };
50
+ // Display Components
51
+ label: {
52
+ nativeType: 'craft-label';
53
+ fallbackTag: 'span';
54
+ fallbackClasses: 'craft-label';
55
+ nativeProps: readonly ['text', 'for']
56
+ };
57
+ badge: {
58
+ nativeType: 'craft-badge';
59
+ fallbackTag: 'span';
60
+ fallbackClasses: 'craft-badge';
61
+ nativeProps: readonly ['variant', 'size']
62
+ };
63
+ avatar: { nativeType: 'craft-avatar'; fallbackTag: 'div'; fallbackClasses: 'craft-avatar'; nativeProps: readonly ['src', 'alt', 'size', 'fallback']; render: (props, _children) => unknown };
64
+ progress: { nativeType: 'craft-progress'; fallbackTag: 'div'; fallbackClasses: 'craft-progress'; nativeProps: readonly ['value', 'max', 'variant']; render: (props, _children) => unknown };
65
+ spinner: { nativeType: 'craft-spinner'; fallbackTag: 'div'; fallbackClasses: 'craft-spinner'; nativeProps: readonly ['size']; render: (props, _children) => unknown };
66
+ // Layout Components
67
+ card: {
68
+ nativeType: 'craft-card';
69
+ fallbackTag: 'div';
70
+ fallbackClasses: 'craft-card';
71
+ nativeProps: readonly ['title', 'subtitle', 'variant']
72
+ };
73
+ modal: { nativeType: 'craft-modal'; fallbackTag: 'dialog'; fallbackClasses: 'craft-modal'; nativeProps: readonly ['open', 'title', 'closable', 'size']; render: (props, children) => unknown };
74
+ tabs: {
75
+ nativeType: 'craft-tabs';
76
+ fallbackTag: 'div';
77
+ fallbackClasses: 'craft-tabs';
78
+ nativeProps: readonly ['activeTab', 'tabs']
79
+ };
80
+ accordion: { nativeType: 'craft-accordion'; fallbackTag: 'details'; fallbackClasses: 'craft-accordion'; nativeProps: readonly ['open', 'title']; render: (props, children) => unknown };
81
+ divider: {
82
+ nativeType: 'craft-divider';
83
+ fallbackTag: 'hr';
84
+ fallbackClasses: 'craft-divider';
85
+ nativeProps: readonly ['orientation', 'variant']
86
+ };
87
+ // Data Components
88
+ table: {
89
+ nativeType: 'craft-table';
90
+ fallbackTag: 'table';
91
+ fallbackClasses: 'craft-table';
92
+ nativeProps: readonly ['columns', 'rows', 'sortable', 'selectable']
93
+ };
94
+ list: {
95
+ nativeType: 'craft-list';
96
+ fallbackTag: 'ul';
97
+ fallbackClasses: 'craft-list';
98
+ nativeProps: readonly ['items', 'selectable']
99
+ };
100
+ tree: {
101
+ nativeType: 'craft-tree';
102
+ fallbackTag: 'div';
103
+ fallbackClasses: 'craft-tree';
104
+ nativeProps: readonly ['nodes', 'expandable', 'selectable']
105
+ };
106
+ // Feedback Components
107
+ alert: { nativeType: 'craft-alert'; fallbackTag: 'div'; fallbackClasses: 'craft-alert'; nativeProps: readonly ['variant', 'title', 'dismissible']; render: (props, children) => unknown };
108
+ toast: {
109
+ nativeType: 'craft-toast';
110
+ fallbackTag: 'div';
111
+ fallbackClasses: 'craft-toast';
112
+ nativeProps: readonly ['variant', 'duration', 'position']
113
+ };
114
+ tooltip: { nativeType: 'craft-tooltip'; fallbackTag: 'span'; fallbackClasses: 'craft-tooltip'; nativeProps: readonly ['content', 'position']; render: (props, children) => unknown };
115
+ // Navigation Components
116
+ menu: {
117
+ nativeType: 'craft-menu';
118
+ fallbackTag: 'nav';
119
+ fallbackClasses: 'craft-menu';
120
+ nativeProps: readonly ['items', 'orientation']
121
+ };
122
+ breadcrumb: {
123
+ nativeType: 'craft-breadcrumb';
124
+ fallbackTag: 'nav';
125
+ fallbackClasses: 'craft-breadcrumb';
126
+ nativeProps: readonly ['items', 'separator']
127
+ };
128
+ pagination: {
129
+ nativeType: 'craft-pagination';
130
+ fallbackTag: 'nav';
131
+ fallbackClasses: 'craft-pagination';
132
+ nativeProps: readonly ['total', 'page', 'pageSize']
133
+ };
134
+ // Advanced Components
135
+ 'code-editor': {
136
+ nativeType: 'craft-code-editor';
137
+ fallbackTag: 'textarea';
138
+ fallbackClasses: 'craft-code-editor';
139
+ nativeProps: readonly ['value', 'language', 'theme', 'readonly', 'lineNumbers']
140
+ };
141
+ 'file-browser': {
142
+ nativeType: 'craft-file-browser';
143
+ fallbackTag: 'div';
144
+ fallbackClasses: 'craft-file-browser';
145
+ nativeProps: readonly ['path', 'showHidden', 'selectable']
146
+ };
147
+ 'color-picker': { nativeType: 'craft-color-picker'; fallbackTag: 'input'; fallbackClasses: 'craft-color-picker'; nativeProps: readonly ['value', 'format']; render: (props, _children) => unknown };
148
+ 'date-picker': { nativeType: 'craft-date-picker'; fallbackTag: 'input'; fallbackClasses: 'craft-date-picker'; nativeProps: readonly ['value', 'min', 'max', 'format']; render: (props, _children) => unknown };
149
+ 'time-picker': { nativeType: 'craft-time-picker'; fallbackTag: 'input'; fallbackClasses: 'craft-time-picker'; nativeProps: readonly ['value', 'min', 'max', 'step']; render: (props, _children) => unknown }
150
+ };
151
+ /**
152
+ * CSS styles for Craft component fallbacks
153
+ */
154
+ export declare const CRAFT_COMPONENT_STYLES: `
155
+ <style id="craft-component-styles">
156
+ /* Craft Component Base Styles */
157
+ .craft-button {
158
+ display: inline-flex;
159
+ align-items: center;
160
+ justify-content: center;
161
+ padding: 8px 16px;
162
+ border: none;
163
+ border-radius: 6px;
164
+ font-family: inherit;
165
+ font-size: 14px;
166
+ font-weight: 500;
167
+ cursor: pointer;
168
+ transition: all 0.2s ease;
169
+ background: var(--craft-primary, #3b82f6);
170
+ color: white;
171
+ }
172
+ .craft-button:hover { opacity: 0.9; }
173
+ .craft-button:disabled { opacity: 0.5; cursor: not-allowed; }
174
+ .craft-button-secondary { background: var(--craft-secondary, #6b7280); }
175
+ .craft-button-outline { background: transparent; border: 1px solid currentColor; color: var(--craft-primary, #3b82f6); }
176
+
177
+ .craft-text-input, .craft-textarea, .craft-select {
178
+ padding: 8px 12px;
179
+ border: 1px solid var(--craft-border, #d1d5db);
180
+ border-radius: 6px;
181
+ font-family: inherit;
182
+ font-size: 14px;
183
+ background: var(--craft-bg, #fff);
184
+ color: var(--craft-text, #1f2937);
185
+ transition: border-color 0.2s ease;
186
+ }
187
+ .craft-text-input:focus, .craft-textarea:focus, .craft-select:focus {
188
+ outline: none;
189
+ border-color: var(--craft-primary, #3b82f6);
190
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
191
+ }
192
+
193
+ .craft-checkbox-wrapper {
194
+ display: inline-flex;
195
+ align-items: center;
196
+ gap: 8px;
197
+ cursor: pointer;
198
+ }
199
+ .craft-checkbox {
200
+ width: 18px;
201
+ height: 18px;
202
+ cursor: pointer;
203
+ }
204
+
205
+ .craft-slider {
206
+ width: 100%;
207
+ height: 6px;
208
+ border-radius: 3px;
209
+ cursor: pointer;
210
+ }
211
+
212
+ .craft-badge {
213
+ display: inline-flex;
214
+ align-items: center;
215
+ padding: 2px 8px;
216
+ border-radius: 9999px;
217
+ font-size: 12px;
218
+ font-weight: 500;
219
+ background: var(--craft-primary, #3b82f6);
220
+ color: white;
221
+ }
222
+
223
+ .craft-avatar {
224
+ display: inline-flex;
225
+ align-items: center;
226
+ justify-content: center;
227
+ background: var(--craft-secondary, #6b7280);
228
+ color: white;
229
+ font-weight: 600;
230
+ overflow: hidden;
231
+ }
232
+ .craft-avatar img { width: 100%; height: 100%; object-fit: cover; }
233
+
234
+ .craft-progress {
235
+ width: 100%;
236
+ height: 8px;
237
+ background: var(--craft-border, #e5e7eb);
238
+ border-radius: 4px;
239
+ overflow: hidden;
240
+ }
241
+ .craft-progress-bar {
242
+ height: 100%;
243
+ background: var(--craft-primary, #3b82f6);
244
+ transition: width 0.3s ease;
245
+ }
246
+
247
+ .craft-spinner {
248
+ border: 2px solid var(--craft-border, #e5e7eb);
249
+ border-top-color: var(--craft-primary, #3b82f6);
250
+ border-radius: 50%;
251
+ animation: craft-spin 0.8s linear infinite;
252
+ }
253
+ @keyframes craft-spin { to { transform: rotate(360deg); } }
254
+
255
+ .craft-card {
256
+ background: var(--craft-bg, #fff);
257
+ border: 1px solid var(--craft-border, #e5e7eb);
258
+ border-radius: 8px;
259
+ padding: 16px;
260
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
261
+ }
262
+
263
+ .craft-modal {
264
+ border: none;
265
+ border-radius: 12px;
266
+ padding: 0;
267
+ max-width: 90vw;
268
+ max-height: 90vh;
269
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
270
+ }
271
+ .craft-modal::backdrop { background: rgba(0,0,0,0.5); }
272
+ .craft-modal-header {
273
+ padding: 16px 20px;
274
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
275
+ }
276
+ .craft-modal-header h2 { margin: 0; font-size: 18px; }
277
+ .craft-modal-body { padding: 20px; }
278
+
279
+ .craft-accordion {
280
+ border: 1px solid var(--craft-border, #e5e7eb);
281
+ border-radius: 6px;
282
+ overflow: hidden;
283
+ }
284
+ .craft-accordion-header {
285
+ padding: 12px 16px;
286
+ cursor: pointer;
287
+ font-weight: 500;
288
+ background: var(--craft-bg-secondary, #f9fafb);
289
+ }
290
+ .craft-accordion-content { padding: 16px; }
291
+
292
+ .craft-divider {
293
+ border: none;
294
+ border-top: 1px solid var(--craft-border, #e5e7eb);
295
+ margin: 16px 0;
296
+ }
297
+
298
+ .craft-alert {
299
+ padding: 12px 16px;
300
+ border-radius: 6px;
301
+ border-left: 4px solid;
302
+ }
303
+ .craft-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
304
+ .craft-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
305
+ .craft-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
306
+ .craft-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
307
+ .craft-alert-title { font-weight: 600; margin-bottom: 4px; }
308
+
309
+ .craft-tooltip {
310
+ position: relative;
311
+ cursor: help;
312
+ }
313
+ .craft-tooltip::after {
314
+ content: attr(data-tooltip);
315
+ position: absolute;
316
+ bottom: 100%;
317
+ left: 50%;
318
+ transform: translateX(-50%);
319
+ padding: 4px 8px;
320
+ background: #1f2937;
321
+ color: white;
322
+ font-size: 12px;
323
+ border-radius: 4px;
324
+ white-space: nowrap;
325
+ opacity: 0;
326
+ pointer-events: none;
327
+ transition: opacity 0.2s;
328
+ }
329
+ .craft-tooltip:hover::after { opacity: 1; }
330
+
331
+ .craft-table {
332
+ width: 100%;
333
+ border-collapse: collapse;
334
+ }
335
+ .craft-table th, .craft-table td {
336
+ padding: 12px;
337
+ text-align: left;
338
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
339
+ }
340
+ .craft-table th { font-weight: 600; background: var(--craft-bg-secondary, #f9fafb); }
341
+
342
+ .craft-list {
343
+ list-style: none;
344
+ padding: 0;
345
+ margin: 0;
346
+ }
347
+ .craft-list li {
348
+ padding: 12px;
349
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
350
+ }
351
+ .craft-list li:last-child { border-bottom: none; }
352
+
353
+ .craft-code-editor {
354
+ font-family: 'SF Mono', 'Fira Code', monospace;
355
+ font-size: 13px;
356
+ line-height: 1.5;
357
+ padding: 12px;
358
+ background: #1e1e1e;
359
+ color: #d4d4d4;
360
+ border-radius: 6px;
361
+ resize: vertical;
362
+ }
363
+
364
+ /* Dark mode support */
365
+ @media (prefers-color-scheme: dark) {
366
+ .craft-text-input, .craft-textarea, .craft-select, .craft-card {
367
+ background: #1f2937;
368
+ color: #f3f4f6;
369
+ border-color: #374151;
370
+ }
371
+ .craft-modal {
372
+ background: #1f2937;
373
+ color: #f3f4f6;
374
+ }
375
+ .craft-accordion-header { background: #374151; }
376
+ .craft-table th { background: #374151; }
377
+ }
378
+ </style>
379
+ `;
380
+ /**
381
+ * Craft Native Components for stx
382
+ *
383
+ * This module provides @craft-* directives that render native components
384
+ * when running in a Craft environment, with HTML fallbacks for web browsers.
385
+ *
386
+ * @example
387
+ * ```html
388
+ * <@craft-button variant="primary" @click="handleClick">
389
+ * Click Me
390
+ * </@craft-button>
391
+ *
392
+ * <@craft-text-input placeholder="Enter name" :value="name" @change="updateName" />
393
+ *
394
+ * <@craft-modal title="Settings" :open="showSettings">
395
+ * Modal content here
396
+ * </@craft-modal>
397
+ * ```
398
+ */
399
+ export declare interface CraftComponentConfig {
400
+ preferNative?: boolean
401
+ classPrefix?: string
402
+ components?: Record<string, CraftComponentDefinition>
403
+ }
404
+ export declare interface CraftComponentDefinition {
405
+ nativeType: string
406
+ fallbackTag: string
407
+ fallbackClasses?: string
408
+ nativeProps?: string[]
409
+ render?: (props: Record<string, unknown>, children: string) => string
410
+ }
411
+ export default craftComponents;
@@ -0,0 +1,5 @@
1
+ export * from './craft-bridge';
2
+ export * from './craft-compiler';
3
+ export * from './craft-components';
4
+ export * from './craft-ssr';
5
+ export * from './native-build';
@@ -0,0 +1,134 @@
1
+ import type { CraftComponentConfig } from './craft-components';
2
+ /**
3
+ * Compile an stx template into a Craft-optimized component tree
4
+ */
5
+ export declare function compileTemplate(template: string, options?: { id?: string }): CompiledTemplate;
6
+ /**
7
+ * Render a compiled template to HTML with SSR optimizations
8
+ */
9
+ export declare function renderSSR(compiled: CompiledTemplate, context?: Record<string, unknown>, config?: SSRConfig): Promise<SSRResult>;
10
+ /**
11
+ * Generate Craft optimization hints for a template
12
+ */
13
+ export declare function generateCraftOptimizations(compiled: CompiledTemplate, _config?: CraftComponentConfig): CraftOptimization;
14
+ /**
15
+ * Pre-render static parts of a template for Craft
16
+ */
17
+ export declare function prerenderForCraft(template: string, context?: Record<string, unknown>): {
18
+ staticHTML: string
19
+ dynamicPlaceholders: Map<string, string>
20
+ craftComponents: string[]
21
+ };
22
+ /**
23
+ * Clear template cache
24
+ */
25
+ export declare function clearTemplateCache(): void;
26
+ /**
27
+ * Clear render cache
28
+ */
29
+ export declare function clearRenderCache(): void;
30
+ /**
31
+ * Clear all caches
32
+ */
33
+ export declare function clearAllCaches(): void;
34
+ /**
35
+ * Get SSR cache statistics
36
+ */
37
+ export declare function getSSRCacheStats(): {
38
+ templateCacheSize: number
39
+ renderCacheSize: number
40
+ totalEntries: number
41
+ };
42
+ /**
43
+ * Represents a node in the Craft component tree
44
+ */
45
+ export declare interface CraftNode {
46
+ type: 'element' | 'text' | 'component' | 'fragment' | 'slot'
47
+ tag?: string
48
+ props?: Record<string, unknown>
49
+ children?: CraftNode[]
50
+ text?: string
51
+ componentName?: string
52
+ slotName?: string
53
+ isStatic?: boolean
54
+ hydrationKey?: string
55
+ }
56
+ /**
57
+ * Compiled template representation
58
+ */
59
+ export declare interface CompiledTemplate {
60
+ id: string
61
+ hash: string
62
+ tree: CraftNode
63
+ scripts: string[]
64
+ styles: string[]
65
+ staticParts: Map<string, string>
66
+ dynamicParts: Map<string, string>
67
+ dependencies: string[]
68
+ metadata: TemplateMetadata
69
+ }
70
+ /**
71
+ * Template metadata for optimization
72
+ */
73
+ export declare interface TemplateMetadata {
74
+ hasSlots: boolean
75
+ hasDynamicContent: boolean
76
+ hasEventHandlers: boolean
77
+ hasAsyncContent: boolean
78
+ componentCount: number
79
+ maxDepth: number
80
+ estimatedSize: number
81
+ }
82
+ /**
83
+ * SSR configuration options
84
+ */
85
+ export declare interface SSRConfig {
86
+ streaming?: boolean
87
+ prerender?: boolean
88
+ hydrate?: boolean
89
+ minify?: boolean
90
+ cache?: boolean
91
+ cacheTTL?: number
92
+ staticAnalysis?: boolean
93
+ target?: 'web' | 'craft' | 'both'
94
+ }
95
+ /**
96
+ * SSR result
97
+ */
98
+ export declare interface SSRResult {
99
+ html: string
100
+ styles: string
101
+ scripts: string
102
+ hydrationData?: Record<string, unknown>
103
+ metadata: SSRMetadata
104
+ }
105
+ /**
106
+ * SSR metadata
107
+ */
108
+ export declare interface SSRMetadata {
109
+ renderTime: number
110
+ cacheHit: boolean
111
+ streamChunks?: number
112
+ totalSize: number
113
+ componentCount: number
114
+ }
115
+ /**
116
+ * Optimization hints for Craft
117
+ */
118
+ export declare interface CraftOptimization {
119
+ nativeComponents: string[]
120
+ staticHTML: string[]
121
+ dynamicParts: string[]
122
+ eventHandlers: Map<string, string>
123
+ nativeWidgets: NativeWidgetSuggestion[]
124
+ }
125
+ /**
126
+ * Native widget suggestion
127
+ */
128
+ export declare interface NativeWidgetSuggestion {
129
+ htmlSelector: string
130
+ nativeComponent: string
131
+ confidence: number
132
+ reason: string
133
+ }
134
+ export default craftSSR;