@morphika/andami 0.5.0 → 0.5.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 (122) hide show
  1. package/README.md +151 -36
  2. package/app/admin/assets/page.tsx +6 -6
  3. package/app/admin/database/page.tsx +302 -302
  4. package/app/admin/error.tsx +53 -53
  5. package/app/admin/layout.tsx +320 -327
  6. package/app/admin/navigation/page.tsx +255 -255
  7. package/app/admin/pages/[slug]/page.tsx +6 -6
  8. package/app/admin/pages/page.tsx +11 -11
  9. package/app/admin/projects/page.tsx +14 -14
  10. package/app/admin/setup/page.tsx +1 -1
  11. package/app/admin/styles/page.tsx +1 -1
  12. package/components/admin/MetadataEditor.tsx +6 -6
  13. package/components/admin/nav-builder/NavBuilder.tsx +1 -1
  14. package/components/admin/nav-builder/NavBuilderGrid.tsx +3 -3
  15. package/components/admin/nav-builder/NavGridCell.tsx +48 -48
  16. package/components/admin/nav-builder/NavGridItem.tsx +4 -4
  17. package/components/admin/nav-builder/NavItemSettings.tsx +331 -331
  18. package/components/admin/nav-builder/NavItemTypePicker.tsx +102 -102
  19. package/components/admin/nav-builder/NavLivePreview.tsx +1 -1
  20. package/components/admin/nav-builder/NavMobileLivePreview.tsx +226 -226
  21. package/components/admin/nav-builder/NavMobileSettings.tsx +242 -242
  22. package/components/admin/nav-builder/NavSettingsFields.tsx +514 -514
  23. package/components/admin/setup-wizard/BrandingStep.tsx +3 -3
  24. package/components/admin/setup-wizard/DatabaseStep.tsx +2 -2
  25. package/components/admin/setup-wizard/DoneStep.tsx +1 -1
  26. package/components/admin/setup-wizard/SetupWizard.tsx +4 -4
  27. package/components/admin/setup-wizard/StorageStep.tsx +2 -2
  28. package/components/admin/setup-wizard/WelcomeStep.tsx +2 -2
  29. package/components/admin/styles/ColorsEditor.tsx +2 -2
  30. package/components/admin/styles/FontsEditor.tsx +6 -6
  31. package/components/admin/styles/GridLayoutEditor.tsx +9 -9
  32. package/components/admin/styles/LinksButtonsEditor.tsx +5 -5
  33. package/components/admin/styles/TypographyEditor.tsx +6 -6
  34. package/components/admin/styles/shared.tsx +68 -68
  35. package/components/blocks/AudioBlockRenderer.tsx +286 -0
  36. package/components/blocks/BeforeAfterBlockRenderer.tsx +274 -0
  37. package/components/blocks/MarqueeBlockRenderer.tsx +316 -0
  38. package/components/blocks/ProjectCarouselBlockRenderer.tsx +1 -1
  39. package/components/builder/BlockCardIcons.tsx +316 -227
  40. package/components/builder/BlockTypePicker.tsx +3 -1
  41. package/components/builder/BubbleIcons.tsx +90 -0
  42. package/components/builder/BuilderCanvas.tsx +2 -0
  43. package/components/builder/CanvasMinimap.tsx +2 -2
  44. package/components/builder/CoverSectionCanvas.tsx +363 -275
  45. package/components/builder/DeviceFrame.tsx +1 -1
  46. package/components/builder/DndWrapper.tsx +3 -3
  47. package/components/builder/InsertionLines.tsx +1 -1
  48. package/components/builder/SectionCardIcons.tsx +421 -320
  49. package/components/builder/SectionEditorBar.tsx +1 -1
  50. package/components/builder/SectionTypePicker.tsx +4 -4
  51. package/components/builder/SectionV2Canvas.tsx +20 -4
  52. package/components/builder/SectionV2Column.tsx +74 -68
  53. package/components/builder/SortableBlock.tsx +93 -73
  54. package/components/builder/SortableRow.tsx +27 -26
  55. package/components/builder/VirtualAssetGrid.tsx +2 -2
  56. package/components/builder/asset-browser/R2BrowserContent.tsx +34 -17
  57. package/components/builder/asset-browser/helpers.ts +4 -0
  58. package/components/builder/asset-browser/types.ts +2 -1
  59. package/components/builder/blockStyles.tsx +192 -173
  60. package/components/builder/color-picker/AlphaSlider.tsx +141 -141
  61. package/components/builder/color-picker/ColorInputs.tsx +105 -105
  62. package/components/builder/color-picker/EyedropperButton.tsx +74 -74
  63. package/components/builder/color-picker/HueSlider.tsx +124 -124
  64. package/components/builder/color-picker/SaturationCanvas.tsx +142 -142
  65. package/components/builder/color-picker/SwatchBar.tsx +93 -93
  66. package/components/builder/editors/AudioBlockEditor.tsx +242 -0
  67. package/components/builder/editors/BeforeAfterBlockEditor.tsx +360 -0
  68. package/components/builder/editors/ButtonBlockEditor.tsx +4 -4
  69. package/components/builder/editors/EnterAnimationPicker.tsx +2 -2
  70. package/components/builder/editors/HoverEffectPicker.tsx +2 -2
  71. package/components/builder/editors/ImageBlockEditor.tsx +2 -2
  72. package/components/builder/editors/ImageGridBlockEditor.tsx +4 -4
  73. package/components/builder/editors/MarqueeBlockEditor.tsx +621 -0
  74. package/components/builder/editors/ProjectCarouselBlockEditor.tsx +443 -443
  75. package/components/builder/editors/ProjectGridEditor.tsx +9 -9
  76. package/components/builder/editors/SpacerBlockEditor.tsx +5 -5
  77. package/components/builder/editors/StaggerSettings.tsx +109 -109
  78. package/components/builder/editors/TextBlockEditor.tsx +3 -3
  79. package/components/builder/editors/TextStylePicker.tsx +1 -1
  80. package/components/builder/editors/VideoBlockEditor.tsx +2 -2
  81. package/components/builder/editors/index.ts +11 -10
  82. package/components/builder/editors/shared.tsx +7 -7
  83. package/components/builder/live-preview/LiveAudioPreview.tsx +120 -0
  84. package/components/builder/live-preview/LiveBeforeAfterPreview.tsx +176 -0
  85. package/components/builder/live-preview/LiveImageGridPreview.tsx +10 -2
  86. package/components/builder/live-preview/LiveImagePreview.tsx +1 -1
  87. package/components/builder/live-preview/LiveMarqueePreview.tsx +39 -0
  88. package/components/builder/live-preview/LiveProjectCarouselPreview.tsx +1 -1
  89. package/components/builder/live-preview/LiveVideoPreview.tsx +1 -1
  90. package/components/builder/live-preview/ProjectCardWrapper.tsx +291 -291
  91. package/components/builder/settings-panel/AnimationTab.tsx +138 -138
  92. package/components/builder/settings-panel/BlockLayoutTab.tsx +7 -7
  93. package/components/builder/settings-panel/CardEntranceSection.tsx +114 -114
  94. package/components/builder/settings-panel/ColumnV2Settings.tsx +5 -5
  95. package/components/builder/settings-panel/CoverSectionLayoutTab.tsx +71 -71
  96. package/components/builder/settings-panel/CoverSectionSettings.tsx +335 -335
  97. package/components/builder/settings-panel/PageSettings.tsx +3 -3
  98. package/components/builder/settings-panel/ParallaxSlideSettings.tsx +2 -2
  99. package/components/builder/settings-panel/SectionV2AnimationTab.tsx +4 -4
  100. package/components/builder/settings-panel/SectionV2LayoutTab.tsx +356 -356
  101. package/components/builder/settings-panel/SectionV2Settings.tsx +14 -14
  102. package/components/builder/settings-panel/TRBLInputs.tsx +1 -1
  103. package/lib/animation/enter-types.ts +3 -0
  104. package/lib/animation/hover-effect-presets.ts +210 -210
  105. package/lib/animation/hover-effect-types.ts +3 -0
  106. package/lib/builder/block-registrations.ts +468 -335
  107. package/lib/builder/constants.ts +111 -111
  108. package/lib/builder/store-sections.ts +2 -2
  109. package/lib/builder/types-slices.ts +414 -414
  110. package/lib/builder/types.ts +6 -1
  111. package/lib/config/index.ts +27 -27
  112. package/lib/sanity/types.ts +156 -1
  113. package/lib/version.ts +1 -1
  114. package/package.json +1 -1
  115. package/sanity/schemas/blocks/audioBlock.ts +69 -0
  116. package/sanity/schemas/blocks/beforeAfterBlock.ts +121 -0
  117. package/sanity/schemas/blocks/index.ts +12 -9
  118. package/sanity/schemas/blocks/marqueeBlock.ts +292 -0
  119. package/sanity/schemas/index.ts +120 -111
  120. package/styles/admin.css +85 -85
  121. package/styles/animations.css +237 -237
  122. package/styles/base.css +114 -114
