@morphika/andami 0.1.2

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 (319) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/admin/assets.ts +4 -0
  4. package/admin/database.ts +4 -0
  5. package/admin/index.ts +6 -0
  6. package/admin/login.ts +4 -0
  7. package/admin/navigation.ts +4 -0
  8. package/admin/pages-editor.ts +4 -0
  9. package/admin/pages.ts +4 -0
  10. package/admin/projects-editor.ts +4 -0
  11. package/admin/projects.ts +4 -0
  12. package/admin/settings.ts +4 -0
  13. package/admin/setup.ts +4 -0
  14. package/admin/storage.ts +4 -0
  15. package/admin/styles.ts +4 -0
  16. package/app/(site)/[slug]/loading.tsx +20 -0
  17. package/app/(site)/[slug]/page.tsx +83 -0
  18. package/app/(site)/error.tsx +32 -0
  19. package/app/(site)/layout.tsx +53 -0
  20. package/app/(site)/loading.tsx +20 -0
  21. package/app/(site)/not-found.tsx +41 -0
  22. package/app/(site)/page.tsx +43 -0
  23. package/app/(site)/preview/page.tsx +99 -0
  24. package/app/(site)/work/[slug]/loading.tsx +23 -0
  25. package/app/(site)/work/[slug]/page.tsx +84 -0
  26. package/app/admin/assets/page.tsx +573 -0
  27. package/app/admin/database/page.tsx +302 -0
  28. package/app/admin/error.tsx +53 -0
  29. package/app/admin/layout.tsx +273 -0
  30. package/app/admin/login/page.tsx +88 -0
  31. package/app/admin/navigation/page.tsx +157 -0
  32. package/app/admin/page.tsx +17 -0
  33. package/app/admin/pages/[slug]/page.tsx +849 -0
  34. package/app/admin/pages/page.tsx +588 -0
  35. package/app/admin/projects/[slug]/page.tsx +3 -0
  36. package/app/admin/projects/page.tsx +669 -0
  37. package/app/admin/settings/page.tsx +132 -0
  38. package/app/admin/setup/page.tsx +64 -0
  39. package/app/admin/storage/page.tsx +518 -0
  40. package/app/admin/styles/page.tsx +243 -0
  41. package/app/api/admin/assets/file/route.ts +81 -0
  42. package/app/api/admin/assets/health/route.ts +170 -0
  43. package/app/api/admin/assets/register/route.ts +163 -0
  44. package/app/api/admin/assets/registry/route.ts +98 -0
  45. package/app/api/admin/assets/relink/confirm/route.ts +242 -0
  46. package/app/api/admin/assets/relink/route.ts +202 -0
  47. package/app/api/admin/assets/scan/route.ts +271 -0
  48. package/app/api/admin/auth/route.ts +160 -0
  49. package/app/api/admin/custom-sections/[slug]/route.ts +159 -0
  50. package/app/api/admin/custom-sections/route.ts +127 -0
  51. package/app/api/admin/database/route.ts +53 -0
  52. package/app/api/admin/pages/[slug]/duplicate/route.ts +91 -0
  53. package/app/api/admin/pages/[slug]/route.ts +617 -0
  54. package/app/api/admin/pages/[slug]/set-home/route.ts +76 -0
  55. package/app/api/admin/pages/route.ts +129 -0
  56. package/app/api/admin/preview/route.ts +53 -0
  57. package/app/api/admin/r2/connect/route.ts +181 -0
  58. package/app/api/admin/r2/delete/route.ts +198 -0
  59. package/app/api/admin/r2/disconnect/route.ts +42 -0
  60. package/app/api/admin/r2/rename/route.ts +265 -0
  61. package/app/api/admin/r2/status/route.ts +106 -0
  62. package/app/api/admin/r2/upload-url/route.ts +148 -0
  63. package/app/api/admin/revalidate/route.ts +55 -0
  64. package/app/api/admin/settings/route.ts +279 -0
  65. package/app/api/admin/setup/complete/route.ts +51 -0
  66. package/app/api/admin/setup/route.ts +118 -0
  67. package/app/api/admin/storage/switch/route.ts +117 -0
  68. package/app/api/admin/styles/fonts/route.ts +97 -0
  69. package/app/api/admin/styles/route.ts +304 -0
  70. package/app/api/assets/[...path]/route.ts +98 -0
  71. package/app/api/custom-sections/[id]/route.ts +43 -0
  72. package/app/api/draft-mode/disable/route.ts +10 -0
  73. package/app/api/draft-mode/enable/route.ts +26 -0
  74. package/app/api/projects/route.ts +42 -0
  75. package/app/api/styles/route.ts +88 -0
  76. package/app/favicon.ico +0 -0
  77. package/app/globals.css +7 -0
  78. package/app/layout.tsx +53 -0
  79. package/app/robots.ts +17 -0
  80. package/app/sitemap.ts +48 -0
  81. package/app/studio/[[...index]]/page.tsx +8 -0
  82. package/components/admin/MetadataEditor.tsx +173 -0
  83. package/components/admin/PublishToggle.tsx +130 -0
  84. package/components/admin/icons.tsx +40 -0
  85. package/components/admin/nav-builder/NavBuilder.tsx +182 -0
  86. package/components/admin/nav-builder/NavBuilderGrid.tsx +326 -0
  87. package/components/admin/nav-builder/NavGeneralSettings.tsx +275 -0
  88. package/components/admin/nav-builder/NavGridCell.tsx +48 -0
  89. package/components/admin/nav-builder/NavGridItem.tsx +189 -0
  90. package/components/admin/nav-builder/NavItemSettings.tsx +288 -0
  91. package/components/admin/nav-builder/NavItemTypePicker.tsx +102 -0
  92. package/components/admin/nav-builder/NavLivePreview.tsx +125 -0
  93. package/components/admin/nav-builder/NavSettingsFields.tsx +248 -0
  94. package/components/admin/nav-builder/NavSettingsPanel.tsx +127 -0
  95. package/components/admin/nav-builder/index.ts +10 -0
  96. package/components/admin/nav-builder/nav-builder-utils.ts +238 -0
  97. package/components/admin/setup-wizard/BrandingStep.tsx +218 -0
  98. package/components/admin/setup-wizard/DatabaseStep.tsx +331 -0
  99. package/components/admin/setup-wizard/DoneStep.tsx +187 -0
  100. package/components/admin/setup-wizard/SetupWizard.tsx +166 -0
  101. package/components/admin/setup-wizard/StorageStep.tsx +308 -0
  102. package/components/admin/setup-wizard/WelcomeStep.tsx +96 -0
  103. package/components/admin/setup-wizard/index.ts +9 -0
  104. package/components/admin/styles/ColorsEditor.tsx +214 -0
  105. package/components/admin/styles/FontsEditor.tsx +258 -0
  106. package/components/admin/styles/GridLayoutEditor.tsx +292 -0
  107. package/components/admin/styles/LinksButtonsEditor.tsx +120 -0
  108. package/components/admin/styles/TypographyEditor.tsx +266 -0
  109. package/components/admin/styles/index.ts +9 -0
  110. package/components/admin/styles/shared.tsx +68 -0
  111. package/components/blocks/BlockRenderer.tsx +404 -0
  112. package/components/blocks/ButtonBlockRenderer.tsx +52 -0
  113. package/components/blocks/CoverBlockRenderer.tsx +239 -0
  114. package/components/blocks/CustomSectionInstanceRenderer.tsx +82 -0
  115. package/components/blocks/EnterAnimationWrapper.tsx +140 -0
  116. package/components/blocks/HoverAnimationWrapper.tsx +308 -0
  117. package/components/blocks/ImageBlockRenderer.tsx +61 -0
  118. package/components/blocks/ImageGridBlockRenderer.tsx +545 -0
  119. package/components/blocks/PageBackground.tsx +28 -0
  120. package/components/blocks/PageNavAnimation.tsx +35 -0
  121. package/components/blocks/PageNavColor.tsx +24 -0
  122. package/components/blocks/PageRenderer.tsx +142 -0
  123. package/components/blocks/ParallaxGroupRenderer.tsx +448 -0
  124. package/components/blocks/ParallaxSlideRenderer.tsx +175 -0
  125. package/components/blocks/ProjectGridBlockRenderer.tsx +556 -0
  126. package/components/blocks/SectionRenderer.tsx +170 -0
  127. package/components/blocks/SectionV2Renderer.tsx +330 -0
  128. package/components/blocks/ShaderCanvas.tsx +392 -0
  129. package/components/blocks/SpacerBlockRenderer.tsx +17 -0
  130. package/components/blocks/TextBlockRenderer.tsx +87 -0
  131. package/components/blocks/TypewriterRichText.tsx +464 -0
  132. package/components/blocks/TypewriterWrapper.tsx +149 -0
  133. package/components/blocks/VideoBlockRenderer.tsx +304 -0
  134. package/components/blocks/index.ts +2 -0
  135. package/components/builder/AssetBrowser.tsx +2 -0
  136. package/components/builder/BlockLivePreview.tsx +101 -0
  137. package/components/builder/BlockTypePicker.tsx +178 -0
  138. package/components/builder/BuilderCanvas.tsx +354 -0
  139. package/components/builder/CanvasMinimap.tsx +200 -0
  140. package/components/builder/CanvasToolbar.tsx +202 -0
  141. package/components/builder/ColorPicker.tsx +243 -0
  142. package/components/builder/ColorSwatchPicker.tsx +274 -0
  143. package/components/builder/ColumnDragContext.tsx +51 -0
  144. package/components/builder/ColumnDragOverlay.tsx +110 -0
  145. package/components/builder/CustomSectionInstanceCard.tsx +97 -0
  146. package/components/builder/DeviceFrame.tsx +123 -0
  147. package/components/builder/DndWrapper.tsx +337 -0
  148. package/components/builder/InsertionLines.tsx +186 -0
  149. package/components/builder/ParallaxGroupCanvas.tsx +228 -0
  150. package/components/builder/ParallaxSlideHeader.tsx +113 -0
  151. package/components/builder/ReadOnlyFrame.tsx +417 -0
  152. package/components/builder/SectionEditorBar.tsx +288 -0
  153. package/components/builder/SectionTypePicker.tsx +422 -0
  154. package/components/builder/SectionV2Canvas.tsx +297 -0
  155. package/components/builder/SectionV2Column.tsx +488 -0
  156. package/components/builder/SettingsPanel.tsx +911 -0
  157. package/components/builder/SortableBlock.tsx +230 -0
  158. package/components/builder/SortableRow.tsx +362 -0
  159. package/components/builder/VirtualAssetGrid.tsx +397 -0
  160. package/components/builder/asset-browser/AssetBrowser.tsx +178 -0
  161. package/components/builder/asset-browser/FileLightbox.tsx +116 -0
  162. package/components/builder/asset-browser/FolderTreeItem.tsx +55 -0
  163. package/components/builder/asset-browser/R2BrowserContent.tsx +436 -0
  164. package/components/builder/asset-browser/R2ContextMenu.tsx +98 -0
  165. package/components/builder/asset-browser/VideoThumbnail.tsx +63 -0
  166. package/components/builder/asset-browser/helpers.ts +88 -0
  167. package/components/builder/asset-browser/index.ts +1 -0
  168. package/components/builder/asset-browser/types.ts +49 -0
  169. package/components/builder/asset-browser/useAssetBrowser.ts +344 -0
  170. package/components/builder/asset-browser/useR2DragDrop.ts +116 -0
  171. package/components/builder/asset-browser/useR2Operations.ts +189 -0
  172. package/components/builder/blockStyles.tsx +295 -0
  173. package/components/builder/editors/ButtonBlockEditor.tsx +184 -0
  174. package/components/builder/editors/CoverBlockEditor.tsx +488 -0
  175. package/components/builder/editors/EnterAnimationPicker.tsx +297 -0
  176. package/components/builder/editors/HoverEffectPicker.tsx +209 -0
  177. package/components/builder/editors/ImageBlockEditor.tsx +206 -0
  178. package/components/builder/editors/ImageGridBlockEditor.tsx +386 -0
  179. package/components/builder/editors/ProjectGridEditor.tsx +648 -0
  180. package/components/builder/editors/SpacerBlockEditor.tsx +167 -0
  181. package/components/builder/editors/StaggerSettings.tsx +108 -0
  182. package/components/builder/editors/TextAlignmentIcons.tsx +39 -0
  183. package/components/builder/editors/TextBlockEditor.tsx +462 -0
  184. package/components/builder/editors/TextStylePicker.tsx +183 -0
  185. package/components/builder/editors/VideoBlockEditor.tsx +278 -0
  186. package/components/builder/editors/index.ts +10 -0
  187. package/components/builder/editors/shared.tsx +345 -0
  188. package/components/builder/hooks/useColumnDrag.ts +472 -0
  189. package/components/builder/hooks/useColumnResize.ts +221 -0
  190. package/components/builder/index.ts +12 -0
  191. package/components/builder/live-preview/LiveButtonPreview.tsx +38 -0
  192. package/components/builder/live-preview/LiveCoverPreview.tsx +146 -0
  193. package/components/builder/live-preview/LiveImageGridPreview.tsx +123 -0
  194. package/components/builder/live-preview/LiveImagePreview.tsx +107 -0
  195. package/components/builder/live-preview/LiveProjectGridPreview.tsx +1010 -0
  196. package/components/builder/live-preview/LiveSpacerPreview.tsx +9 -0
  197. package/components/builder/live-preview/LiveTextEditor.tsx +198 -0
  198. package/components/builder/live-preview/LiveVideoPreview.tsx +98 -0
  199. package/components/builder/live-preview/index.ts +10 -0
  200. package/components/builder/live-preview/shared.tsx +153 -0
  201. package/components/builder/settings-panel/BlockLayoutTab.tsx +532 -0
  202. package/components/builder/settings-panel/BlockSettings.tsx +94 -0
  203. package/components/builder/settings-panel/ColumnV2Settings.tsx +160 -0
  204. package/components/builder/settings-panel/LayoutTab.tsx +310 -0
  205. package/components/builder/settings-panel/PageSettings.tsx +200 -0
  206. package/components/builder/settings-panel/ParallaxGroupSettings.tsx +118 -0
  207. package/components/builder/settings-panel/ParallaxSlideSettings.tsx +178 -0
  208. package/components/builder/settings-panel/SectionV2AnimationTab.tsx +103 -0
  209. package/components/builder/settings-panel/SectionV2LayoutTab.tsx +312 -0
  210. package/components/builder/settings-panel/SectionV2Settings.tsx +323 -0
  211. package/components/builder/settings-panel/TRBLInputs.tsx +51 -0
  212. package/components/builder/settings-panel/index.ts +19 -0
  213. package/components/builder/settings-panel/responsive-helpers.ts +524 -0
  214. package/components/ui/CustomCursor.tsx +118 -0
  215. package/components/ui/NavContentLightbox.tsx +152 -0
  216. package/components/ui/Navbar.tsx +582 -0
  217. package/components/ui/PortfolioTracker.tsx +87 -0
  218. package/components/ui/ScrollToTop.tsx +47 -0
  219. package/lib/animation/enter-presets.ts +147 -0
  220. package/lib/animation/enter-resolve.ts +90 -0
  221. package/lib/animation/enter-types.ts +128 -0
  222. package/lib/animation/hover-effect-presets.ts +210 -0
  223. package/lib/animation/hover-effect-types.ts +126 -0
  224. package/lib/asset-retry.ts +111 -0
  225. package/lib/assets.ts +92 -0
  226. package/lib/audit.ts +35 -0
  227. package/lib/auth-token.ts +94 -0
  228. package/lib/auth.ts +13 -0
  229. package/lib/builder/cascade-helpers.ts +51 -0
  230. package/lib/builder/cascade.ts +533 -0
  231. package/lib/builder/constants.ts +103 -0
  232. package/lib/builder/defaults.ts +182 -0
  233. package/lib/builder/history.ts +48 -0
  234. package/lib/builder/index.ts +21 -0
  235. package/lib/builder/layout-styles.ts +344 -0
  236. package/lib/builder/masonry.ts +166 -0
  237. package/lib/builder/responsive.ts +156 -0
  238. package/lib/builder/serializer.ts +845 -0
  239. package/lib/builder/store-blocks.ts +193 -0
  240. package/lib/builder/store-canvas.ts +319 -0
  241. package/lib/builder/store-helpers.ts +490 -0
  242. package/lib/builder/store-sections.ts +709 -0
  243. package/lib/builder/store.ts +333 -0
  244. package/lib/builder/templates.ts +297 -0
  245. package/lib/builder/types.ts +374 -0
  246. package/lib/builder/utils.ts +37 -0
  247. package/lib/color-utils.ts +116 -0
  248. package/lib/config/index.ts +57 -0
  249. package/lib/config/types.ts +122 -0
  250. package/lib/contexts/AssetContext.tsx +79 -0
  251. package/lib/contexts/NavAnimationContext.tsx +44 -0
  252. package/lib/contexts/NavColorContext.tsx +38 -0
  253. package/lib/contexts/PageExitContext.tsx +194 -0
  254. package/lib/contexts/ThumbStatusContext.tsx +83 -0
  255. package/lib/csrf-client.ts +34 -0
  256. package/lib/csrf.ts +68 -0
  257. package/lib/format-utils.ts +24 -0
  258. package/lib/hooks/useViewport.ts +42 -0
  259. package/lib/logger.ts +81 -0
  260. package/lib/revalidate.ts +23 -0
  261. package/lib/sanitize.ts +91 -0
  262. package/lib/sanity/client.ts +8 -0
  263. package/lib/sanity/queries.ts +486 -0
  264. package/lib/sanity/types.ts +869 -0
  265. package/lib/sanity/writeClient.ts +24 -0
  266. package/lib/security.ts +402 -0
  267. package/lib/setup/detect.ts +156 -0
  268. package/lib/shader/glsl/index.ts +27 -0
  269. package/lib/shader/glsl/pixelate.ts +51 -0
  270. package/lib/shader/glsl/rgb-shift.ts +45 -0
  271. package/lib/shader/glsl/ripple.ts +46 -0
  272. package/lib/shader/glsl/vertex.ts +14 -0
  273. package/lib/storage/index.ts +211 -0
  274. package/lib/storage/r2-adapter.ts +286 -0
  275. package/lib/storage/types.ts +125 -0
  276. package/lib/styles/provider.tsx +267 -0
  277. package/lib/thumbnails/generate.ts +151 -0
  278. package/lib/utils.ts +6 -0
  279. package/package.json +212 -0
  280. package/sanity/compose.ts +65 -0
  281. package/sanity/sanity.config.ts +126 -0
  282. package/sanity/schemas/assetRegistry.ts +301 -0
  283. package/sanity/schemas/blocks/blockLayout.ts +90 -0
  284. package/sanity/schemas/blocks/buttonBlock.ts +82 -0
  285. package/sanity/schemas/blocks/coverBlock.ts +229 -0
  286. package/sanity/schemas/blocks/imageBlock.ts +58 -0
  287. package/sanity/schemas/blocks/imageGridBlock.ts +112 -0
  288. package/sanity/schemas/blocks/index.ts +9 -0
  289. package/sanity/schemas/blocks/projectGridBlock.ts +251 -0
  290. package/sanity/schemas/blocks/spacerBlock.ts +41 -0
  291. package/sanity/schemas/blocks/textBlock.ts +139 -0
  292. package/sanity/schemas/blocks/videoBlock.ts +80 -0
  293. package/sanity/schemas/customSection.ts +69 -0
  294. package/sanity/schemas/customSectionInstance.ts +163 -0
  295. package/sanity/schemas/index.ts +111 -0
  296. package/sanity/schemas/objects/enterAnimationConfig.ts +72 -0
  297. package/sanity/schemas/objects/hoverEffectConfig.ts +90 -0
  298. package/sanity/schemas/objects/parallaxGroup.ts +66 -0
  299. package/sanity/schemas/objects/parallaxSlide.ts +217 -0
  300. package/sanity/schemas/objects/typewriterConfig.ts +38 -0
  301. package/sanity/schemas/page.ts +162 -0
  302. package/sanity/schemas/pageSection.ts +157 -0
  303. package/sanity/schemas/pageSectionV2.ts +269 -0
  304. package/sanity/schemas/siteSettings.ts +256 -0
  305. package/sanity/schemas/siteStyles.ts +212 -0
  306. package/site/error.ts +4 -0
  307. package/site/index.ts +8 -0
  308. package/site/not-found.ts +4 -0
  309. package/site/page.ts +4 -0
  310. package/site/preview.ts +4 -0
  311. package/site/robots.ts +4 -0
  312. package/site/sitemap.ts +4 -0
  313. package/site/work.ts +4 -0
  314. package/studio/index.ts +4 -0
  315. package/styles/admin.css +85 -0
  316. package/styles/animations.css +237 -0
  317. package/styles/base.css +148 -0
  318. package/styles/globals.css +10 -0
  319. package/tsconfig.json +25 -0
