@upstart.gg/sdk 0.0.96 → 0.0.97

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 (527) hide show
  1. package/dist/node/cli/api.js +2 -2
  2. package/dist/node/cli/api.js.map +1 -1
  3. package/dist/node/cli/commands/login/cmd-login.js +6 -6
  4. package/dist/node/cli/commands/login/cmd-login.js.map +1 -1
  5. package/dist/node/cli/commands/publish/cmd-publish.d.ts.map +1 -1
  6. package/dist/node/cli/commands/publish/cmd-publish.js +18 -18
  7. package/dist/node/cli/commands/publish/cmd-publish.js.map +1 -1
  8. package/dist/node/cli/commands/publish/uploader.js +7 -7
  9. package/dist/node/cli/commands/publish/uploader.js.map +1 -1
  10. package/dist/node/cli/is-logged-in.js +2 -2
  11. package/dist/node/cli/is-logged-in.js.map +1 -1
  12. package/dist/node/cli/program.js +24 -24
  13. package/dist/node/cli/program.js.map +1 -1
  14. package/dist/node/shared/config.d.ts +4 -14
  15. package/dist/node/shared/config.d.ts.map +1 -1
  16. package/dist/node/shared/config.js +4 -4
  17. package/dist/node/shared/config.js.map +1 -1
  18. package/dist/node/shared/logger.d.ts.map +1 -1
  19. package/dist/node/shared/logger.js +2 -2
  20. package/dist/node/shared/logger.js.map +1 -1
  21. package/dist/shared/ajv.d.ts +2 -0
  22. package/dist/shared/ajv.d.ts.map +1 -1
  23. package/dist/shared/ajv.js +1 -1
  24. package/dist/shared/attributes.d.ts +20 -93
  25. package/dist/shared/attributes.d.ts.map +1 -1
  26. package/dist/shared/attributes.js +1 -1
  27. package/dist/shared/brick-manifest.d.ts +7 -17
  28. package/dist/shared/brick-manifest.d.ts.map +1 -1
  29. package/dist/shared/brick-manifest.js +1 -1
  30. package/dist/shared/bricks/manifests/accordion.manifest.d.ts +111 -0
  31. package/dist/shared/bricks/manifests/accordion.manifest.d.ts.map +1 -0
  32. package/dist/shared/bricks/manifests/accordion.manifest.js +3 -0
  33. package/dist/shared/bricks/manifests/all-manifests.d.ts +5 -0
  34. package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
  35. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  36. package/dist/shared/bricks/manifests/button.manifest.d.ts +22 -13
  37. package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
  38. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  39. package/dist/shared/bricks/manifests/card.manifest.d.ts +44 -54
  40. package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
  41. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  42. package/dist/shared/bricks/manifests/carousel.manifest.d.ts +39 -12
  43. package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
  44. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  45. package/dist/shared/bricks/manifests/container.manifest.d.ts +49 -172
  46. package/dist/shared/bricks/manifests/container.manifest.d.ts.map +1 -1
  47. package/dist/shared/bricks/manifests/container.manifest.js +1 -1
  48. package/dist/shared/bricks/manifests/divider.manifest.d.ts +63 -0
  49. package/dist/shared/bricks/manifests/divider.manifest.d.ts.map +1 -0
  50. package/dist/shared/bricks/manifests/divider.manifest.js +3 -0
  51. package/dist/shared/bricks/manifests/footer.manifest.d.ts +30 -35
  52. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  53. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  54. package/dist/shared/bricks/manifests/form.manifest.d.ts +22 -12
  55. package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
  56. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  57. package/dist/shared/bricks/manifests/hero.manifest.d.ts +31 -71
  58. package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
  59. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  60. package/dist/shared/bricks/manifests/icon.manifest.d.ts +18 -12
  61. package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
  62. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  63. package/dist/shared/bricks/manifests/image.manifest.d.ts +36 -50
  64. package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
  65. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  66. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +55 -115
  67. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
  68. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  69. package/dist/shared/bricks/manifests/map.manifest.d.ts +36 -12
  70. package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
  71. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  72. package/dist/shared/bricks/manifests/navbar.manifest.d.ts +160 -0
  73. package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -0
  74. package/dist/shared/bricks/manifests/navbar.manifest.js +3 -0
  75. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +83 -12
  76. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
  77. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  78. package/dist/shared/bricks/manifests/social-links.manifest.d.ts +37 -12
  79. package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
  80. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  81. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +94 -0
  82. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -0
  83. package/dist/shared/bricks/manifests/testimonials.manifest.js +3 -0
  84. package/dist/shared/bricks/manifests/text.manifest.d.ts +31 -63
  85. package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
  86. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  87. package/dist/shared/bricks/manifests/timeline.manifest.d.ts +122 -0
  88. package/dist/shared/bricks/manifests/timeline.manifest.d.ts.map +1 -0
  89. package/dist/shared/bricks/manifests/timeline.manifest.js +3 -0
  90. package/dist/shared/bricks/manifests/video.manifest.d.ts +38 -12
  91. package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
  92. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  93. package/dist/shared/bricks/props/_style-presets.d.ts +1 -1
  94. package/dist/shared/bricks/props/_style-presets.d.ts.map +1 -1
  95. package/dist/shared/bricks/props/_style-presets.js +1 -1
  96. package/dist/shared/bricks/props/align.d.ts +7 -3
  97. package/dist/shared/bricks/props/align.d.ts.map +1 -1
  98. package/dist/shared/bricks/props/align.js +1 -1
  99. package/dist/shared/bricks/props/background.d.ts +8 -1
  100. package/dist/shared/bricks/props/background.d.ts.map +1 -1
  101. package/dist/shared/bricks/props/background.js +1 -1
  102. package/dist/shared/bricks/props/boolean.js +1 -1
  103. package/dist/shared/bricks/props/border.d.ts +24 -22
  104. package/dist/shared/bricks/props/border.d.ts.map +1 -1
  105. package/dist/shared/bricks/props/border.js +1 -1
  106. package/dist/shared/bricks/props/color.d.ts +5 -0
  107. package/dist/shared/bricks/props/color.d.ts.map +1 -0
  108. package/dist/shared/bricks/props/color.js +3 -0
  109. package/dist/shared/bricks/props/common.d.ts +9 -1
  110. package/dist/shared/bricks/props/common.d.ts.map +1 -1
  111. package/dist/shared/bricks/props/common.js +1 -1
  112. package/dist/shared/bricks/props/container.d.ts +37 -45
  113. package/dist/shared/bricks/props/container.d.ts.map +1 -1
  114. package/dist/shared/bricks/props/container.js +1 -1
  115. package/dist/shared/bricks/props/css-length.d.ts +5 -0
  116. package/dist/shared/bricks/props/css-length.d.ts.map +1 -0
  117. package/dist/shared/bricks/props/css-length.js +3 -0
  118. package/dist/shared/bricks/props/datasource.d.ts +9 -13
  119. package/dist/shared/bricks/props/datasource.d.ts.map +1 -1
  120. package/dist/shared/bricks/props/datasource.js +1 -1
  121. package/dist/shared/bricks/props/date.d.ts +4 -0
  122. package/dist/shared/bricks/props/date.d.ts.map +1 -0
  123. package/dist/shared/bricks/props/date.js +3 -0
  124. package/dist/shared/bricks/props/effects.d.ts +4 -21
  125. package/dist/shared/bricks/props/effects.d.ts.map +1 -1
  126. package/dist/shared/bricks/props/effects.js +1 -1
  127. package/dist/shared/bricks/props/enum.d.ts +13 -0
  128. package/dist/shared/bricks/props/enum.d.ts.map +1 -0
  129. package/dist/shared/bricks/props/enum.js +3 -0
  130. package/dist/shared/bricks/props/file.d.ts +2 -0
  131. package/dist/shared/bricks/props/file.d.ts.map +1 -0
  132. package/dist/shared/bricks/props/file.js +3 -0
  133. package/dist/shared/bricks/props/geolocation.d.ts +16 -0
  134. package/dist/shared/bricks/props/geolocation.d.ts.map +1 -0
  135. package/dist/shared/bricks/props/geolocation.js +3 -0
  136. package/dist/shared/bricks/props/helpers.d.ts +8 -4
  137. package/dist/shared/bricks/props/helpers.d.ts.map +1 -1
  138. package/dist/shared/bricks/props/helpers.js +1 -1
  139. package/dist/shared/bricks/props/image.d.ts +7 -1
  140. package/dist/shared/bricks/props/image.d.ts.map +1 -1
  141. package/dist/shared/bricks/props/image.js +1 -1
  142. package/dist/shared/bricks/props/number.js +1 -1
  143. package/dist/shared/bricks/props/padding.d.ts +2 -1
  144. package/dist/shared/bricks/props/padding.d.ts.map +1 -1
  145. package/dist/shared/bricks/props/padding.js +1 -1
  146. package/dist/shared/bricks/props/position.d.ts.map +1 -1
  147. package/dist/shared/bricks/props/position.js +1 -1
  148. package/dist/shared/bricks/props/preset.d.ts +92 -0
  149. package/dist/shared/bricks/props/preset.d.ts.map +1 -0
  150. package/dist/shared/bricks/props/preset.js +3 -0
  151. package/dist/shared/bricks/props/string.d.ts +8 -3
  152. package/dist/shared/bricks/props/string.d.ts.map +1 -1
  153. package/dist/shared/bricks/props/string.js +1 -1
  154. package/dist/shared/bricks/props/text.d.ts +3 -4
  155. package/dist/shared/bricks/props/text.d.ts.map +1 -1
  156. package/dist/shared/bricks/props/text.js +1 -1
  157. package/dist/shared/bricks/props/types.d.ts +5 -2
  158. package/dist/shared/bricks/props/types.d.ts.map +1 -1
  159. package/dist/shared/bricks.d.ts +243 -134
  160. package/dist/shared/bricks.d.ts.map +1 -1
  161. package/dist/shared/bricks.js +1 -1
  162. package/dist/shared/chunk-2AJYHJFG.js +8 -0
  163. package/dist/shared/chunk-2FHWS73Y.js +6 -0
  164. package/dist/shared/chunk-3FJVF357.js +3 -0
  165. package/dist/shared/chunk-3RHYJ6E7.js +5 -0
  166. package/dist/shared/chunk-3VZACK2Y.js +3 -0
  167. package/dist/shared/chunk-3XCKZ4JQ.js +3 -0
  168. package/dist/shared/chunk-4MPRHJWO.js +3 -0
  169. package/dist/shared/chunk-5EOWW7BX.js +4 -0
  170. package/dist/shared/chunk-5HYPCOSS.js +3 -0
  171. package/dist/shared/chunk-5K5C6XFX.js +3 -0
  172. package/dist/shared/chunk-6QS5PKLA.js +3 -0
  173. package/dist/shared/chunk-74EL657O.js +3 -0
  174. package/dist/shared/chunk-AJDYOLKP.js +3 -0
  175. package/dist/shared/chunk-ALFOZHAH.js +3 -0
  176. package/dist/shared/{chunk-FGU4BGP4.js → chunk-ATDJCXC2.js} +1 -1
  177. package/dist/shared/chunk-BJSO43AS.js +3 -0
  178. package/dist/shared/chunk-BTKLQQZA.js +3 -0
  179. package/dist/shared/chunk-CAVNF3BU.js +3 -0
  180. package/dist/shared/chunk-CCNU3J56.js +3 -0
  181. package/dist/shared/chunk-CTRS76PX.js +3 -0
  182. package/dist/shared/chunk-DCH2FI6T.js +8 -0
  183. package/dist/shared/chunk-DFSQR6QC.js +3 -0
  184. package/dist/shared/chunk-ENU4SEHO.js +3 -0
  185. package/dist/shared/chunk-G7LX3UKQ.js +3 -0
  186. package/dist/shared/chunk-GGJBTPGW.js +3 -0
  187. package/dist/shared/chunk-H24R3IWA.js +3 -0
  188. package/dist/shared/chunk-HYVQXAK5.js +3 -0
  189. package/dist/shared/chunk-LKVQQQTI.js +3 -0
  190. package/dist/shared/chunk-MITJPRGD.js +6 -0
  191. package/dist/shared/chunk-NLZBY65T.js +3 -0
  192. package/dist/shared/chunk-OUI2VDNM.js +3 -0
  193. package/dist/shared/chunk-OYIL5SCU.js +3 -0
  194. package/dist/shared/chunk-P5DZK4TS.js +3 -0
  195. package/dist/shared/chunk-PK3R5VOF.js +3 -0
  196. package/dist/shared/chunk-QPATZM3I.js +3 -0
  197. package/dist/shared/chunk-RDBEWW4G.js +7 -0
  198. package/dist/shared/chunk-RPBQZW5I.js +3 -0
  199. package/dist/shared/chunk-SLSIAUYV.js +3 -0
  200. package/dist/shared/chunk-SUG225LF.js +3 -0
  201. package/dist/shared/chunk-U5XOIYSS.js +3 -0
  202. package/dist/shared/{chunk-HIZPJNEM.js → chunk-UL7L3HYV.js} +1 -1
  203. package/dist/shared/chunk-V6BCYHZH.js +3 -0
  204. package/dist/shared/chunk-VA5LFJVE.js +3 -0
  205. package/dist/shared/chunk-VAC73HJE.js +3 -0
  206. package/dist/shared/chunk-VBWC36L2.js +3 -0
  207. package/dist/shared/chunk-VLGLD6GR.js +3 -0
  208. package/dist/shared/chunk-VTFWVTPI.js +3 -0
  209. package/dist/shared/chunk-WAAKB6OB.js +3 -0
  210. package/dist/shared/chunk-Y36SM2AO.js +3 -0
  211. package/dist/shared/chunk-Y7CEEEVW.js +3 -0
  212. package/dist/shared/chunk-YZ5Y4WE6.js +3 -0
  213. package/dist/shared/chunk-Z7SYP6FG.js +3 -0
  214. package/dist/shared/chunk-ZJNA4QQC.js +3 -0
  215. package/dist/shared/chunk-ZMDHKAWL.js +3 -0
  216. package/dist/shared/context.d.ts +38 -0
  217. package/dist/shared/context.d.ts.map +1 -0
  218. package/dist/shared/{chunk-WJ5CDDXW.js → context.js} +0 -1
  219. package/dist/shared/datarecords/types.d.ts +40 -20
  220. package/dist/shared/datarecords/types.d.ts.map +1 -1
  221. package/dist/shared/datarecords/types.js +1 -1
  222. package/dist/shared/datasources/external/http-json/fetcher.d.ts.map +1 -0
  223. package/dist/shared/datasources/external/http-json/options.d.ts.map +1 -0
  224. package/dist/shared/datasources/external/{json → http-json}/schema.d.ts +0 -1
  225. package/dist/shared/datasources/external/http-json/schema.d.ts.map +1 -0
  226. package/dist/shared/datasources/external/http-json/tests/fetcher.test.d.ts.map +1 -0
  227. package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
  228. package/dist/shared/datasources/external/rss/sample.d.ts.map +1 -1
  229. package/dist/shared/datasources/external/rss/schema.d.ts +7 -13
  230. package/dist/shared/datasources/external/rss/schema.d.ts.map +1 -1
  231. package/dist/shared/datasources/external/youtube/list/sample.d.ts +23 -32
  232. package/dist/shared/datasources/external/youtube/list/sample.d.ts.map +1 -1
  233. package/dist/shared/datasources/external/youtube/list/schema.d.ts +24 -33
  234. package/dist/shared/datasources/external/youtube/list/schema.d.ts.map +1 -1
  235. package/dist/shared/datasources/internal/blog/schema.d.ts.map +1 -1
  236. package/dist/shared/datasources/internal/changelog/schema.d.ts.map +1 -1
  237. package/dist/shared/datasources/internal/recipes/schema.d.ts.map +1 -1
  238. package/dist/shared/datasources/samples.d.ts +1 -1
  239. package/dist/shared/datasources/samples.d.ts.map +1 -1
  240. package/dist/shared/datasources/schemas.d.ts +33 -583
  241. package/dist/shared/datasources/schemas.d.ts.map +1 -1
  242. package/dist/shared/datasources/schemas.js +1 -1
  243. package/dist/shared/datasources/types.d.ts +75 -1314
  244. package/dist/shared/datasources/types.d.ts.map +1 -1
  245. package/dist/shared/datasources/types.js +1 -1
  246. package/dist/shared/datasources.d.ts +14 -0
  247. package/dist/shared/datasources.d.ts.map +1 -1
  248. package/dist/shared/datasources.js +1 -1
  249. package/dist/shared/images.d.ts +30 -0
  250. package/dist/shared/images.d.ts.map +1 -0
  251. package/dist/shared/images.js +3 -0
  252. package/dist/shared/layout-constants.js +1 -1
  253. package/dist/shared/page.d.ts +104 -2670
  254. package/dist/shared/page.d.ts.map +1 -1
  255. package/dist/shared/page.js +1 -1
  256. package/dist/shared/prompt.d.ts +4 -0
  257. package/dist/shared/prompt.d.ts.map +1 -0
  258. package/dist/shared/prompt.js +3 -0
  259. package/dist/shared/responsive.d.ts +3 -3
  260. package/dist/shared/responsive.d.ts.map +1 -1
  261. package/dist/shared/responsive.js +1 -1
  262. package/dist/shared/site.d.ts +545 -0
  263. package/dist/shared/site.d.ts.map +1 -0
  264. package/dist/shared/site.js +3 -0
  265. package/dist/shared/sitemap.d.ts +38 -0
  266. package/dist/shared/sitemap.d.ts.map +1 -0
  267. package/dist/shared/sitemap.js +3 -0
  268. package/dist/shared/theme.d.ts +41 -19
  269. package/dist/shared/theme.d.ts.map +1 -1
  270. package/dist/shared/theme.js +1 -1
  271. package/dist/shared/themes/color-system.d.ts +5 -309
  272. package/dist/shared/themes/color-system.d.ts.map +1 -1
  273. package/dist/shared/themes/color-system.js +1 -1
  274. package/dist/shared/utils/invariant.js +1 -1
  275. package/dist/shared/utils/schema.d.ts +10 -2
  276. package/dist/shared/utils/schema.d.ts.map +1 -1
  277. package/dist/shared/utils/schema.js +1 -1
  278. package/dist/shared/utils/typed-ref.d.ts +32 -0
  279. package/dist/shared/utils/typed-ref.d.ts.map +1 -0
  280. package/dist/shared/utils/typed-ref.js +3 -0
  281. package/package.json +11 -11
  282. package/src/node/cli/api.ts +101 -0
  283. package/src/node/cli/commands/cmd-build.ts +64 -0
  284. package/src/node/cli/commands/login/cmd-login.ts +111 -0
  285. package/src/node/cli/commands/logout/cmd-logout.ts +11 -0
  286. package/src/node/cli/commands/publish/cmd-publish.ts +135 -0
  287. package/src/node/cli/commands/publish/parse-gitignore.ts +278 -0
  288. package/src/node/cli/commands/publish/uploader.ts +333 -0
  289. package/src/node/cli/constants.ts +14 -0
  290. package/src/node/cli/is-logged-in.ts +28 -0
  291. package/src/node/cli/program.ts +77 -0
  292. package/src/node/cli/store.ts +64 -0
  293. package/src/node/cli/tests/api.test.ts +161 -0
  294. package/src/node/cli/types.ts +34 -0
  295. package/src/node/cli/utils.ts +20 -0
  296. package/src/node/shared/config.ts +69 -0
  297. package/src/node/shared/logger.ts +44 -0
  298. package/src/shared/ajv.ts +111 -0
  299. package/src/shared/analytics/init.ts +14 -0
  300. package/src/shared/analytics/track.ts +21 -0
  301. package/src/shared/analytics/types.ts +13 -0
  302. package/src/shared/attributes.ts +222 -0
  303. package/src/shared/brick-manifest.ts +110 -0
  304. package/src/shared/bricks/manifests/accordion.manifest.ts +179 -0
  305. package/src/shared/bricks/manifests/all-manifests.ts +92 -0
  306. package/src/shared/bricks/manifests/button.manifest.ts +145 -0
  307. package/src/shared/bricks/manifests/card.manifest.ts +269 -0
  308. package/src/shared/bricks/manifests/carousel.manifest.ts +106 -0
  309. package/src/shared/bricks/manifests/container.manifest.ts +357 -0
  310. package/src/shared/bricks/manifests/divider.manifest.ts +121 -0
  311. package/src/shared/bricks/manifests/footer.manifest.ts +487 -0
  312. package/src/shared/bricks/manifests/form.manifest.ts +112 -0
  313. package/src/shared/bricks/manifests/hero.manifest.ts +132 -0
  314. package/src/shared/bricks/manifests/icon.manifest.ts +130 -0
  315. package/src/shared/bricks/manifests/image.manifest.ts +203 -0
  316. package/src/shared/bricks/manifests/images-gallery.manifest.ts +227 -0
  317. package/src/shared/bricks/manifests/map.manifest.ts +75 -0
  318. package/src/shared/bricks/manifests/navbar.manifest.ts +344 -0
  319. package/src/shared/bricks/manifests/sidebar.manifest.ts +90 -0
  320. package/src/shared/bricks/manifests/social-links.manifest.ts +370 -0
  321. package/src/shared/bricks/manifests/testimonials.manifest.ts +397 -0
  322. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +10 -0
  323. package/src/shared/bricks/manifests/text.manifest.ts +164 -0
  324. package/src/shared/bricks/manifests/timeline.manifest.ts +456 -0
  325. package/src/shared/bricks/manifests/video.manifest.ts +59 -0
  326. package/src/shared/bricks/props/_style-presets.ts +352 -0
  327. package/src/shared/bricks/props/align.ts +59 -0
  328. package/src/shared/bricks/props/background.ts +118 -0
  329. package/src/shared/bricks/props/boolean.ts +11 -0
  330. package/src/shared/bricks/props/border.ts +84 -0
  331. package/src/shared/bricks/props/color.ts +24 -0
  332. package/src/shared/bricks/props/common.ts +37 -0
  333. package/src/shared/bricks/props/container.ts +356 -0
  334. package/src/shared/bricks/props/css-length.ts +25 -0
  335. package/src/shared/bricks/props/datasource.ts +60 -0
  336. package/src/shared/bricks/props/date.ts +24 -0
  337. package/src/shared/bricks/props/effects.ts +123 -0
  338. package/src/shared/bricks/props/enum.ts +42 -0
  339. package/src/shared/bricks/props/file.ts +12 -0
  340. package/src/shared/bricks/props/geolocation.ts +30 -0
  341. package/src/shared/bricks/props/helpers.ts +101 -0
  342. package/src/shared/bricks/props/image.ts +90 -0
  343. package/src/shared/bricks/props/number.ts +16 -0
  344. package/src/shared/bricks/props/padding.ts +21 -0
  345. package/src/shared/bricks/props/position.ts +27 -0
  346. package/src/shared/bricks/props/preset.ts +136 -0
  347. package/src/shared/bricks/props/string.ts +60 -0
  348. package/src/shared/bricks/props/tests/align.test.ts +37 -0
  349. package/src/shared/bricks/props/tests/background.test.ts +102 -0
  350. package/src/shared/bricks/props/tests/border.test.ts +38 -0
  351. package/src/shared/bricks/props/tests/effects.test.ts +37 -0
  352. package/src/shared/bricks/props/tests/helpers.test.ts +133 -0
  353. package/src/shared/bricks/props/tests/image.test.ts +71 -0
  354. package/src/shared/bricks/props/tests/padding.ts +12 -0
  355. package/src/shared/bricks/props/tests/string.test.ts +79 -0
  356. package/src/shared/bricks/props/text.ts +66 -0
  357. package/src/shared/bricks/props/types.ts +57 -0
  358. package/src/shared/bricks.ts +232 -0
  359. package/src/shared/context.ts +39 -0
  360. package/src/shared/datarecords/external/airtable/handler.ts +21 -0
  361. package/src/shared/datarecords/external/airtable/options.ts +22 -0
  362. package/src/shared/datarecords/external/generic-webhook/handler.ts +10 -0
  363. package/src/shared/datarecords/external/generic-webhook/options.ts +13 -0
  364. package/src/shared/datarecords/external/google/oauth/config.ts +30 -0
  365. package/src/shared/datarecords/external/google/sheets/handler.ts +26 -0
  366. package/src/shared/datarecords/external/google/sheets/options.ts +9 -0
  367. package/src/shared/datarecords/types.ts +120 -0
  368. package/src/shared/datarecords.ts +5 -0
  369. package/src/shared/datasources/README.md +3 -0
  370. package/src/shared/datasources/external/facebook/posts/fetcher.ts +62 -0
  371. package/src/shared/datasources/external/facebook/posts/sample.ts +35 -0
  372. package/src/shared/datasources/external/facebook/posts/schema.ts +33 -0
  373. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +91 -0
  374. package/src/shared/datasources/external/http-json/fetcher.ts +28 -0
  375. package/src/shared/datasources/external/http-json/options.ts +12 -0
  376. package/src/shared/datasources/external/http-json/schema.ts +6 -0
  377. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +70 -0
  378. package/src/shared/datasources/external/instagram/feed/fetcher.ts +43 -0
  379. package/src/shared/datasources/external/instagram/feed/sample.ts +22 -0
  380. package/src/shared/datasources/external/instagram/feed/schema.ts +23 -0
  381. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +82 -0
  382. package/src/shared/datasources/external/mastodon/account/fetcher.ts +33 -0
  383. package/src/shared/datasources/external/mastodon/account/sample.ts +33 -0
  384. package/src/shared/datasources/external/mastodon/account/schema.ts +45 -0
  385. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +65 -0
  386. package/src/shared/datasources/external/mastodon/options.ts +11 -0
  387. package/src/shared/datasources/external/mastodon/status/fetcher.ts +45 -0
  388. package/src/shared/datasources/external/mastodon/status/sample.array.ts +59 -0
  389. package/src/shared/datasources/external/mastodon/status/sample.single.ts +55 -0
  390. package/src/shared/datasources/external/mastodon/status/schema.ts +130 -0
  391. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +74 -0
  392. package/src/shared/datasources/external/meta/oauth/config.ts +16 -0
  393. package/src/shared/datasources/external/meta/options.ts +11 -0
  394. package/src/shared/datasources/external/rss/fetcher.ts +30 -0
  395. package/src/shared/datasources/external/rss/options.ts +11 -0
  396. package/src/shared/datasources/external/rss/sample.ts +22 -0
  397. package/src/shared/datasources/external/rss/schema.ts +42 -0
  398. package/src/shared/datasources/external/threads/media/fetcher.ts +63 -0
  399. package/src/shared/datasources/external/threads/media/sample.ts +44 -0
  400. package/src/shared/datasources/external/threads/media/schema.ts +37 -0
  401. package/src/shared/datasources/external/tiktok/oauth/config.ts +17 -0
  402. package/src/shared/datasources/external/tiktok/video/fetcher.ts +49 -0
  403. package/src/shared/datasources/external/tiktok/video/options.ts +12 -0
  404. package/src/shared/datasources/external/tiktok/video/sample.ts +26 -0
  405. package/src/shared/datasources/external/tiktok/video/schema.ts +27 -0
  406. package/src/shared/datasources/external/youtube/list/fetcher.ts +46 -0
  407. package/src/shared/datasources/external/youtube/list/options.ts +15 -0
  408. package/src/shared/datasources/external/youtube/list/sample.ts +33 -0
  409. package/src/shared/datasources/external/youtube/list/schema.ts +38 -0
  410. package/src/shared/datasources/external/youtube/oauth/config.ts +15 -0
  411. package/src/shared/datasources/fetcher.ts +17 -0
  412. package/src/shared/datasources/internal/blog/schema.ts +69 -0
  413. package/src/shared/datasources/internal/changelog/schema.ts +48 -0
  414. package/src/shared/datasources/internal/contact-info/schema.ts +20 -0
  415. package/src/shared/datasources/internal/cv/schema.ts +217 -0
  416. package/src/shared/datasources/internal/faq/schema.ts +27 -0
  417. package/src/shared/datasources/internal/job-board/schema.ts +228 -0
  418. package/src/shared/datasources/internal/links/schema.ts +15 -0
  419. package/src/shared/datasources/internal/recipes/schema.ts +42 -0
  420. package/src/shared/datasources/internal/restaurant/schema.ts +225 -0
  421. package/src/shared/datasources/provider-options.ts +7 -0
  422. package/src/shared/datasources/samples.ts +26 -0
  423. package/src/shared/datasources/schemas.ts +45 -0
  424. package/src/shared/datasources/types.ts +276 -0
  425. package/src/shared/datasources/utils.ts +16 -0
  426. package/src/shared/datasources.ts +42 -0
  427. package/src/shared/env.ts +23 -0
  428. package/src/shared/errors.ts +1 -0
  429. package/src/shared/images.ts +44 -0
  430. package/src/shared/index.ts +3 -0
  431. package/src/shared/layout-constants.ts +25 -0
  432. package/src/shared/manifest.ts +50 -0
  433. package/src/shared/oauth.ts +16 -0
  434. package/src/shared/page.ts +61 -0
  435. package/src/shared/prompt.ts +9 -0
  436. package/src/shared/responsive.ts +5 -0
  437. package/src/shared/site.ts +97 -0
  438. package/src/shared/sitemap.ts +66 -0
  439. package/src/shared/social-icons.ts +307 -0
  440. package/src/shared/tests/attributes.test.ts +37 -0
  441. package/src/shared/theme.ts +245 -0
  442. package/src/shared/themes/README.md +34 -0
  443. package/src/shared/themes/color-system.ts +127 -0
  444. package/src/shared/utils/canvas-data-uri.ts +2 -0
  445. package/src/shared/utils/invariant.ts +25 -0
  446. package/src/shared/utils/json-date.ts +8 -0
  447. package/src/shared/utils/merge.ts +12 -0
  448. package/src/shared/utils/object-hash.ts +7 -0
  449. package/src/shared/utils/schema.ts +30 -0
  450. package/src/shared/utils/try-catch.ts +12 -0
  451. package/src/shared/utils/typed-ref.ts +41 -0
  452. package/dist/shared/bricks/manifests/countdown.manifest.d.ts +0 -57
  453. package/dist/shared/bricks/manifests/countdown.manifest.d.ts.map +0 -1
  454. package/dist/shared/bricks/manifests/countdown.manifest.js +0 -3
  455. package/dist/shared/bricks/manifests/generic-component.manifest.d.ts +0 -62
  456. package/dist/shared/bricks/manifests/generic-component.manifest.d.ts.map +0 -1
  457. package/dist/shared/bricks/manifests/generic-component.manifest.js +0 -3
  458. package/dist/shared/bricks/manifests/header.manifest.d.ts +0 -275
  459. package/dist/shared/bricks/manifests/header.manifest.d.ts.map +0 -1
  460. package/dist/shared/bricks/manifests/header.manifest.js +0 -3
  461. package/dist/shared/bricks/props/_docs-common-styles.d.ts +0 -59
  462. package/dist/shared/bricks/props/_docs-common-styles.d.ts.map +0 -1
  463. package/dist/shared/bricks/props/_docs-common-styles.js +0 -3
  464. package/dist/shared/bricks/props/tests/container.test.d.ts +0 -2
  465. package/dist/shared/bricks/props/tests/container.test.d.ts.map +0 -1
  466. package/dist/shared/chunk-2ZPY4LCA.js +0 -3
  467. package/dist/shared/chunk-3CY6AZG7.js +0 -3
  468. package/dist/shared/chunk-4K5NN4CN.js +0 -3
  469. package/dist/shared/chunk-4NCCSLBW.js +0 -3
  470. package/dist/shared/chunk-6I4PY5WS.js +0 -3
  471. package/dist/shared/chunk-6LDLGZUM.js +0 -3
  472. package/dist/shared/chunk-AZ63RF3K.js +0 -3
  473. package/dist/shared/chunk-BH4HTAAC.js +0 -3
  474. package/dist/shared/chunk-BK6LBWDI.js +0 -3
  475. package/dist/shared/chunk-BMDB2V7J.js +0 -3
  476. package/dist/shared/chunk-DAPQ4JPP.js +0 -3
  477. package/dist/shared/chunk-ECZ6FGZM.js +0 -3
  478. package/dist/shared/chunk-EFJQECVB.js +0 -3
  479. package/dist/shared/chunk-F2ZVIFHO.js +0 -3
  480. package/dist/shared/chunk-H6L4KRCJ.js +0 -3
  481. package/dist/shared/chunk-IWSVY2VC.js +0 -3
  482. package/dist/shared/chunk-JVDUEZYO.js +0 -3
  483. package/dist/shared/chunk-KB4HY432.js +0 -3
  484. package/dist/shared/chunk-KOTGMAXH.js +0 -3
  485. package/dist/shared/chunk-LDOM2LJF.js +0 -3
  486. package/dist/shared/chunk-NFU5BF6G.js +0 -3
  487. package/dist/shared/chunk-P5FVZ5PL.js +0 -3
  488. package/dist/shared/chunk-PD7P5KSV.js +0 -3
  489. package/dist/shared/chunk-PJ6HA55L.js +0 -3
  490. package/dist/shared/chunk-PSNFBHPU.js +0 -3
  491. package/dist/shared/chunk-PSSJMWGU.js +0 -3
  492. package/dist/shared/chunk-PU2FOOTY.js +0 -3
  493. package/dist/shared/chunk-Q4MXTCE4.js +0 -8
  494. package/dist/shared/chunk-RBYYMUOZ.js +0 -3
  495. package/dist/shared/chunk-S2RQWOG2.js +0 -3
  496. package/dist/shared/chunk-SO5M7CYA.js +0 -3
  497. package/dist/shared/chunk-THRRILTW.js +0 -3
  498. package/dist/shared/chunk-TQ23UATQ.js +0 -3
  499. package/dist/shared/chunk-U44NTSIO.js +0 -3
  500. package/dist/shared/chunk-U4R5EGBK.js +0 -3
  501. package/dist/shared/chunk-WOEBR25A.js +0 -3
  502. package/dist/shared/chunk-WPTVLIYS.js +0 -3
  503. package/dist/shared/chunk-WXKRIUTA.js +0 -3
  504. package/dist/shared/chunk-XBX6II3M.js +0 -3
  505. package/dist/shared/chunk-XEQ2XZLQ.js +0 -3
  506. package/dist/shared/chunk-XGCBIXOO.js +0 -3
  507. package/dist/shared/chunk-YY6DANZF.js +0 -3
  508. package/dist/shared/chunk-ZWQHIQEQ.js +0 -3
  509. package/dist/shared/datasources/external/json/fetcher.d.ts.map +0 -1
  510. package/dist/shared/datasources/external/json/options.d.ts.map +0 -1
  511. package/dist/shared/datasources/external/json/schema.d.ts.map +0 -1
  512. package/dist/shared/datasources/external/json/tests/fetcher.test.d.ts.map +0 -1
  513. package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts +0 -2
  514. package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts.map +0 -1
  515. package/dist/shared/template.d.ts +0 -898
  516. package/dist/shared/template.d.ts.map +0 -1
  517. package/dist/shared/template.js +0 -3
  518. package/dist/shared/tests/page.test.d.ts +0 -2
  519. package/dist/shared/tests/page.test.d.ts.map +0 -1
  520. package/dist/shared/tests/test-config.d.ts +0 -3
  521. package/dist/shared/tests/test-config.d.ts.map +0 -1
  522. package/dist/shared/themes/all-themes.d.ts +0 -3
  523. package/dist/shared/themes/all-themes.d.ts.map +0 -1
  524. package/dist/shared/themes/all-themes.js +0 -3
  525. /package/dist/shared/datasources/external/{json → http-json}/fetcher.d.ts +0 -0
  526. /package/dist/shared/datasources/external/{json → http-json}/options.d.ts +0 -0
  527. /package/dist/shared/datasources/external/{json → http-json}/tests/fetcher.test.d.ts +0 -0
