zelune 1.5.2 → 1.5.5
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 +38 -0
- package/bin/cli.mjs +17 -6
- package/index.html +9 -2
- package/package.json +2 -1
- package/plugin.json +1 -1
- package/plugins/viteReactNativeFallbackPlugin.ts +528 -0
- package/plugins/viteVirtualScreensPlugin.ts +139 -8
- package/src/canvas/CanvasApp.tsx +186 -45
- package/src/canvas/FlowArrowsLayer.tsx +7 -7
- package/src/canvas/InspectorPanel.tsx +58 -49
- package/src/canvas/ScreenArtboard.tsx +107 -32
- package/src/main.tsx +71 -1
- package/src/runtime/MockNavigationContext.tsx +1460 -40
- package/src/runtime/reactNativeShim.ts +141 -0
- package/src/screens/ProductDetailScreen.tsx +32 -59
- package/src/server/astEngine.ts +10 -1
- package/src/styles.css +182 -21
- package/vite.config.ts +136 -67
package/src/main.tsx
CHANGED
|
@@ -1,10 +1,80 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import './runtime/MockNavigationContext';
|
|
3
4
|
import { CanvasApp } from './canvas/CanvasApp';
|
|
4
5
|
import './styles.css';
|
|
5
6
|
|
|
7
|
+
class StudioRootErrorBoundary extends React.Component<
|
|
8
|
+
{ children: React.ReactNode },
|
|
9
|
+
{ error: Error | null }
|
|
10
|
+
> {
|
|
11
|
+
state: { error: Error | null } = { error: null };
|
|
12
|
+
|
|
13
|
+
static getDerivedStateFromError(error: Error) {
|
|
14
|
+
return { error };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
if (this.state.error) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
style={{
|
|
22
|
+
minHeight: '100vh',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
padding: 32,
|
|
28
|
+
backgroundColor: '#09090B',
|
|
29
|
+
color: '#F8FAFC',
|
|
30
|
+
fontFamily: 'system-ui, -apple-system, sans-serif',
|
|
31
|
+
gap: 12,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<div style={{ fontSize: 16, fontWeight: 700, color: '#F87171' }}>
|
|
35
|
+
Zelune Studio Recovery Mode
|
|
36
|
+
</div>
|
|
37
|
+
<pre
|
|
38
|
+
style={{
|
|
39
|
+
maxWidth: 720,
|
|
40
|
+
padding: 16,
|
|
41
|
+
borderRadius: 8,
|
|
42
|
+
backgroundColor: '#18181B',
|
|
43
|
+
border: '1px solid #27272A',
|
|
44
|
+
color: '#FCA5A5',
|
|
45
|
+
fontSize: 12,
|
|
46
|
+
whiteSpace: 'pre-wrap',
|
|
47
|
+
wordBreak: 'break-word',
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{this.state.error.message}
|
|
51
|
+
</pre>
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
onClick={() => this.setState({ error: null })}
|
|
55
|
+
style={{
|
|
56
|
+
padding: '8px 16px',
|
|
57
|
+
borderRadius: 6,
|
|
58
|
+
border: '1px solid #4F46E5',
|
|
59
|
+
backgroundColor: '#4F46E5',
|
|
60
|
+
color: '#FFFFFF',
|
|
61
|
+
fontWeight: 600,
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
Retry Studio Render
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return this.props.children;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
6
74
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
75
|
<React.StrictMode>
|
|
8
|
-
<
|
|
76
|
+
<StudioRootErrorBoundary>
|
|
77
|
+
<CanvasApp />
|
|
78
|
+
</StudioRootErrorBoundary>
|
|
9
79
|
</React.StrictMode>
|
|
10
80
|
);
|