@upstart.gg/sdk 0.0.104 → 0.0.106

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 (254) hide show
  1. package/dist/shared/ajv.d.ts +2 -0
  2. package/dist/shared/ajv.d.ts.map +1 -1
  3. package/dist/shared/ajv.js +1 -1
  4. package/dist/shared/attributes.js +1 -1
  5. package/dist/shared/brick-manifest.js +1 -1
  6. package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
  7. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  8. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  9. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  10. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  11. package/dist/shared/bricks/manifests/container.manifest.js +1 -1
  12. package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
  13. package/dist/shared/bricks/manifests/footer.manifest.d.ts +1 -1
  14. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  15. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  16. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  17. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  18. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  19. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  20. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  21. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  22. package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
  23. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  24. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  25. package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
  26. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  27. package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
  28. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  29. package/dist/shared/bricks/props/border.d.ts.map +1 -1
  30. package/dist/shared/bricks/props/border.js +1 -1
  31. package/dist/shared/bricks/props/container.js +1 -1
  32. package/dist/shared/bricks/props/effects.js +1 -1
  33. package/dist/shared/bricks.d.ts.map +1 -1
  34. package/dist/shared/bricks.js +1 -1
  35. package/dist/shared/{chunk-TCZBR3ZU.js → chunk-2DI5SIVV.js} +1 -1
  36. package/dist/shared/{chunk-O22VV7YR.js → chunk-33FU4KGU.js} +1 -1
  37. package/dist/shared/{chunk-WCNVFVDK.js → chunk-3ZGRY444.js} +1 -1
  38. package/dist/shared/{chunk-CUCUHPQ7.js → chunk-6OKXZL6R.js} +1 -1
  39. package/dist/shared/chunk-7E67XSKP.js +3 -0
  40. package/dist/shared/{chunk-LJQXN32B.js → chunk-AMGHA7QH.js} +1 -1
  41. package/dist/shared/{chunk-QALNFBY7.js → chunk-DC5DWF7B.js} +1 -1
  42. package/dist/shared/{chunk-I43NIQ2K.js → chunk-DY2YCYZ6.js} +1 -1
  43. package/dist/shared/{chunk-CEXHD4BO.js → chunk-E4UAVLKC.js} +2 -2
  44. package/dist/shared/{chunk-ZFTWLZ3G.js → chunk-EHH677K5.js} +1 -1
  45. package/dist/shared/{chunk-POYVTV5F.js → chunk-FD3KX2U7.js} +1 -1
  46. package/dist/shared/chunk-G3JO5DM5.js +3 -0
  47. package/dist/shared/{chunk-I5S2MPPR.js → chunk-H7OYUKBW.js} +1 -1
  48. package/dist/shared/{chunk-ATVHWZSA.js → chunk-HBM4DPIW.js} +1 -1
  49. package/dist/shared/chunk-HIBTEX2T.js +3 -0
  50. package/dist/shared/{chunk-E2EBTWJI.js → chunk-I3HSLGFA.js} +1 -1
  51. package/dist/shared/{chunk-UISES3HA.js → chunk-IXJX7EQ3.js} +1 -1
  52. package/dist/shared/{chunk-5IEGQ7YT.js → chunk-JAAPJQNK.js} +1 -1
  53. package/dist/shared/{chunk-UK6H3FDX.js → chunk-JDBVMPSI.js} +1 -1
  54. package/dist/shared/{chunk-F6MLW6DO.js → chunk-JH3NRO6M.js} +1 -1
  55. package/dist/shared/{chunk-ZNVRYEO7.js → chunk-L3TKLJKK.js} +1 -1
  56. package/dist/shared/{chunk-TEPFFY32.js → chunk-LOFXGDAK.js} +1 -1
  57. package/dist/shared/chunk-O3FJP65T.js +3 -0
  58. package/dist/shared/{chunk-7L3UOEMR.js → chunk-PX7QSNLO.js} +1 -1
  59. package/dist/shared/{chunk-22KRCQK5.js → chunk-U76JDFWJ.js} +1 -1
  60. package/dist/shared/{chunk-CW5FWW5W.js → chunk-UYZP24VV.js} +1 -1
  61. package/dist/shared/chunk-X42WBJTN.js +3 -0
  62. package/dist/shared/{chunk-OQIFFJ7I.js → chunk-XB3X4P3I.js} +1 -1
  63. package/dist/shared/chunk-XDCGA4WT.js +3 -0
  64. package/dist/shared/chunk-YGHBFXR6.js +3 -0
  65. package/dist/shared/{chunk-WEQRYCPD.js → chunk-ZWYLKIBI.js} +1 -1
  66. package/dist/shared/datasources/external/rss/fetcher.d.ts +1 -1
  67. package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
  68. package/dist/shared/images.js +1 -1
  69. package/dist/shared/page.js +1 -1
  70. package/dist/shared/responsive.js +1 -1
  71. package/dist/shared/site.js +1 -1
  72. package/dist/shared/sitemap.js +1 -1
  73. package/dist/shared/theme.js +1 -1
  74. package/dist/shared/utils/schema.d.ts +6 -8
  75. package/dist/shared/utils/schema.d.ts.map +1 -1
  76. package/dist/shared/utils/schema.js +1 -1
  77. package/package.json +5 -9
  78. package/dist/shared/chunk-F63ANNAK.js +0 -3
  79. package/dist/shared/chunk-GPKRRX3D.js +0 -3
  80. package/dist/shared/chunk-HQQYIKTE.js +0 -3
  81. package/dist/shared/chunk-JFDOR3UH.js +0 -3
  82. package/dist/shared/chunk-OD2PRCLH.js +0 -3
  83. package/dist/shared/chunk-PK6UAFPW.js +0 -3
  84. package/dist/shared/chunk-VDHLON5R.js +0 -3
  85. package/src/node/cli/api.ts +0 -101
  86. package/src/node/cli/commands/cmd-build.ts +0 -64
  87. package/src/node/cli/commands/login/cmd-login.ts +0 -111
  88. package/src/node/cli/commands/logout/cmd-logout.ts +0 -11
  89. package/src/node/cli/commands/publish/cmd-publish.ts +0 -135
  90. package/src/node/cli/commands/publish/parse-gitignore.ts +0 -278
  91. package/src/node/cli/commands/publish/uploader.ts +0 -333
  92. package/src/node/cli/constants.ts +0 -14
  93. package/src/node/cli/is-logged-in.ts +0 -28
  94. package/src/node/cli/program.ts +0 -77
  95. package/src/node/cli/store.ts +0 -64
  96. package/src/node/cli/tests/api.test.ts +0 -161
  97. package/src/node/cli/types.ts +0 -34
  98. package/src/node/cli/utils.ts +0 -20
  99. package/src/node/shared/config.ts +0 -69
  100. package/src/node/shared/logger.ts +0 -44
  101. package/src/shared/ajv.ts +0 -103
  102. package/src/shared/analytics/init.ts +0 -14
  103. package/src/shared/analytics/track.ts +0 -21
  104. package/src/shared/analytics/types.ts +0 -13
  105. package/src/shared/attributes.ts +0 -211
  106. package/src/shared/brick-manifest.ts +0 -110
  107. package/src/shared/bricks/manifests/accordion.manifest.ts +0 -179
  108. package/src/shared/bricks/manifests/all-manifests.ts +0 -92
  109. package/src/shared/bricks/manifests/button.manifest.ts +0 -145
  110. package/src/shared/bricks/manifests/card.manifest.ts +0 -269
  111. package/src/shared/bricks/manifests/carousel.manifest.ts +0 -106
  112. package/src/shared/bricks/manifests/container.manifest.ts +0 -357
  113. package/src/shared/bricks/manifests/divider.manifest.ts +0 -121
  114. package/src/shared/bricks/manifests/footer.manifest.ts +0 -487
  115. package/src/shared/bricks/manifests/form.manifest.ts +0 -112
  116. package/src/shared/bricks/manifests/hero.manifest.ts +0 -132
  117. package/src/shared/bricks/manifests/icon.manifest.ts +0 -130
  118. package/src/shared/bricks/manifests/image.manifest.ts +0 -203
  119. package/src/shared/bricks/manifests/images-gallery.manifest.ts +0 -227
  120. package/src/shared/bricks/manifests/map.manifest.ts +0 -75
  121. package/src/shared/bricks/manifests/navbar.manifest.ts +0 -344
  122. package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -90
  123. package/src/shared/bricks/manifests/social-links.manifest.ts +0 -370
  124. package/src/shared/bricks/manifests/testimonials.manifest.ts +0 -397
  125. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +0 -10
  126. package/src/shared/bricks/manifests/text.manifest.ts +0 -164
  127. package/src/shared/bricks/manifests/timeline.manifest.ts +0 -456
  128. package/src/shared/bricks/manifests/video.manifest.ts +0 -59
  129. package/src/shared/bricks/props/_style-presets.ts +0 -352
  130. package/src/shared/bricks/props/align.ts +0 -59
  131. package/src/shared/bricks/props/background.ts +0 -118
  132. package/src/shared/bricks/props/boolean.ts +0 -11
  133. package/src/shared/bricks/props/border.ts +0 -84
  134. package/src/shared/bricks/props/color.ts +0 -24
  135. package/src/shared/bricks/props/common.ts +0 -37
  136. package/src/shared/bricks/props/container.ts +0 -356
  137. package/src/shared/bricks/props/css-length.ts +0 -25
  138. package/src/shared/bricks/props/datasource.ts +0 -60
  139. package/src/shared/bricks/props/date.ts +0 -24
  140. package/src/shared/bricks/props/effects.ts +0 -123
  141. package/src/shared/bricks/props/enum.ts +0 -42
  142. package/src/shared/bricks/props/file.ts +0 -12
  143. package/src/shared/bricks/props/geolocation.ts +0 -30
  144. package/src/shared/bricks/props/helpers.ts +0 -101
  145. package/src/shared/bricks/props/image.ts +0 -90
  146. package/src/shared/bricks/props/number.ts +0 -16
  147. package/src/shared/bricks/props/padding.ts +0 -21
  148. package/src/shared/bricks/props/position.ts +0 -27
  149. package/src/shared/bricks/props/preset.ts +0 -136
  150. package/src/shared/bricks/props/string.ts +0 -56
  151. package/src/shared/bricks/props/tests/align.test.ts +0 -37
  152. package/src/shared/bricks/props/tests/background.test.ts +0 -102
  153. package/src/shared/bricks/props/tests/border.test.ts +0 -38
  154. package/src/shared/bricks/props/tests/effects.test.ts +0 -37
  155. package/src/shared/bricks/props/tests/helpers.test.ts +0 -133
  156. package/src/shared/bricks/props/tests/image.test.ts +0 -71
  157. package/src/shared/bricks/props/tests/padding.ts +0 -12
  158. package/src/shared/bricks/props/tests/string.test.ts +0 -79
  159. package/src/shared/bricks/props/text.ts +0 -66
  160. package/src/shared/bricks/props/types.ts +0 -57
  161. package/src/shared/bricks.ts +0 -232
  162. package/src/shared/context.ts +0 -39
  163. package/src/shared/datarecords/external/airtable/handler.ts +0 -21
  164. package/src/shared/datarecords/external/airtable/options.ts +0 -22
  165. package/src/shared/datarecords/external/generic-webhook/handler.ts +0 -10
  166. package/src/shared/datarecords/external/generic-webhook/options.ts +0 -13
  167. package/src/shared/datarecords/external/google/oauth/config.ts +0 -30
  168. package/src/shared/datarecords/external/google/sheets/handler.ts +0 -26
  169. package/src/shared/datarecords/external/google/sheets/options.ts +0 -9
  170. package/src/shared/datarecords/types.ts +0 -120
  171. package/src/shared/datarecords.ts +0 -5
  172. package/src/shared/datasources/README.md +0 -3
  173. package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -52
  174. package/src/shared/datasources/external/facebook/posts/sample.ts +0 -35
  175. package/src/shared/datasources/external/facebook/posts/schema.ts +0 -33
  176. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -73
  177. package/src/shared/datasources/external/http-json/fetcher.ts +0 -28
  178. package/src/shared/datasources/external/http-json/options.ts +0 -12
  179. package/src/shared/datasources/external/http-json/schema.ts +0 -6
  180. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +0 -70
  181. package/src/shared/datasources/external/instagram/feed/fetcher.ts +0 -33
  182. package/src/shared/datasources/external/instagram/feed/sample.ts +0 -22
  183. package/src/shared/datasources/external/instagram/feed/schema.ts +0 -23
  184. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +0 -64
  185. package/src/shared/datasources/external/mastodon/account/fetcher.ts +0 -24
  186. package/src/shared/datasources/external/mastodon/account/sample.ts +0 -33
  187. package/src/shared/datasources/external/mastodon/account/schema.ts +0 -45
  188. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +0 -47
  189. package/src/shared/datasources/external/mastodon/options.ts +0 -11
  190. package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -35
  191. package/src/shared/datasources/external/mastodon/status/sample.array.ts +0 -59
  192. package/src/shared/datasources/external/mastodon/status/sample.single.ts +0 -55
  193. package/src/shared/datasources/external/mastodon/status/schema.ts +0 -130
  194. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +0 -74
  195. package/src/shared/datasources/external/meta/oauth/config.ts +0 -16
  196. package/src/shared/datasources/external/meta/options.ts +0 -11
  197. package/src/shared/datasources/external/rss/fetcher.ts +0 -29
  198. package/src/shared/datasources/external/rss/options.ts +0 -11
  199. package/src/shared/datasources/external/rss/sample.ts +0 -22
  200. package/src/shared/datasources/external/rss/schema.ts +0 -42
  201. package/src/shared/datasources/external/threads/media/fetcher.ts +0 -53
  202. package/src/shared/datasources/external/threads/media/sample.ts +0 -44
  203. package/src/shared/datasources/external/threads/media/schema.ts +0 -37
  204. package/src/shared/datasources/external/tiktok/oauth/config.ts +0 -17
  205. package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -39
  206. package/src/shared/datasources/external/tiktok/video/options.ts +0 -12
  207. package/src/shared/datasources/external/tiktok/video/sample.ts +0 -26
  208. package/src/shared/datasources/external/tiktok/video/schema.ts +0 -27
  209. package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -37
  210. package/src/shared/datasources/external/youtube/list/options.ts +0 -15
  211. package/src/shared/datasources/external/youtube/list/sample.ts +0 -33
  212. package/src/shared/datasources/external/youtube/list/schema.ts +0 -38
  213. package/src/shared/datasources/external/youtube/oauth/config.ts +0 -15
  214. package/src/shared/datasources/fetcher.ts +0 -17
  215. package/src/shared/datasources/internal/blog/schema.ts +0 -69
  216. package/src/shared/datasources/internal/changelog/schema.ts +0 -48
  217. package/src/shared/datasources/internal/contact-info/schema.ts +0 -20
  218. package/src/shared/datasources/internal/cv/schema.ts +0 -217
  219. package/src/shared/datasources/internal/faq/schema.ts +0 -27
  220. package/src/shared/datasources/internal/job-board/schema.ts +0 -228
  221. package/src/shared/datasources/internal/links/schema.ts +0 -15
  222. package/src/shared/datasources/internal/recipes/schema.ts +0 -42
  223. package/src/shared/datasources/internal/restaurant/schema.ts +0 -225
  224. package/src/shared/datasources/provider-options.ts +0 -7
  225. package/src/shared/datasources/samples.ts +0 -26
  226. package/src/shared/datasources/schemas.ts +0 -45
  227. package/src/shared/datasources/types.ts +0 -276
  228. package/src/shared/datasources/utils.ts +0 -16
  229. package/src/shared/datasources.ts +0 -42
  230. package/src/shared/env.ts +0 -23
  231. package/src/shared/errors.ts +0 -1
  232. package/src/shared/images.ts +0 -44
  233. package/src/shared/index.ts +0 -3
  234. package/src/shared/layout-constants.ts +0 -25
  235. package/src/shared/manifest.ts +0 -50
  236. package/src/shared/oauth.ts +0 -16
  237. package/src/shared/page.ts +0 -61
  238. package/src/shared/prompt.ts +0 -9
  239. package/src/shared/responsive.ts +0 -5
  240. package/src/shared/site.ts +0 -97
  241. package/src/shared/sitemap.ts +0 -66
  242. package/src/shared/social-icons.ts +0 -307
  243. package/src/shared/tests/attributes.test.ts +0 -37
  244. package/src/shared/theme.ts +0 -245
  245. package/src/shared/themes/README.md +0 -34
  246. package/src/shared/themes/color-system.ts +0 -127
  247. package/src/shared/utils/canvas-data-uri.ts +0 -2
  248. package/src/shared/utils/invariant.ts +0 -25
  249. package/src/shared/utils/json-date.ts +0 -8
  250. package/src/shared/utils/merge.ts +0 -12
  251. package/src/shared/utils/object-hash.ts +0 -7
  252. package/src/shared/utils/schema.ts +0 -35
  253. package/src/shared/utils/try-catch.ts +0 -12
  254. package/src/shared/utils/typed-ref.ts +0 -41
