@morphika/andami 0.2.12 → 0.2.14
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 +2 -1
- package/app/admin/pages/[slug]/page.tsx +39 -2
- package/components/blocks/BlockRenderer.tsx +0 -7
- package/components/blocks/CoverSectionRenderer.tsx +295 -0
- package/components/blocks/ImageBlockRenderer.tsx +12 -10
- package/components/blocks/PageRenderer.tsx +13 -9
- package/components/blocks/VideoBlockRenderer.tsx +11 -6
- package/components/builder/BlockLivePreview.tsx +0 -5
- package/components/builder/BlockTypePicker.tsx +0 -1
- package/components/builder/ColorSwatchPicker.tsx +2 -2
- package/components/builder/CoverRowResizeHandle.tsx +180 -0
- package/components/builder/CoverSectionCanvas.tsx +260 -0
- package/components/builder/ReadOnlyFrame.tsx +127 -3
- package/components/builder/SectionTypePicker.tsx +29 -0
- package/components/builder/SectionV2Canvas.tsx +4 -1
- package/components/builder/SectionV2Column.tsx +15 -20
- package/components/builder/SettingsPanel.tsx +14 -0
- package/components/builder/SortableRow.tsx +7 -21
- package/components/builder/blockStyles.tsx +13 -14
- package/components/builder/editors/ImageBlockEditor.tsx +1 -0
- package/components/builder/editors/VideoBlockEditor.tsx +1 -0
- package/components/builder/editors/index.ts +0 -1
- package/components/builder/index.ts +1 -0
- package/components/builder/live-preview/LiveImagePreview.tsx +21 -2
- package/components/builder/live-preview/LiveVideoPreview.tsx +8 -3
- package/components/builder/live-preview/RichTextEditor.tsx +23 -2
- package/components/builder/live-preview/index.ts +0 -1
- package/components/builder/settings-panel/BlockSettings.tsx +0 -7
- package/components/builder/settings-panel/CoverSectionSettings.tsx +296 -0
- package/components/builder/settings-panel/index.ts +1 -0
- package/components/builder/settings-panel/useSettingsPanelSelection.ts +36 -2
- package/lib/animation/enter-types.ts +0 -1
- package/lib/animation/hover-effect-types.ts +0 -1
- package/lib/builder/defaults.ts +43 -22
- package/lib/builder/serializer/normalizers.ts +34 -1
- package/lib/builder/serializer/serializers.ts +39 -2
- package/lib/builder/store-blocks.ts +11 -3
- package/lib/builder/store-cover.ts +220 -0
- package/lib/builder/store-helpers.ts +81 -4
- package/lib/builder/store-sections.ts +12 -2
- package/lib/builder/store.ts +11 -2
- package/lib/builder/types.ts +15 -2
- package/lib/sanity/queries.ts +18 -4
- package/lib/sanity/types.ts +81 -45
- package/lib/version.ts +1 -1
- package/package.json +1 -1
- package/sanity/schemas/blocks/imageBlock.ts +1 -0
- package/sanity/schemas/blocks/index.ts +1 -2
- package/sanity/schemas/blocks/videoBlock.ts +1 -0
- package/sanity/schemas/index.ts +5 -3
- package/sanity/schemas/objects/coverSection.ts +317 -0
- package/sanity/schemas/objects/parallaxSlide.ts +0 -1
- package/sanity/schemas/page.ts +1 -1
- package/sanity/schemas/pageSectionV2.ts +0 -1
- package/components/blocks/CoverBlockRenderer.tsx +0 -261
- package/components/builder/editors/CoverBlockEditor.tsx +0 -550
- package/components/builder/live-preview/LiveCoverPreview.tsx +0 -146
- package/sanity/schemas/blocks/coverBlock.ts +0 -229
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { defineField, defineType } from "sanity";
|
|
2
|
-
import { blockLayoutField, blockAnimationFields } from "./blockLayout";
|
|
3
|
-
|
|
4
|
-
export const coverBlock = defineType({
|
|
5
|
-
name: "coverBlock",
|
|
6
|
-
title: "Cover Block",
|
|
7
|
-
type: "object",
|
|
8
|
-
fields: [
|
|
9
|
-
// --- Content ---
|
|
10
|
-
defineField({ name: "headline", title: "Headline", type: "string" }),
|
|
11
|
-
defineField({ name: "subheadline", title: "Subheadline", type: "string" }),
|
|
12
|
-
defineField({
|
|
13
|
-
name: "cta_button",
|
|
14
|
-
title: "CTA Button",
|
|
15
|
-
type: "object",
|
|
16
|
-
fields: [
|
|
17
|
-
defineField({ name: "text", title: "Text", type: "string" }),
|
|
18
|
-
defineField({ name: "url", title: "URL", type: "string" }),
|
|
19
|
-
defineField({
|
|
20
|
-
name: "target_blank",
|
|
21
|
-
title: "Open in New Tab",
|
|
22
|
-
type: "boolean",
|
|
23
|
-
initialValue: false,
|
|
24
|
-
}),
|
|
25
|
-
defineField({
|
|
26
|
-
name: "style",
|
|
27
|
-
title: "Button Style",
|
|
28
|
-
type: "string",
|
|
29
|
-
options: {
|
|
30
|
-
list: [
|
|
31
|
-
{ title: "Primary", value: "primary" },
|
|
32
|
-
{ title: "Secondary", value: "secondary" },
|
|
33
|
-
{ title: "Outline", value: "outline" },
|
|
34
|
-
{ title: "Text", value: "text" },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
initialValue: "primary",
|
|
38
|
-
}),
|
|
39
|
-
],
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
// --- Media Background ---
|
|
43
|
-
defineField({
|
|
44
|
-
name: "media_type",
|
|
45
|
-
title: "Media Type",
|
|
46
|
-
type: "string",
|
|
47
|
-
options: {
|
|
48
|
-
list: [
|
|
49
|
-
{ title: "Image", value: "image" },
|
|
50
|
-
{ title: "Video", value: "video" },
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
initialValue: "image",
|
|
54
|
-
}),
|
|
55
|
-
defineField({
|
|
56
|
-
name: "media_path",
|
|
57
|
-
title: "Media Path",
|
|
58
|
-
type: "string",
|
|
59
|
-
description: "Relative asset path for image or MP4 video",
|
|
60
|
-
}),
|
|
61
|
-
defineField({
|
|
62
|
-
name: "video_poster",
|
|
63
|
-
title: "Video Poster",
|
|
64
|
-
type: "string",
|
|
65
|
-
description: "Fallback image shown while video loads",
|
|
66
|
-
}),
|
|
67
|
-
defineField({
|
|
68
|
-
name: "background_size",
|
|
69
|
-
title: "Background Size",
|
|
70
|
-
type: "string",
|
|
71
|
-
options: {
|
|
72
|
-
list: [
|
|
73
|
-
{ title: "Cover", value: "cover" },
|
|
74
|
-
{ title: "Contain", value: "contain" },
|
|
75
|
-
{ title: "No Scale", value: "none" },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
initialValue: "cover",
|
|
79
|
-
}),
|
|
80
|
-
defineField({
|
|
81
|
-
name: "background_position",
|
|
82
|
-
title: "Background Position",
|
|
83
|
-
type: "string",
|
|
84
|
-
options: {
|
|
85
|
-
list: [
|
|
86
|
-
{ title: "Top Left", value: "top left" },
|
|
87
|
-
{ title: "Top Center", value: "top center" },
|
|
88
|
-
{ title: "Top Right", value: "top right" },
|
|
89
|
-
{ title: "Middle Left", value: "center left" },
|
|
90
|
-
{ title: "Middle Center", value: "center center" },
|
|
91
|
-
{ title: "Middle Right", value: "center right" },
|
|
92
|
-
{ title: "Bottom Left", value: "bottom left" },
|
|
93
|
-
{ title: "Bottom Center", value: "bottom center" },
|
|
94
|
-
{ title: "Bottom Right", value: "bottom right" },
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
initialValue: "center center",
|
|
98
|
-
}),
|
|
99
|
-
defineField({
|
|
100
|
-
name: "background_repeat",
|
|
101
|
-
title: "Background Repeat",
|
|
102
|
-
type: "string",
|
|
103
|
-
options: {
|
|
104
|
-
list: [
|
|
105
|
-
{ title: "No Repeat", value: "no-repeat" },
|
|
106
|
-
{ title: "Repeat", value: "repeat" },
|
|
107
|
-
{ title: "Repeat X", value: "repeat-x" },
|
|
108
|
-
{ title: "Repeat Y", value: "repeat-y" },
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
initialValue: "no-repeat",
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
// --- Overlay ---
|
|
115
|
-
defineField({
|
|
116
|
-
name: "overlay",
|
|
117
|
-
title: "Overlay",
|
|
118
|
-
type: "string",
|
|
119
|
-
options: {
|
|
120
|
-
list: [
|
|
121
|
-
{ title: "None", value: "none" },
|
|
122
|
-
{ title: "Dark", value: "dark" },
|
|
123
|
-
{ title: "Light", value: "light" },
|
|
124
|
-
{ title: "Gradient (Bottom)", value: "gradient-bottom" },
|
|
125
|
-
{ title: "Gradient (Top)", value: "gradient-top" },
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
initialValue: "dark",
|
|
129
|
-
}),
|
|
130
|
-
defineField({
|
|
131
|
-
name: "overlay_opacity",
|
|
132
|
-
title: "Overlay Opacity",
|
|
133
|
-
type: "number",
|
|
134
|
-
validation: (Rule) => Rule.min(0).max(100),
|
|
135
|
-
initialValue: 50,
|
|
136
|
-
}),
|
|
137
|
-
|
|
138
|
-
// --- Layout ---
|
|
139
|
-
defineField({
|
|
140
|
-
name: "content_align_h",
|
|
141
|
-
title: "Content Horizontal Alignment",
|
|
142
|
-
type: "string",
|
|
143
|
-
options: {
|
|
144
|
-
list: [
|
|
145
|
-
{ title: "Left", value: "left" },
|
|
146
|
-
{ title: "Center", value: "center" },
|
|
147
|
-
{ title: "Right", value: "right" },
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
initialValue: "center",
|
|
151
|
-
}),
|
|
152
|
-
defineField({
|
|
153
|
-
name: "content_align_v",
|
|
154
|
-
title: "Content Vertical Alignment",
|
|
155
|
-
type: "string",
|
|
156
|
-
options: {
|
|
157
|
-
list: [
|
|
158
|
-
{ title: "Top", value: "top" },
|
|
159
|
-
{ title: "Center", value: "center" },
|
|
160
|
-
{ title: "Bottom", value: "bottom" },
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
initialValue: "center",
|
|
164
|
-
}),
|
|
165
|
-
defineField({
|
|
166
|
-
name: "content_max_width",
|
|
167
|
-
title: "Content Max Width",
|
|
168
|
-
type: "string",
|
|
169
|
-
description: "Max width for text container (e.g. 600px, 800px, 100%)",
|
|
170
|
-
initialValue: "800px",
|
|
171
|
-
}),
|
|
172
|
-
defineField({
|
|
173
|
-
name: "height",
|
|
174
|
-
title: "Height",
|
|
175
|
-
type: "string",
|
|
176
|
-
options: {
|
|
177
|
-
list: [
|
|
178
|
-
{ title: "Full Screen (100vh)", value: "100vh" },
|
|
179
|
-
{ title: "Large (80vh)", value: "80vh" },
|
|
180
|
-
{ title: "Medium (60vh)", value: "60vh" },
|
|
181
|
-
{ title: "Small (40vh)", value: "40vh" },
|
|
182
|
-
{ title: "Custom", value: "custom" },
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
initialValue: "100vh",
|
|
186
|
-
}),
|
|
187
|
-
defineField({
|
|
188
|
-
name: "custom_height",
|
|
189
|
-
title: "Custom Height",
|
|
190
|
-
type: "string",
|
|
191
|
-
description: "CSS value (e.g. 500px, 70vh)",
|
|
192
|
-
}),
|
|
193
|
-
defineField({
|
|
194
|
-
name: "mobile_height",
|
|
195
|
-
title: "Mobile Height",
|
|
196
|
-
type: "string",
|
|
197
|
-
options: {
|
|
198
|
-
list: [
|
|
199
|
-
{ title: "Same as desktop", value: "same" },
|
|
200
|
-
{ title: "Full Screen (100vh)", value: "100vh" },
|
|
201
|
-
{ title: "80vh", value: "80vh" },
|
|
202
|
-
{ title: "60vh", value: "60vh" },
|
|
203
|
-
{ title: "500px", value: "500px" },
|
|
204
|
-
{ title: "400px", value: "400px" },
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
initialValue: "same",
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
// --- Appearance ---
|
|
211
|
-
defineField({ name: "text_color", title: "Text Color", type: "string" }),
|
|
212
|
-
|
|
213
|
-
// --- Scroll Indicator ---
|
|
214
|
-
defineField({
|
|
215
|
-
name: "show_scroll_indicator",
|
|
216
|
-
title: "Show Scroll Down Arrow",
|
|
217
|
-
type: "boolean",
|
|
218
|
-
initialValue: false,
|
|
219
|
-
}),
|
|
220
|
-
...blockAnimationFields,
|
|
221
|
-
blockLayoutField,
|
|
222
|
-
],
|
|
223
|
-
preview: {
|
|
224
|
-
select: { title: "headline" },
|
|
225
|
-
prepare({ title }) {
|
|
226
|
-
return { title: title || "Cover" };
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
});
|