@@ -1,111 +1,111 @@
1
- /**
2
- * Shared constants for the builder and public site renderers.
3
- * Consolidates duplicated maps and utility functions.
4
- */
5
-
6
-
7
- // ============================================
8
- // Responsive Breakpoints
9
- // ============================================
10
- // Single source of truth for all media query breakpoints.
11
- // Import these instead of hardcoding numeric values.
12
-
13
- export const BREAKPOINTS = {
14
- /** Phone max-width breakpoint (640px) */
15
- phone: 640,
16
- /** Scroll animation disable breakpoint (768px) */
17
- mobileAnimation: 768,
18
- /** Tablet max-width breakpoint (1024px) */
19
- tablet: 1024,
20
- } as const;
21
-
22
- // ============================================
23
- // Default Grid Width
24
- // ============================================
25
- // The default page grid max-width in pixels.
26
-
27
- export const DEFAULT_GRID_WIDTH = "1445";
28
- export const DEFAULT_GRID_WIDTH_PX = `${DEFAULT_GRID_WIDTH}px`;
29
-
30
- // ============================================
31
- // Default Page Colors
32
- // ============================================
33
- // Default background and text colors for new pages.
34
-
35
- export const DEFAULT_BG_COLOR = "#ffffff";
36
- export const DEFAULT_TEXT_COLOR = "#000000";
37
-
38
- // ============================================
39
- // Admin UI Colors
40
- // ============================================
41
- // Accent colors used throughout the admin/builder interface.
42
- // These are also available as CSS custom properties:
43
- // --admin-accent, --admin-accent-dark
44
-
45
- export const ADMIN_ACCENT = "#076bff";
46
- export const ADMIN_ACCENT_DARK = "#0559d4";
47
- export const ADMIN_ACCENT_SHADOW = "rgba(7,107,255,0.06)";
48
- export const ADMIN_ERROR = "#ed3821";
49
- export const ADMIN_ERROR_DARK = "#d42f1a";
50
-
51
- // ============================================
52
- // Builder Semantic Color System
53
- // ============================================
54
- // Each UI entity in the builder has a dedicated color to provide
55
- // visual differentiation at a glance. This is a design rule that
56
- // MUST be followed across all builder components.
57
- //
58
- // BLUE (#4794e2) — Columns: outlines, resize handles, drag grip,
59
- // column selection/hover chrome.
60
- // BLUE (#4794e2) — Blocks: "+ Add Block" buttons, block toolbar
61
- // pill, block selection ring, block-level actions.
62
- // (Same hue as columns — a future pass may split
63
- // these into distinct hues if the shared blue is
64
- // causing ambiguity.)
65
- // VIOLET (#7500d5) — Sections: side pill, cover/parallax accent,
66
- // section outlines, hover/selection chrome.
67
- // Also used for Custom Sections card chrome.
68
- //
69
- // When adding new builder UI, pick the color that matches the entity
70
- // being represented, not the action being performed. For example, a
71
- // delete button on a column is BLUE (it belongs to the column chrome),
72
- // while the delete inside a block toolbar is BLUE too (inside the block
73
- // pill, on hover it flashes red as a destructive cue).
74
-
75
- export const BUILDER_BLUE = "#4794e2"; // Columns (softened was #076bff)
76
- export const BUILDER_BLOCK = "#4794e2"; // Blocks — same hue as columns for now
77
- export const BUILDER_VIOLET = "#7500d5"; // Sections (incl. Custom)
78
- export const BUILDER_GREEN = "#22c55e"; // Success / confirmation cues (e.g. R2 asset check)
79
-
80
- /**
81
- * @deprecated Use `BUILDER_BLOCK` instead. The legacy name survived multiple
82
- * colour migrations (orange → emerald → blue) and no longer reflects reality.
83
- * Kept as an alias so third-party code doesn't break at the import boundary.
84
- */
85
- export const BUILDER_ORANGE = BUILDER_BLOCK;
86
-
87
- /**
88
- * Padding map for Row settings (in pixels)
89
- * Used by builder (SortableRow, ReadOnlyFrame) and public site (RowRenderer)
90
- */
91
- export const PADDING_MAP: Record<string, string> = {
92
- none: "0",
93
- small: "16px",
94
- medium: "32px",
95
- large: "64px",
96
- xlarge: "96px",
97
- };
98
-
99
- /**
100
- * Padding map for Row settings (in Tailwind classes)
101
- * Used only by public site (RowRenderer) when using class-based padding
102
- */
103
- export const PADDING_CLASSES_MAP: Record<string, string> = {
104
- none: "py-0",
105
- small: "py-4",
106
- medium: "py-8",
107
- large: "py-16",
108
- xlarge: "py-24",
109
- };
110
-
111
-
1
+ /**
2
+ * Shared constants for the builder and public site renderers.
3
+ * Consolidates duplicated maps and utility functions.
4
+ */
5
+
6
+
7
+ // ============================================
8
+ // Responsive Breakpoints
9
+ // ============================================
10
+ // Single source of truth for all media query breakpoints.
11
+ // Import these instead of hardcoding numeric values.
12
+
13
+ export const BREAKPOINTS = {
14
+ /** Phone max-width breakpoint (640px) */
15
+ phone: 640,
16
+ /** Scroll animation disable breakpoint (768px) */
17
+ mobileAnimation: 768,
18
+ /** Tablet max-width breakpoint (1024px) */
19
+ tablet: 1024,
20
+ } as const;
21
+
22
+ // ============================================
23
+ // Default Grid Width
24
+ // ============================================
25
+ // The default page grid max-width in pixels.
26
+
27
+ export const DEFAULT_GRID_WIDTH = "1445";
28
+ export const DEFAULT_GRID_WIDTH_PX = `${DEFAULT_GRID_WIDTH}px`;
29
+
30
+ // ============================================
31
+ // Default Page Colors
32
+ // ============================================
33
+ // Default background and text colors for new pages.
34
+
35
+ export const DEFAULT_BG_COLOR = "#ffffff";
36
+ export const DEFAULT_TEXT_COLOR = "#000000";
37
+
38
+ // ============================================
39
+ // Admin UI Colors
40
+ // ============================================
41
+ // Accent colors used throughout the admin/builder interface.
42
+ // These are also available as CSS custom properties:
43
+ // --admin-accent, --admin-accent-dark
44
+
45
+ export const ADMIN_ACCENT = "#3580f9";
46
+ export const ADMIN_ACCENT_DARK = "#2d6dd4";
47
+ export const ADMIN_ACCENT_SHADOW = "rgba(53,128,249,0.06)";
48
+ export const ADMIN_ERROR = "#ed3821";
49
+ export const ADMIN_ERROR_DARK = "#d42f1a";
50
+
51
+ // ============================================
52
+ // Builder Semantic Color System
53
+ // ============================================
54
+ // Each UI entity in the builder has a dedicated color to provide
55
+ // visual differentiation at a glance. This is a design rule that
56
+ // MUST be followed across all builder components.
57
+ //
58
+ // BLUE (#3580f9) — Columns: outlines, resize handles, drag grip,
59
+ // column selection/hover chrome.
60
+ // BLUE (#3580f9) — Blocks: "+ Add Block" buttons, block toolbar
61
+ // pill, block selection ring, block-level actions.
62
+ // (Same hue as columns — a future pass may split
63
+ // these into distinct hues if the shared blue is
64
+ // causing ambiguity.)
65
+ // VIOLET (#7500d5) — Sections: side pill, cover/parallax accent,
66
+ // section outlines, hover/selection chrome.
67
+ // Also used for Custom Sections card chrome.
68
+ //
69
+ // When adding new builder UI, pick the color that matches the entity
70
+ // being represented, not the action being performed. For example, a
71
+ // delete button on a column is BLUE (it belongs to the column chrome),
72
+ // while the delete inside a block toolbar is BLUE too (inside the block
73
+ // pill, on hover it flashes red as a destructive cue).
74
+
75
+ export const BUILDER_BLUE = "#3580f9"; // Columns (unified strong blue)
76
+ export const BUILDER_BLOCK = "#3580f9"; // Blocks — same hue as columns
77
+ export const BUILDER_VIOLET = "#7500d5"; // Sections (incl. Custom)
78
+ export const BUILDER_GREEN = "#22c55e"; // Success / confirmation cues (e.g. R2 asset check)
79
+
80
+ /**
81
+ * @deprecated Use `BUILDER_BLOCK` instead. The legacy name survived multiple
82
+ * colour migrations (orange → emerald → blue) and no longer reflects reality.
83
+ * Kept as an alias so third-party code doesn't break at the import boundary.
84
+ */
85
+ export const BUILDER_ORANGE = BUILDER_BLOCK;
86
+
87
+ /**
88
+ * Padding map for Row settings (in pixels)
89
+ * Used by builder (SortableRow, ReadOnlyFrame) and public site (RowRenderer)
90
+ */
91
+ export const PADDING_MAP: Record<string, string> = {
92
+ none: "0",
93
+ small: "16px",
94
+ medium: "32px",
95
+ large: "64px",
96
+ xlarge: "96px",
97
+ };
98
+
99
+ /**
100
+ * Padding map for Row settings (in Tailwind classes)
101
+ * Used only by public site (RowRenderer) when using class-based padding
102
+ */
103
+ export const PADDING_CLASSES_MAP: Record<string, string> = {
104
+ none: "py-0",
105
+ small: "py-4",
106
+ medium: "py-8",
107
+ large: "py-16",
108
+ xlarge: "py-24",
109
+ };
110
+
111
+
@@ -1,4 +1,4 @@
1
- import type { BuilderStore, BuilderState, BlockType, SectionSliceActions } from "./types";
1
+ import type { BuilderStore, BuilderState, BlockType, SectionSliceActions, SectionBlockType } from "./types";
2
2
  import type {
3
3
  ContentBlock,
4
4
  ContentItem,
@@ -59,7 +59,7 @@ export function createSectionActions(set: StoreSet, get: StoreGet): SectionSlice
59
59
  * Existing V1 pages still work — V1 update/delete actions are kept until
60
60
  * the data migration in Session 165.
61
61
  */
62
- addSection: (blockType: "projectGridBlock" | "projectCarouselBlock", afterRowKey?: string | null): void => {
62
+ addSection: (blockType: SectionBlockType, afterRowKey?: string | null): void => {
63
63
  get()._pushSnapshot();
64
64
  const block = createDefaultBlock(blockType);
65
65
  const gridColumns = 12;