@@ -0,0 +1,133 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { Type } from "@sinclair/typebox";
3
+ import { prop, group, defineProps, getGroupInfo, getStyleProperties } from "../helpers";
4
+ import { manifest as sampleManifest } from "../../manifests/navbar.manifest";
5
+
6
+ describe("Props helpers test suite", () => {
7
+ describe("prop", () => {
8
+ it("should create a schema with the correct title", () => {
9
+ const schema = Type.String();
10
+ const result = prop({ title: "Test Title", schema });
11
+ expect(result.title).toBe("Test Title");
12
+ });
13
+
14
+ it("should add description when provided", () => {
15
+ const schema = Type.String();
16
+ const result = prop({ title: "Test", schema, description: "Test description" });
17
+ expect(result.description).toBe("Test description");
18
+ });
19
+
20
+ it("should add $id when provided", () => {
21
+ const schema = Type.String();
22
+ const result = prop({ title: "Test", schema, $id: "testId" });
23
+ expect(result.$id).toBe("testId");
24
+ });
25
+ });
26
+
27
+ describe("group", () => {
28
+ it("should create a group object with the correct title", () => {
29
+ const children = {
30
+ test: Type.String({ title: "Test String" }),
31
+ };
32
+ const result = group({ title: "Test Group", children });
33
+ expect(result.title).toBe("Test Group");
34
+ });
35
+
36
+ it("should have the correct default tab", () => {
37
+ const children = { test: Type.String() };
38
+ const result = group({ title: "Test Group", children });
39
+ const info = getGroupInfo(result);
40
+ expect(info.tab).toBe("common");
41
+ });
42
+
43
+ it("should use the provided tab", () => {
44
+ const children = { test: Type.String() };
45
+ const result = group({ title: "Test Group", children });
46
+ const info = getGroupInfo(result);
47
+ expect(info.tab).toBe("common");
48
+ });
49
+
50
+ it("should create a proper group ID from the title", () => {
51
+ const children = { test: Type.String() };
52
+ const result = group({ title: "Test Group Name", children });
53
+ const info = getGroupInfo(result);
54
+ expect(info.meta.group).toBe(true);
55
+ });
56
+
57
+ it("should contain the correct children", () => {
58
+ const children = {
59
+ stringProp: Type.String({ title: "String Prop" }),
60
+ numberProp: Type.Number({ title: "Number Prop" }),
61
+ };
62
+ const result = group({ title: "Test Group", children });
63
+
64
+ expect(result.properties.stringProp).toBeDefined();
65
+ expect(result.properties.stringProp.title).toBe("String Prop");
66
+ expect(result.properties.numberProp).toBeDefined();
67
+ expect(result.properties.numberProp.title).toBe("Number Prop");
68
+ });
69
+ });
70
+
71
+ describe("defineProps", () => {
72
+ it("should combine props into a single object schema", () => {
73
+ const props = {
74
+ stringProp: Type.String({ title: "String Prop" }),
75
+ groupProp: group({
76
+ title: "Group Prop",
77
+ children: {
78
+ nestedProp: Type.Number({ title: "Nested Prop" }),
79
+ },
80
+ }),
81
+ };
82
+
83
+ const result = defineProps(props);
84
+
85
+ expect(result.type).toBe("object");
86
+ expect(result.properties.stringProp).toBeDefined();
87
+ expect(result.properties.groupProp).toBeDefined();
88
+ expect(result.properties.groupProp.properties.nestedProp).toBeDefined();
89
+ });
90
+
91
+ it("should include common props", () => {
92
+ const props = {
93
+ stringProp: Type.String({ title: "String Prop" }),
94
+ };
95
+
96
+ const result = defineProps(props);
97
+
98
+ // Check for common props (this assumes the structure of commonProps)
99
+ // You may need to adjust this expectation based on the actual structure
100
+ expect(result.properties).toHaveProperty("stringProp");
101
+ });
102
+ });
103
+
104
+ describe("getGroupInfo", () => {
105
+ it("should use 'common' as default tab when not specified", () => {
106
+ const schema = Type.Object(
107
+ {},
108
+ {
109
+ title: "Test",
110
+ metadata: { group: "test" },
111
+ },
112
+ );
113
+
114
+ const info = getGroupInfo(schema);
115
+
116
+ expect(info.tab).toBe("common");
117
+ });
118
+ });
119
+
120
+ describe("getStyleProperties", () => {
121
+ it("should extract style properties from a schema", () => {
122
+ const styles = getStyleProperties(sampleManifest.props);
123
+ expect(styles).toMatchObject({
124
+ "brand.color": "#styles:color",
125
+ "container.backgroundColor": "#styles:backgroundColor",
126
+ "container.border": "#styles:border",
127
+ "container.fixedPositioned": "#styles:fixedPositioned",
128
+ "container.shadow": "#styles:shadow",
129
+ "navigation.color": "#styles:color",
130
+ });
131
+ });
132
+ });
133
+ });
@@ -0,0 +1,71 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { image } from "../image";
3
+
4
+ describe("Image prop test suite", () => {
5
+ describe("image", () => {
6
+ it("should have the correct title", () => {
7
+ const imageProp = image();
8
+ expect(imageProp.title).toBe("Image");
9
+ });
10
+
11
+ it("should have a custom title when provided", () => {
12
+ const imageProp = image("Custom Image");
13
+ expect(imageProp.title).toBe("Custom Image");
14
+ });
15
+
16
+ it("should have the correct UI field type", () => {
17
+ const imageProp = image();
18
+ expect(imageProp["ui:field"]).toBe("image");
19
+ });
20
+
21
+ it("should accept image files", () => {
22
+ const imageProp = image();
23
+ expect(imageProp["ui:accept"]).toBe("image/*");
24
+ });
25
+
26
+ it("should not show image search by default", () => {
27
+ const imageProp = image();
28
+ expect(imageProp["ui:show-img-search"]).toBe(false);
29
+ });
30
+
31
+ it("should show image search when specified", () => {
32
+ const imageProp = image("Image", { showImgSearch: true });
33
+ expect(imageProp["ui:show-img-search"]).toBe(true);
34
+ });
35
+
36
+ describe("src property", () => {
37
+ it("should have correct src title", () => {
38
+ const imageProp = image("Custom Image");
39
+ expect(imageProp.properties?.src.title).toBe("Custom Image");
40
+ });
41
+
42
+ it("should have default image URL when specified", () => {
43
+ const defaultUrl = "https://example.com/image.jpg";
44
+ const imageProp = image("Image", { defaultImageUrl: defaultUrl });
45
+ expect(imageProp.properties?.src.default).toBe(defaultUrl);
46
+ });
47
+ });
48
+
49
+ describe("alt property", () => {
50
+ it("should have the correct title", () => {
51
+ const imageProp = image();
52
+ expect(imageProp.properties?.alt.title).toBe("Alternate Text");
53
+ });
54
+
55
+ it("should have a description", () => {
56
+ const imageProp = image();
57
+ expect(imageProp.properties?.alt.description).toContain("screen readers and SEO");
58
+ });
59
+
60
+ it("should have a placeholder", () => {
61
+ const imageProp = image();
62
+ expect(imageProp.properties?.alt["ui:placeholder"]).toBe("Your image description");
63
+ });
64
+
65
+ it("should be optional", () => {
66
+ const imageProp = image();
67
+ expect(imageProp.properties?.alt.required).toBeUndefined();
68
+ });
69
+ });
70
+ });
71
+ });
@@ -0,0 +1,12 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { padding } from "../padding";
3
+
4
+ describe("Padding props test suite", () => {
5
+ describe("padding", () => {
6
+ it("should have correct title and group metadata", () => {
7
+ const prop = padding();
8
+ expect(prop.title).toBe("Padding");
9
+ expect(prop["ui:group"]).toBe("spacing");
10
+ });
11
+ });
12
+ });
@@ -0,0 +1,79 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { string, url, urlOrPageId } from "../string";
3
+
4
+ describe("String prop test suite", () => {
5
+ describe("string", () => {
6
+ it("should have the correct title", () => {
7
+ const stringProp = string("Test String");
8
+ expect(stringProp.title).toBe("Test String");
9
+ });
10
+
11
+ it("should have the correct default value when provided", () => {
12
+ const stringProp = string("Test String", "Default value");
13
+ expect(stringProp.default).toBe("Default value");
14
+ });
15
+
16
+ it("should apply additional options when provided", () => {
17
+ const stringProp = string("Test String", undefined, { minLength: 5, maxLength: 10 });
18
+ expect(stringProp.minLength).toBe(5);
19
+ expect(stringProp.maxLength).toBe(10);
20
+ });
21
+
22
+ it("should apply UI field options when provided", () => {
23
+ const stringProp = string("Test String", undefined, { "ui:field": "textarea" });
24
+ expect(stringProp["ui:field"]).toBe("textarea");
25
+ });
26
+ });
27
+
28
+ describe("url", () => {
29
+ it("should have the correct title", () => {
30
+ const urlProp = url();
31
+ expect(urlProp.title).toBe("URL");
32
+ });
33
+
34
+ it("should have custom title when provided", () => {
35
+ const urlProp = url("Custom URL");
36
+ expect(urlProp.title).toBe("Custom URL");
37
+ });
38
+
39
+ it("should have the correct format", () => {
40
+ const urlProp = url();
41
+ expect(urlProp.format).toBe("uri");
42
+ });
43
+
44
+ it("should use the correct UI field", () => {
45
+ const urlProp = url();
46
+ expect(urlProp["ui:field"]).toBe("url");
47
+ });
48
+ });
49
+
50
+ describe("urlOrPageId", () => {
51
+ it("should have the correct title", () => {
52
+ const prop = urlOrPageId();
53
+ expect(prop.title).toBe("URL or Page ID");
54
+ });
55
+
56
+ it("should have custom title when provided", () => {
57
+ const prop = urlOrPageId("Custom Link");
58
+ expect(prop.title).toBe("Custom Link");
59
+ });
60
+
61
+ it("should be a union type", () => {
62
+ const prop = urlOrPageId();
63
+ expect(prop.anyOf).toBeDefined();
64
+ expect(prop.anyOf?.length).toBe(2);
65
+ });
66
+
67
+ it("should contain URL and page-id options", () => {
68
+ const prop = urlOrPageId();
69
+
70
+ // First option should be URL
71
+ const urlOption = prop.anyOf?.[0];
72
+ expect(urlOption?.format).toBe("uri");
73
+
74
+ // Second option should be page-id
75
+ const pageIdOption = prop.anyOf?.[1];
76
+ expect(pageIdOption?.["ui:field"]).toBe("page-id");
77
+ });
78
+ });
79
+ });
@@ -0,0 +1,66 @@
1
+ import { type StringOptions, Type, type Static } from "@sinclair/typebox";
2
+ import { prop } from "./helpers";
3
+ import { typedRef } from "~/shared/utils/typed-ref";
4
+
5
+ export function fontSize(defaultValue = "inherit", title = "Font size") {
6
+ return prop({
7
+ title,
8
+ schema: Type.Union(
9
+ [
10
+ Type.Literal("inherit", { title: "Inherit from parent" }),
11
+ Type.Literal("text-xs", { title: "Extra small" }),
12
+ Type.Literal("text-sm", { title: "Small" }),
13
+ Type.Literal("text-base", { title: "Base size" }),
14
+ Type.Literal("text-lg", { title: "Large" }),
15
+ Type.Literal("text-xl", { title: "Extra large" }),
16
+ Type.Literal("text-2xl", { title: "Extra large (2x)" }),
17
+ Type.Literal("text-3xl", { title: "Extra large (3x)" }),
18
+ Type.Literal("text-4xl", { title: "Extra large (4x)" }),
19
+ Type.Literal("text-5xl", { title: "Extra large (5x)" }),
20
+ Type.Literal("text-6xl", { title: "Extra large (6x)" }),
21
+ Type.Literal("text-7xl", { title: "Extra large (7x)" }),
22
+ ],
23
+ {
24
+ default: defaultValue,
25
+ "ui:styleId": "#styles:fontSize",
26
+ "ui:field": "enum",
27
+ "ui:display": "select",
28
+ },
29
+ ),
30
+ });
31
+ }
32
+
33
+ export type FontSizeSettings = Static<ReturnType<typeof fontSize>>;
34
+
35
+ type TextContentOptions = {
36
+ showInSettings?: boolean;
37
+ disableSizing?: boolean;
38
+ disableAlignment?: boolean;
39
+ };
40
+
41
+ export function textContent({
42
+ title = "Text",
43
+ default: defaults,
44
+ showInSettings,
45
+ disableSizing = false,
46
+ disableAlignment = false,
47
+ }: TextContentOptions & StringOptions = {}) {
48
+ return prop({
49
+ title,
50
+ description:
51
+ "Text content. Can contain basic HTML tags like `<strong>`, `<em>`, `<br>` and `<a>` as well as `<p>` and `<span>` and lists <ul> <ol> <li>.",
52
+ schema: Type.String({
53
+ $id: "content:text",
54
+ default: defaults ?? "My text",
55
+ "ui:disable-sizing": disableSizing,
56
+ "ui:disable-alignment": disableAlignment,
57
+ "ui:field": showInSettings ? "string" : "hidden",
58
+ }),
59
+ });
60
+ }
61
+
62
+ export type TextContentSettings = Static<ReturnType<typeof textContent>>;
63
+
64
+ export function textContentRef(options: TextContentOptions & StringOptions = {}) {
65
+ return typedRef("content:text", options);
66
+ }
@@ -0,0 +1,57 @@
1
+ import type { Static, TObject, TProperties, TSchema } from "@sinclair/typebox";
2
+ import type { BrickManifest } from "~/shared/brick-manifest";
3
+ import type { Brick } from "~/shared/bricks";
4
+
5
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
6
+
7
+ export type BrickProps<T extends BrickManifest> = {
8
+ brick: Omit<Brick, "props" | "mobileProps"> & {
9
+ props: Static<T["props"]>;
10
+ mobileProps?: Partial<Static<T["props"]>>;
11
+ };
12
+ editable?: boolean;
13
+ selected?: boolean;
14
+ isContainerChild?: boolean;
15
+ };
16
+
17
+ export type BrickPropCategory = "settings" | "presets" | "content";
18
+
19
+ // Export the TSchema type for use in other files
20
+ export type { TSchema };
21
+
22
+ type CommonMetadata = {
23
+ "ui:responsive"?: boolean | "mobile" | "mobile-only";
24
+ "ui:hidden"?: boolean | "if-empty";
25
+ "ui:scope"?: "site" | "page";
26
+ };
27
+
28
+ export type FieldMetadata = CommonMetadata & {
29
+ "ui:field"?: string;
30
+ [key: string]: string | number | boolean | undefined;
31
+ };
32
+
33
+ export type GroupMetadata = CommonMetadata & {
34
+ group?: string;
35
+ groupTab?: string;
36
+ [key: string]: string | number | boolean | undefined;
37
+ };
38
+
39
+ export interface PropSchema extends TSchema {
40
+ title: string;
41
+ }
42
+
43
+ export type Prop<T = TSchema> = {
44
+ title: string;
45
+ description?: string;
46
+ schema: T;
47
+ [key: string]: unknown;
48
+ };
49
+
50
+ export type PropGroup<T extends TProperties = TProperties> = {
51
+ title: string;
52
+ category: BrickPropCategory;
53
+ children: T | TObject<T>;
54
+ metadata?: GroupMetadata;
55
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
56
+ options?: Record<string, any>;
57
+ };
@@ -0,0 +1,232 @@
1
+ import { Type, type Static } from "@sinclair/typebox";
2
+ import { customAlphabet } from "nanoid";
3
+ import { defaultProps } from "./bricks/manifests/all-manifests";
4
+ import { backgroundRef } from "./bricks/props/background";
5
+ import { border, borderRef } from "./bricks/props/border";
6
+ import { preset, presetRef } from "./bricks/props/preset";
7
+ import { merge } from "lodash-es";
8
+ import { cssLength, cssLengthRef } from "./bricks/props/css-length";
9
+ import { enumProp } from "./bricks/props/enum";
10
+ import { containerLayoutRef } from "./bricks/props/container";
11
+ import { StringEnum } from "./utils/schema";
12
+
13
+ /**
14
+ * Generates a unique identifier for bricks.
15
+ */
16
+ export const generateId = customAlphabet("1234567890azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN", 7);
17
+
18
+ const brickAbsolutePositionSchema = Type.Object({
19
+ left: Type.Optional(
20
+ Type.String({
21
+ title: "top",
22
+ description: "The left position in css unit.",
23
+ }),
24
+ ),
25
+ top: Type.Optional(
26
+ Type.String({
27
+ title: "top",
28
+ description: "The top position in css unit.",
29
+ }),
30
+ ),
31
+ right: Type.Optional(
32
+ Type.String({
33
+ title: "right",
34
+ description: "The right position in css unit.",
35
+ }),
36
+ ),
37
+ bottom: Type.Optional(
38
+ Type.String({
39
+ title: "bottom",
40
+ description: "The bottom position in css unit.",
41
+ }),
42
+ ),
43
+ inset: Type.Optional(
44
+ Type.String({
45
+ title: "inset",
46
+ description: "The inset position in css unit.",
47
+ }),
48
+ ),
49
+ translateX: Type.Optional(
50
+ Type.String({
51
+ title: "translateX",
52
+ description: "The translateX position in css unit.",
53
+ }),
54
+ ),
55
+ translateY: Type.Optional(
56
+ Type.String({
57
+ title: "translateY",
58
+ description: "The translateY position in css unit.",
59
+ }),
60
+ ),
61
+ rotate: Type.Optional(
62
+ Type.String({
63
+ title: "rotate",
64
+ description: "The rotate position in css unit.",
65
+ }),
66
+ ),
67
+ });
68
+
69
+ export type BrickAbsolutePosition = Static<typeof brickAbsolutePositionSchema>;
70
+
71
+ export const brickTypeSchema = StringEnum(Object.keys(defaultProps), {
72
+ title: "Brick type",
73
+ });
74
+
75
+ export const brickSchema = Type.Object(
76
+ {
77
+ id: Type.String({
78
+ title: "ID",
79
+ description: "A unique identifier for the brick.",
80
+ }),
81
+ type: brickTypeSchema,
82
+ props: Type.Any({
83
+ title: "Props",
84
+ description: "The props of the brick. The available props depends on the brick type.",
85
+ }),
86
+ // props: Type.Object({
87
+ // ...commonProps,
88
+ // $children: Type.Optional(
89
+ // Type.Array(Type.Ref("brick"), {
90
+ // title: "Children",
91
+ // description: "The children of the brick. Only used when the brick is a container.",
92
+ // }),
93
+ // ),
94
+ // }),
95
+ mobileProps: Type.Optional(
96
+ Type.Object(
97
+ {},
98
+ { additionalProperties: true, description: "The props for mobile, merged with the default props" },
99
+ ),
100
+ ),
101
+ // props: Type.Record(Type.String(), Type.Any(), {
102
+ // description: "The available props depends on the brick type.",
103
+ // }),
104
+ // mobileProps: Type.Optional(
105
+ // Type.Record(Type.String(), Type.Any(), {
106
+ // description: "The props for mobile, merged with the default props",
107
+ // }),
108
+ // ),
109
+
110
+ // absolutePosition: Type.Optional(
111
+ // Type.Object(
112
+ // {
113
+ // mobile: brickAbsolutePositionSchema,
114
+ // desktop: brickAbsolutePositionSchema,
115
+ // },
116
+ // {
117
+ // title: "Position",
118
+ // description:
119
+ // "The position of the brick in the layout. Optional when the brick is a container child",
120
+ // additionalProperties: false,
121
+ // },
122
+ // ),
123
+ // ),
124
+ },
125
+ { $id: "brick", additionalProperties: true },
126
+ );
127
+
128
+ export type Brick = Static<typeof brickSchema>;
129
+
130
+ export const sectionProps = Type.Object(
131
+ {
132
+ layout: Type.Optional(
133
+ containerLayoutRef({
134
+ options: { disableGrid: true },
135
+ defaults: {
136
+ gap: "gap-4",
137
+ wrap: true,
138
+ fillSpace: false,
139
+ alignItems: "items-stretch",
140
+ justifyContent: "justify-stretch",
141
+ },
142
+ }),
143
+ ),
144
+ background: Type.Optional(backgroundRef()),
145
+ preset: Type.Optional(presetRef),
146
+ border: Type.Optional(borderRef),
147
+ minHeight: Type.Optional(
148
+ cssLengthRef({ title: "Minimum height", default: "0px", description: "The min height of the section" }),
149
+ ),
150
+ maxWidth: Type.Optional(
151
+ enumProp("Maximum width", "max-w-full", {
152
+ options: [
153
+ {
154
+ value: "max-w-screen-lg",
155
+ title: "Medium",
156
+ description: "Common for text-heavy content/blog posts",
157
+ },
158
+ { value: "max-w-screen-xl", title: "Large", description: "Usefull or some landing pages" },
159
+ { value: "max-w-screen-2xl", title: "Extra large", description: "Common width" },
160
+ { value: "max-w-full", title: "Full width", description: "Takes the entire space" },
161
+ ],
162
+ description: "The maximum width of the section. Desktop only",
163
+ displayAs: "select",
164
+ }),
165
+ ),
166
+ horizontalPadding: Type.Optional(
167
+ cssLengthRef({
168
+ title: "Horizontal padding",
169
+ default: "20px",
170
+ description: "Horizontal padding. Desktop only",
171
+ }),
172
+ ),
173
+ verticalPadding: Type.Optional(
174
+ cssLengthRef({ title: "Vertical padding", default: "20px", description: "Vertical padding." }),
175
+ ),
176
+ lastTouched: Type.Optional(
177
+ Type.Number({
178
+ description: "Do not use this field. It is used internally by the editor.",
179
+ "ui:field": "hidden",
180
+ }),
181
+ ),
182
+ },
183
+ { additionalProperties: true, "ai:instructions": "Do not use the border prop" },
184
+ );
185
+
186
+ export const sectionSchema = Type.Object(
187
+ {
188
+ id: Type.String({ description: "The unique ID of the section. Use a human readable url-safe slug" }),
189
+ label: Type.Optional(
190
+ Type.String({
191
+ description: "The label (name) of the section. Used for editor purposes only.",
192
+ }),
193
+ ),
194
+ order: Type.Number({
195
+ description: "Determines section order in the page (lower numbers appear first). 0-based",
196
+ }),
197
+ props: sectionProps,
198
+ mobileProps: Type.Optional(Type.Partial(sectionProps, { additionalProperties: false })),
199
+ bricks: Type.Array(brickSchema),
200
+ },
201
+ {
202
+ $id: "section",
203
+ description:
204
+ "Sections are direct children of the page that are stacked vertically, but they always align their children horizontally (flex-row).",
205
+ },
206
+ );
207
+
208
+ export type Section = Static<typeof sectionSchema>;
209
+
210
+ export function processSections(sections: Section[]) {
211
+ return sections.map((section) => {
212
+ return {
213
+ ...section,
214
+ bricks: section.bricks.map(processBrick),
215
+ } as const;
216
+ });
217
+ }
218
+
219
+ /**
220
+ * process a brick and add default props
221
+ */
222
+ export function processBrick<T extends Brick>(brick: T): T {
223
+ const defProps = defaultProps[brick.type];
224
+ const result = {
225
+ ...brick,
226
+ props: merge({}, defProps.props, {
227
+ ...brick.props,
228
+ ...(brick.props.$children ? { $children: (brick.props.$children as T[]).map(processBrick) } : {}),
229
+ }),
230
+ };
231
+ return result;
232
+ }
@@ -0,0 +1,39 @@
1
+ import type { GenericPageConfig } from "./page";
2
+ import type { Site } from "./site";
3
+ import type { Sitemap } from "./sitemap";
4
+
5
+ export type GenerationState = {
6
+ isReady: boolean;
7
+ hasSitemap: boolean;
8
+ hasThemesGenerated: boolean;
9
+ pages: GenericPageConfig[];
10
+ sitemap: Sitemap;
11
+ };
12
+
13
+ export type CallContextProps = {
14
+ /**
15
+ * The site object
16
+ */
17
+ site: Site;
18
+ /**
19
+ * All pages in the site.
20
+ */
21
+ pages: GenericPageConfig[];
22
+ /**
23
+ * Current page ID. Undefined if flow is "setup" and no paage has been created yet.
24
+ */
25
+ currentPageId?: string;
26
+ /**
27
+ * When generating a new site, the flow should be "setup".
28
+ * Otherwise, it should be "edit".
29
+ */
30
+ flow: "setup" | "edit";
31
+ /**
32
+ * The current generation state of the site. Only used when flow is "setup".
33
+ */
34
+ generationState?: GenerationState;
35
+ /**
36
+ * The user language guessed from the sitePrompt, if available.
37
+ */
38
+ userLanguage?: string;
39
+ };