@morphika/andami 0.5.1 → 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.
- package/app/admin/assets/page.tsx +6 -6
- package/app/admin/database/page.tsx +302 -302
- package/app/admin/error.tsx +53 -53
- package/app/admin/layout.tsx +320 -320
- package/app/admin/navigation/page.tsx +255 -255
- package/app/admin/pages/[slug]/page.tsx +6 -6
- package/app/admin/pages/page.tsx +11 -11
- package/app/admin/projects/page.tsx +14 -14
- package/app/admin/setup/page.tsx +1 -1
- package/app/admin/styles/page.tsx +1 -1
- package/components/admin/MetadataEditor.tsx +6 -6
- package/components/admin/nav-builder/NavBuilder.tsx +1 -1
- package/components/admin/nav-builder/NavBuilderGrid.tsx +3 -3
- package/components/admin/nav-builder/NavGridCell.tsx +48 -48
- package/components/admin/nav-builder/NavGridItem.tsx +4 -4
- package/components/admin/nav-builder/NavItemSettings.tsx +331 -331
- package/components/admin/nav-builder/NavItemTypePicker.tsx +102 -102
- package/components/admin/nav-builder/NavLivePreview.tsx +1 -1
- package/components/admin/nav-builder/NavMobileLivePreview.tsx +226 -226
- package/components/admin/nav-builder/NavMobileSettings.tsx +242 -242
- package/components/admin/nav-builder/NavSettingsFields.tsx +514 -514
- package/components/admin/setup-wizard/BrandingStep.tsx +3 -3
- package/components/admin/setup-wizard/DatabaseStep.tsx +2 -2
- package/components/admin/setup-wizard/DoneStep.tsx +1 -1
- package/components/admin/setup-wizard/SetupWizard.tsx +4 -4
- package/components/admin/setup-wizard/StorageStep.tsx +2 -2
- package/components/admin/setup-wizard/WelcomeStep.tsx +2 -2
- package/components/admin/styles/ColorsEditor.tsx +2 -2
- package/components/admin/styles/FontsEditor.tsx +6 -6
- package/components/admin/styles/GridLayoutEditor.tsx +9 -9
- package/components/admin/styles/LinksButtonsEditor.tsx +5 -5
- package/components/admin/styles/TypographyEditor.tsx +6 -6
- package/components/admin/styles/shared.tsx +68 -68
- package/components/blocks/AudioBlockRenderer.tsx +286 -286
- package/components/blocks/MarqueeBlockRenderer.tsx +316 -0
- package/components/blocks/ProjectCarouselBlockRenderer.tsx +1 -1
- package/components/builder/BlockCardIcons.tsx +316 -316
- package/components/builder/BlockTypePicker.tsx +1 -1
- package/components/builder/BubbleIcons.tsx +90 -0
- package/components/builder/BuilderCanvas.tsx +2 -0
- package/components/builder/CanvasMinimap.tsx +2 -2
- package/components/builder/CoverSectionCanvas.tsx +363 -363
- package/components/builder/DeviceFrame.tsx +1 -1
- package/components/builder/DndWrapper.tsx +3 -3
- package/components/builder/InsertionLines.tsx +1 -1
- package/components/builder/SectionCardIcons.tsx +421 -320
- package/components/builder/SectionEditorBar.tsx +1 -1
- package/components/builder/SectionTypePicker.tsx +4 -4
- package/components/builder/SectionV2Canvas.tsx +1 -1
- package/components/builder/SectionV2Column.tsx +69 -67
- package/components/builder/SortableBlock.tsx +93 -73
- package/components/builder/SortableRow.tsx +27 -26
- package/components/builder/VirtualAssetGrid.tsx +2 -2
- package/components/builder/asset-browser/R2BrowserContent.tsx +11 -11
- package/components/builder/blockStyles.tsx +192 -185
- package/components/builder/color-picker/AlphaSlider.tsx +141 -141
- package/components/builder/color-picker/ColorInputs.tsx +105 -105
- package/components/builder/color-picker/EyedropperButton.tsx +74 -74
- package/components/builder/color-picker/HueSlider.tsx +124 -124
- package/components/builder/color-picker/SaturationCanvas.tsx +142 -142
- package/components/builder/color-picker/SwatchBar.tsx +93 -93
- package/components/builder/editors/AudioBlockEditor.tsx +242 -242
- package/components/builder/editors/BeforeAfterBlockEditor.tsx +360 -360
- package/components/builder/editors/ButtonBlockEditor.tsx +4 -4
- package/components/builder/editors/EnterAnimationPicker.tsx +2 -2
- package/components/builder/editors/HoverEffectPicker.tsx +2 -2
- package/components/builder/editors/ImageBlockEditor.tsx +2 -2
- package/components/builder/editors/ImageGridBlockEditor.tsx +4 -4
- package/components/builder/editors/MarqueeBlockEditor.tsx +621 -0
- package/components/builder/editors/ProjectCarouselBlockEditor.tsx +443 -443
- package/components/builder/editors/ProjectGridEditor.tsx +9 -9
- package/components/builder/editors/SpacerBlockEditor.tsx +5 -5
- package/components/builder/editors/StaggerSettings.tsx +109 -109
- package/components/builder/editors/TextBlockEditor.tsx +3 -3
- package/components/builder/editors/TextStylePicker.tsx +1 -1
- package/components/builder/editors/VideoBlockEditor.tsx +2 -2
- package/components/builder/editors/index.ts +11 -10
- package/components/builder/editors/shared.tsx +6 -6
- package/components/builder/live-preview/LiveAudioPreview.tsx +120 -120
- package/components/builder/live-preview/LiveBeforeAfterPreview.tsx +1 -1
- package/components/builder/live-preview/LiveImageGridPreview.tsx +10 -2
- package/components/builder/live-preview/LiveImagePreview.tsx +1 -1
- package/components/builder/live-preview/LiveMarqueePreview.tsx +39 -0
- package/components/builder/live-preview/LiveProjectCarouselPreview.tsx +1 -1
- package/components/builder/live-preview/LiveVideoPreview.tsx +1 -1
- package/components/builder/live-preview/ProjectCardWrapper.tsx +291 -291
- package/components/builder/settings-panel/AnimationTab.tsx +138 -138
- package/components/builder/settings-panel/BlockLayoutTab.tsx +7 -7
- package/components/builder/settings-panel/CardEntranceSection.tsx +114 -114
- package/components/builder/settings-panel/ColumnV2Settings.tsx +5 -5
- package/components/builder/settings-panel/CoverSectionLayoutTab.tsx +71 -71
- package/components/builder/settings-panel/CoverSectionSettings.tsx +335 -335
- package/components/builder/settings-panel/PageSettings.tsx +3 -3
- package/components/builder/settings-panel/ParallaxSlideSettings.tsx +2 -2
- package/components/builder/settings-panel/SectionV2AnimationTab.tsx +4 -4
- package/components/builder/settings-panel/SectionV2LayoutTab.tsx +356 -356
- package/components/builder/settings-panel/SectionV2Settings.tsx +14 -14
- package/components/builder/settings-panel/TRBLInputs.tsx +1 -1
- package/lib/animation/enter-types.ts +1 -0
- package/lib/animation/hover-effect-presets.ts +210 -210
- package/lib/animation/hover-effect-types.ts +1 -0
- package/lib/builder/block-registrations.ts +468 -417
- package/lib/builder/constants.ts +111 -111
- package/lib/builder/store-sections.ts +2 -2
- package/lib/builder/types-slices.ts +414 -414
- package/lib/builder/types.ts +4 -1
- package/lib/config/index.ts +27 -27
- package/lib/sanity/types.ts +98 -1
- package/lib/version.ts +1 -1
- package/package.json +1 -1
- package/sanity/schemas/blocks/audioBlock.ts +69 -69
- package/sanity/schemas/blocks/index.ts +12 -11
- package/sanity/schemas/blocks/marqueeBlock.ts +292 -0
- package/sanity/schemas/index.ts +120 -117
- package/styles/admin.css +85 -85
- package/styles/animations.css +237 -237
- package/styles/base.css +114 -114
package/lib/builder/constants.ts
CHANGED
|
@@ -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 = "#
|
|
46
|
-
export const ADMIN_ACCENT_DARK = "#
|
|
47
|
-
export const ADMIN_ACCENT_SHADOW = "rgba(
|
|
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 (#
|
|
59
|
-
// column selection/hover chrome.
|
|
60
|
-
// BLUE (#
|
|
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 = "#
|
|
76
|
-
export const BUILDER_BLOCK = "#
|
|
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:
|
|
62
|
+
addSection: (blockType: SectionBlockType, afterRowKey?: string | null): void => {
|
|
63
63
|
get()._pushSnapshot();
|
|
64
64
|
const block = createDefaultBlock(blockType);
|
|
65
65
|
const gridColumns = 12;
|