@morphika/andami 0.5.5 → 0.5.6
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/components/builder/ColumnDragOverlay.tsx +4 -4
- package/components/builder/CoverSectionCanvas.tsx +3 -3
- package/components/builder/InsertionLines.tsx +3 -3
- package/components/builder/SectionV2Canvas.tsx +3 -3
- package/components/builder/SectionV2Column.tsx +20 -20
- package/components/builder/live-preview/drag-utils.tsx +5 -3
- package/components/builder/settings-panel/SectionV2Settings.tsx +3 -3
- package/lib/builder/constants.ts +5 -3
- package/lib/version.ts +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { createPortal } from "react-dom";
|
|
|
5
5
|
import { useBuilderStore } from "../../lib/builder/store";
|
|
6
6
|
import type { PageSectionV2, CoverSection, SectionColumn } from "../../lib/sanity/types";
|
|
7
7
|
import { isPageSectionV2, isCoverSection } from "../../lib/sanity/types";
|
|
8
|
-
import {
|
|
8
|
+
import { BUILDER_YELLOW } from "../../lib/builder/constants";
|
|
9
9
|
|
|
10
10
|
/** Color used when the current drop target is invalid (cross-section
|
|
11
11
|
* swap, or a target that is not V2/Cover). Red 500 with compatible
|
|
@@ -57,9 +57,9 @@ const ColumnDragOverlay = memo(function ColumnDragOverlay({
|
|
|
57
57
|
|
|
58
58
|
const blockCount = (col.blocks || []).length;
|
|
59
59
|
|
|
60
|
-
// Pick accent based on drop validity.
|
|
61
|
-
const accentColor = isValidDrop ?
|
|
62
|
-
const accentRgb = isValidDrop ? "
|
|
60
|
+
// Pick accent based on drop validity. Column drag = BUILDER_YELLOW.
|
|
61
|
+
const accentColor = isValidDrop ? BUILDER_YELLOW : INVALID_RED;
|
|
62
|
+
const accentRgb = isValidDrop ? "214, 137, 0" : INVALID_RED_RGB;
|
|
63
63
|
|
|
64
64
|
const overlay = (
|
|
65
65
|
<div
|
|
@@ -329,9 +329,9 @@ export default function CoverSectionCanvas({
|
|
|
329
329
|
className="rounded-full text-[10px] font-medium transition-all hover:scale-105"
|
|
330
330
|
style={{
|
|
331
331
|
padding: "5px 16px",
|
|
332
|
-
background: `rgba(
|
|
333
|
-
color: "#
|
|
334
|
-
border: "1.5px dashed rgba(
|
|
332
|
+
background: `rgba(214, 137, 0, 0.10)`,
|
|
333
|
+
color: "#d68900",
|
|
334
|
+
border: "1.5px dashed rgba(214, 137, 0, 0.4)",
|
|
335
335
|
opacity: isSectionHovered ? 1 : 0,
|
|
336
336
|
pointerEvents: isSectionHovered ? "auto" : "none",
|
|
337
337
|
transition: "opacity 150ms",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useMemo, memo } from "react";
|
|
4
4
|
import type { CascadeColumn } from "../../lib/builder/cascade-helpers";
|
|
5
5
|
import type { DropTarget } from "./hooks/useColumnDrag";
|
|
6
|
-
import {
|
|
6
|
+
import { BUILDER_YELLOW } from "../../lib/builder/constants";
|
|
7
7
|
|
|
8
8
|
// ============================================
|
|
9
9
|
// InsertionLines — Visual insertion indicators between adjacent columns
|
|
@@ -154,7 +154,7 @@ export const InsertionLines = memo(function InsertionLines({
|
|
|
154
154
|
bottom: 4,
|
|
155
155
|
width: isActive ? 4 : 0,
|
|
156
156
|
transform: "translateX(-50%)",
|
|
157
|
-
background:
|
|
157
|
+
background: BUILDER_YELLOW,
|
|
158
158
|
borderRadius: 2,
|
|
159
159
|
transition: "width 100ms ease-out, opacity 100ms ease-out",
|
|
160
160
|
opacity: isActive ? 1 : 0,
|
|
@@ -171,7 +171,7 @@ export const InsertionLines = memo(function InsertionLines({
|
|
|
171
171
|
width: 14,
|
|
172
172
|
height: 14,
|
|
173
173
|
borderRadius: "50%",
|
|
174
|
-
background:
|
|
174
|
+
background: BUILDER_YELLOW,
|
|
175
175
|
border: "2px solid white",
|
|
176
176
|
boxShadow: "0 1px 4px rgba(53, 128, 249, 0.4)",
|
|
177
177
|
display: "flex",
|
|
@@ -306,11 +306,11 @@ export default function SectionV2Canvas({
|
|
|
306
306
|
}}
|
|
307
307
|
className={`rounded-lg border-2 border-dashed text-xs font-medium transition-all flex items-center justify-center cursor-pointer ${
|
|
308
308
|
isGapTarget
|
|
309
|
-
? "border-
|
|
309
|
+
? "border-[#d68900] text-[#d68900] bg-[#d68900]/10 opacity-100"
|
|
310
310
|
: showAsDropTarget
|
|
311
|
-
? "border-
|
|
311
|
+
? "border-[#d68900]/40 text-[#d68900]/60 bg-[#d68900]/5 opacity-100"
|
|
312
312
|
: isSectionHovered
|
|
313
|
-
? "border-[#
|
|
313
|
+
? "border-[#d68900]/25 text-[#d68900]/50 hover:text-[#d68900] hover:border-[#d68900]/60 hover:bg-[#d68900]/5 opacity-100"
|
|
314
314
|
: "border-transparent text-transparent opacity-0 pointer-events-none"
|
|
315
315
|
}`}
|
|
316
316
|
>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getBorderStyles,
|
|
16
16
|
} from "../../lib/builder/layout-styles";
|
|
17
17
|
import { isSectionBlockType } from "../../lib/builder/types";
|
|
18
|
-
import {
|
|
18
|
+
import { BUILDER_YELLOW, BUILDER_YELLOW_LIGHT } from "../../lib/builder/constants";
|
|
19
19
|
import { BubbleTooltip, CloseIcon, DragDropIcon } from "./BubbleIcons";
|
|
20
20
|
|
|
21
21
|
// ============================================
|
|
@@ -89,17 +89,17 @@ function ResizeHandle({
|
|
|
89
89
|
height: isActive ? 16 : isHoveredEdge ? 56 : showChrome ? 56 : 32,
|
|
90
90
|
borderRadius: isActive ? "50%" : 999,
|
|
91
91
|
backgroundColor: isActive
|
|
92
|
-
? "rgba(
|
|
92
|
+
? "rgba(214, 137, 0, 0.9)"
|
|
93
93
|
: isHoveredEdge
|
|
94
|
-
? "rgba(
|
|
94
|
+
? "rgba(214, 137, 0, 0.7)"
|
|
95
95
|
: showChrome
|
|
96
|
-
? "rgba(
|
|
97
|
-
: "rgba(
|
|
96
|
+
? "rgba(214, 137, 0, 0.5)"
|
|
97
|
+
: "rgba(214, 137, 0, 0.2)",
|
|
98
98
|
transition: "width 150ms ease-out, height 150ms ease-out, border-radius 150ms ease-out, background-color 150ms, box-shadow 150ms",
|
|
99
99
|
boxShadow: isActive
|
|
100
|
-
? "0 0 10px rgba(
|
|
100
|
+
? "0 0 10px rgba(214, 137, 0, 0.5)"
|
|
101
101
|
: isHoveredEdge
|
|
102
|
-
? "0 0 6px rgba(
|
|
102
|
+
? "0 0 6px rgba(214, 137, 0, 0.2)"
|
|
103
103
|
: undefined,
|
|
104
104
|
}}
|
|
105
105
|
/>
|
|
@@ -304,15 +304,15 @@ export default function SectionV2Column({
|
|
|
304
304
|
style={{
|
|
305
305
|
transition: "box-shadow 150ms",
|
|
306
306
|
...(isSwapTarget
|
|
307
|
-
? { boxShadow: `inset 0 0 0 2px ${
|
|
307
|
+
? { boxShadow: `inset 0 0 0 2px ${BUILDER_YELLOW}`, background: "rgba(214, 137, 0, 0.08)" }
|
|
308
308
|
: isBlockOver
|
|
309
|
-
? { boxShadow: `inset 0 0 0 2px ${
|
|
309
|
+
? { boxShadow: `inset 0 0 0 2px ${BUILDER_YELLOW}` }
|
|
310
310
|
: isSelected
|
|
311
|
-
? { boxShadow: `inset 0 0 0 2px rgba(
|
|
311
|
+
? { boxShadow: `inset 0 0 0 2px rgba(214, 137, 0, 0.6)` }
|
|
312
312
|
: isHovered
|
|
313
|
-
? { boxShadow: `inset 0 0 0 1.5px rgba(
|
|
313
|
+
? { boxShadow: `inset 0 0 0 1.5px rgba(214, 137, 0, 0.5)` }
|
|
314
314
|
: showFaintOutline
|
|
315
|
-
? { boxShadow: `inset 0 0 0 1px rgba(
|
|
315
|
+
? { boxShadow: `inset 0 0 0 1px rgba(214, 137, 0, 0.2)`, borderRadius: 4 }
|
|
316
316
|
: undefined),
|
|
317
317
|
}}
|
|
318
318
|
/>
|
|
@@ -383,14 +383,14 @@ export default function SectionV2Column({
|
|
|
383
383
|
<div
|
|
384
384
|
className="flex items-center rounded-[5px]"
|
|
385
385
|
style={{
|
|
386
|
-
background:
|
|
387
|
-
border:
|
|
386
|
+
background: BUILDER_YELLOW_LIGHT,
|
|
387
|
+
border: `1.5px solid ${BUILDER_YELLOW}`,
|
|
388
388
|
}}
|
|
389
389
|
>
|
|
390
390
|
{/* Drag handle — starts a column drag via @dnd-kit, selects on click */}
|
|
391
391
|
<button
|
|
392
392
|
type="button"
|
|
393
|
-
className="group/bb relative text-[#
|
|
393
|
+
className="group/bb relative text-[#d68900] hover:bg-[#d68900]/15 transition-colors px-1.5 py-1 flex items-center justify-center cursor-grab active:cursor-grabbing rounded-l-[3px]"
|
|
394
394
|
aria-label="Move column"
|
|
395
395
|
onMouseDown={(e) => {
|
|
396
396
|
e.stopPropagation();
|
|
@@ -404,22 +404,22 @@ export default function SectionV2Column({
|
|
|
404
404
|
<DragDropIcon size={14} />
|
|
405
405
|
<BubbleTooltip>Drag to move</BubbleTooltip>
|
|
406
406
|
</button>
|
|
407
|
-
<div className="w-px self-stretch my-1" style={{ background:
|
|
407
|
+
<div className="w-px self-stretch my-1" style={{ background: BUILDER_YELLOW }} />
|
|
408
408
|
{/* Label — clicking selects the column */}
|
|
409
409
|
<button
|
|
410
410
|
type="button"
|
|
411
411
|
onClick={(e) => { e.stopPropagation(); onSelect(); }}
|
|
412
|
-
className="text-[11px] px-2 py-0.5 font-medium hover:bg-[#
|
|
413
|
-
style={{ color:
|
|
412
|
+
className="text-[11px] px-2 py-0.5 font-medium hover:bg-[#d68900]/15 transition-colors"
|
|
413
|
+
style={{ color: BUILDER_YELLOW }}
|
|
414
414
|
aria-label="Select column"
|
|
415
415
|
>
|
|
416
416
|
Col
|
|
417
417
|
</button>
|
|
418
|
-
<div className="w-px self-stretch my-1" style={{ background:
|
|
418
|
+
<div className="w-px self-stretch my-1" style={{ background: BUILDER_YELLOW }} />
|
|
419
419
|
{/* Delete */}
|
|
420
420
|
<button
|
|
421
421
|
onClick={handleDelete}
|
|
422
|
-
className="group/bb relative text-[#
|
|
422
|
+
className="group/bb relative text-[#d68900] hover:text-red-500 hover:bg-red-500/10 transition-colors px-1.5 py-1 flex items-center justify-center rounded-r-[3px]"
|
|
423
423
|
aria-label="Delete column"
|
|
424
424
|
>
|
|
425
425
|
<CloseIcon size={14} />
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Session 162: Extracted from LiveProjectGridPreview.tsx (Phase B1).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { BUILDER_BLOCK } from "../../../lib/builder/constants";
|
|
11
11
|
import type { MasonryOutput } from "../../../lib/builder/masonry";
|
|
12
12
|
|
|
13
13
|
// ─── Constants ───────────────────────────────────────────────────────
|
|
@@ -15,8 +15,10 @@ import type { MasonryOutput } from "../../../lib/builder/masonry";
|
|
|
15
15
|
export const HOLD_DELAY = 150; // ms before card-body drag activates
|
|
16
16
|
export const MOVE_THRESHOLD_SQ = 9; // 3px² — grabbed → dragging
|
|
17
17
|
export const CANCEL_DURATION = 200; // ms — cancel fly-back animation
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// Project-card DnD chrome inside `projectGridBlock` — semantic is block-level
|
|
19
|
+
// (card reorder within a block), so tracks BUILDER_BLOCK, not BUILDER_YELLOW.
|
|
20
|
+
export const ADMIN_BLUE = BUILDER_BLOCK;
|
|
21
|
+
export const DROP_BLUE = BUILDER_BLOCK;
|
|
20
22
|
|
|
21
23
|
// ─── Types ───────────────────────────────────────────────────────────
|
|
22
24
|
|
|
@@ -142,15 +142,15 @@ function PresetGrid({ section }: { section: PageSectionV2 }) {
|
|
|
142
142
|
{/* + Add Column button */}
|
|
143
143
|
<button
|
|
144
144
|
onClick={handleAddColumn}
|
|
145
|
-
className="group/bb relative flex flex-col items-center gap-1 p-2 rounded-lg border border-dashed border-neutral-300 transition-all hover:border-[#
|
|
145
|
+
className="group/bb relative flex flex-col items-center gap-1 p-2 rounded-lg border border-dashed border-neutral-300 transition-all hover:border-[#d68900] hover:bg-[#d68900]/5 group"
|
|
146
146
|
aria-label="Add a column (fills first gap, or adds new row below)"
|
|
147
147
|
>
|
|
148
148
|
<div className="flex items-center justify-center w-full h-4">
|
|
149
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" className="text-neutral-400 group-hover:text-[#
|
|
149
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" className="text-neutral-400 group-hover:text-[#d68900] transition-colors">
|
|
150
150
|
<path d="M12 5v14M5 12h14" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
|
|
151
151
|
</svg>
|
|
152
152
|
</div>
|
|
153
|
-
<span className="text-[9px] font-medium text-neutral-400 group-hover:text-[#
|
|
153
|
+
<span className="text-[9px] font-medium text-neutral-400 group-hover:text-[#d68900] transition-colors">
|
|
154
154
|
Add Col
|
|
155
155
|
</span>
|
|
156
156
|
<BubbleTooltip>Add a column (fills first gap, or adds new row below)</BubbleTooltip>
|
package/lib/builder/constants.ts
CHANGED
|
@@ -72,9 +72,11 @@ export const ADMIN_ERROR_DARK = "#d42f1a";
|
|
|
72
72
|
// while the delete inside a block toolbar is BLUE too (inside the block
|
|
73
73
|
// pill, on hover it flashes red as a destructive cue).
|
|
74
74
|
|
|
75
|
-
export const BUILDER_BLUE = "#3580f9"; //
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
75
|
+
export const BUILDER_BLUE = "#3580f9"; // Admin accent / generic blue (admin chrome, inputs, focus rings)
|
|
76
|
+
export const BUILDER_YELLOW = "#d68900"; // Columns (dark — strokes, borders, pill text)
|
|
77
|
+
export const BUILDER_YELLOW_LIGHT = "#fffcc2"; // Columns (light — pill background)
|
|
78
|
+
export const BUILDER_BLOCK = "#3580f9"; // Blocks (shares the blue hue; distinct semantic from columns)
|
|
79
|
+
export const BUILDER_VIOLET = "#7500d5"; // Sections (incl. Custom, Cover, Parallax)
|
|
78
80
|
export const BUILDER_GREEN = "#22c55e"; // Success / confirmation cues (e.g. R2 asset check)
|
|
79
81
|
|
|
80
82
|
/**
|
package/lib/version.ts
CHANGED
package/package.json
CHANGED