@morphika/andami 0.5.1 → 0.5.3
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/README.md +27 -2
- 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 +332 -320
- package/app/admin/navigation/page.tsx +255 -255
- package/app/admin/pages/[slug]/page.tsx +44 -27
- package/app/admin/pages/page.tsx +24 -19
- package/app/admin/projects/page.tsx +30 -21
- package/app/admin/setup/page.tsx +1 -1
- package/app/admin/styles/page.tsx +1 -1
- package/app/api/admin/assets/register/route.ts +51 -14
- package/app/api/admin/assets/registry/route.ts +4 -1
- package/app/api/admin/assets/relink/confirm/route.ts +4 -1
- package/app/api/admin/assets/relink/route.ts +4 -1
- package/app/api/admin/assets/scan/route.ts +4 -1
- package/app/api/admin/backups/restore-data/route.ts +4 -1
- package/app/api/admin/r2/connect/route.ts +4 -1
- package/app/api/admin/r2/delete/route.ts +4 -1
- package/app/api/admin/r2/rename/route.ts +4 -1
- package/app/api/admin/r2/upload-url/route.ts +4 -1
- package/app/api/admin/revalidate/route.ts +4 -1
- package/app/api/admin/storage/switch/route.ts +4 -1
- package/app/api/custom-sections/[id]/route.ts +5 -6
- package/components/admin/MetadataEditor.tsx +6 -6
- package/components/admin/PublishToggle.tsx +2 -2
- 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 +8 -6
- 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 +518 -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 +9 -8
- package/components/admin/styles/FontsEditor.tsx +9 -7
- 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/CoverSectionRenderer.tsx +7 -1
- package/components/blocks/MarqueeBlockRenderer.tsx +316 -0
- package/components/blocks/ProjectCarouselBlockRenderer.tsx +1 -1
- package/components/blocks/SectionV2Renderer.tsx +8 -1
- package/components/builder/BlockCardIcons.tsx +316 -316
- package/components/builder/BlockTypePicker.tsx +1 -1
- package/components/builder/BubbleIcons.tsx +104 -0
- package/components/builder/BuilderCanvas.tsx +2 -0
- package/components/builder/CanvasMinimap.tsx +66 -49
- package/components/builder/CanvasToolbar.tsx +31 -41
- 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 +5 -3
- package/components/builder/SectionTypePicker.tsx +7 -5
- package/components/builder/SectionV2Canvas.tsx +1 -1
- package/components/builder/SectionV2Column.tsx +82 -68
- package/components/builder/SettingsPanel.tsx +21 -17
- package/components/builder/SortableBlock.tsx +93 -73
- package/components/builder/SortableRow.tsx +33 -35
- package/components/builder/VirtualAssetGrid.tsx +10 -4
- package/components/builder/asset-browser/R2BrowserContent.tsx +18 -14
- 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 +75 -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 +98 -93
- package/components/builder/color-picker/UnifiedColorPicker.tsx +11 -6
- 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 +8 -6
- package/components/builder/editors/MarqueeBlockEditor.tsx +622 -0
- package/components/builder/editors/ProjectCarouselBlockEditor.tsx +443 -443
- package/components/builder/editors/ProjectGridEditor.tsx +21 -16
- package/components/builder/editors/SpacerBlockEditor.tsx +29 -27
- package/components/builder/editors/StaggerSettings.tsx +109 -109
- package/components/builder/editors/TextBlockEditor.tsx +22 -17
- 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 +10 -8
- 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 +4 -2
- 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 +293 -291
- package/components/builder/live-preview/RichTextBubbleMenu.tsx +10 -6
- package/components/builder/live-preview/shared.tsx +5 -2
- package/components/builder/settings-panel/AnimationTab.tsx +138 -138
- package/components/builder/settings-panel/BlockLayoutTab.tsx +11 -9
- package/components/builder/settings-panel/CardEntranceSection.tsx +114 -114
- package/components/builder/settings-panel/ColumnV2LayoutTab.tsx +242 -0
- 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 +337 -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 +25 -20
- package/components/builder/settings-panel/TRBLInputs.tsx +1 -1
- package/components/builder/settings-panel/index.ts +1 -0
- 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/serializer/normalizers.ts +14 -0
- package/lib/builder/serializer/serializers.ts +27 -0
- package/lib/builder/store-sections.ts +23 -2
- package/lib/builder/types-slices.ts +428 -414
- package/lib/builder/types.ts +4 -1
- package/lib/config/index.ts +27 -27
- package/lib/sanity/queries.ts +48 -0
- package/lib/sanity/types.ts +112 -1
- package/lib/version.ts +1 -1
- package/package.json +7 -5
- 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/sanity/schemas/objects/coverSection.ts +32 -0
- package/sanity/schemas/objects/parallaxSlide.ts +32 -0
- package/sanity/schemas/pageSectionV2.ts +32 -0
- package/styles/admin.css +85 -85
- package/styles/animations.css +237 -237
- package/styles/base.css +114 -114
|
@@ -1,93 +1,98 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SwatchBar — User palette swatches + common neutral colors.
|
|
5
|
-
*
|
|
6
|
-
* Integrated inside the color picker modal. Shows:
|
|
7
|
-
* - "Your Palette" row with user swatches + an "add to palette" button
|
|
8
|
-
* - "Common" row with standard neutrals (white → black)
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { useCallback } from "react";
|
|
12
|
-
import type { SwatchBarProps } from "./types";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"#
|
|
18
|
-
"#
|
|
19
|
-
"#
|
|
20
|
-
"#
|
|
21
|
-
"#
|
|
22
|
-
"#
|
|
23
|
-
"#
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SwatchBar — User palette swatches + common neutral colors.
|
|
5
|
+
*
|
|
6
|
+
* Integrated inside the color picker modal. Shows:
|
|
7
|
+
* - "Your Palette" row with user swatches + an "add to palette" button
|
|
8
|
+
* - "Common" row with standard neutrals (white → black)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useCallback } from "react";
|
|
12
|
+
import type { SwatchBarProps } from "./types";
|
|
13
|
+
import { BubbleTooltip } from "../BubbleIcons";
|
|
14
|
+
|
|
15
|
+
// Common neutral colors always available
|
|
16
|
+
const COMMON_COLORS = [
|
|
17
|
+
"#ffffff",
|
|
18
|
+
"#f5f5f5",
|
|
19
|
+
"#e5e5e5",
|
|
20
|
+
"#a3a3a3",
|
|
21
|
+
"#525252",
|
|
22
|
+
"#262626",
|
|
23
|
+
"#171717",
|
|
24
|
+
"#000000",
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export default function SwatchBar({
|
|
28
|
+
value,
|
|
29
|
+
onSelect,
|
|
30
|
+
swatches = [],
|
|
31
|
+
}: SwatchBarProps) {
|
|
32
|
+
const handleSwatchClick = useCallback(
|
|
33
|
+
(hex: string) => {
|
|
34
|
+
onSelect(hex);
|
|
35
|
+
},
|
|
36
|
+
[onSelect]
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className="border-t border-neutral-200 pt-4">
|
|
41
|
+
{/* User palette */}
|
|
42
|
+
{swatches.length > 0 && (
|
|
43
|
+
<div className="mb-3">
|
|
44
|
+
<div className="flex items-center justify-between mb-2">
|
|
45
|
+
<span className="text-[10px] text-neutral-400 uppercase tracking-widest">
|
|
46
|
+
Your Palette
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="flex flex-wrap gap-1.5">
|
|
50
|
+
{swatches.map((s, i) => (
|
|
51
|
+
<button
|
|
52
|
+
key={s._key || `swatch-${i}`}
|
|
53
|
+
type="button"
|
|
54
|
+
onClick={() => handleSwatchClick(s.hex)}
|
|
55
|
+
aria-label={`${s.name}: ${s.hex}`}
|
|
56
|
+
className={`group/bb relative w-8 h-8 rounded-lg cursor-pointer transition-all ${
|
|
57
|
+
value.toLowerCase() === s.hex.toLowerCase()
|
|
58
|
+
? "ring-2 ring-[#3580f9] ring-offset-1 ring-offset-white"
|
|
59
|
+
: "border border-neutral-200 hover:border-neutral-400 hover:scale-110"
|
|
60
|
+
}`}
|
|
61
|
+
style={{ background: s.hex }}
|
|
62
|
+
>
|
|
63
|
+
<BubbleTooltip>{`${s.name}: ${s.hex}`}</BubbleTooltip>
|
|
64
|
+
</button>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
{/* Common colors */}
|
|
71
|
+
<div>
|
|
72
|
+
{swatches.length > 0 && (
|
|
73
|
+
<span className="text-[10px] text-neutral-400 uppercase tracking-widest block mb-2">
|
|
74
|
+
Common
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
<div className="flex gap-1">
|
|
78
|
+
{COMMON_COLORS.map((c) => (
|
|
79
|
+
<button
|
|
80
|
+
key={c}
|
|
81
|
+
type="button"
|
|
82
|
+
onClick={() => handleSwatchClick(c)}
|
|
83
|
+
aria-label={c.toUpperCase()}
|
|
84
|
+
className={`group/bb relative w-6 h-6 rounded-md cursor-pointer transition-all ${
|
|
85
|
+
value.toLowerCase() === c
|
|
86
|
+
? "ring-2 ring-[#3580f9] ring-offset-1 ring-offset-white"
|
|
87
|
+
: "border border-neutral-200 hover:border-neutral-400 hover:scale-110"
|
|
88
|
+
}`}
|
|
89
|
+
style={{ background: c }}
|
|
90
|
+
>
|
|
91
|
+
<BubbleTooltip>{c.toUpperCase()}</BubbleTooltip>
|
|
92
|
+
</button>
|
|
93
|
+
))}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
import { getPresetsForCategory } from "../../../lib/builder/gradient-presets";
|
|
46
46
|
import type { GradientPresetInfo } from "../../../lib/builder/gradient-presets";
|
|
47
47
|
import type { ColorSwatch } from "../../../lib/sanity/types";
|
|
48
|
+
import { BubbleTooltip } from "../BubbleIcons";
|
|
48
49
|
|
|
49
50
|
type GradientTab = "solid" | "linear" | "radial" | "mesh";
|
|
50
51
|
|
|
@@ -554,11 +555,13 @@ export default function UnifiedColorPicker({
|
|
|
554
555
|
<button
|
|
555
556
|
key={preset.id}
|
|
556
557
|
type="button"
|
|
557
|
-
|
|
558
|
+
aria-label={preset.label}
|
|
558
559
|
onClick={() => handlePresetSelect(preset)}
|
|
559
|
-
className="w-8 h-8 rounded-lg border border-neutral-200 hover:border-neutral-400 transition-colors cursor-pointer shrink-0"
|
|
560
|
+
className="group/bb relative w-8 h-8 rounded-lg border border-neutral-200 hover:border-neutral-400 transition-colors cursor-pointer shrink-0"
|
|
560
561
|
style={{ backgroundImage: colorToCSS(preset.template) }}
|
|
561
|
-
|
|
562
|
+
>
|
|
563
|
+
<BubbleTooltip>{preset.label}</BubbleTooltip>
|
|
564
|
+
</button>
|
|
562
565
|
))}
|
|
563
566
|
</div>
|
|
564
567
|
)}
|
|
@@ -678,11 +681,13 @@ export default function UnifiedColorPicker({
|
|
|
678
681
|
<button
|
|
679
682
|
key={preset.id}
|
|
680
683
|
type="button"
|
|
681
|
-
|
|
684
|
+
aria-label={preset.label}
|
|
682
685
|
onClick={() => handlePresetSelect(preset)}
|
|
683
|
-
className="w-8 h-8 rounded-lg border border-neutral-200 hover:border-neutral-400 transition-colors cursor-pointer shrink-0"
|
|
686
|
+
className="group/bb relative w-8 h-8 rounded-lg border border-neutral-200 hover:border-neutral-400 transition-colors cursor-pointer shrink-0"
|
|
684
687
|
style={{ backgroundImage: colorToCSS(preset.template) }}
|
|
685
|
-
|
|
688
|
+
>
|
|
689
|
+
<BubbleTooltip>{preset.label}</BubbleTooltip>
|
|
690
|
+
</button>
|
|
686
691
|
))}
|
|
687
692
|
</div>
|
|
688
693
|
)}
|