@@ -0,0 +1,58 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ export const imageBlock = defineType({
5
+ name: "imageBlock",
6
+ title: "Image Block",
7
+ type: "object",
8
+ fields: [
9
+ defineField({
10
+ name: "asset_path",
11
+ title: "Asset Path",
12
+ type: "string",
13
+ description: "Relative path to the image file",
14
+ validation: (Rule) => Rule.required(),
15
+ }),
16
+ defineField({ name: "alt", title: "Alt Text", type: "string" }),
17
+ defineField({ name: "caption", title: "Caption", type: "string" }),
18
+ defineField({
19
+ name: "width",
20
+ title: "Width",
21
+ type: "string",
22
+ options: {
23
+ list: [
24
+ { title: "Full", value: "full" },
25
+ { title: "Contained", value: "contained" },
26
+ { title: "Small", value: "small" },
27
+ ],
28
+ },
29
+ initialValue: "full",
30
+ }),
31
+ defineField({
32
+ name: "aspect_ratio",
33
+ title: "Aspect Ratio",
34
+ type: "string",
35
+ options: {
36
+ list: [
37
+ { title: "Auto", value: "auto" },
38
+ { title: "16:9", value: "16:9" },
39
+ { title: "4:3", value: "4:3" },
40
+ { title: "1:1", value: "1:1" },
41
+ { title: "21:9", value: "21:9" },
42
+ ],
43
+ },
44
+ initialValue: "auto",
45
+ }),
46
+ defineField({ name: "lazy", title: "Lazy Load", type: "boolean", initialValue: true }),
47
+ defineField({ name: "border_radius", title: "Border Radius", type: "string" }),
48
+ defineField({ name: "shadow", title: "Shadow", type: "boolean", initialValue: false }),
49
+ ...blockAnimationFields,
50
+ blockLayoutField,
51
+ ],
52
+ preview: {
53
+ select: { path: "asset_path", alt: "alt" },
54
+ prepare({ path, alt }) {
55
+ return { title: alt || path || "Image block" };
56
+ },
57
+ },
58
+ });
@@ -0,0 +1,112 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ export const imageGridBlock = defineType({
5
+ name: "imageGridBlock",
6
+ title: "Image Grid Block",
7
+ type: "object",
8
+ fields: [
9
+ defineField({
10
+ name: "images",
11
+ title: "Images",
12
+ type: "array",
13
+ of: [
14
+ {
15
+ type: "object",
16
+ fields: [
17
+ defineField({
18
+ name: "asset_path",
19
+ title: "Asset Path",
20
+ type: "string",
21
+ validation: (Rule) => Rule.required(),
22
+ }),
23
+ defineField({ name: "alt", title: "Alt Text", type: "string" }),
24
+ ],
25
+ preview: {
26
+ select: { path: "asset_path", alt: "alt" },
27
+ prepare({ path, alt }) {
28
+ return { title: alt || path || "Image" };
29
+ },
30
+ },
31
+ },
32
+ ],
33
+ }),
34
+ defineField({
35
+ name: "h_gutter",
36
+ title: "Horizontal Gutter",
37
+ type: "number",
38
+ initialValue: 10,
39
+ }),
40
+ defineField({
41
+ name: "v_gutter",
42
+ title: "Vertical Gutter",
43
+ type: "number",
44
+ initialValue: 10,
45
+ }),
46
+ defineField({
47
+ name: "images_per_row",
48
+ title: "Images Per Row",
49
+ type: "number",
50
+ options: {
51
+ list: [
52
+ { title: "1 Image", value: 1 },
53
+ { title: "2 Images", value: 2 },
54
+ { title: "4 Images", value: 4 },
55
+ { title: "6 Images", value: 6 },
56
+ { title: "12 Images", value: 12 },
57
+ ],
58
+ },
59
+ initialValue: 2,
60
+ }),
61
+ defineField({
62
+ name: "random_grid",
63
+ title: "Random Grid",
64
+ type: "string",
65
+ options: {
66
+ list: [
67
+ { title: "Disabled", value: "disabled" },
68
+ { title: "Small 2 Col, Big 4 Col", value: "small2-big4" },
69
+ { title: "Small 3 Col, Big 6 Col", value: "small3-big6" },
70
+ { title: "Small 4 Col, Big 8 Col", value: "small4-big8" },
71
+ ],
72
+ },
73
+ initialValue: "disabled",
74
+ }),
75
+ defineField({
76
+ name: "random_seed",
77
+ title: "Random Seed",
78
+ type: "number",
79
+ description: "Seed for random grid layout — change to re-randomize",
80
+ initialValue: 1,
81
+ }),
82
+ defineField({
83
+ name: "lightbox",
84
+ title: "Lightbox",
85
+ type: "boolean",
86
+ initialValue: false,
87
+ }),
88
+ defineField({
89
+ name: "object_fit",
90
+ title: "Object Fit",
91
+ type: "string",
92
+ options: {
93
+ list: [
94
+ { title: "Cover", value: "cover" },
95
+ { title: "Contain", value: "contain" },
96
+ ],
97
+ },
98
+ initialValue: "cover",
99
+ }),
100
+ defineField({ name: "border_radius", title: "Border Radius", type: "string" }),
101
+ ...blockAnimationFields,
102
+ blockLayoutField,
103
+ ],
104
+ preview: {
105
+ select: { images: "images", images_per_row: "images_per_row", random_grid: "random_grid" },
106
+ prepare({ images, images_per_row, random_grid }) {
107
+ const count = images?.length || 0;
108
+ const mode = random_grid && random_grid !== "disabled" ? `random` : `${images_per_row || 2}/row`;
109
+ return { title: `Image Grid (${mode}) — ${count} images` };
110
+ },
111
+ },
112
+ });
@@ -0,0 +1,9 @@
1
+ // Block schemas (8)
2
+ export { textBlock } from "./textBlock";
3
+ export { imageBlock } from "./imageBlock";
4
+ export { imageGridBlock } from "./imageGridBlock";
5
+ export { videoBlock } from "./videoBlock";
6
+ export { spacerBlock } from "./spacerBlock";
7
+ export { buttonBlock } from "./buttonBlock";
8
+ export { coverBlock } from "./coverBlock";
9
+ export { projectGridBlock } from "./projectGridBlock";
@@ -0,0 +1,251 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ /**
5
+ * projectGridBlock — v2 schema (Session 105).
6
+ *
7
+ * Single masonry grid mode. Columns 1–6, multi-select aspect ratios,
8
+ * separate H/V gaps, hover effects (scale/3d/none), video modes,
9
+ * per-card overrides.
10
+ *
11
+ * Not available in the regular block picker — only injected via page templates.
12
+ */
13
+ export const projectGridBlock = defineType({
14
+ name: "projectGridBlock",
15
+ title: "Project Grid Block",
16
+ type: "object",
17
+ fields: [
18
+ // ─── Grid Settings ───
19
+ defineField({
20
+ name: "columns",
21
+ title: "Columns",
22
+ type: "number",
23
+ description: "Number of columns (1–6)",
24
+ initialValue: 3,
25
+ validation: (Rule) => Rule.min(1).max(6).integer(),
26
+ }),
27
+ defineField({
28
+ name: "aspect_ratios",
29
+ title: "Aspect Ratios",
30
+ type: "array",
31
+ of: [{ type: "string" }],
32
+ description: "One or more aspect ratios for cards. Random distribution when multiple selected.",
33
+ options: {
34
+ list: [
35
+ { title: "Landscape (16:9)", value: "16/9" },
36
+ { title: "Square (1:1)", value: "1/1" },
37
+ { title: "Portrait (9:16)", value: "9/16" },
38
+ ],
39
+ },
40
+ initialValue: ["16/9"],
41
+ validation: (Rule) => Rule.min(1),
42
+ }),
43
+ defineField({
44
+ name: "gap_v",
45
+ title: "Vertical Gap",
46
+ type: "number",
47
+ description: "Vertical gap between cards in px",
48
+ initialValue: 16,
49
+ }),
50
+ defineField({
51
+ name: "gap_h",
52
+ title: "Horizontal Gap",
53
+ type: "number",
54
+ description: "Horizontal gap between cards in px",
55
+ initialValue: 16,
56
+ }),
57
+
58
+ // ─── Appearance ───
59
+ defineField({
60
+ name: "hover_effect",
61
+ title: "Hover Effect",
62
+ type: "string",
63
+ options: {
64
+ list: [
65
+ { title: "3D Tilt", value: "3d" },
66
+ { title: "Scale", value: "scale" },
67
+ { title: "None", value: "none" },
68
+ ],
69
+ },
70
+ initialValue: "scale",
71
+ }),
72
+ defineField({
73
+ name: "show_subtitle",
74
+ title: "Show Subtitle",
75
+ type: "boolean",
76
+ initialValue: true,
77
+ }),
78
+ defineField({
79
+ name: "border_radius",
80
+ title: "Border Radius",
81
+ type: "number",
82
+ description: "Card corner radius in px",
83
+ initialValue: 0,
84
+ }),
85
+
86
+ // ─── Video ───
87
+ defineField({
88
+ name: "video_mode",
89
+ title: "Video Mode",
90
+ type: "string",
91
+ options: {
92
+ list: [
93
+ { title: "Off", value: "off" },
94
+ { title: "Hover", value: "hover" },
95
+ { title: "Autoloop", value: "autoloop" },
96
+ ],
97
+ },
98
+ initialValue: "off",
99
+ }),
100
+
101
+ // ─── Card Entrance Animation ───
102
+ defineField({
103
+ name: "card_entrance",
104
+ title: "Card Entrance Animation",
105
+ type: "object",
106
+ fields: [
107
+ defineField({
108
+ name: "enabled",
109
+ title: "Enabled",
110
+ type: "boolean",
111
+ initialValue: false,
112
+ }),
113
+ defineField({
114
+ name: "preset",
115
+ title: "Preset",
116
+ type: "string",
117
+ options: {
118
+ list: [
119
+ { title: "Fade", value: "fade" },
120
+ { title: "Slide Up", value: "slide-up" },
121
+ { title: "Scale", value: "scale" },
122
+ ],
123
+ },
124
+ initialValue: "slide-up",
125
+ }),
126
+ defineField({
127
+ name: "stagger_delay",
128
+ title: "Stagger Delay",
129
+ type: "number",
130
+ description: "Delay between cards (ms)",
131
+ initialValue: 80,
132
+ }),
133
+ defineField({
134
+ name: "duration",
135
+ title: "Duration",
136
+ type: "number",
137
+ description: "Animation duration (ms)",
138
+ initialValue: 500,
139
+ }),
140
+ ],
141
+ }),
142
+
143
+ // ─── Projects ───
144
+ defineField({
145
+ name: "projects",
146
+ title: "Projects",
147
+ type: "array",
148
+ of: [
149
+ {
150
+ type: "object",
151
+ fields: [
152
+ defineField({
153
+ name: "project_slug",
154
+ title: "Project Slug",
155
+ type: "string",
156
+ validation: (Rule) => Rule.required(),
157
+ }),
158
+ defineField({
159
+ name: "custom_thumbnail",
160
+ title: "Custom Thumbnail",
161
+ type: "string",
162
+ description: "Override the project thumbnail (asset path)",
163
+ }),
164
+ defineField({
165
+ name: "custom_subtitle",
166
+ title: "Custom Subtitle",
167
+ type: "string",
168
+ description: "Override the project subtitle",
169
+ }),
170
+ defineField({
171
+ name: "aspect_ratio_override",
172
+ title: "Aspect Ratio Override",
173
+ type: "string",
174
+ description: "Override aspect ratio for this specific card (null = inherit grid)",
175
+ options: {
176
+ list: [
177
+ { title: "Landscape (16:9)", value: "16/9" },
178
+ { title: "Square (1:1)", value: "1/1" },
179
+ { title: "Portrait (9:16)", value: "9/16" },
180
+ ],
181
+ },
182
+ }),
183
+ defineField({
184
+ name: "responsive",
185
+ title: "Responsive Overrides",
186
+ type: "object",
187
+ description: "Viewport-specific per-card overrides",
188
+ fields: [
189
+ defineField({
190
+ name: "tablet",
191
+ title: "Tablet",
192
+ type: "object",
193
+ fields: [
194
+ defineField({
195
+ name: "aspect_ratio_override",
196
+ title: "Aspect Ratio Override",
197
+ type: "string",
198
+ options: {
199
+ list: [
200
+ { title: "Landscape (16:9)", value: "16/9" },
201
+ { title: "Square (1:1)", value: "1/1" },
202
+ { title: "Portrait (9:16)", value: "9/16" },
203
+ ],
204
+ },
205
+ }),
206
+ ],
207
+ }),
208
+ defineField({
209
+ name: "phone",
210
+ title: "Phone",
211
+ type: "object",
212
+ fields: [
213
+ defineField({
214
+ name: "aspect_ratio_override",
215
+ title: "Aspect Ratio Override",
216
+ type: "string",
217
+ options: {
218
+ list: [
219
+ { title: "Landscape (16:9)", value: "16/9" },
220
+ { title: "Square (1:1)", value: "1/1" },
221
+ { title: "Portrait (9:16)", value: "9/16" },
222
+ ],
223
+ },
224
+ }),
225
+ ],
226
+ }),
227
+ ],
228
+ }),
229
+ ],
230
+ preview: {
231
+ select: { slug: "project_slug" },
232
+ prepare({ slug }) {
233
+ return { title: slug || "Project" };
234
+ },
235
+ },
236
+ },
237
+ ],
238
+ }),
239
+
240
+ // ─── Standard block fields ───
241
+ ...blockAnimationFields,
242
+ blockLayoutField,
243
+ ],
244
+ preview: {
245
+ select: { projects: "projects", columns: "columns" },
246
+ prepare({ projects, columns }) {
247
+ const count = projects?.length || 0;
248
+ return { title: `Project Grid (${columns || 3} col) — ${count} projects` };
249
+ },
250
+ },
251
+ });
@@ -0,0 +1,41 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ export const spacerBlock = defineType({
5
+ name: "spacerBlock",
6
+ title: "Spacer Block",
7
+ type: "object",
8
+ fields: [
9
+ defineField({
10
+ name: "height",
11
+ title: "Height",
12
+ type: "string",
13
+ options: {
14
+ list: [
15
+ { title: "Small (24px)", value: "small" },
16
+ { title: "Medium (48px)", value: "medium" },
17
+ { title: "Large (96px)", value: "large" },
18
+ { title: "XLarge (144px)", value: "xlarge" },
19
+ { title: "Custom", value: "custom" },
20
+ ],
21
+ },
22
+ initialValue: "medium",
23
+ }),
24
+ defineField({
25
+ name: "custom_height",
26
+ title: "Custom Height (px)",
27
+ type: "number",
28
+ description: "Only used when height is set to Custom",
29
+ hidden: ({ parent }) => parent?.height !== "custom",
30
+ }),
31
+ ...blockAnimationFields,
32
+ blockLayoutField,
33
+ ],
34
+ preview: {
35
+ select: { height: "height", custom: "custom_height" },
36
+ prepare({ height, custom }) {
37
+ const label = height === "custom" ? `${custom || 0}px` : height || "medium";
38
+ return { title: `Spacer — ${label}` };
39
+ },
40
+ },
41
+ });
@@ -0,0 +1,139 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ export const textBlock = defineType({
5
+ name: "textBlock",
6
+ title: "Text Block",
7
+ type: "object",
8
+ fields: [
9
+ defineField({
10
+ name: "text",
11
+ title: "Text",
12
+ type: "array",
13
+ of: [
14
+ {
15
+ type: "block",
16
+ styles: [
17
+ { title: "Normal", value: "normal" },
18
+ { title: "H1", value: "h1" },
19
+ { title: "H2", value: "h2" },
20
+ { title: "H3", value: "h3" },
21
+ { title: "H4", value: "h4" },
22
+ { title: "Quote", value: "blockquote" },
23
+ ],
24
+ marks: {
25
+ decorators: [
26
+ { title: "Bold", value: "strong" },
27
+ { title: "Italic", value: "em" },
28
+ { title: "Underline", value: "underline" },
29
+ { title: "Strike", value: "strike-through" },
30
+ ],
31
+ annotations: [
32
+ {
33
+ name: "link",
34
+ type: "object",
35
+ title: "Link",
36
+ fields: [
37
+ defineField({
38
+ name: "href",
39
+ type: "url",
40
+ title: "URL",
41
+ validation: (Rule) =>
42
+ Rule.uri({ allowRelative: true, scheme: ["http", "https", "mailto"] }),
43
+ }),
44
+ defineField({
45
+ name: "blank",
46
+ type: "boolean",
47
+ title: "Open in new tab",
48
+ }),
49
+ ],
50
+ },
51
+ ],
52
+ },
53
+ },
54
+ ],
55
+ }),
56
+ defineField({
57
+ name: "columns",
58
+ title: "Columns",
59
+ type: "number",
60
+ description: "Number of text columns (1–4). Gap inherits the global grid gutter.",
61
+ validation: (Rule) => Rule.min(1).max(4).integer(),
62
+ initialValue: 1,
63
+ }),
64
+ defineField({
65
+ name: "style",
66
+ title: "Style",
67
+ type: "object",
68
+ fields: [
69
+ defineField({
70
+ name: "fontSize",
71
+ title: "Font Size",
72
+ type: "string",
73
+ options: {
74
+ list: [
75
+ { title: "Small", value: "small" },
76
+ { title: "Base", value: "base" },
77
+ { title: "Large", value: "large" },
78
+ { title: "XL", value: "xl" },
79
+ { title: "2XL", value: "2xl" },
80
+ { title: "3XL", value: "3xl" },
81
+ ],
82
+ },
83
+ }),
84
+ defineField({ name: "color", title: "Text Color", type: "string" }),
85
+ defineField({
86
+ name: "alignment",
87
+ title: "Alignment",
88
+ type: "string",
89
+ options: {
90
+ list: [
91
+ { title: "Left", value: "left" },
92
+ { title: "Center", value: "center" },
93
+ { title: "Right", value: "right" },
94
+ ],
95
+ },
96
+ }),
97
+ defineField({
98
+ name: "fontWeight",
99
+ title: "Font Weight",
100
+ type: "string",
101
+ options: {
102
+ list: [
103
+ { title: "Normal", value: "normal" },
104
+ { title: "Medium", value: "medium" },
105
+ { title: "Bold", value: "bold" },
106
+ ],
107
+ },
108
+ }),
109
+ defineField({ name: "lineHeight", title: "Line Height", type: "string" }),
110
+ defineField({ name: "letterSpacing", title: "Letter Spacing", type: "string" }),
111
+ defineField({ name: "maxWidth", title: "Max Width", type: "string" }),
112
+ defineField({
113
+ name: "opacity",
114
+ title: "Opacity",
115
+ type: "number",
116
+ validation: (Rule) => Rule.min(0).max(1),
117
+ }),
118
+ ],
119
+ }),
120
+ ...blockAnimationFields,
121
+ defineField({
122
+ name: "typewriter_config",
123
+ title: "Typewriter Config",
124
+ type: "typewriterConfig",
125
+ }),
126
+ blockLayoutField,
127
+ ],
128
+ preview: {
129
+ select: { text: "text" },
130
+ prepare({ text }) {
131
+ const firstBlock = text?.find((b: { _type: string }) => b._type === "block");
132
+ const preview =
133
+ firstBlock?.children
134
+ ?.map((c: { text: string }) => c.text)
135
+ .join("") || "Empty text block";
136
+ return { title: preview.substring(0, 60) };
137
+ },
138
+ },
139
+ });
@@ -0,0 +1,80 @@
1
+ import { defineField, defineType } from "sanity";
2
+ import { blockLayoutField, blockAnimationFields } from "./blockLayout";
3
+
4
+ export const videoBlock = defineType({
5
+ name: "videoBlock",
6
+ title: "Video Block",
7
+ type: "object",
8
+ fields: [
9
+ defineField({
10
+ name: "video_type",
11
+ title: "Video Type",
12
+ type: "string",
13
+ options: {
14
+ list: [
15
+ { title: "Vimeo", value: "vimeo" },
16
+ { title: "YouTube", value: "youtube" },
17
+ { title: "MP4 File", value: "mp4" },
18
+ { title: "External URL", value: "url" },
19
+ ],
20
+ },
21
+ validation: (Rule) => Rule.required(),
22
+ }),
23
+ defineField({
24
+ name: "url_or_path",
25
+ title: "URL or Path",
26
+ type: "string",
27
+ description: "Vimeo/YouTube URL, MP4 relative path, or external video URL",
28
+ validation: (Rule) => Rule.required(),
29
+ }),
30
+ defineField({
31
+ name: "poster",
32
+ title: "Poster Image Path",
33
+ type: "string",
34
+ description: "Relative path to poster/thumbnail image",
35
+ }),
36
+ defineField({ name: "autoplay", title: "Autoplay", type: "boolean", initialValue: false }),
37
+ defineField({ name: "loop", title: "Loop", type: "boolean", initialValue: false }),
38
+ defineField({ name: "muted", title: "Muted", type: "boolean", initialValue: true }),
39
+ defineField({ name: "controls", title: "Show Controls", type: "boolean", initialValue: true }),
40
+ defineField({
41
+ name: "width",
42
+ title: "Width",
43
+ type: "string",
44
+ options: {
45
+ list: [
46
+ { title: "Full", value: "full" },
47
+ { title: "Contained", value: "contained" },
48
+ ],
49
+ },
50
+ initialValue: "full",
51
+ }),
52
+ defineField({
53
+ name: "aspect_ratio",
54
+ title: "Aspect Ratio",
55
+ type: "string",
56
+ options: {
57
+ list: [
58
+ { title: "16:9", value: "16:9" },
59
+ { title: "21:9", value: "21:9" },
60
+ { title: "4:3", value: "4:3" },
61
+ { title: "Auto", value: "auto" },
62
+ ],
63
+ },
64
+ initialValue: "16:9",
65
+ }),
66
+ defineField({
67
+ name: "border_radius",
68
+ title: "Border Radius",
69
+ type: "string",
70
+ }),
71
+ ...blockAnimationFields,
72
+ blockLayoutField,
73
+ ],
74
+ preview: {
75
+ select: { type: "video_type", url: "url_or_path" },
76
+ prepare({ type, url }) {
77
+ return { title: `${type?.toUpperCase() || "Video"}: ${url || "No URL"}` };
78
+ },
79
+ },
80
+ });