zelune 1.6.2 → 1.6.4
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/CHANGELOG.md +16 -0
- package/bin/cli.mjs +13 -54
- package/dist/assets/CheckoutScreen-6IdrpKgm.js +229 -0
- package/dist/assets/HomeScreen-Dxe9L4I2.js +316 -0
- package/dist/assets/LoginScreen-Dp1awI4F.js +189 -0
- package/dist/assets/ProductDetailScreen-Wa5_nlRP.js +196 -0
- package/dist/assets/ProfileScreen-riAU6vVh.js +185 -0
- package/dist/assets/index-hEzd4JVy.js +44697 -0
- package/{index.html → dist/index.html} +3 -7
- package/mcp/server.mjs +1370 -34
- package/package.json +10 -17
- package/plugin.json +1 -1
- package/socket.yml +11 -0
- package/mcp/server.ts +0 -446
- package/plugins/viteReactNativeFallbackPlugin.ts +0 -519
- package/plugins/viteRnSourceInject.ts +0 -117
- package/plugins/viteVirtualScreensPlugin.ts +0 -216
- package/src/canvas/CanvasApp.tsx +0 -1655
- package/src/canvas/FlowArrowsLayer.tsx +0 -239
- package/src/canvas/InspectorPanel.tsx +0 -1494
- package/src/canvas/ScreenArtboard.tsx +0 -1491
- package/src/canvas/types.ts +0 -23
- package/src/main.tsx +0 -80
- package/src/runtime/MockNavigationContext.tsx +0 -1795
- package/src/runtime/ScreenErrorBoundary.tsx +0 -86
- package/src/runtime/nativewindShim.ts +0 -997
- package/src/runtime/reactNativeShim.ts +0 -240
- package/src/screens/CheckoutScreen.tsx +0 -229
- package/src/screens/HomeScreen.tsx +0 -288
- package/src/screens/LoginScreen.tsx +0 -176
- package/src/screens/ProductDetailScreen.tsx +0 -207
- package/src/screens/ProfileScreen.tsx +0 -172
- package/src/screens/index.ts +0 -1
- package/src/server/apiMiddleware.ts +0 -375
- package/src/server/astEngine.ts +0 -2553
- package/src/vite-env.d.ts +0 -7
- package/tsconfig.json +0 -23
- package/vite.config.ts +0 -340
- /package/{src/styles.css → dist/assets/index-C7nrS82N.css} +0 -0
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ArtboardLayoutMap, NavigationEdge, ScreenMetadata } from './types';
|
|
3
|
-
|
|
4
|
-
interface FlowArrowsLayerProps {
|
|
5
|
-
screens: ScreenMetadata[];
|
|
6
|
-
layout: ArtboardLayoutMap;
|
|
7
|
-
activeScreenId: string | null;
|
|
8
|
-
highlightedScreenId: string | null;
|
|
9
|
-
onSelectFlow?: (edge: NavigationEdge) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const ARTBOARD_HEADER_OFFSET = 38;
|
|
13
|
-
|
|
14
|
-
export const FlowArrowsLayer: React.FC<FlowArrowsLayerProps> = React.memo(({
|
|
15
|
-
screens,
|
|
16
|
-
layout,
|
|
17
|
-
activeScreenId,
|
|
18
|
-
highlightedScreenId,
|
|
19
|
-
onSelectFlow,
|
|
20
|
-
}) => {
|
|
21
|
-
const edges: NavigationEdge[] = [];
|
|
22
|
-
for (const screen of screens) {
|
|
23
|
-
for (const edge of screen.outgoingFlows) {
|
|
24
|
-
if (layout[edge.fromScreen] && layout[edge.toScreen]) {
|
|
25
|
-
edges.push(edge);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (edges.length === 0) return null;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<svg
|
|
34
|
-
style={{
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
left: 0,
|
|
38
|
-
width: 8000,
|
|
39
|
-
height: 6000,
|
|
40
|
-
pointerEvents: 'none',
|
|
41
|
-
overflow: 'visible',
|
|
42
|
-
zIndex: 5,
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
<defs>
|
|
46
|
-
<marker
|
|
47
|
-
id="flow-arrow-default"
|
|
48
|
-
viewBox="0 0 10 10"
|
|
49
|
-
refX="8"
|
|
50
|
-
refY="5"
|
|
51
|
-
markerWidth="6.5"
|
|
52
|
-
markerHeight="6.5"
|
|
53
|
-
orient="auto-start-reverse"
|
|
54
|
-
>
|
|
55
|
-
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#6366F1" />
|
|
56
|
-
</marker>
|
|
57
|
-
<marker
|
|
58
|
-
id="flow-arrow-active"
|
|
59
|
-
viewBox="0 0 10 10"
|
|
60
|
-
refX="8"
|
|
61
|
-
refY="5"
|
|
62
|
-
markerWidth="7"
|
|
63
|
-
markerHeight="7"
|
|
64
|
-
orient="auto-start-reverse"
|
|
65
|
-
>
|
|
66
|
-
<path d="M 0 1.5 L 8.5 5 L 0 8.5 z" fill="#10B981" />
|
|
67
|
-
</marker>
|
|
68
|
-
</defs>
|
|
69
|
-
|
|
70
|
-
{edges.map((edge, idx) => {
|
|
71
|
-
const fromBox = layout[edge.fromScreen];
|
|
72
|
-
const toBox = layout[edge.toScreen];
|
|
73
|
-
if (!fromBox || !toBox) return null;
|
|
74
|
-
|
|
75
|
-
const sameRow = Math.abs(toBox.y - fromBox.y) < 180;
|
|
76
|
-
const isExplicitReturn =
|
|
77
|
-
edge.id.includes(':return') || edge.triggerLabel.startsWith('Back to ');
|
|
78
|
-
const isReturnOrBackward =
|
|
79
|
-
isExplicitReturn || (sameRow ? toBox.x < fromBox.x : toBox.y < fromBox.y);
|
|
80
|
-
|
|
81
|
-
const isHighlighted =
|
|
82
|
-
activeScreenId === edge.fromScreen ||
|
|
83
|
-
highlightedScreenId === edge.toScreen ||
|
|
84
|
-
activeScreenId === edge.toScreen;
|
|
85
|
-
|
|
86
|
-
// Emerald/Green wires for Return/Back flows AND Active/Highlighted flows; Blue/Indigo wires for Forward flows
|
|
87
|
-
const useEmeraldWire = isHighlighted || isReturnOrBackward;
|
|
88
|
-
|
|
89
|
-
const verticalSlot = ((idx % 4) - 1.5) * 52;
|
|
90
|
-
const horizontalSlot = ((idx % 5) - 2) * 38;
|
|
91
|
-
|
|
92
|
-
let startX: number;
|
|
93
|
-
let startY: number;
|
|
94
|
-
let cp1X: number;
|
|
95
|
-
let cp1Y: number;
|
|
96
|
-
let cp2X: number;
|
|
97
|
-
let cp2Y: number;
|
|
98
|
-
let endX: number;
|
|
99
|
-
let endY: number;
|
|
100
|
-
|
|
101
|
-
if (sameRow) {
|
|
102
|
-
const horizontalGap = toBox.x - (fromBox.x + fromBox.width);
|
|
103
|
-
const isAdjacentForward = toBox.x > fromBox.x && horizontalGap <= 240;
|
|
104
|
-
|
|
105
|
-
if (isAdjacentForward) {
|
|
106
|
-
// Directly adjacent neighbors in the same row: connect across the empty vertical alley
|
|
107
|
-
startX = fromBox.x + fromBox.width;
|
|
108
|
-
startY = fromBox.y + ARTBOARD_HEADER_OFFSET + fromBox.height * 0.45 + verticalSlot;
|
|
109
|
-
endX = toBox.x;
|
|
110
|
-
endY = toBox.y + ARTBOARD_HEADER_OFFSET + toBox.height * 0.36 + verticalSlot * 0.6;
|
|
111
|
-
const dx = Math.max(60, Math.abs(endX - startX) * 0.45);
|
|
112
|
-
cp1X = startX + dx;
|
|
113
|
-
cp1Y = startY;
|
|
114
|
-
cp2X = endX - dx;
|
|
115
|
-
cp2Y = endY;
|
|
116
|
-
} else {
|
|
117
|
-
// Non-adjacent or return in same row: arch cleanly inside the empty horizontal corridor below the row
|
|
118
|
-
startX = fromBox.x + fromBox.width * 0.5 + horizontalSlot * 0.5;
|
|
119
|
-
startY = fromBox.y + ARTBOARD_HEADER_OFFSET + fromBox.height;
|
|
120
|
-
endX = toBox.x + toBox.width * 0.5 - horizontalSlot * 0.5;
|
|
121
|
-
endY = toBox.y + ARTBOARD_HEADER_OFFSET + toBox.height;
|
|
122
|
-
const archDepth = 58 + (idx % 4) * 26;
|
|
123
|
-
cp1X = startX;
|
|
124
|
-
cp1Y = startY + archDepth;
|
|
125
|
-
cp2X = endX;
|
|
126
|
-
cp2Y = endY + archDepth;
|
|
127
|
-
}
|
|
128
|
-
} else if (toBox.y > fromBox.y) {
|
|
129
|
-
// Cross-row downward connection through the horizontal corridor between rows
|
|
130
|
-
startX = fromBox.x + fromBox.width * 0.5 + horizontalSlot;
|
|
131
|
-
startY = fromBox.y + ARTBOARD_HEADER_OFFSET + fromBox.height;
|
|
132
|
-
endX = toBox.x + toBox.width * 0.5 + horizontalSlot * 0.6;
|
|
133
|
-
endY = toBox.y;
|
|
134
|
-
const dy = Math.max(70, Math.min(140, Math.abs(endY - startY) * 0.45));
|
|
135
|
-
cp1X = startX;
|
|
136
|
-
cp1Y = startY + dy;
|
|
137
|
-
cp2X = endX;
|
|
138
|
-
cp2Y = endY - dy;
|
|
139
|
-
} else {
|
|
140
|
-
// Cross-row upward return connection through the horizontal corridor between rows
|
|
141
|
-
startX = fromBox.x + fromBox.width * 0.5 + horizontalSlot;
|
|
142
|
-
startY = fromBox.y;
|
|
143
|
-
endX = toBox.x + toBox.width * 0.5 + horizontalSlot * 0.6;
|
|
144
|
-
endY = toBox.y + ARTBOARD_HEADER_OFFSET + toBox.height;
|
|
145
|
-
const dy = Math.max(70, Math.min(140, Math.abs(startY - endY) * 0.45));
|
|
146
|
-
cp1X = startX;
|
|
147
|
-
cp1Y = startY - dy;
|
|
148
|
-
cp2X = endX;
|
|
149
|
-
cp2Y = endY + dy;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const pathD = `M ${startX} ${startY} C ${cp1X} ${cp1Y}, ${cp2X} ${cp2Y}, ${endX} ${endY}`;
|
|
153
|
-
// Exact cubic Bezier midpoint at t = 0.5
|
|
154
|
-
const midX = 0.125 * startX + 0.375 * cp1X + 0.375 * cp2X + 0.125 * endX;
|
|
155
|
-
const midY = 0.125 * startY + 0.375 * cp1Y + 0.375 * cp2Y + 0.125 * endY;
|
|
156
|
-
|
|
157
|
-
const strokeColor = useEmeraldWire ? '#10B981' : '#6366F1';
|
|
158
|
-
const strokeOpacity = isHighlighted ? 0.98 : 0.82;
|
|
159
|
-
|
|
160
|
-
return (
|
|
161
|
-
<g key={edge.id}>
|
|
162
|
-
{/* Subtle glow path */}
|
|
163
|
-
{isHighlighted && (
|
|
164
|
-
<path
|
|
165
|
-
d={pathD}
|
|
166
|
-
fill="none"
|
|
167
|
-
stroke={strokeColor}
|
|
168
|
-
strokeWidth={7}
|
|
169
|
-
strokeOpacity={0.22}
|
|
170
|
-
/>
|
|
171
|
-
)}
|
|
172
|
-
|
|
173
|
-
{/* Main cubic-bezier connector */}
|
|
174
|
-
<path
|
|
175
|
-
d={pathD}
|
|
176
|
-
fill="none"
|
|
177
|
-
stroke={strokeColor}
|
|
178
|
-
strokeWidth={isHighlighted ? 2.8 : 2.15}
|
|
179
|
-
strokeOpacity={strokeOpacity}
|
|
180
|
-
strokeDasharray={isReturnOrBackward ? '7 5' : undefined}
|
|
181
|
-
markerEnd={
|
|
182
|
-
useEmeraldWire ? 'url(#flow-arrow-active)' : 'url(#flow-arrow-default)'
|
|
183
|
-
}
|
|
184
|
-
/>
|
|
185
|
-
|
|
186
|
-
{/* Origin anchor dot */}
|
|
187
|
-
<circle
|
|
188
|
-
cx={startX}
|
|
189
|
-
cy={startY}
|
|
190
|
-
r={4.5}
|
|
191
|
-
fill="var(--studio-surface-1)"
|
|
192
|
-
stroke={strokeColor}
|
|
193
|
-
strokeWidth={2.2}
|
|
194
|
-
/>
|
|
195
|
-
|
|
196
|
-
{/* Interactive Flow Label Pill */}
|
|
197
|
-
<foreignObject
|
|
198
|
-
x={midX - 85}
|
|
199
|
-
y={midY - 13}
|
|
200
|
-
width={170}
|
|
201
|
-
height={28}
|
|
202
|
-
style={{ pointerEvents: 'auto', overflow: 'visible' }}
|
|
203
|
-
>
|
|
204
|
-
<div
|
|
205
|
-
onClick={(e) => {
|
|
206
|
-
e.stopPropagation();
|
|
207
|
-
onSelectFlow?.(edge);
|
|
208
|
-
}}
|
|
209
|
-
title={`${edge.fromScreen} → ${edge.toScreen} (${edge.triggerLabel})`}
|
|
210
|
-
style={{
|
|
211
|
-
display: 'inline-flex',
|
|
212
|
-
alignItems: 'center',
|
|
213
|
-
justifyContent: 'center',
|
|
214
|
-
gap: 4,
|
|
215
|
-
padding: '3px 9px',
|
|
216
|
-
borderRadius: 999,
|
|
217
|
-
backgroundColor: 'var(--studio-surface-1)',
|
|
218
|
-
border: `1px solid ${useEmeraldWire ? 'var(--studio-accent-emerald)' : 'var(--studio-badge-indigo-border)'}`,
|
|
219
|
-
color: useEmeraldWire ? 'var(--studio-badge-emerald-text)' : 'var(--studio-badge-indigo-text)',
|
|
220
|
-
fontSize: 10,
|
|
221
|
-
fontWeight: 600,
|
|
222
|
-
fontFamily: 'JetBrains Mono, monospace',
|
|
223
|
-
whiteSpace: 'nowrap',
|
|
224
|
-
cursor: 'pointer',
|
|
225
|
-
boxShadow: '0 4px 12px rgba(0,0,0,0.2)',
|
|
226
|
-
margin: '0 auto',
|
|
227
|
-
}}
|
|
228
|
-
>
|
|
229
|
-
<span>{edge.fromScreen}</span>
|
|
230
|
-
<span>→</span>
|
|
231
|
-
<span>{edge.toScreen}</span>
|
|
232
|
-
</div>
|
|
233
|
-
</foreignObject>
|
|
234
|
-
</g>
|
|
235
|
-
);
|
|
236
|
-
})}
|
|
237
|
-
</svg>
|
|
238
|
-
);
|
|
239
|
-
});
|