@@ -1,211 +0,0 @@
1
- import { Type, type TProperties, type Static, type TObject } from "@sinclair/typebox";
2
- import type { JSONSchemaType } from "ajv";
3
- import { backgroundRef } from "./bricks/props/background";
4
- import { string } from "./bricks/props/string";
5
- import { optional } from "./bricks/props/helpers";
6
- import { boolean } from "./bricks/props/boolean";
7
- import { datetime } from "./bricks/props/date";
8
- import { enumProp } from "./bricks/props/enum";
9
- import { jsonDefault } from "json-schema-default";
10
-
11
- export function defineAttributes(attrs: TProperties) {
12
- // Attributes starting with "$" are reserved for internal use
13
- for (const key in attrs) {
14
- if (key.startsWith("$")) {
15
- throw new Error(
16
- `Attribute names starting with '$' (like "${key}") are reserved for internal use. Please rename it.`,
17
- );
18
- }
19
- }
20
- return Type.Object(attrs);
21
- }
22
-
23
- /**
24
- * Retuns the custom attributes schema merged with the default attributes schema
25
- */
26
- export function processAttributesSchema(customAttributes: TObject) {
27
- return Type.Composite([customAttributes, defaultAttributesSchema]) as AttributesSchema;
28
- }
29
-
30
- export type { JSONSchemaType };
31
-
32
- // Default attributes
33
- const defaultAttributes = {
34
- $pageLanguage: enumProp("Language", "en", {
35
- options: [
36
- { value: "ar", title: "Arabic" },
37
- { value: "zh", title: "Chinese" },
38
- { value: "cs", title: "Czech" },
39
- { value: "nl", title: "Dutch" },
40
- { value: "en", title: "English" },
41
- { value: "fr", title: "French" },
42
- { value: "de", title: "German" },
43
- { value: "he", title: "Hebrew" },
44
- { value: "hi", title: "Hindi" },
45
- { value: "it", title: "Italian" },
46
- { value: "ja", title: "Japanese" },
47
- { value: "ko", title: "Korean" },
48
- { value: "fa", title: "Persian" },
49
- { value: "pl", title: "Polish" },
50
- { value: "pt", title: "Portuguese" },
51
- { value: "ru", title: "Russian" },
52
- { value: "es", title: "Spanish" },
53
- { value: "tr", title: "Turkish" },
54
- { value: "vi", title: "Vietnamese" },
55
- ],
56
- "ai:guidelines":
57
- "Choose a value based on the site description. If the site is in multiple languages, use 'en'.",
58
-
59
- "ui:group": "meta",
60
- "ui:group:title": "Meta tags",
61
- }),
62
-
63
- $bodyBackground: optional(
64
- backgroundRef({
65
- default: {
66
- color: "#ffffff",
67
- },
68
- title: "Body Background",
69
- description:
70
- "Applies to the body element of the page (while $pageBackground applies to the page container)",
71
- "ui:field": "background",
72
- // disable for now
73
- // "ui:show-img-search": true,
74
- "ui:group": "layout",
75
- "ui:group:title": "Page Layout",
76
- "ui:group:order": 3,
77
- }),
78
- ),
79
-
80
- $pageBackground: optional(backgroundRef({ title: "Page Background", defaultValue: { color: "base-100" } })),
81
-
82
- $pageOgImage: optional(
83
- string("Social share image", "", {
84
- description: "Image shown when page is shared on social media",
85
- "ai:guidelines": "Don't generate this property/image, it is automatically generated.",
86
- "ui:group": "meta",
87
- "ui:field": "image",
88
- }),
89
- ),
90
-
91
- $robotsIndexing: optional(
92
- boolean("Allow search engines to index this site", true, {
93
- description: "Disabling this will prevent search engines from indexing this site",
94
- "ai:guidelines": "Don't generate this property/image, it is automatically generated.",
95
- "ui:group": "seo",
96
- "ui:group:title": "SEO",
97
- "ui:scope": "site",
98
- }),
99
- ),
100
-
101
- $siteOgImage: optional(
102
- string("Social share image", "", {
103
- description: "Image shown when this site is shared on social media",
104
- "ai:guidelines": "Don't generate this image, it is automatically generated.",
105
- "ui:field": "image",
106
- "ui:group": "meta",
107
- "ui:group:title": "Meta tags",
108
- "ui:scope": "site",
109
- }),
110
- ),
111
-
112
- $pagePath: string("Page path", "/", {
113
- description: "The URL path of the page",
114
- "ui:group": "location",
115
- "ui:group:title": "Location",
116
- "ui:field": "path",
117
- }),
118
-
119
- $pageTitle: string("Title", "Untitled", {
120
- "ui:group": "meta",
121
- "ui:group:title": "Meta tags",
122
- description: "The title of the page. Appears in the browser tab and search results",
123
- }),
124
-
125
- $pageDescription: string("Description", "", {
126
- "ui:widget": "textarea",
127
- "ui:group": "meta",
128
- "ui:group:title": "Meta tags",
129
- description: "A short description of the page. Used by search engines",
130
- "ui:multiline": true,
131
- }),
132
-
133
- $pageKeywords: string("Keywords", "", {
134
- "ui:group": "meta",
135
- "ui:group:title": "Meta tags",
136
- description: "Keywords related to the page. Used by search engines",
137
- "ui:multiline": true,
138
- }),
139
-
140
- $pageLastUpdated: optional(
141
- datetime("Last updated", {
142
- "ui:hidden": true,
143
- "ai:guidelines": "Don't generate this property.",
144
- }),
145
- ),
146
-
147
- // --- layout attributes ---
148
-
149
- $siteHeadTags: optional(
150
- Type.String({
151
- title: "Head tags",
152
- description:
153
- "Add custom tags to the <head> of your site. Useful for analytics tags, custom scripts, etc.",
154
- "ai:guidelines": "Don't include meta tags here, they are automatically generated.",
155
- "ui:multiline": true,
156
- "ui:textarea-class": "h-40 !font-mono",
157
- "ui:placeholder": "<script src='https://example.com/script.js'></script>",
158
- "ui:premium": true,
159
- "ui:scope": "site",
160
- "ui:group": "external-scripts",
161
- "ui:group:title": "External scripts",
162
- }),
163
- ),
164
- $siteBodyTags: optional(
165
- Type.String({
166
- title: "Body tags",
167
- description:
168
- "Add custom tags to the <body> of your site. Useful for analytics tags, custom scripts, etc.",
169
- "ui:multiline": true,
170
- "ui:premium": true,
171
- "ui:textarea-class": "h-40 !font-mono",
172
- "ui:placeholder": "<script src='https://example.com/script.js'></script>",
173
- "ui:scope": "site",
174
- "ui:group": "external-scripts",
175
- "ui:group:title": "External scripts",
176
- }),
177
- ),
178
- };
179
-
180
- export const defaultAttributesSchema = Type.Object(defaultAttributes, { additionalProperties: true });
181
- export const siteAttributesSchemaForLLM = Type.Pick(defaultAttributesSchema, [
182
- "$bodyBackground",
183
- "$pageBackground",
184
- ]);
185
- export const pageAttributesSchemaForLLM = Type.Pick(defaultAttributesSchema, [
186
- "$pageTitle",
187
- "$pageDescription",
188
- "$pageKeywords",
189
- "$pageLanguage",
190
- "$pagePath",
191
- "$bodyBackground",
192
- "$pageBackground",
193
- ]);
194
-
195
- export type AttributesSchema = typeof defaultAttributesSchema & Record<string, unknown>;
196
-
197
- export type Attributes<T extends Record<string, unknown> = Record<string, unknown>> = Static<
198
- typeof defaultAttributesSchema
199
- > &
200
- T;
201
-
202
- export function resolveAttributes(
203
- customAttrsSchema: TObject = Type.Object({}),
204
- data: Record<string, unknown> = {},
205
- ) {
206
- // To get default values from the custom attributes schema,
207
- const defaultAttrValues = jsonDefault(defaultAttributesSchema) as Attributes<
208
- Static<typeof defaultAttributesSchema>
209
- >;
210
- return { ...defaultAttrValues, ...data } as Attributes<Static<typeof customAttrsSchema>>;
211
- }
@@ -1,110 +0,0 @@
1
- import type { TObject, TProperties, TArray } from "@sinclair/typebox";
2
- import type { IconBase } from "react-icons/lib";
3
- import { getSchemaDefaults } from "./utils/schema";
4
-
5
- type BrickKind = "brick" | "widget" | "container";
6
-
7
- type BrickManifestProps<BProps extends TProperties, DSSchema extends TObject | TArray<TObject>> = {
8
- type: string;
9
- kind?: BrickKind;
10
- name: string;
11
- icon: typeof IconBase;
12
- iconClassName?: string;
13
- description?: string;
14
- minWidth?: {
15
- mobile: number;
16
- desktop: number;
17
- };
18
- maxWidth?: {
19
- mobile: number;
20
- desktop: number;
21
- };
22
- minHeight?: {
23
- mobile: number;
24
- desktop: number;
25
- };
26
- maxHeight?: {
27
- mobile: number;
28
- desktop: number;
29
- };
30
- defaultWidth?: {
31
- mobile: number;
32
- desktop: number;
33
- };
34
- defaultHeight?: {
35
- mobile: number;
36
- desktop: number;
37
- };
38
- props: TObject<BProps>;
39
- datasource?: DSSchema;
40
- hideInLibrary?: boolean;
41
- defaultInspectorTab?: "preset" | "style" | "content";
42
- deletable?: boolean;
43
- movable?: boolean;
44
- repeatable?: boolean;
45
- resizable?: boolean;
46
- duplicatable?: boolean;
47
- isContainer?: boolean;
48
- aiInstructions?: string;
49
- };
50
-
51
- export function defineBrickManifest<BProps extends TProperties, DSSchema extends TObject | TArray<TObject>>({
52
- props,
53
- defaultWidth,
54
- defaultHeight,
55
- minWidth,
56
- minHeight,
57
- kind = "brick",
58
- isContainer = false,
59
- hideInLibrary = false,
60
- deletable = true,
61
- movable = true,
62
- resizable = true,
63
- repeatable = false,
64
- duplicatable = true,
65
- defaultInspectorTab = "preset",
66
- icon,
67
- datasource,
68
- ...rest
69
- }: BrickManifestProps<BProps, DSSchema>) {
70
- return {
71
- ...rest,
72
- datasource: datasource as DSSchema,
73
- icon,
74
- props,
75
- kind,
76
- defaultInspectorTab,
77
- hideInLibrary,
78
- deletable,
79
- movable,
80
- resizable,
81
- repeatable,
82
- duplicatable,
83
- isContainer,
84
- defaultWidth:
85
- defaultWidth ?? minWidth ?? ({ desktop: 8, mobile: -1 } as { desktop: number; mobile: number }),
86
- defaultHeight:
87
- defaultHeight ?? minHeight ?? ({ desktop: 3, mobile: 3 } as { desktop: number; mobile: number }),
88
- minWidth,
89
- minHeight,
90
- } as const;
91
- }
92
-
93
- export type BrickManifest = ReturnType<typeof defineBrickManifest>;
94
-
95
- export function getBrickManifestDefaults<M extends BrickManifest>(manifest: M) {
96
- return {
97
- ...manifest,
98
- props: getSchemaDefaults(manifest.props),
99
- // mobileProps: {},
100
- ...(manifest.datasource ? { datasource: getSchemaDefaults(manifest.datasource) } : {}),
101
- // ...(manifest.datarecord ? { datarecord: Value.Create(manifest.datarecord) } : {}),
102
- };
103
- }
104
-
105
- export type BrickDefaults = ReturnType<typeof getBrickManifestDefaults>;
106
-
107
- export type BrickConstraints = Pick<
108
- BrickManifest,
109
- "defaultWidth" | "defaultHeight" | "minWidth" | "minHeight" | "maxWidth" | "resizable" | "movable"
110
- >;
@@ -1,179 +0,0 @@
1
- import { defineBrickManifest } from "~/shared/brick-manifest";
2
- import { defineProps, optional, group, prop } from "../props/helpers";
3
- import { Type } from "@sinclair/typebox";
4
- import { MdExpandMore } from "react-icons/md";
5
- import { preset } from "../props/preset";
6
- import { backgroundColor, backgroundColorRef } from "../props/background";
7
- import { fontSize, textContent, textContentRef } from "../props/text";
8
- import { string } from "../props/string";
9
- import { padding, paddingRef } from "../props/padding";
10
- import { border, borderRef } from "../props/border";
11
- import { shadow, shadowRef } from "../props/effects";
12
- import { boolean } from "../props/boolean";
13
- import { TfiLayoutAccordionSeparated } from "react-icons/tfi";
14
- import type { BrickProps } from "../props/types";
15
- import { StringEnum } from "~/shared/utils/schema";
16
- import { colorRef } from "../props/color";
17
- import type { FC } from "react";
18
-
19
- export const manifest = defineBrickManifest({
20
- type: "accordion",
21
- kind: "widget",
22
- name: "Accordion",
23
- description: "An accordion/collapse element for expandable content",
24
- aiInstructions: `
25
- This accordion element displays content in collapsible panels.
26
- It is typically used for FAQ sections, organized documentation, or to save space.
27
- Each item has a title and expandable content area.
28
- Multiple panels can be open simultaneously or limited to one at a time.
29
- `.trim(),
30
- icon: TfiLayoutAccordionSeparated,
31
-
32
- defaultHeight: { desktop: 10, mobile: 15 },
33
- defaultWidth: { desktop: 36, mobile: 24 },
34
-
35
- props: defineProps(
36
- {
37
- container: optional(
38
- group({
39
- title: "Container",
40
- children: {
41
- backgroundColor: optional(backgroundColorRef()),
42
- padding: optional(paddingRef),
43
- border: optional(borderRef),
44
- shadow: optional(shadowRef()),
45
- },
46
- }),
47
- ),
48
- items: prop({
49
- title: "Accordion items",
50
- schema: Type.Array(
51
- Type.Object({
52
- title: textContentRef({ title: "Title", default: "My title", disableSizing: true }),
53
- content: textContentRef({ title: "Content", default: "Expandable content goes here" }),
54
- defaultOpen: optional(boolean("Open by default", false)),
55
- }),
56
- ),
57
- }),
58
- itemsStyles: optional(
59
- group({
60
- title: "Accordion item styles",
61
- children: {
62
- backgroundColor: optional(backgroundColorRef()),
63
- color: optional(colorRef()),
64
- fontSize: fontSize("text-base"),
65
- },
66
- }),
67
- ),
68
- allowMultiple: prop({
69
- title: "Accordion items",
70
- schema: boolean("Allow multiple open", true, {
71
- description: "Allow multiple accordion items to be open at the same time",
72
- }),
73
- }),
74
- variants: Type.Array(
75
- StringEnum(["collapse-arrow", "collapse-plus"], {
76
- default: ["collapse-arrow"],
77
- enumNames: ["With Arrow indicator", "With + indicator"],
78
- }),
79
- ),
80
- },
81
- {
82
- default: {
83
- container: {
84
- padding: "p-6",
85
- backgroundColor: "bg-transparent",
86
- },
87
- allowMultiple: true,
88
- variants: ["collapse-arrow"],
89
- },
90
- },
91
- ),
92
- });
93
-
94
- export type Manifest = typeof manifest;
95
-
96
- export const examples: {
97
- description: string;
98
- type: string;
99
- props: BrickProps<Manifest>["brick"]["props"];
100
- }[] = [
101
- {
102
- description: "FAQ section with card styling with single open",
103
- type: "accordion",
104
- props: {
105
- container: {
106
- backgroundColor: "bg-base-50",
107
- padding: "p-8",
108
- border: {
109
- rounding: "rounded-lg",
110
- },
111
- shadow: "shadow-lg",
112
- },
113
- variants: ["collapse-plus"],
114
- allowMultiple: false,
115
- items: [
116
- {
117
- title: "What is included in the basic plan?",
118
- content:
119
- "The basic plan includes access to all core features, up to 10 projects, 5GB storage, email support, and basic analytics. You can upgrade at any time to access advanced features like API access, priority support, and unlimited projects.",
120
- defaultOpen: true,
121
- },
122
- {
123
- title: "How do I cancel my subscription?",
124
- content:
125
- "You can cancel your subscription at any time from your account settings. Go to Billing > Manage Subscription > Cancel. Your access will continue until the end of your current billing period, and you won't be charged for the next cycle.",
126
- },
127
- {
128
- title: "Is there a free trial available?",
129
- content:
130
- "Yes! We offer a 14-day free trial with full access to all premium features. No credit card required to start. You can upgrade to a paid plan anytime during or after the trial period.",
131
- },
132
- {
133
- title: "What payment methods do you accept?",
134
- content:
135
- "We accept all major credit cards (Visa, MasterCard, American Express), PayPal, and bank transfers for annual subscriptions. All payments are processed securely through our payment partners.",
136
- },
137
- {
138
- title: "Do you offer refunds?",
139
- content:
140
- "We offer a 30-day money-back guarantee for all new subscriptions. If you're not satisfied with our service, contact our support team within 30 days of your purchase for a full refund.",
141
- },
142
- ],
143
- },
144
- },
145
- {
146
- description: "Product features with arrow indicator and multiple open",
147
- type: "accordion",
148
- props: {
149
- container: {
150
- padding: "p-4",
151
- },
152
- variants: ["collapse-arrow"],
153
- allowMultiple: true,
154
- items: [
155
- {
156
- title: "Advanced Analytics",
157
- content:
158
- "Get detailed insights into your data with our comprehensive analytics dashboard. Track key metrics, generate custom reports, and identify trends with powerful visualization tools.",
159
- defaultOpen: true,
160
- },
161
- {
162
- title: "Team Collaboration",
163
- content:
164
- "Work seamlessly with your team using real-time collaboration features. Share projects, assign tasks, leave comments, and track progress all in one place.",
165
- },
166
- {
167
- title: "API Integration",
168
- content:
169
- "Connect with your existing tools and workflows using our robust API. Full documentation, SDKs for popular languages, and webhook support included.",
170
- },
171
- {
172
- title: "Security & Compliance",
173
- content:
174
- "Enterprise-grade security with SOC 2 compliance, data encryption at rest and in transit, SSO support, and comprehensive audit logs.",
175
- },
176
- ],
177
- },
178
- },
179
- ];
@@ -1,92 +0,0 @@
1
- import { manifest as heroManifest, examples as heroExamples } from "./hero.manifest";
2
- import { manifest as imageManifest, examples as imageExamples } from "./image.manifest";
3
- import { manifest as videoManifest, examples as videoExamples } from "./video.manifest";
4
- import { manifest as textManifest, examples as textExamples } from "./text.manifest";
5
- import { manifest as containerManifest, examples as containerExamples } from "./container.manifest";
6
- import { manifest as cardManifest, examples as cardExamples } from "./card.manifest";
7
- import { manifest as mapManifest, examples as mapExamples } from "./map.manifest";
8
- import { manifest as formManifest, examples as formExamples } from "./form.manifest";
9
- import { manifest as imagesWallManifest, examples as imagesWallExamples } from "./images-gallery.manifest";
10
- import { manifest as carouselManifest, examples as carouselExamples } from "./carousel.manifest";
11
- import { manifest as navbarManifest, examples as navbarExamples } from "./navbar.manifest";
12
- import { manifest as footerManifest, examples as footerExamples } from "./footer.manifest";
13
- import { manifest as buttonManifest, examples as buttonExamples } from "./button.manifest";
14
- import { manifest as iconManifest, examples as iconExamples } from "./icon.manifest";
15
- import { manifest as socialLinksManifest, examples as socialLinksExamples } from "./social-links.manifest";
16
- import { manifest as sidebarManifest, examples as sidebarExamples } from "./sidebar.manifest";
17
- import { manifest as dividerManifest, examples as dividerExamples } from "./divider.manifest";
18
- import { manifest as testimonialsManifest, examples as testimonialsExamples } from "./testimonials.manifest";
19
- import { manifest as timelineManifest, examples as timelineExamples } from "./timeline.manifest";
20
- import { manifest as accordionManifest, examples as accordionExamples } from "./accordion.manifest";
21
-
22
- import { getBrickManifestDefaults, type BrickDefaults, type BrickManifest } from "../../brick-manifest";
23
-
24
- export const manifests: Record<string, BrickManifest> = {
25
- [textManifest.type]: textManifest,
26
- [heroManifest.type]: heroManifest,
27
- [imageManifest.type]: imageManifest,
28
- [videoManifest.type]: videoManifest,
29
- [cardManifest.type]: cardManifest,
30
- [mapManifest.type]: mapManifest,
31
- [formManifest.type]: formManifest,
32
- [sidebarManifest.type]: sidebarManifest,
33
- [imagesWallManifest.type]: imagesWallManifest,
34
- [carouselManifest.type]: carouselManifest,
35
- [navbarManifest.type]: navbarManifest,
36
- [footerManifest.type]: footerManifest,
37
- [buttonManifest.type]: buttonManifest,
38
- [iconManifest.type]: iconManifest,
39
- [socialLinksManifest.type]: socialLinksManifest,
40
- [containerManifest.type]: containerManifest,
41
- [dividerManifest.type]: dividerManifest,
42
- [testimonialsManifest.type]: testimonialsManifest,
43
- [timelineManifest.type]: timelineManifest,
44
- [accordionManifest.type]: accordionManifest,
45
- };
46
-
47
- export const defaultProps: Record<string, BrickDefaults> = {
48
- [textManifest.type]: getBrickManifestDefaults(textManifest),
49
- [heroManifest.type]: getBrickManifestDefaults(heroManifest),
50
- [imageManifest.type]: getBrickManifestDefaults(imageManifest),
51
- [videoManifest.type]: getBrickManifestDefaults(videoManifest),
52
- [cardManifest.type]: getBrickManifestDefaults(cardManifest),
53
- [sidebarManifest.type]: getBrickManifestDefaults(sidebarManifest),
54
- [mapManifest.type]: getBrickManifestDefaults(mapManifest),
55
- [formManifest.type]: getBrickManifestDefaults(formManifest),
56
- [imagesWallManifest.type]: getBrickManifestDefaults(imagesWallManifest),
57
- [carouselManifest.type]: getBrickManifestDefaults(carouselManifest),
58
- [navbarManifest.type]: getBrickManifestDefaults(navbarManifest),
59
- [footerManifest.type]: getBrickManifestDefaults(footerManifest),
60
- [buttonManifest.type]: getBrickManifestDefaults(buttonManifest),
61
- [iconManifest.type]: getBrickManifestDefaults(iconManifest),
62
- [socialLinksManifest.type]: getBrickManifestDefaults(socialLinksManifest),
63
- [containerManifest.type]: getBrickManifestDefaults(containerManifest),
64
- [dividerManifest.type]: getBrickManifestDefaults(dividerManifest),
65
- [testimonialsManifest.type]: getBrickManifestDefaults(testimonialsManifest),
66
- [timelineManifest.type]: getBrickManifestDefaults(timelineManifest),
67
- [accordionManifest.type]: getBrickManifestDefaults(accordionManifest),
68
- };
69
-
70
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
71
- export const examples: Record<string, { description: string; type: string; props: any }[]> = {
72
- [textManifest.type]: textExamples,
73
- [heroManifest.type]: heroExamples,
74
- [imageManifest.type]: imageExamples,
75
- [videoManifest.type]: videoExamples,
76
- [cardManifest.type]: cardExamples,
77
- [mapManifest.type]: mapExamples,
78
- [formManifest.type]: formExamples,
79
- [sidebarManifest.type]: sidebarExamples,
80
- [imagesWallManifest.type]: imagesWallExamples,
81
- [carouselManifest.type]: carouselExamples,
82
- [navbarManifest.type]: navbarExamples,
83
- [footerManifest.type]: footerExamples,
84
- [buttonManifest.type]: buttonExamples,
85
- [iconManifest.type]: iconExamples,
86
- [socialLinksManifest.type]: socialLinksExamples,
87
- [containerManifest.type]: containerExamples,
88
- [dividerManifest.type]: dividerExamples,
89
- [testimonialsManifest.type]: testimonialsExamples,
90
- [timelineManifest.type]: timelineExamples,
91
- [accordionManifest.type]: accordionExamples,
92
- };