@upstart.gg/sdk 0.0.130 → 0.0.132

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 (533) hide show
  1. package/dist/shared/ai/schemas.d.ts +13 -0
  2. package/dist/shared/ai/schemas.d.ts.map +1 -0
  3. package/dist/shared/ai/schemas.js +3 -0
  4. package/dist/shared/ai/types.d.ts +170 -0
  5. package/dist/shared/ai/types.d.ts.map +1 -0
  6. package/dist/shared/{chunk-EJGNYD4V.js → ai/types.js} +0 -1
  7. package/dist/shared/ajv.d.ts +2 -1
  8. package/dist/shared/ajv.d.ts.map +1 -1
  9. package/dist/shared/ajv.js +1 -1
  10. package/dist/shared/attributes.d.ts +300 -12
  11. package/dist/shared/attributes.d.ts.map +1 -1
  12. package/dist/shared/attributes.js +1 -1
  13. package/dist/shared/brick-manifest.d.ts +3 -1
  14. package/dist/shared/brick-manifest.d.ts.map +1 -1
  15. package/dist/shared/brick-manifest.js +1 -1
  16. package/dist/shared/bricks/manifests/accordion.manifest.d.ts +4 -3
  17. package/dist/shared/bricks/manifests/accordion.manifest.d.ts.map +1 -1
  18. package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
  19. package/dist/shared/bricks/manifests/all-manifests.d.ts +4 -1
  20. package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
  21. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  22. package/dist/shared/bricks/manifests/box.manifest.d.ts +6 -4
  23. package/dist/shared/bricks/manifests/box.manifest.d.ts.map +1 -1
  24. package/dist/shared/bricks/manifests/box.manifest.js +1 -1
  25. package/dist/shared/bricks/manifests/button.manifest.d.ts +4 -3
  26. package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
  27. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  28. package/dist/shared/bricks/manifests/card.manifest.d.ts +6 -5
  29. package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
  30. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  31. package/dist/shared/bricks/manifests/carousel.manifest.d.ts +6 -5
  32. package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
  33. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  34. package/dist/shared/bricks/manifests/footer.manifest.d.ts +40 -5
  35. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  36. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  37. package/dist/shared/bricks/manifests/form.manifest.d.ts +6 -5
  38. package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
  39. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  40. package/dist/shared/bricks/manifests/hero.manifest.d.ts +4 -3
  41. package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
  42. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  43. package/dist/shared/bricks/manifests/html.manifest.d.ts +3 -2
  44. package/dist/shared/bricks/manifests/html.manifest.d.ts.map +1 -1
  45. package/dist/shared/bricks/manifests/html.manifest.js +1 -1
  46. package/dist/shared/bricks/manifests/icon.manifest.d.ts +3 -2
  47. package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
  48. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  49. package/dist/shared/bricks/manifests/image.manifest.d.ts +10 -6
  50. package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
  51. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  52. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +7 -6
  53. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
  54. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  55. package/dist/shared/bricks/manifests/map.manifest.d.ts +5 -4
  56. package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
  57. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  58. package/dist/shared/bricks/manifests/navbar.manifest.d.ts +42 -8
  59. package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -1
  60. package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
  61. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +4 -3
  62. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
  63. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  64. package/dist/shared/bricks/manifests/social-links.manifest.d.ts +5 -4
  65. package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
  66. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  67. package/dist/shared/bricks/manifests/spacer.manifest.d.ts +3 -2
  68. package/dist/shared/bricks/manifests/spacer.manifest.d.ts.map +1 -1
  69. package/dist/shared/bricks/manifests/spacer.manifest.js +1 -1
  70. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +6 -5
  71. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -1
  72. package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
  73. package/dist/shared/bricks/manifests/text.manifest.d.ts +4 -3
  74. package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
  75. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  76. package/dist/shared/bricks/manifests/video.manifest.d.ts +4 -3
  77. package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
  78. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  79. package/dist/shared/bricks/props/align.d.ts.map +1 -1
  80. package/dist/shared/bricks/props/align.js +1 -1
  81. package/dist/shared/bricks/props/background.d.ts +6 -9
  82. package/dist/shared/bricks/props/background.d.ts.map +1 -1
  83. package/dist/shared/bricks/props/background.js +1 -1
  84. package/dist/shared/bricks/props/border.d.ts.map +1 -1
  85. package/dist/shared/bricks/props/border.js +1 -1
  86. package/dist/shared/bricks/props/color-preset.d.ts +3 -4
  87. package/dist/shared/bricks/props/color-preset.d.ts.map +1 -1
  88. package/dist/shared/bricks/props/color-preset.js +1 -1
  89. package/dist/shared/bricks/props/color.js +1 -1
  90. package/dist/shared/bricks/props/common.d.ts +6 -6
  91. package/dist/shared/bricks/props/common.d.ts.map +1 -1
  92. package/dist/shared/bricks/props/common.js +1 -1
  93. package/dist/shared/bricks/props/css-length.d.ts.map +1 -1
  94. package/dist/shared/bricks/props/css-length.js +1 -1
  95. package/dist/shared/bricks/props/datasource.d.ts +1 -1
  96. package/dist/shared/bricks/props/datasource.js +1 -1
  97. package/dist/shared/bricks/props/date.d.ts.map +1 -1
  98. package/dist/shared/bricks/props/date.js +1 -1
  99. package/dist/shared/bricks/props/direction.d.ts.map +1 -1
  100. package/dist/shared/bricks/props/direction.js +1 -1
  101. package/dist/shared/bricks/props/dynamic.d.ts.map +1 -1
  102. package/dist/shared/bricks/props/dynamic.js +1 -1
  103. package/dist/shared/bricks/props/effects.d.ts +0 -1
  104. package/dist/shared/bricks/props/effects.d.ts.map +1 -1
  105. package/dist/shared/bricks/props/effects.js +1 -1
  106. package/dist/shared/bricks/props/file.d.ts.map +1 -1
  107. package/dist/shared/bricks/props/file.js +1 -1
  108. package/dist/shared/bricks/props/geolocation.js +1 -1
  109. package/dist/shared/bricks/props/helpers.d.ts +2 -2
  110. package/dist/shared/bricks/props/helpers.js +1 -1
  111. package/dist/shared/bricks/props/image.d.ts +4 -4
  112. package/dist/shared/bricks/props/image.d.ts.map +1 -1
  113. package/dist/shared/bricks/props/image.js +1 -1
  114. package/dist/shared/bricks/props/position.d.ts +0 -2
  115. package/dist/shared/bricks/props/position.d.ts.map +1 -1
  116. package/dist/shared/bricks/props/position.js +1 -1
  117. package/dist/shared/bricks/props/string.js +1 -1
  118. package/dist/shared/bricks/props/tags.d.ts.map +1 -1
  119. package/dist/shared/bricks/props/tags.js +1 -1
  120. package/dist/shared/bricks/props/text.js +1 -1
  121. package/dist/shared/bricks/props/types.d.ts +1 -2
  122. package/dist/shared/bricks/props/types.d.ts.map +1 -1
  123. package/dist/shared/bricks.d.ts +189 -18
  124. package/dist/shared/bricks.d.ts.map +1 -1
  125. package/dist/shared/bricks.js +1 -1
  126. package/dist/shared/chunk-2CYAFF56.js +3 -0
  127. package/dist/shared/chunk-2NLDX5FG.js +3 -0
  128. package/dist/shared/chunk-3FPFR5RA.js +3 -0
  129. package/dist/shared/chunk-3P36LG6T.js +3 -0
  130. package/dist/shared/chunk-3QOAHMV4.js +5 -0
  131. package/dist/shared/chunk-46YDGGFF.js +3 -0
  132. package/dist/shared/chunk-4GIZ6WSG.js +3 -0
  133. package/dist/shared/chunk-5DZIQGY2.js +3 -0
  134. package/dist/shared/chunk-5WY7LYXK.js +3 -0
  135. package/dist/shared/chunk-5X5SX5N7.js +4 -0
  136. package/dist/shared/chunk-6L3Z5SZQ.js +3 -0
  137. package/dist/shared/{chunk-UU2MSQXY.js → chunk-6PGAWO4H.js} +1 -1
  138. package/dist/shared/chunk-6R76KIHZ.js +3 -0
  139. package/dist/shared/chunk-7UBMXMNJ.js +3 -0
  140. package/dist/shared/chunk-AB3IMRXZ.js +3 -0
  141. package/dist/shared/chunk-AMQAGDFH.js +3 -0
  142. package/dist/shared/chunk-ARMM6B47.js +3 -0
  143. package/dist/shared/chunk-ARYG4XMX.js +3 -0
  144. package/dist/shared/chunk-AZHH3XJJ.js +3 -0
  145. package/dist/shared/chunk-DHSWVVMI.js +3 -0
  146. package/dist/shared/chunk-DKNOZLA6.js +3 -0
  147. package/dist/shared/chunk-EVDZ2KND.js +6 -0
  148. package/dist/shared/chunk-F4JNKU7J.js +3 -0
  149. package/dist/shared/chunk-GC5OWY2Z.js +3 -0
  150. package/dist/shared/chunk-HP7CZB2F.js +3 -0
  151. package/dist/shared/chunk-HSRXUIVM.js +3 -0
  152. package/dist/shared/chunk-ILIWVWHC.js +8 -0
  153. package/dist/shared/chunk-JRCVYDCD.js +3 -0
  154. package/dist/shared/chunk-K5ADUHF4.js +3 -0
  155. package/dist/shared/chunk-L2HOZVBC.js +3 -0
  156. package/dist/shared/chunk-LEWKHCRI.js +3 -0
  157. package/dist/shared/chunk-LT4CW2F7.js +3 -0
  158. package/dist/shared/chunk-ML4JSDQM.js +34 -0
  159. package/dist/shared/chunk-MVCVVKBY.js +3 -0
  160. package/dist/shared/chunk-NKIEDT7V.js +3 -0
  161. package/dist/shared/chunk-NQKXDMQ5.js +3 -0
  162. package/dist/shared/chunk-PO6UODZ5.js +8 -0
  163. package/dist/shared/chunk-PW5HRVMD.js +3 -0
  164. package/dist/shared/chunk-PZYX3ACO.js +3 -0
  165. package/dist/shared/chunk-QGFQA7OZ.js +4 -0
  166. package/dist/shared/chunk-RJZZWCBD.js +3 -0
  167. package/dist/shared/chunk-SAJY7H6N.js +3 -0
  168. package/dist/shared/chunk-SFDRAHYP.js +3 -0
  169. package/dist/shared/chunk-STDCM2KD.js +3 -0
  170. package/dist/shared/chunk-TH5SONR6.js +3 -0
  171. package/dist/shared/chunk-UCR2UZOY.js +3 -0
  172. package/dist/shared/chunk-UDQWYGSO.js +3 -0
  173. package/dist/shared/{chunk-LSPN22SI.js → chunk-URRCKLAS.js} +3 -3
  174. package/dist/shared/{chunk-OIOYMECS.js → chunk-US53TNMK.js} +1 -1
  175. package/dist/shared/chunk-VDX2J22H.js +3 -0
  176. package/dist/shared/chunk-VK26ZZFR.js +3 -0
  177. package/dist/shared/chunk-VLXZMESE.js +3 -0
  178. package/dist/shared/chunk-WAML3IGZ.js +3 -0
  179. package/dist/shared/chunk-WXKRIUTA.js +3 -0
  180. package/dist/shared/chunk-X62OEAE6.js +3 -0
  181. package/dist/shared/chunk-XED6ARVN.js +3 -0
  182. package/dist/shared/chunk-XZLBM4AX.js +3 -0
  183. package/dist/shared/chunk-Y3X4F4YJ.js +3 -0
  184. package/dist/shared/chunk-Z4YKRLOX.js +3 -0
  185. package/dist/shared/context.d.ts +4 -12
  186. package/dist/shared/context.d.ts.map +1 -1
  187. package/dist/shared/datarecords/external/airtable/handler.d.ts +22 -5
  188. package/dist/shared/datarecords/external/airtable/handler.d.ts.map +1 -1
  189. package/dist/shared/datarecords/external/airtable/handler.js +1 -1
  190. package/dist/shared/datarecords/external/airtable/oauth/config.js +3 -0
  191. package/dist/shared/datarecords/external/airtable/types.d.ts +25 -0
  192. package/dist/shared/datarecords/external/airtable/types.d.ts.map +1 -1
  193. package/dist/shared/datarecords/external/airtable/types.js +3 -0
  194. package/dist/shared/datarecords/external/generic-webhook/handler.js +3 -0
  195. package/dist/shared/datarecords/external/generic-webhook/options.js +3 -0
  196. package/dist/shared/datarecords/external/google/sheets/client.js +3 -0
  197. package/dist/shared/datarecords/external/google/sheets/handler.d.ts +29 -5
  198. package/dist/shared/datarecords/external/google/sheets/handler.d.ts.map +1 -1
  199. package/dist/shared/datarecords/external/google/sheets/handler.js +5 -4
  200. package/dist/shared/datarecords/external/google/sheets/{options.d.ts → types.d.ts} +1 -1
  201. package/dist/shared/datarecords/external/google/sheets/types.d.ts.map +1 -0
  202. package/dist/shared/datarecords/external/google/sheets/types.js +3 -0
  203. package/dist/shared/datarecords/external/notion/handler.d.ts +29 -7
  204. package/dist/shared/datarecords/external/notion/handler.d.ts.map +1 -1
  205. package/dist/shared/datarecords/external/notion/handler.js +1 -1
  206. package/dist/shared/datarecords/external/notion/oauth/config.js +3 -0
  207. package/dist/shared/datarecords/external/notion/{options.d.ts → types.d.ts} +11 -1
  208. package/dist/shared/datarecords/external/notion/types.d.ts.map +1 -0
  209. package/dist/shared/datarecords/external/notion/types.js +3 -0
  210. package/dist/shared/datarecords/types.d.ts +17 -165
  211. package/dist/shared/datarecords/types.d.ts.map +1 -1
  212. package/dist/shared/datarecords/types.js +1 -1
  213. package/dist/shared/datarecords.d.ts +2 -2
  214. package/dist/shared/datarecords.d.ts.map +1 -1
  215. package/dist/shared/datarecords.js +1 -1
  216. package/dist/shared/datasources/external/facebook/posts/fetcher.js +3 -0
  217. package/dist/shared/datasources/external/facebook/posts/schema.js +3 -0
  218. package/dist/shared/datasources/external/http-json/fetcher.js +3 -0
  219. package/dist/shared/datasources/external/http-json/options.js +3 -0
  220. package/dist/shared/datasources/external/http-json/schema.js +3 -0
  221. package/dist/shared/datasources/external/instagram/feed/fetcher.js +3 -0
  222. package/dist/shared/datasources/external/instagram/feed/schema.js +3 -0
  223. package/dist/shared/datasources/external/mastodon/account/fetcher.js +3 -0
  224. package/dist/shared/datasources/external/mastodon/account/schema.js +3 -0
  225. package/dist/shared/datasources/external/mastodon/options.js +3 -0
  226. package/dist/shared/datasources/external/mastodon/status/fetcher.js +3 -0
  227. package/dist/shared/datasources/external/mastodon/status/sample.array.js +3 -0
  228. package/dist/shared/datasources/external/mastodon/status/sample.single.js +3 -0
  229. package/dist/shared/datasources/external/mastodon/status/schema.d.ts.map +1 -1
  230. package/dist/shared/datasources/external/mastodon/status/schema.js +3 -0
  231. package/dist/shared/datasources/external/meta/options.js +3 -0
  232. package/dist/shared/datasources/external/rss/fetcher.js +3 -0
  233. package/dist/shared/datasources/external/rss/options.js +3 -0
  234. package/dist/shared/datasources/external/rss/schema.js +3 -0
  235. package/dist/shared/datasources/external/threads/media/fetcher.js +3 -0
  236. package/dist/shared/datasources/external/threads/media/schema.js +3 -0
  237. package/dist/shared/datasources/external/tiktok/video/fetcher.js +3 -0
  238. package/dist/shared/datasources/external/tiktok/video/options.js +3 -0
  239. package/dist/shared/datasources/external/tiktok/video/schema.js +3 -0
  240. package/dist/shared/datasources/external/youtube/list/fetcher.js +3 -0
  241. package/dist/shared/datasources/external/youtube/list/options.js +3 -0
  242. package/dist/shared/datasources/external/youtube/list/schema.js +3 -0
  243. package/dist/shared/datasources/fetcher.js +2 -0
  244. package/dist/shared/datasources/internal/blog/schema.js +3 -0
  245. package/dist/shared/datasources/internal/changelog/schema.js +3 -0
  246. package/dist/shared/datasources/internal/contact-info/schema.js +3 -0
  247. package/dist/shared/datasources/internal/cv/schema.js +3 -0
  248. package/dist/shared/datasources/internal/faq/schema.js +3 -0
  249. package/dist/shared/datasources/internal/job-board/schema.js +3 -0
  250. package/dist/shared/datasources/internal/links/schema.js +3 -0
  251. package/dist/shared/datasources/internal/recipes/schema.js +3 -0
  252. package/dist/shared/datasources/internal/restaurant/schema.js +3 -0
  253. package/dist/shared/datasources/samples.js +3 -0
  254. package/dist/shared/datasources/schemas.d.ts +0 -49
  255. package/dist/shared/datasources/schemas.d.ts.map +1 -1
  256. package/dist/shared/datasources/schemas.js +1 -1
  257. package/dist/shared/datasources/types.d.ts +53 -130
  258. package/dist/shared/datasources/types.d.ts.map +1 -1
  259. package/dist/shared/datasources/types.js +1 -1
  260. package/dist/shared/datasources/utils.js +3 -0
  261. package/dist/shared/datasources.d.ts +7 -4
  262. package/dist/shared/datasources.d.ts.map +1 -1
  263. package/dist/shared/datasources.js +1 -1
  264. package/dist/shared/errors.js +1 -1
  265. package/dist/shared/images.d.ts +1 -12
  266. package/dist/shared/images.d.ts.map +1 -1
  267. package/dist/shared/images.js +1 -1
  268. package/dist/shared/index.js +3 -0
  269. package/dist/shared/manifest.js +3 -0
  270. package/dist/shared/page.d.ts +143 -12
  271. package/dist/shared/page.d.ts.map +1 -1
  272. package/dist/shared/page.js +1 -1
  273. package/dist/shared/site.d.ts +224 -114
  274. package/dist/shared/site.d.ts.map +1 -1
  275. package/dist/shared/site.js +1 -1
  276. package/dist/shared/sitemap.d.ts +167 -23
  277. package/dist/shared/sitemap.d.ts.map +1 -1
  278. package/dist/shared/sitemap.js +1 -1
  279. package/dist/shared/social-icons.js +3 -0
  280. package/dist/shared/theme.d.ts +41 -4
  281. package/dist/shared/theme.d.ts.map +1 -1
  282. package/dist/shared/theme.js +1 -1
  283. package/dist/shared/utils/invariant.js +1 -1
  284. package/dist/shared/utils/llm.d.ts +19 -0
  285. package/dist/shared/utils/llm.d.ts.map +1 -0
  286. package/dist/shared/utils/llm.js +3 -0
  287. package/dist/shared/utils/schema.d.ts +6 -1
  288. package/dist/shared/utils/schema.d.ts.map +1 -1
  289. package/dist/shared/utils/schema.js +1 -1
  290. package/dist/shared/utils/tests/schema.test.d.ts +2 -0
  291. package/dist/shared/utils/tests/schema.test.d.ts.map +1 -0
  292. package/dist/shared/utils/typed-ref.d.ts +1 -6
  293. package/dist/shared/utils/typed-ref.d.ts.map +1 -1
  294. package/dist/shared/utils/typed-ref.js +1 -1
  295. package/package.json +18 -19
  296. package/src/shared/ai/schemas.ts +33 -0
  297. package/src/shared/ai/types.ts +155 -0
  298. package/src/shared/ajv.ts +123 -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 +396 -0
  303. package/src/shared/brick-manifest.ts +119 -0
  304. package/src/shared/bricks/manifests/accordion.manifest.ts +482 -0
  305. package/src/shared/bricks/manifests/all-manifests.ts +121 -0
  306. package/src/shared/bricks/manifests/box.manifest.ts +551 -0
  307. package/src/shared/bricks/manifests/button.manifest.ts +208 -0
  308. package/src/shared/bricks/manifests/card.manifest.ts +320 -0
  309. package/src/shared/bricks/manifests/carousel.manifest.ts +708 -0
  310. package/src/shared/bricks/manifests/footer.manifest.ts +509 -0
  311. package/src/shared/bricks/manifests/form.manifest.ts +226 -0
  312. package/src/shared/bricks/manifests/hero.manifest.ts +365 -0
  313. package/src/shared/bricks/manifests/html.manifest.ts +127 -0
  314. package/src/shared/bricks/manifests/icon.manifest.ts +164 -0
  315. package/src/shared/bricks/manifests/image.manifest.ts +378 -0
  316. package/src/shared/bricks/manifests/images-gallery.manifest.ts +822 -0
  317. package/src/shared/bricks/manifests/map.manifest.ts +215 -0
  318. package/src/shared/bricks/manifests/navbar.manifest.ts +361 -0
  319. package/src/shared/bricks/manifests/sidebar.manifest.ts +88 -0
  320. package/src/shared/bricks/manifests/social-links.manifest.ts +497 -0
  321. package/src/shared/bricks/manifests/spacer.manifest.ts +54 -0
  322. package/src/shared/bricks/manifests/testimonials.manifest.ts +480 -0
  323. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +10 -0
  324. package/src/shared/bricks/manifests/text.manifest.ts +245 -0
  325. package/src/shared/bricks/manifests/video.manifest.ts +115 -0
  326. package/src/shared/bricks/props/align.ts +63 -0
  327. package/src/shared/bricks/props/background.ts +79 -0
  328. package/src/shared/bricks/props/boolean.ts +7 -0
  329. package/src/shared/bricks/props/border.ts +86 -0
  330. package/src/shared/bricks/props/color-preset.ts +390 -0
  331. package/src/shared/bricks/props/color.ts +40 -0
  332. package/src/shared/bricks/props/common.ts +64 -0
  333. package/src/shared/bricks/props/css-length.ts +32 -0
  334. package/src/shared/bricks/props/datarecord.ts +11 -0
  335. package/src/shared/bricks/props/datasource.ts +82 -0
  336. package/src/shared/bricks/props/date.ts +21 -0
  337. package/src/shared/bricks/props/direction.ts +21 -0
  338. package/src/shared/bricks/props/dynamic.ts +112 -0
  339. package/src/shared/bricks/props/effects.ts +71 -0
  340. package/src/shared/bricks/props/enum.ts +38 -0
  341. package/src/shared/bricks/props/file.ts +10 -0
  342. package/src/shared/bricks/props/geolocation.ts +36 -0
  343. package/src/shared/bricks/props/helpers.ts +73 -0
  344. package/src/shared/bricks/props/image.ts +96 -0
  345. package/src/shared/bricks/props/number.ts +8 -0
  346. package/src/shared/bricks/props/position.ts +11 -0
  347. package/src/shared/bricks/props/string.ts +72 -0
  348. package/src/shared/bricks/props/tags.ts +26 -0
  349. package/src/shared/bricks/props/tests/background.test.ts +90 -0
  350. package/src/shared/bricks/props/tests/border.test.ts +12 -0
  351. package/src/shared/bricks/props/tests/effects.test.ts +37 -0
  352. package/src/shared/bricks/props/tests/helpers.test.ts +98 -0
  353. package/src/shared/bricks/props/tests/image.test.ts +71 -0
  354. package/src/shared/bricks/props/tests/string.test.ts +80 -0
  355. package/src/shared/bricks/props/text.ts +107 -0
  356. package/src/shared/bricks/props/types.ts +72 -0
  357. package/src/shared/bricks.ts +1237 -0
  358. package/src/shared/context.ts +32 -0
  359. package/src/shared/datarecords/external/airtable/handler.ts +501 -0
  360. package/src/shared/datarecords/external/airtable/oauth/config.ts +11 -0
  361. package/src/shared/datarecords/external/airtable/types.ts +63 -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/client.ts +112 -0
  366. package/src/shared/datarecords/external/google/sheets/handler.ts +253 -0
  367. package/src/shared/datarecords/external/google/sheets/types.ts +10 -0
  368. package/src/shared/datarecords/external/notion/handler.ts +469 -0
  369. package/src/shared/datarecords/external/notion/oauth/config.ts +7 -0
  370. package/src/shared/datarecords/external/notion/types.ts +28 -0
  371. package/src/shared/datarecords/types.ts +165 -0
  372. package/src/shared/datarecords.ts +5 -0
  373. package/src/shared/datasources/README.md +3 -0
  374. package/src/shared/datasources/external/facebook/posts/fetcher.ts +52 -0
  375. package/src/shared/datasources/external/facebook/posts/sample.ts +35 -0
  376. package/src/shared/datasources/external/facebook/posts/schema.ts +33 -0
  377. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +73 -0
  378. package/src/shared/datasources/external/http-json/fetcher.ts +31 -0
  379. package/src/shared/datasources/external/http-json/options.ts +8 -0
  380. package/src/shared/datasources/external/http-json/schema.ts +6 -0
  381. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +70 -0
  382. package/src/shared/datasources/external/instagram/feed/fetcher.ts +33 -0
  383. package/src/shared/datasources/external/instagram/feed/sample.ts +22 -0
  384. package/src/shared/datasources/external/instagram/feed/schema.ts +23 -0
  385. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +64 -0
  386. package/src/shared/datasources/external/mastodon/account/fetcher.ts +24 -0
  387. package/src/shared/datasources/external/mastodon/account/sample.ts +33 -0
  388. package/src/shared/datasources/external/mastodon/account/schema.ts +45 -0
  389. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +47 -0
  390. package/src/shared/datasources/external/mastodon/options.ts +6 -0
  391. package/src/shared/datasources/external/mastodon/status/fetcher.ts +35 -0
  392. package/src/shared/datasources/external/mastodon/status/sample.array.ts +59 -0
  393. package/src/shared/datasources/external/mastodon/status/sample.single.ts +55 -0
  394. package/src/shared/datasources/external/mastodon/status/schema.ts +125 -0
  395. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +74 -0
  396. package/src/shared/datasources/external/meta/oauth/config.ts +16 -0
  397. package/src/shared/datasources/external/meta/options.ts +7 -0
  398. package/src/shared/datasources/external/rss/fetcher.ts +31 -0
  399. package/src/shared/datasources/external/rss/options.ts +7 -0
  400. package/src/shared/datasources/external/rss/sample.ts +22 -0
  401. package/src/shared/datasources/external/rss/schema.ts +42 -0
  402. package/src/shared/datasources/external/threads/media/fetcher.ts +53 -0
  403. package/src/shared/datasources/external/threads/media/sample.ts +44 -0
  404. package/src/shared/datasources/external/threads/media/schema.ts +37 -0
  405. package/src/shared/datasources/external/tiktok/oauth/config.ts +17 -0
  406. package/src/shared/datasources/external/tiktok/video/fetcher.ts +39 -0
  407. package/src/shared/datasources/external/tiktok/video/options.ts +8 -0
  408. package/src/shared/datasources/external/tiktok/video/sample.ts +26 -0
  409. package/src/shared/datasources/external/tiktok/video/schema.ts +27 -0
  410. package/src/shared/datasources/external/youtube/list/fetcher.ts +37 -0
  411. package/src/shared/datasources/external/youtube/list/options.ts +11 -0
  412. package/src/shared/datasources/external/youtube/list/sample.ts +33 -0
  413. package/src/shared/datasources/external/youtube/list/schema.ts +38 -0
  414. package/src/shared/datasources/external/youtube/oauth/config.ts +15 -0
  415. package/src/shared/datasources/fetcher.ts +16 -0
  416. package/src/shared/datasources/internal/blog/schema.ts +69 -0
  417. package/src/shared/datasources/internal/changelog/schema.ts +48 -0
  418. package/src/shared/datasources/internal/contact-info/schema.ts +20 -0
  419. package/src/shared/datasources/internal/cv/schema.ts +217 -0
  420. package/src/shared/datasources/internal/faq/schema.ts +27 -0
  421. package/src/shared/datasources/internal/job-board/schema.ts +228 -0
  422. package/src/shared/datasources/internal/links/schema.ts +15 -0
  423. package/src/shared/datasources/internal/recipes/schema.ts +42 -0
  424. package/src/shared/datasources/internal/restaurant/schema.ts +225 -0
  425. package/src/shared/datasources/samples.ts +26 -0
  426. package/src/shared/datasources/schemas.ts +48 -0
  427. package/src/shared/datasources/types.ts +490 -0
  428. package/src/shared/datasources/utils.ts +17 -0
  429. package/src/shared/datasources.ts +57 -0
  430. package/src/shared/env.ts +23 -0
  431. package/src/shared/errors.ts +1 -0
  432. package/src/shared/images.ts +44 -0
  433. package/src/shared/index.ts +3 -0
  434. package/src/shared/layout-constants.ts +19 -0
  435. package/src/shared/manifest.ts +50 -0
  436. package/src/shared/oauth.ts +16 -0
  437. package/src/shared/page.ts +36 -0
  438. package/src/shared/prompt.ts +9 -0
  439. package/src/shared/responsive.ts +5 -0
  440. package/src/shared/site.ts +59 -0
  441. package/src/shared/sitemap.ts +98 -0
  442. package/src/shared/social-icons.ts +307 -0
  443. package/src/shared/tests/attributes.test.ts +31 -0
  444. package/src/shared/theme.ts +244 -0
  445. package/src/shared/themes/README.md +34 -0
  446. package/src/shared/themes/color-system.ts +146 -0
  447. package/src/shared/themes/tests/color-system.test.ts +170 -0
  448. package/src/shared/utils/canvas-data-uri.ts +2 -0
  449. package/src/shared/utils/invariant.ts +25 -0
  450. package/src/shared/utils/json-date.ts +8 -0
  451. package/src/shared/utils/llm.ts +282 -0
  452. package/src/shared/utils/merge.ts +12 -0
  453. package/src/shared/utils/object-hash.ts +7 -0
  454. package/src/shared/utils/schema.ts +359 -0
  455. package/src/shared/utils/string-enum.ts +12 -0
  456. package/src/shared/utils/tests/schema.test.ts +724 -0
  457. package/src/shared/utils/try-catch.ts +12 -0
  458. package/src/shared/utils/typed-ref.ts +53 -0
  459. package/dist/shared/bricks/props/container.d.ts +0 -11
  460. package/dist/shared/bricks/props/container.d.ts.map +0 -1
  461. package/dist/shared/bricks/props/container.js +0 -3
  462. package/dist/shared/bricks/props/gap.d.ts +0 -9
  463. package/dist/shared/bricks/props/gap.d.ts.map +0 -1
  464. package/dist/shared/bricks/props/gap.js +0 -3
  465. package/dist/shared/bricks/props/padding.d.ts +0 -5
  466. package/dist/shared/bricks/props/padding.d.ts.map +0 -1
  467. package/dist/shared/bricks/props/padding.js +0 -3
  468. package/dist/shared/bricks/props/tests/padding.d.ts +0 -2
  469. package/dist/shared/bricks/props/tests/padding.d.ts.map +0 -1
  470. package/dist/shared/chunk-2IYSJYNE.js +0 -3
  471. package/dist/shared/chunk-3EM3B4DX.js +0 -3
  472. package/dist/shared/chunk-4TH3C76A.js +0 -3
  473. package/dist/shared/chunk-5N6MBJJ4.js +0 -3
  474. package/dist/shared/chunk-6FITVVZX.js +0 -3
  475. package/dist/shared/chunk-6WCGUAQN.js +0 -3
  476. package/dist/shared/chunk-7DMUDZ4H.js +0 -3
  477. package/dist/shared/chunk-ACVLF55Q.js +0 -3
  478. package/dist/shared/chunk-AQPN5SE2.js +0 -3
  479. package/dist/shared/chunk-BZGNY7LB.js +0 -3
  480. package/dist/shared/chunk-C3VGP4CA.js +0 -3
  481. package/dist/shared/chunk-CT3EI7YN.js +0 -3
  482. package/dist/shared/chunk-DQXDGV67.js +0 -3
  483. package/dist/shared/chunk-E22E4XWE.js +0 -3
  484. package/dist/shared/chunk-ETYYRWLK.js +0 -3
  485. package/dist/shared/chunk-EYPREFMH.js +0 -3
  486. package/dist/shared/chunk-FKNNTHWX.js +0 -5
  487. package/dist/shared/chunk-HHO3ONTQ.js +0 -3
  488. package/dist/shared/chunk-I46VBMLF.js +0 -3
  489. package/dist/shared/chunk-IIFTGWFZ.js +0 -3
  490. package/dist/shared/chunk-JS4K5JRM.js +0 -5
  491. package/dist/shared/chunk-KHFNN4P3.js +0 -3
  492. package/dist/shared/chunk-L6WHBSRZ.js +0 -8
  493. package/dist/shared/chunk-LFQZRGHS.js +0 -3
  494. package/dist/shared/chunk-LGP6GWIY.js +0 -3
  495. package/dist/shared/chunk-NLEWXPVM.js +0 -3
  496. package/dist/shared/chunk-NNI225RG.js +0 -3
  497. package/dist/shared/chunk-QISTDGPP.js +0 -3
  498. package/dist/shared/chunk-QSZWDE3D.js +0 -3
  499. package/dist/shared/chunk-RGLVKILY.js +0 -3
  500. package/dist/shared/chunk-SLRU4CT6.js +0 -4
  501. package/dist/shared/chunk-T3LIA4YB.js +0 -3
  502. package/dist/shared/chunk-T4LMBG2G.js +0 -3
  503. package/dist/shared/chunk-TATG6SFZ.js +0 -3
  504. package/dist/shared/chunk-TF3JVVRU.js +0 -3
  505. package/dist/shared/chunk-TTTXV7TJ.js +0 -6
  506. package/dist/shared/chunk-TWBY2GOR.js +0 -3
  507. package/dist/shared/chunk-UAQHU6L6.js +0 -3
  508. package/dist/shared/chunk-UHF6IEKV.js +0 -3
  509. package/dist/shared/chunk-UMHXXXVP.js +0 -3
  510. package/dist/shared/chunk-VGRYSAXA.js +0 -3
  511. package/dist/shared/chunk-VPFCY4DH.js +0 -3
  512. package/dist/shared/chunk-VZPXXFVX.js +0 -3
  513. package/dist/shared/chunk-WU6Q4WYD.js +0 -3
  514. package/dist/shared/chunk-X43MB5WD.js +0 -3
  515. package/dist/shared/chunk-YBGPPF7T.js +0 -3
  516. package/dist/shared/chunk-YFFTZ5T6.js +0 -3
  517. package/dist/shared/chunk-ZQGNYK5I.js +0 -8
  518. package/dist/shared/chunk-ZTDUXSWH.js +0 -3
  519. package/dist/shared/datarecords/external/airtable/client.d.ts +0 -8
  520. package/dist/shared/datarecords/external/airtable/client.d.ts.map +0 -1
  521. package/dist/shared/datarecords/external/airtable/elements.d.ts +0 -21
  522. package/dist/shared/datarecords/external/airtable/elements.d.ts.map +0 -1
  523. package/dist/shared/datarecords/external/airtable/options.d.ts +0 -10
  524. package/dist/shared/datarecords/external/airtable/options.d.ts.map +0 -1
  525. package/dist/shared/datarecords/external/google/sheets/options.d.ts.map +0 -1
  526. package/dist/shared/datarecords/external/notion/client.d.ts +0 -8
  527. package/dist/shared/datarecords/external/notion/client.d.ts.map +0 -1
  528. package/dist/shared/datarecords/external/notion/options.d.ts.map +0 -1
  529. package/dist/shared/datarecords/external/notion/utils.d.ts +0 -5
  530. package/dist/shared/datarecords/external/notion/utils.d.ts.map +0 -1
  531. package/dist/shared/utils/schema-resolver.d.ts +0 -3
  532. package/dist/shared/utils/schema-resolver.d.ts.map +0 -1
  533. package/dist/shared/utils/schema-resolver.js +0 -3
@@ -0,0 +1,112 @@
1
+ import { typedRef } from "~/shared/utils/typed-ref";
2
+ import { type ObjectOptions, Type, type Static } from "@sinclair/typebox";
3
+ import { queryFilter } from "~/shared/datasources/types";
4
+ import { over } from "lodash-es";
5
+
6
+ export function queryUse() {
7
+ return Type.Object(
8
+ {
9
+ queryId: Type.String({
10
+ description: "The Site Query ID to use.",
11
+ }),
12
+ alias: Type.String({
13
+ title: "Alias",
14
+ minLength: 1,
15
+ maxLength: 100,
16
+ pattern: "^[a-zA-Z0-9_]+$",
17
+ description:
18
+ "Alias for the query results, used in dynamic content. Use a simple keyword without spaces or special characters. Aliases are unique across the page.",
19
+ "ai:instructions":
20
+ "Use a simple keyword without spaces or special characters. Aliases are unique across the page. You can use the same query several times with different aliases in order to, for example, apply different parameters to the same query.",
21
+ }),
22
+ params: Type.Optional(
23
+ Type.Array(queryFilter, {
24
+ description:
25
+ "Additional query parameters/filters to apply to the query. One can use placeholders in values like ':slug' to reference URL parameters.",
26
+ title: "Query Parameters",
27
+ default: [],
28
+ }),
29
+ ),
30
+ },
31
+ {
32
+ title: "Query",
33
+ description:
34
+ "When set, this brick will loop through the results of the query and render the content for each item.",
35
+ // $id: "content:queryUse",
36
+ "ui:field": "query",
37
+ metadata: {
38
+ category: "content",
39
+ },
40
+ examples: [
41
+ { queryId: "get-latest-posts", alias: "latestPosts" },
42
+ {
43
+ queryId: "get-user-profile",
44
+ alias: "userProfile",
45
+ params: [{ field: "userId", op: "eq", value: ":slug" }],
46
+ },
47
+ {
48
+ queryId: "get-posts-by-category",
49
+ alias: "postsByCategory",
50
+ params: [{ field: "category", op: "eq", value: ":slug" }],
51
+ },
52
+ ],
53
+ },
54
+ );
55
+ }
56
+
57
+ export const queryUseSchema = queryUseRef();
58
+
59
+ export type QueryUseSettings = Static<ReturnType<typeof queryUse>>;
60
+
61
+ export function queryUseRef(options: ObjectOptions = {}) {
62
+ return typedRef("content:queryUse", options);
63
+ }
64
+
65
+ export function loop(options: ObjectOptions = {}) {
66
+ return Type.Object(
67
+ {
68
+ over: Type.String({
69
+ title: "Over",
70
+ description: "The query alias to loop over. If not set, the brick will be rendered only once.",
71
+ "ai:instructions": "Specify the Query Alias to loop over the results.",
72
+ }),
73
+ overrideLimit: Type.Optional(
74
+ Type.Number({
75
+ minimum: 1,
76
+ description:
77
+ "Override the limit of items to loop through. If not set, it will use the default limit of the query. If set to 1, it will not loop and will render only the first item.",
78
+ }),
79
+ ),
80
+ },
81
+ {
82
+ // $id: "content:loop",
83
+ title: "Repeat over",
84
+ description: "Repeat this brick for each item in the specified query results.",
85
+ "ui:field": "loop",
86
+ "ui:hidden-if": "no-page-queries",
87
+ metadata: {
88
+ category: "content",
89
+ },
90
+ examples: [
91
+ {
92
+ over: "latestBlogPosts",
93
+ overrideLimit: 5,
94
+ },
95
+ {
96
+ over: "featuredProducts",
97
+ overrideLimit: 3,
98
+ },
99
+ {
100
+ over: "popularProducts",
101
+ },
102
+ ],
103
+ ...options,
104
+ },
105
+ );
106
+ }
107
+
108
+ export type LoopSettings = Static<ReturnType<typeof loop>>;
109
+
110
+ export function loopRef(options: ObjectOptions = {}) {
111
+ return typedRef("content:loop", options);
112
+ }
@@ -0,0 +1,71 @@
1
+ import { type SchemaOptions, Type, type Static } from "@sinclair/typebox";
2
+ import { typedRef } from "~/shared/utils/typed-ref";
3
+ import { StringEnum, type StringEnumOptions } from "~/shared/utils/string-enum";
4
+
5
+ export function shadow(options: StringEnumOptions = {}) {
6
+ return StringEnum(["shadow-none", "shadow-sm", "shadow-md", "shadow-lg", "shadow-xl", "shadow-2xl"], {
7
+ // $id: "styles:shadow",
8
+ title: "Shadow",
9
+ description: "Box shadow around the brick",
10
+ enumNames: ["None", "Small", "Medium", "Large", "XL", "2XL"],
11
+ "ui:placeholder": "Not specified",
12
+ "ui:field": "enum",
13
+ "ui:display": "select",
14
+ "ui:responsive": "desktop",
15
+ "ui:styleId": "styles:shadow",
16
+ ...options,
17
+ });
18
+ }
19
+
20
+ export type ShadowSettings = Static<ReturnType<typeof shadow>>;
21
+
22
+ export function shadowRef(options: StringEnumOptions = {}) {
23
+ return typedRef("styles:shadow", options);
24
+ }
25
+
26
+ /**
27
+ * This function is used in ajv and type ref translations, but should not be used directly in bricks
28
+ */
29
+ export function textShadow(options: StringEnumOptions = {}) {
30
+ return StringEnum(
31
+ ["text-shadow-none", "text-shadow-sm", "text-shadow-md", "text-shadow-lg", "text-shadow-xl"],
32
+ {
33
+ // $id: "styles:textShadow",
34
+ title: "Text shadow",
35
+ enumNames: ["None", "S", "M", "L", "XL"],
36
+ "ui:display": "button-group",
37
+ "ui:placeholder": "Not specified",
38
+ "ui:field": "enum",
39
+ "ui:styleId": "styles:textShadow",
40
+ examples: ["text-shadow-sm", "text-shadow-md", "text-shadow-lg"],
41
+ ...options,
42
+ },
43
+ );
44
+ }
45
+
46
+ export function textShadowRef(options: SchemaOptions = {}) {
47
+ return typedRef("styles:textShadow", options);
48
+ }
49
+
50
+ export type TextShadowSettings = Static<ReturnType<typeof textShadow>>;
51
+
52
+ type OpacityOptions = {
53
+ title?: string;
54
+ defaultValue?: number;
55
+ };
56
+
57
+ export function opacity({ defaultValue = 1, title = "Opacity" }: OpacityOptions = {}) {
58
+ return Type.Number({
59
+ title,
60
+ minimum: 0.1,
61
+ maximum: 1,
62
+ default: defaultValue,
63
+ multipleOf: 0.1,
64
+ "ui:field": "slider",
65
+ "ui:unit": "%",
66
+ "ui:multiplier": 100,
67
+ examples: [0.5, 0.75, 1],
68
+ });
69
+ }
70
+
71
+ export type OpacitySettings = Static<ReturnType<typeof opacity>>;
@@ -0,0 +1,38 @@
1
+ import { type SchemaOptions, Type } from "@sinclair/typebox";
2
+
3
+ type EnumOption = {
4
+ title?: string;
5
+ description?: string;
6
+ value: string;
7
+ icon?: string;
8
+ };
9
+
10
+ export function enumProp(
11
+ title: string,
12
+ defaultValue: string,
13
+ opts: Omit<SchemaOptions, "title" | "default"> & {
14
+ options: EnumOption[] | string[];
15
+ displayAs?: "radio" | "select" | "button-group" | "icon-group";
16
+ },
17
+ ) {
18
+ const defaultOpts = {
19
+ "ui:field": "enum",
20
+ "ui:display": opts.displayAs || "select",
21
+ };
22
+ const { options, displayAs, ...commonOpts } = opts;
23
+
24
+ return Type.Union(
25
+ options.map((opt) =>
26
+ Type.Literal(typeof opt === "string" ? opt : opt.value, {
27
+ title: typeof opt === "string" ? opt : opt.title,
28
+ "ui:icon": typeof opt === "string" ? undefined : opt.icon,
29
+ }),
30
+ ),
31
+ {
32
+ title,
33
+ default: defaultValue,
34
+ ...defaultOpts,
35
+ ...commonOpts,
36
+ },
37
+ );
38
+ }
@@ -0,0 +1,10 @@
1
+ import { Type } from "@sinclair/typebox";
2
+
3
+ export function file(title = "File") {
4
+ return Type.String({
5
+ title,
6
+ format: "file-url",
7
+ "ui:field": "file",
8
+ examples: ["https://example.com/file.pdf"],
9
+ });
10
+ }
@@ -0,0 +1,36 @@
1
+ import { type ObjectOptions, Type, type Static } from "@sinclair/typebox";
2
+ import { number } from "./number";
3
+ import { string } from "./string";
4
+
5
+ export function geolocation(opts: ObjectOptions & { defaultZoom?: number } = {}) {
6
+ const { title = "Location", defaultZoom } = opts;
7
+ return Type.Object(
8
+ {
9
+ lat: number("Latitude", { "ui:field": "hidden" }),
10
+ lng: number("Longitude", { "ui:field": "hidden" }),
11
+ address: string("Address", {
12
+ "ui:field": "geoaddress",
13
+ }),
14
+ tooltip: Type.Optional(string("Tooltip", {})),
15
+ zoom: Type.Optional(
16
+ number("Zoom", {
17
+ description: "Zoom level for the map",
18
+ "ui:instructions": "The zoom level should be between 0 (world view) and 21 (street view).",
19
+ "ui:field": "slider",
20
+ minimum: 12,
21
+ maximum: 18,
22
+ default: defaultZoom,
23
+ }),
24
+ ),
25
+ },
26
+ {
27
+ title,
28
+ metadata: {
29
+ category: "content",
30
+ },
31
+ ...opts,
32
+ },
33
+ );
34
+ }
35
+
36
+ export type GeolocationSettings = Static<ReturnType<typeof geolocation>>;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Helper functions for defining and working with props and groups of props
3
+ */
4
+ import { type TProperties, Type, type TSchema, type TObject, type ObjectOptions } from "@sinclair/typebox";
5
+ import { commonProps } from "./common";
6
+ import type { PartialBy, PropGroup, GroupMetadata } from "./types";
7
+
8
+ function isTObject(schema: TSchema | TProperties): schema is TObject {
9
+ return schema.type === "object";
10
+ }
11
+
12
+ export function group<T extends TProperties>({
13
+ title,
14
+ children,
15
+ category = "settings",
16
+ metadata,
17
+ options,
18
+ }: PartialBy<PropGroup<T>, "category">) {
19
+ // check if children is already a TObject
20
+ if (isTObject(children)) {
21
+ const generated = Type.Composite([Type.Object({}), children], {
22
+ title,
23
+ metadata: {
24
+ category,
25
+ group: true,
26
+ ...metadata,
27
+ },
28
+ ...options,
29
+ });
30
+ return generated;
31
+ }
32
+
33
+ // Create the TypeBox schema with title as a standard property and group-specific info in metadata
34
+ return Type.Object(children, {
35
+ title,
36
+ ...options,
37
+ metadata: {
38
+ category,
39
+ group: true,
40
+ ...metadata,
41
+ },
42
+ });
43
+ }
44
+
45
+ // Functions to extract metadata from schemas
46
+ export function getGroupInfo(schema: TSchema) {
47
+ const meta = schema.metadata as GroupMetadata;
48
+ return {
49
+ title: (schema.title ?? schema.metadata?.title) as string | undefined,
50
+ meta,
51
+ tab: meta.groupTab || "common",
52
+ };
53
+ }
54
+
55
+ export function defineProps<P extends TProperties>(
56
+ props: P,
57
+ options?: ObjectOptions & {
58
+ noGrow?: boolean;
59
+ noAlignSelf?: boolean;
60
+ },
61
+ ) {
62
+ const allProps = { ...commonProps, ...props };
63
+ const { alignSelf, grow, ...rest } = allProps;
64
+ const finalProps = {
65
+ ...rest,
66
+ ...(options?.noAlignSelf ? {} : { alignSelf }),
67
+ ...(options?.noGrow ? {} : { grow }),
68
+ } as typeof allProps;
69
+ return Type.Object(finalProps, { ...options, additionalProperties: false });
70
+ }
71
+
72
+ // export const optional = Type.Optional;
73
+ export const array = Type.Array;
@@ -0,0 +1,96 @@
1
+ import { type SchemaOptions, Type, type Static, type ObjectOptions } from "@sinclair/typebox";
2
+ import { StringEnum } from "~/shared/utils/string-enum";
3
+ import { typedRef } from "~/shared/utils/typed-ref";
4
+
5
+ type PropImageOptions = {
6
+ defaultImageUrl?: string;
7
+ showImgSearch?: boolean;
8
+ noObjectOptions?: boolean;
9
+ } & ObjectOptions;
10
+
11
+ export function image(title = "Image", options: PropImageOptions = {}) {
12
+ const { defaultImageUrl, showImgSearch = false, noObjectOptions = false } = options;
13
+ const schema = Type.Object(
14
+ {
15
+ src: Type.String({
16
+ default: defaultImageUrl,
17
+ title,
18
+ description: "Image URL. Can be a link to an image or a data URI",
19
+ }),
20
+ alt: Type.Optional(
21
+ Type.String({
22
+ title: "Alternate Text",
23
+ description: "Alternative text for the image. Recommended for screen readers and SEO",
24
+ "ui:placeholder": "Your image description",
25
+ }),
26
+ ),
27
+ fit: Type.Optional(
28
+ StringEnum(["object-none", "object-contain", "object-cover", "object-fill", "object-scale-down"], {
29
+ enumNames: ["None", "Contain", "Cover", "Fill", "Scale down"],
30
+ title: "Fit",
31
+ description: "How the image should be resized to fit its container",
32
+ default: "object-cover",
33
+ "ui:field": "enum",
34
+ "ui:styleId": "styles:objectFit",
35
+ }),
36
+ ),
37
+ position: Type.Optional(
38
+ StringEnum(
39
+ [
40
+ "object-top",
41
+ "object-center",
42
+ "object-bottom",
43
+ "object-left",
44
+ "object-right",
45
+ "object-top-left",
46
+ "object-top-right",
47
+ "object-bottom-left",
48
+ "object-bottom-right",
49
+ ],
50
+ {
51
+ enumNames: [
52
+ "Top",
53
+ "Center",
54
+ "Bottom",
55
+ "Left",
56
+ "Right",
57
+ "Top left",
58
+ "Top right",
59
+ "Bottom left",
60
+ "Bottom right",
61
+ ],
62
+ "ui:styleId": "styles:objectPosition",
63
+ title: "Position",
64
+ description: "The position of the image inside its container",
65
+ "ui:field": "enum",
66
+ },
67
+ ),
68
+ ),
69
+ },
70
+ {
71
+ // $id: "assets:image",
72
+ title,
73
+ "ui:field": "image",
74
+ "ui:accept": "image/*",
75
+ "ui:show-img-search": showImgSearch,
76
+ "ui:no-object-options": noObjectOptions,
77
+ default: {
78
+ alt: "Image",
79
+ fit: "object-cover",
80
+ position: "object-center",
81
+ },
82
+ // "ui:responsive": "desktop",
83
+ metadata: {
84
+ category: "content",
85
+ },
86
+ ...options,
87
+ },
88
+ );
89
+ return schema;
90
+ }
91
+
92
+ export function imageRef(options: PropImageOptions & SchemaOptions = {}) {
93
+ return typedRef("assets:image", options);
94
+ }
95
+
96
+ export type ImageProps = Static<ReturnType<typeof image>>;
@@ -0,0 +1,8 @@
1
+ import { Type, type NumberOptions } from "@sinclair/typebox";
2
+ import type { FieldMetadata } from "./types";
3
+
4
+ type NumberFieldOptions = NumberOptions & FieldMetadata;
5
+
6
+ export function number(title: string, options: NumberFieldOptions = {}) {
7
+ return Type.Number({ title, ...options });
8
+ }
@@ -0,0 +1,11 @@
1
+ import { Type, type Static } from "@sinclair/typebox";
2
+
3
+ export function fixedPositioned(defaultValue = false, title = "Fixed position") {
4
+ return Type.Boolean({
5
+ title,
6
+ default: defaultValue,
7
+ "ui:styleId": "styles:fixedPositioned",
8
+ });
9
+ }
10
+
11
+ export type FixedPositionedSettings = Static<ReturnType<typeof fixedPositioned>>;
@@ -0,0 +1,72 @@
1
+ import { type Static, Type, type StringOptions } from "@sinclair/typebox";
2
+ import type { FieldMetadata } from "./types";
3
+ import { typedRef } from "~/shared/utils/typed-ref";
4
+
5
+ type StrFieldOptions = StringOptions &
6
+ FieldMetadata & {
7
+ "ui:multiline"?: boolean;
8
+ };
9
+
10
+ export function string(title: string, options: StrFieldOptions = {}) {
11
+ return Type.String({ title, ...options });
12
+ }
13
+
14
+ export function url(title = "URL", defaultValue?: string) {
15
+ return Type.String({
16
+ title,
17
+ format: "url",
18
+ "ui:field": "url",
19
+ default: defaultValue,
20
+ });
21
+ }
22
+
23
+ const pageIdSchema = Type.String({
24
+ "ui:field": "page-id",
25
+ });
26
+
27
+ export function urlOrPageId(title = "URL", defaultValue?: string) {
28
+ return Type.Union(
29
+ [
30
+ Type.String({
31
+ format: "url",
32
+ }),
33
+ pageIdSchema,
34
+ ],
35
+ {
36
+ // $id: "content:urlOrPageId",
37
+ default: defaultValue,
38
+ title,
39
+ metadata: {
40
+ category: "content",
41
+ },
42
+ "ui:field": "url-page-id",
43
+ "ai:instructions":
44
+ "This field can be a URL or a page ID. Use the page ID when linking to a internal page, and a URL for external links.",
45
+ },
46
+ );
47
+ }
48
+
49
+ export type UrlOrPageIdSettings = Static<ReturnType<typeof urlOrPageId>>;
50
+
51
+ export function urlOrPageIdRef(options: StrFieldOptions = {}) {
52
+ return typedRef("content:urlOrPageId", { ...options });
53
+ }
54
+
55
+ type IconOptions = StrFieldOptions & { "ui:default-icon-collection"?: string };
56
+
57
+ export function icon(title?: string, options: IconOptions = {}) {
58
+ return Type.String({
59
+ title: title ?? "Icon",
60
+ "ai:instructions": "Use a iconify reference like 'mdi:heart' or 'fa-solid:coffee'.",
61
+ "ui:field": "iconify",
62
+ // $id: "assets:icon",
63
+ metadata: {
64
+ category: "content",
65
+ },
66
+ ...options,
67
+ });
68
+ }
69
+
70
+ export function iconRef(options: IconOptions = {}) {
71
+ return typedRef("assets:icon", options);
72
+ }
@@ -0,0 +1,26 @@
1
+ import { type Static, Type, type StringOptions } from "@sinclair/typebox";
2
+ import { typedRef } from "~/shared/utils/typed-ref";
3
+
4
+ export function tags(options?: StringOptions) {
5
+ return Type.Array(
6
+ Type.String({
7
+ title: options?.title ?? "Tags",
8
+ ...options,
9
+ }),
10
+ {
11
+ // $id: "content:tags",
12
+ "ui:field": "tags",
13
+ title: options?.title ?? "Tags",
14
+ metadata: {
15
+ category: "content",
16
+ },
17
+ ...options,
18
+ },
19
+ );
20
+ }
21
+
22
+ export type TagsSettings = Static<ReturnType<typeof tags>>;
23
+
24
+ export function tagsRef(options: StringOptions = {}) {
25
+ return typedRef("content:tags", { ...options });
26
+ }
@@ -0,0 +1,90 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { background, backgroundRef, backgroundColor } from "../background";
3
+
4
+ describe("Background prop test suite", () => {
5
+ describe("background", () => {
6
+ it("should have the correct title", () => {
7
+ expect(background().title).toBe("Background image");
8
+ });
9
+
10
+ it("should have correct schema structure", () => {
11
+ const schema = background();
12
+ expect(schema.type).toBe("object");
13
+ expect(schema).toHaveProperty("properties.image");
14
+ expect(schema).toHaveProperty("properties.size");
15
+ expect(schema).toHaveProperty("properties.repeat");
16
+ });
17
+
18
+ it("should have correct UI metadata", () => {
19
+ const schema = background();
20
+ expect(schema["ui:field"]).toBe("background");
21
+ });
22
+
23
+ it("should accept custom default values", () => {
24
+ const customBg = background({
25
+ default: {
26
+ size: "cover",
27
+ repeat: "repeat",
28
+ image: "https://example.com/image.jpg",
29
+ },
30
+ });
31
+ expect(customBg.default).toEqual({
32
+ size: "cover",
33
+ repeat: "repeat",
34
+ image: "https://example.com/image.jpg",
35
+ });
36
+ });
37
+
38
+ it("should accept custom title", () => {
39
+ const customBg = background({ title: "Custom Title" });
40
+ expect(customBg.title).toBe("Custom Title");
41
+ });
42
+
43
+ describe("image property", () => {
44
+ it("should have correct metadata", () => {
45
+ const imageProp = background().properties.image;
46
+ expect(imageProp.title).toBe("Image");
47
+ expect(imageProp.type).toBe("string");
48
+ });
49
+ });
50
+
51
+ describe("size property", () => {
52
+ it("should have correct metadata", () => {
53
+ const sizeProp = background().properties.size;
54
+ expect(sizeProp.default).toBe("auto");
55
+ });
56
+ });
57
+
58
+ describe("repeat property", () => {
59
+ it("should have correct metadata", () => {
60
+ const repeatProp = background().properties.repeat;
61
+ expect(repeatProp.default).toBe("no-repeat");
62
+ });
63
+ });
64
+ });
65
+
66
+ describe("backgroundColor", () => {
67
+ it("should have the correct title", () => {
68
+ expect(backgroundColor().title).toBe("Background color");
69
+ });
70
+
71
+ it("should accept custom title", () => {
72
+ expect(backgroundColor({ title: "Custom Title" }).title).toBe("Custom Title");
73
+ });
74
+
75
+ it("should have correct schema structure", () => {
76
+ const schema = backgroundColor();
77
+ expect(schema.type).toBe("string");
78
+ });
79
+
80
+ it("should have correct UI metadata", () => {
81
+ const schema = backgroundColor();
82
+ expect(schema["ui:field"]).toBe("color");
83
+ expect(schema["ui:color-type"]).toBe("background");
84
+ });
85
+
86
+ it("should have correct default value", () => {
87
+ expect(backgroundColor().default).toBeUndefined();
88
+ });
89
+ });
90
+ });
@@ -0,0 +1,12 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { border } from "../border";
3
+
4
+ describe("Border prop test suite", () => {
5
+ const borderSchema = border();
6
+
7
+ describe("propBorder", () => {
8
+ it("should have the correct title", () => {
9
+ expect(border().title).toBe("Border");
10
+ });
11
+ });
12
+ });