@adminide-stack/yantra-mobile 12.0.125-alpha.1 → 12.0.126
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/lib/features/canvas/AudioEditorExperience.js +207 -109
- package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
- package/lib/features/canvas/CanvasAgentChatPane.js +87 -72
- package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
- package/lib/features/canvas/CanvasBoardsGrid.js +494 -387
- package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
- package/lib/features/canvas/CanvasChatResultCard.js +78 -59
- package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
- package/lib/features/canvas/CanvasEditToolsPanel.js +126 -84
- package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
- package/lib/features/canvas/CanvasExperience.js +108 -126
- package/lib/features/canvas/CanvasExperience.js.map +1 -1
- package/lib/features/canvas/CanvasGeneratePanel.js +178 -166
- package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
- package/lib/features/canvas/CanvasLibrarySheet.js +119 -123
- package/lib/features/canvas/CanvasLibrarySheet.js.map +1 -1
- package/lib/features/canvas/CanvasLooksPanel.js +113 -89
- package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasModelPicker.js +79 -79
- package/lib/features/canvas/CanvasModelPicker.js.map +1 -1
- package/lib/features/canvas/CanvasTasksPanel.js +193 -128
- package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasTemplatesPanel.js +106 -94
- package/lib/features/canvas/CanvasTemplatesPanel.js.map +1 -1
- package/lib/features/canvas/CanvasToolDock.js +195 -127
- package/lib/features/canvas/CanvasToolDock.js.map +1 -1
- package/lib/features/canvas/FrameExtractorExperience.js +163 -100
- package/lib/features/canvas/FrameExtractorExperience.js.map +1 -1
- package/lib/features/canvas/GeneratorReferenceSlots.js +132 -69
- package/lib/features/canvas/GeneratorReferenceSlots.js.map +1 -1
- package/lib/features/canvas/ImageEditorExperience.js +278 -209
- package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
- package/lib/features/canvas/InfluencerStudioExperience.js +167 -125
- package/lib/features/canvas/InfluencerStudioExperience.js.map +1 -1
- package/lib/features/canvas/MoodboardExperience.js +102 -85
- package/lib/features/canvas/MoodboardExperience.js.map +1 -1
- package/lib/features/canvas/NativeCanvasViewer.js +203 -192
- package/lib/features/canvas/NativeCanvasViewer.js.map +1 -1
- package/lib/features/canvas/PromoContextFields.js +125 -92
- package/lib/features/canvas/PromoContextFields.js.map +1 -1
- package/lib/features/canvas/SetStudioExperience.js +225 -143
- package/lib/features/canvas/SetStudioExperience.js.map +1 -1
- package/lib/features/canvas/VideoClipsExperience.js +126 -92
- package/lib/features/canvas/VideoClipsExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditExperience.js +154 -142
- package/lib/features/canvas/VideoEditExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditorExperience.js +551 -492
- package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
- package/lib/features/canvas/VideoGeneratorExperience.js +284 -131
- package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
- package/lib/features/canvas/canvasTasks.js +7 -3
- package/lib/features/canvas/canvasTasks.js.map +1 -1
- package/lib/features/canvas/canvasTheme.js +265 -0
- package/lib/features/canvas/canvasTheme.js.map +1 -0
- package/lib/features/canvas/canvasUi.js +381 -0
- package/lib/features/canvas/canvasUi.js.map +1 -0
- package/lib/features/canvas/recorder/CameraRecorderExperience.js +109 -52
- package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
- package/lib/features/canvas/serverTasks.js +1 -1
- package/lib/features/canvas/serverTasks.js.map +1 -1
- package/lib/features/canvas/set/SetViewportWebView.js +1 -1
- package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
- package/lib/features/canvas/videoEditor/BlurBoxOverlay.js +8 -7
- package/lib/features/canvas/videoEditor/BlurBoxOverlay.js.map +1 -1
- package/lib/features/canvas/videoEditor/ExportTaskCard.js +44 -41
- package/lib/features/canvas/videoEditor/ExportTaskCard.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +50 -45
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
- package/lib/features/canvas/videoEditor/exportTask.js +3 -2
- package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
- package/lib/features/canvas/videoEditor/formWidgets.js +116 -64
- package/lib/features/canvas/videoEditor/formWidgets.js.map +1 -1
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js +77 -63
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js.map +1 -1
- package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js +95 -79
- package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js.map +1 -1
- package/lib/features/design/DesignEditorExperience.js +241 -160
- package/lib/features/design/DesignEditorExperience.js.map +1 -1
- package/lib/features/design/DesignExperience.js +300 -143
- package/lib/features/design/DesignExperience.js.map +1 -1
- package/lib/features/health/HealthSyncRunner.js +9 -1
- package/lib/features/health/HealthSyncRunner.js.map +1 -1
- package/lib/features/health/backgroundSync.js +41 -0
- package/lib/features/health/backgroundSync.js.map +1 -0
- package/lib/features/health/healthConnectBackground.js +32 -0
- package/lib/features/health/healthConnectBackground.js.map +1 -0
- package/lib/features/health/healthConnectReader.js +16 -2
- package/lib/features/health/healthConnectReader.js.map +1 -1
- package/lib/features/health/healthSync.js +31 -3
- package/lib/features/health/healthSync.js.map +1 -1
- package/lib/features/health/healthSyncStore.js +89 -5
- package/lib/features/health/healthSyncStore.js.map +1 -1
- package/lib/features/health/healthkitBackground.js +17 -0
- package/lib/features/health/healthkitBackground.js.map +1 -0
- package/lib/features/health/reader.js.map +1 -1
- package/lib/features/health/sessionVault.js +38 -0
- package/lib/features/health/sessionVault.js.map +1 -0
- package/lib/features/health/syncState.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +3 -2
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/webbuilderPrompts.js +2 -5
- package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/screens/Health/index.js +12 -2
- package/lib/screens/Health/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js +120 -0
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -0
- package/lib/screens/WebBuilderNative/useRestoredSandboxes.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +26 -4
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +110 -7
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +6 -4
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import {jsx,Fragment}from'react/jsx-runtime';import {MaterialCommunityIcons}from'@expo/vector-icons';import {createContext,useContext,useState,useEffect,useMemo,useCallback}from'react';import {StyleSheet,useColorScheme,Pressable}from'react-native';var _a;
|
|
2
|
+
const CANVAS_THEME_STORAGE_KEY = "canvas.theme";
|
|
3
|
+
const rgba = (rgb) => (alpha) => `rgba(${rgb},${alpha})`;
|
|
4
|
+
const CANVAS_LIGHT = {
|
|
5
|
+
mode: "light",
|
|
6
|
+
isDark: false,
|
|
7
|
+
background: "#ffffff",
|
|
8
|
+
foreground: "#141414",
|
|
9
|
+
card: "#f4f4f5",
|
|
10
|
+
cardForeground: "#141414",
|
|
11
|
+
popover: "#ffffff",
|
|
12
|
+
popoverForeground: "#141414",
|
|
13
|
+
primary: "#e1ff00",
|
|
14
|
+
primaryForeground: "#000000",
|
|
15
|
+
secondary: "#27272a",
|
|
16
|
+
secondaryForeground: "#ffffff",
|
|
17
|
+
muted: "#f1f1f1",
|
|
18
|
+
mutedForeground: "#71717a",
|
|
19
|
+
accent: "#e1ff00",
|
|
20
|
+
accentForeground: "#000000",
|
|
21
|
+
destructive: "#ef4444",
|
|
22
|
+
destructiveForeground: "#ffffff",
|
|
23
|
+
border: "#e4e4e7",
|
|
24
|
+
input: "#e4e4e7",
|
|
25
|
+
ring: "#d4e100",
|
|
26
|
+
surface: "#ffffff",
|
|
27
|
+
inkSoft: "#3f3f46",
|
|
28
|
+
borderStrong: "#d4d4d8",
|
|
29
|
+
primaryText: "#4d7c0f",
|
|
30
|
+
destructiveText: "#b91c1c",
|
|
31
|
+
destructiveSoft: "#fef2f2",
|
|
32
|
+
destructiveBorder: "#fecaca",
|
|
33
|
+
successText: "#15803d",
|
|
34
|
+
successSoft: "#f0fdf4",
|
|
35
|
+
warningText: "#92400e",
|
|
36
|
+
info: "#2563eb",
|
|
37
|
+
infoSoft: "#dbeafe",
|
|
38
|
+
backgroundAlpha: rgba("255,255,255"),
|
|
39
|
+
tint: rgba("20,20,20"),
|
|
40
|
+
edWell: "#e4e4e7",
|
|
41
|
+
edBg: "#f5f5f3",
|
|
42
|
+
edPanel: "#ffffff",
|
|
43
|
+
edRaised: "#f4f4f5",
|
|
44
|
+
edRaisedHi: "#e9e9eb",
|
|
45
|
+
edLine: "#e4e4e7",
|
|
46
|
+
edLineHi: "#d4d4d8",
|
|
47
|
+
edInk: "#18181b",
|
|
48
|
+
edInk2: "#52525b",
|
|
49
|
+
edInk3: "#6b6b76",
|
|
50
|
+
edOnInk: "#ffffff",
|
|
51
|
+
edAccent: "#6c5ce7",
|
|
52
|
+
edAccentSoft: "#ece9ff",
|
|
53
|
+
edDanger: "#b91c1c",
|
|
54
|
+
edDangerSoft: "#fef2f2",
|
|
55
|
+
edOk: "#15803d",
|
|
56
|
+
edWarn: "#92400e",
|
|
57
|
+
edTint: rgba("0,0,0")
|
|
58
|
+
};
|
|
59
|
+
const CANVAS_DARK = {
|
|
60
|
+
mode: "dark",
|
|
61
|
+
isDark: true,
|
|
62
|
+
background: "#0d0d0d",
|
|
63
|
+
foreground: "#f2f2f2",
|
|
64
|
+
card: "#141414",
|
|
65
|
+
cardForeground: "#f2f2f2",
|
|
66
|
+
popover: "#0d0d0d",
|
|
67
|
+
popoverForeground: "#f2f2f2",
|
|
68
|
+
primary: "#d4ff00",
|
|
69
|
+
primaryForeground: "#000000",
|
|
70
|
+
secondary: "#262626",
|
|
71
|
+
secondaryForeground: "#f2f2f2",
|
|
72
|
+
muted: "#1a1a1a",
|
|
73
|
+
mutedForeground: "#a1a1aa",
|
|
74
|
+
accent: "#262626",
|
|
75
|
+
accentForeground: "#d4ff00",
|
|
76
|
+
destructive: "#7f1d1d",
|
|
77
|
+
destructiveForeground: "#f2f2f2",
|
|
78
|
+
border: "#262626",
|
|
79
|
+
input: "#262626",
|
|
80
|
+
ring: "#d4ff00",
|
|
81
|
+
surface: "#141414",
|
|
82
|
+
inkSoft: "#d4d4d8",
|
|
83
|
+
borderStrong: "#3f3f46",
|
|
84
|
+
primaryText: "#d4ff00",
|
|
85
|
+
destructiveText: "#f87171",
|
|
86
|
+
destructiveSoft: "#421f23",
|
|
87
|
+
destructiveBorder: "#7f3336",
|
|
88
|
+
successText: "#4ade80",
|
|
89
|
+
successSoft: "#12261a",
|
|
90
|
+
warningText: "#fbbf24",
|
|
91
|
+
info: "#6ea8fe",
|
|
92
|
+
infoSoft: "#243a5e",
|
|
93
|
+
backgroundAlpha: rgba("13,13,13"),
|
|
94
|
+
tint: rgba("242,242,242"),
|
|
95
|
+
// Native editors' existing dark chassis.
|
|
96
|
+
edWell: "#08080a",
|
|
97
|
+
edBg: "#0a0a0c",
|
|
98
|
+
edPanel: "#16161a",
|
|
99
|
+
edRaised: "#1f1f24",
|
|
100
|
+
edRaisedHi: "#2a2a32",
|
|
101
|
+
edLine: "#26262c",
|
|
102
|
+
edLineHi: "#32323a",
|
|
103
|
+
edInk: "#f7f7fa",
|
|
104
|
+
edInk2: "#9a9aa5",
|
|
105
|
+
edInk3: "#7a7a88",
|
|
106
|
+
edOnInk: "#0a0a0c",
|
|
107
|
+
edAccent: "#8b7cff",
|
|
108
|
+
edAccentSoft: "rgba(139,124,255,0.2)",
|
|
109
|
+
edDanger: "#f87171",
|
|
110
|
+
edDangerSoft: "rgba(248,113,113,0.14)",
|
|
111
|
+
edOk: "#4ade80",
|
|
112
|
+
edWarn: "#fbbf24",
|
|
113
|
+
edTint: rgba("255,255,255")
|
|
114
|
+
};
|
|
115
|
+
function canvasPalette(mode) {
|
|
116
|
+
return mode === "dark" ? CANVAS_DARK : CANVAS_LIGHT;
|
|
117
|
+
}
|
|
118
|
+
function themedStyles(factory) {
|
|
119
|
+
const cache = /* @__PURE__ */ new Map();
|
|
120
|
+
return (theme) => {
|
|
121
|
+
let sheet = cache.get(theme);
|
|
122
|
+
if (!sheet) {
|
|
123
|
+
sheet = factory(theme);
|
|
124
|
+
cache.set(theme, sheet);
|
|
125
|
+
}
|
|
126
|
+
return sheet;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
let storage = null;
|
|
130
|
+
try {
|
|
131
|
+
storage = (_a = require("@react-native-async-storage/async-storage").default) != null ? _a : null;
|
|
132
|
+
} catch (e) {
|
|
133
|
+
storage = null;
|
|
134
|
+
}
|
|
135
|
+
function isPreference(value) {
|
|
136
|
+
return value === "light" || value === "dark" || value === "system";
|
|
137
|
+
}
|
|
138
|
+
let currentPreference = "system";
|
|
139
|
+
let loaded = false;
|
|
140
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
141
|
+
function notify() {
|
|
142
|
+
listeners.forEach((fn) => fn(currentPreference));
|
|
143
|
+
}
|
|
144
|
+
function loadPreference() {
|
|
145
|
+
if (loaded || !storage) return;
|
|
146
|
+
loaded = true;
|
|
147
|
+
try {
|
|
148
|
+
void storage.getItem(CANVAS_THEME_STORAGE_KEY).then((raw) => {
|
|
149
|
+
if (isPreference(raw) && raw !== currentPreference) {
|
|
150
|
+
currentPreference = raw;
|
|
151
|
+
notify();
|
|
152
|
+
}
|
|
153
|
+
}).catch(() => void 0);
|
|
154
|
+
} catch (e) {
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function setCanvasThemePreference(next) {
|
|
158
|
+
if (!isPreference(next)) return;
|
|
159
|
+
loaded = true;
|
|
160
|
+
currentPreference = next;
|
|
161
|
+
notify();
|
|
162
|
+
try {
|
|
163
|
+
void (storage == null ? void 0 : storage.setItem(CANVAS_THEME_STORAGE_KEY, next).catch(() => void 0));
|
|
164
|
+
} catch (e) {
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const CanvasThemeContext = createContext(null);
|
|
168
|
+
function useOsScheme() {
|
|
169
|
+
return typeof useColorScheme === "function" ? useColorScheme() : null;
|
|
170
|
+
}
|
|
171
|
+
function osMode(scheme) {
|
|
172
|
+
return scheme === "dark" ? "dark" : "light";
|
|
173
|
+
}
|
|
174
|
+
function CanvasThemeProvider({
|
|
175
|
+
mode,
|
|
176
|
+
children
|
|
177
|
+
}) {
|
|
178
|
+
const parent = useContext(CanvasThemeContext);
|
|
179
|
+
const scheme = useOsScheme();
|
|
180
|
+
const [preference, setPreferenceState] = useState(currentPreference);
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
const listener = (pref) => setPreferenceState(pref);
|
|
183
|
+
listeners.add(listener);
|
|
184
|
+
setPreferenceState(currentPreference);
|
|
185
|
+
loadPreference();
|
|
186
|
+
return () => {
|
|
187
|
+
listeners.delete(listener);
|
|
188
|
+
};
|
|
189
|
+
}, []);
|
|
190
|
+
const resolved = preference !== "system" ? preference : mode != null ? mode : osMode(scheme);
|
|
191
|
+
const value = useMemo(() => ({
|
|
192
|
+
palette: canvasPalette(resolved),
|
|
193
|
+
preference,
|
|
194
|
+
setPreference: setCanvasThemePreference
|
|
195
|
+
}), [resolved, preference]);
|
|
196
|
+
if (parent && mode == null) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
197
|
+
return /* @__PURE__ */ jsx(CanvasThemeContext.Provider, { value, children });
|
|
198
|
+
}
|
|
199
|
+
function useCanvasTheme() {
|
|
200
|
+
const ctx = useContext(CanvasThemeContext);
|
|
201
|
+
const scheme = useOsScheme();
|
|
202
|
+
return ctx ? ctx.palette : canvasPalette(osMode(scheme));
|
|
203
|
+
}
|
|
204
|
+
function useCanvasThemeControls() {
|
|
205
|
+
const ctx = useContext(CanvasThemeContext);
|
|
206
|
+
const palette = useCanvasTheme();
|
|
207
|
+
return ctx != null ? ctx : {
|
|
208
|
+
palette,
|
|
209
|
+
preference: currentPreference,
|
|
210
|
+
setPreference: setCanvasThemePreference
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const NEXT_PREFERENCE = {
|
|
214
|
+
system: "light",
|
|
215
|
+
light: "dark",
|
|
216
|
+
dark: "system"
|
|
217
|
+
};
|
|
218
|
+
const PREFERENCE_ICON = {
|
|
219
|
+
system: "theme-light-dark",
|
|
220
|
+
light: "weather-sunny",
|
|
221
|
+
dark: "weather-night"
|
|
222
|
+
};
|
|
223
|
+
const PREFERENCE_LABEL = {
|
|
224
|
+
system: "Theme: follows system",
|
|
225
|
+
light: "Theme: light",
|
|
226
|
+
dark: "Theme: dark"
|
|
227
|
+
};
|
|
228
|
+
function CanvasThemeToggle({
|
|
229
|
+
style,
|
|
230
|
+
size = 18
|
|
231
|
+
}) {
|
|
232
|
+
const {
|
|
233
|
+
palette,
|
|
234
|
+
preference,
|
|
235
|
+
setPreference
|
|
236
|
+
} = useCanvasThemeControls();
|
|
237
|
+
const onPress = useCallback(() => setPreference(NEXT_PREFERENCE[preference]), [preference, setPreference]);
|
|
238
|
+
return /* @__PURE__ */ jsx(
|
|
239
|
+
Pressable,
|
|
240
|
+
{
|
|
241
|
+
onPress,
|
|
242
|
+
hitSlop: 8,
|
|
243
|
+
accessibilityRole: "button",
|
|
244
|
+
accessibilityLabel: `${PREFERENCE_LABEL[preference]}. Tap to change.`,
|
|
245
|
+
style: StyleSheet.flatten([toggleStyles.button, {
|
|
246
|
+
backgroundColor: palette.surface,
|
|
247
|
+
borderColor: palette.border
|
|
248
|
+
}, style]),
|
|
249
|
+
children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: PREFERENCE_ICON[preference], size, color: palette.foreground })
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
const toggleStyles = StyleSheet.create({
|
|
254
|
+
button: {
|
|
255
|
+
width: 36,
|
|
256
|
+
height: 36,
|
|
257
|
+
borderRadius: 18,
|
|
258
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
259
|
+
alignItems: "center",
|
|
260
|
+
justifyContent: "center"
|
|
261
|
+
},
|
|
262
|
+
pressed: {
|
|
263
|
+
opacity: 0.7
|
|
264
|
+
}
|
|
265
|
+
});export{CANVAS_DARK,CANVAS_LIGHT,CANVAS_THEME_STORAGE_KEY,CanvasThemeProvider,CanvasThemeToggle,canvasPalette,setCanvasThemePreference,themedStyles,useCanvasTheme,useCanvasThemeControls};//# sourceMappingURL=canvasTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvasTheme.js","sources":["../../../src/features/canvas/canvasTheme.tsx"],"sourcesContent":["/**\n * Canvas light/dark theming — the native port of the web canvas theme\n * (yantra-surface packages/canvas/src/styles/theme.css + surface.css).\n *\n * Two sets of tokens:\n * - Surface tokens (background, card, foreground, muted, border, primary,\n * accent, destructive …) are the tweakcn export's `:root` / `.dark` values,\n * used by the boards home, the viewer chrome, sheets and panels.\n * - Editor-grade tokens (`ed*`) mirror the web `[data-editor]` design layer:\n * the dark grade keeps the native editors' existing near-black chassis, the\n * light grade is the web `[data-editor='light']` set.\n *\n * The mode follows the OS (`useColorScheme`), or a host-provided mode, unless\n * the person picked light/dark with the toggle — that pick is persisted under\n * AsyncStorage key `canvas.theme`.\n *\n * Remote-safe: this module ships OTA inside the federated canvas remote, so\n * AsyncStorage is required in a try/catch (see canvasBoardsSnapshot.ts) and\n * `useCanvasTheme()` never throws without a provider — it falls back to the\n * OS scheme.\n */\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { Pressable, StyleSheet, useColorScheme, type StyleProp, type ViewStyle } from 'react-native';\n\nexport type CanvasThemeMode = 'light' | 'dark';\nexport type CanvasThemePreference = CanvasThemeMode | 'system';\n\nexport const CANVAS_THEME_STORAGE_KEY = 'canvas.theme';\n\nexport type CanvasPalette = {\n mode: CanvasThemeMode;\n isDark: boolean;\n\n // ── Web surface tokens (tweakcn theme.css) ───────────────────────────\n background: string;\n foreground: string;\n card: string;\n cardForeground: string;\n popover: string;\n popoverForeground: string;\n primary: string;\n primaryForeground: string;\n secondary: string;\n secondaryForeground: string;\n muted: string;\n mutedForeground: string;\n accent: string;\n accentForeground: string;\n destructive: string;\n destructiveForeground: string;\n border: string;\n input: string;\n ring: string;\n\n // ── Native extras derived from the tokens (accessible on background) ─\n /** Raised sheets, cards and fields: white in light, the card step in dark. */\n surface: string;\n /** Secondary body text, one step softer than foreground. */\n inkSoft: string;\n /** A stronger hairline for dashed drop zones and field edges. */\n borderStrong: string;\n /** The primary hue as text on the background (lime is unreadable on white). */\n primaryText: string;\n destructiveText: string;\n destructiveSoft: string;\n destructiveBorder: string;\n successText: string;\n successSoft: string;\n warningText: string;\n info: string;\n infoSoft: string;\n /** Translucent page ground for sticky / frosted bars. */\n backgroundAlpha: (alpha: number) => string;\n /** Foreground at `alpha`, for hairlines and tints that must flip with the mode. */\n tint: (alpha: number) => string;\n\n // ── Editor grade (web [data-editor] / [data-editor='light']) ─────────\n edWell: string;\n edBg: string;\n edPanel: string;\n edRaised: string;\n edRaisedHi: string;\n edLine: string;\n edLineHi: string;\n edInk: string;\n edInk2: string;\n edInk3: string;\n /** Ink on an edInk or edAccent solid. */\n edOnInk: string;\n edAccent: string;\n edAccentSoft: string;\n edDanger: string;\n edDangerSoft: string;\n edOk: string;\n edWarn: string;\n /** edInk at `alpha` (white veil on dark, black veil on light). */\n edTint: (alpha: number) => string;\n};\n\nconst rgba = (rgb: string) => (alpha: number) => `rgba(${rgb},${alpha})`;\n\nexport const CANVAS_LIGHT: CanvasPalette = {\n mode: 'light',\n isDark: false,\n\n background: '#ffffff',\n foreground: '#141414',\n card: '#f4f4f5',\n cardForeground: '#141414',\n popover: '#ffffff',\n popoverForeground: '#141414',\n primary: '#e1ff00',\n primaryForeground: '#000000',\n secondary: '#27272a',\n secondaryForeground: '#ffffff',\n muted: '#f1f1f1',\n mutedForeground: '#71717a',\n accent: '#e1ff00',\n accentForeground: '#000000',\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n border: '#e4e4e7',\n input: '#e4e4e7',\n ring: '#d4e100',\n\n surface: '#ffffff',\n inkSoft: '#3f3f46',\n borderStrong: '#d4d4d8',\n primaryText: '#4d7c0f',\n destructiveText: '#b91c1c',\n destructiveSoft: '#fef2f2',\n destructiveBorder: '#fecaca',\n successText: '#15803d',\n successSoft: '#f0fdf4',\n warningText: '#92400e',\n info: '#2563eb',\n infoSoft: '#dbeafe',\n backgroundAlpha: rgba('255,255,255'),\n tint: rgba('20,20,20'),\n\n edWell: '#e4e4e7',\n edBg: '#f5f5f3',\n edPanel: '#ffffff',\n edRaised: '#f4f4f5',\n edRaisedHi: '#e9e9eb',\n edLine: '#e4e4e7',\n edLineHi: '#d4d4d8',\n edInk: '#18181b',\n edInk2: '#52525b',\n edInk3: '#6b6b76',\n edOnInk: '#ffffff',\n edAccent: '#6c5ce7',\n edAccentSoft: '#ece9ff',\n edDanger: '#b91c1c',\n edDangerSoft: '#fef2f2',\n edOk: '#15803d',\n edWarn: '#92400e',\n edTint: rgba('0,0,0'),\n};\n\nexport const CANVAS_DARK: CanvasPalette = {\n mode: 'dark',\n isDark: true,\n\n background: '#0d0d0d',\n foreground: '#f2f2f2',\n card: '#141414',\n cardForeground: '#f2f2f2',\n popover: '#0d0d0d',\n popoverForeground: '#f2f2f2',\n primary: '#d4ff00',\n primaryForeground: '#000000',\n secondary: '#262626',\n secondaryForeground: '#f2f2f2',\n muted: '#1a1a1a',\n mutedForeground: '#a1a1aa',\n accent: '#262626',\n accentForeground: '#d4ff00',\n destructive: '#7f1d1d',\n destructiveForeground: '#f2f2f2',\n border: '#262626',\n input: '#262626',\n ring: '#d4ff00',\n\n surface: '#141414',\n inkSoft: '#d4d4d8',\n borderStrong: '#3f3f46',\n primaryText: '#d4ff00',\n destructiveText: '#f87171',\n destructiveSoft: '#421f23',\n destructiveBorder: '#7f3336',\n successText: '#4ade80',\n successSoft: '#12261a',\n warningText: '#fbbf24',\n info: '#6ea8fe',\n infoSoft: '#243a5e',\n backgroundAlpha: rgba('13,13,13'),\n tint: rgba('242,242,242'),\n\n // Native editors' existing dark chassis.\n edWell: '#08080a',\n edBg: '#0a0a0c',\n edPanel: '#16161a',\n edRaised: '#1f1f24',\n edRaisedHi: '#2a2a32',\n edLine: '#26262c',\n edLineHi: '#32323a',\n edInk: '#f7f7fa',\n edInk2: '#9a9aa5',\n edInk3: '#7a7a88',\n edOnInk: '#0a0a0c',\n edAccent: '#8b7cff',\n edAccentSoft: 'rgba(139,124,255,0.2)',\n edDanger: '#f87171',\n edDangerSoft: 'rgba(248,113,113,0.14)',\n edOk: '#4ade80',\n edWarn: '#fbbf24',\n edTint: rgba('255,255,255'),\n};\n\nexport function canvasPalette(mode: CanvasThemeMode): CanvasPalette {\n return mode === 'dark' ? CANVAS_DARK : CANVAS_LIGHT;\n}\n\n/**\n * Wraps a `(theme) => StyleSheet.create(...)` factory so each palette's sheet\n * is built once per module, not once per mounted component instance.\n */\nexport function themedStyles<T>(factory: (theme: CanvasPalette) => T): (theme: CanvasPalette) => T {\n const cache = new Map<CanvasPalette, T>();\n return (theme) => {\n let sheet = cache.get(theme);\n if (!sheet) {\n sheet = factory(theme);\n cache.set(theme, sheet);\n }\n return sheet;\n };\n}\n\n// ── Persisted preference (shared by every provider in the process) ─────────\n\ntype StorageLike = { getItem(key: string): Promise<string | null>; setItem(key: string, value: string): Promise<void> };\nlet storage: StorageLike | null = null;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, global-require\n storage = require('@react-native-async-storage/async-storage').default ?? null;\n} catch {\n storage = null;\n}\n\nfunction isPreference(value: unknown): value is CanvasThemePreference {\n return value === 'light' || value === 'dark' || value === 'system';\n}\n\nlet currentPreference: CanvasThemePreference = 'system';\nlet loaded = false;\nconst listeners = new Set<(pref: CanvasThemePreference) => void>();\n\nfunction notify() {\n listeners.forEach((fn) => fn(currentPreference));\n}\n\nfunction loadPreference() {\n if (loaded || !storage) return;\n loaded = true;\n try {\n void storage\n .getItem(CANVAS_THEME_STORAGE_KEY)\n .then((raw) => {\n if (isPreference(raw) && raw !== currentPreference) {\n currentPreference = raw;\n notify();\n }\n })\n .catch(() => undefined);\n } catch {\n /* storage unavailable: memory only */\n }\n}\n\nexport function setCanvasThemePreference(next: CanvasThemePreference) {\n if (!isPreference(next)) return;\n loaded = true;\n currentPreference = next;\n notify();\n try {\n void storage?.setItem(CANVAS_THEME_STORAGE_KEY, next).catch(() => undefined);\n } catch {\n /* ignore */\n }\n}\n\n// ── Context ─────────────────────────────────────────────────────────────────\n\ntype CanvasThemeContextValue = {\n palette: CanvasPalette;\n preference: CanvasThemePreference;\n setPreference: (next: CanvasThemePreference) => void;\n};\n\nconst CanvasThemeContext = createContext<CanvasThemeContextValue | null>(null);\n\n/**\n * The OS scheme, or null where the host's react-native exposes no\n * useColorScheme (minimal mocks, exotic hosts). Its presence is constant for\n * the process, so the hook order stays stable.\n */\nfunction useOsScheme(): string | null | undefined {\n // eslint-disable-next-line react-hooks/rules-of-hooks -- process-constant branch\n return typeof useColorScheme === 'function' ? useColorScheme() : null;\n}\n\nfunction osMode(scheme: string | null | undefined): CanvasThemeMode {\n return scheme === 'dark' ? 'dark' : 'light';\n}\n\nexport type CanvasThemeProviderProps = {\n /** Host-provided mode; used while the preference is 'system'. Null/undefined follows the OS. */\n mode?: CanvasThemeMode | null;\n children?: React.ReactNode;\n};\n\n/**\n * Mount once at each exposed root. A nested provider without its own `mode`\n * passes through to the outer one, so the viewer inside the experience shares\n * the experience's theme.\n */\nexport function CanvasThemeProvider({ mode, children }: CanvasThemeProviderProps) {\n const parent = useContext(CanvasThemeContext);\n const scheme = useOsScheme();\n const [preference, setPreferenceState] = useState<CanvasThemePreference>(currentPreference);\n\n useEffect(() => {\n const listener = (pref: CanvasThemePreference) => setPreferenceState(pref);\n listeners.add(listener);\n // Catch a change that landed between render and subscribe.\n setPreferenceState(currentPreference);\n loadPreference();\n return () => {\n listeners.delete(listener);\n };\n }, []);\n\n const resolved: CanvasThemeMode = preference !== 'system' ? preference : (mode ?? osMode(scheme));\n const value = useMemo<CanvasThemeContextValue>(\n () => ({ palette: canvasPalette(resolved), preference, setPreference: setCanvasThemePreference }),\n [resolved, preference],\n );\n\n if (parent && mode == null) return <>{children}</>;\n return <CanvasThemeContext.Provider value={value}>{children}</CanvasThemeContext.Provider>;\n}\n\n/** The active palette. Never throws: without a provider it follows the OS scheme. */\nexport function useCanvasTheme(): CanvasPalette {\n const ctx = useContext(CanvasThemeContext);\n const scheme = useOsScheme();\n return ctx ? ctx.palette : canvasPalette(osMode(scheme));\n}\n\n/** Preference + setter for the toggle. Without a provider it still writes the shared store. */\nexport function useCanvasThemeControls(): CanvasThemeContextValue {\n const ctx = useContext(CanvasThemeContext);\n const palette = useCanvasTheme();\n return ctx ?? { palette, preference: currentPreference, setPreference: setCanvasThemePreference };\n}\n\n/** Wraps an exposed component in its own CanvasThemeProvider (pass-through when one is already above). */\nexport function withCanvasTheme<P extends object>(Component: React.ComponentType<P>): React.ComponentType<P> {\n function CanvasThemed(props: P) {\n return (\n <CanvasThemeProvider>\n <Component {...props} />\n </CanvasThemeProvider>\n );\n }\n CanvasThemed.displayName = `withCanvasTheme(${Component.displayName || Component.name || 'Component'})`;\n return CanvasThemed;\n}\n\nconst NEXT_PREFERENCE: Record<CanvasThemePreference, CanvasThemePreference> = {\n system: 'light',\n light: 'dark',\n dark: 'system',\n};\n\nconst PREFERENCE_ICON: Record<CanvasThemePreference, React.ComponentProps<typeof MaterialCommunityIcons>['name']> = {\n system: 'theme-light-dark',\n light: 'weather-sunny',\n dark: 'weather-night',\n};\n\nconst PREFERENCE_LABEL: Record<CanvasThemePreference, string> = {\n system: 'Theme: follows system',\n light: 'Theme: light',\n dark: 'Theme: dark',\n};\n\n/** Sun / moon / auto toggle — cycles system → light → dark (web ThemeToggleButton). */\nexport function CanvasThemeToggle({ style, size = 18 }: { style?: StyleProp<ViewStyle>; size?: number }) {\n const { palette, preference, setPreference } = useCanvasThemeControls();\n const onPress = useCallback(() => setPreference(NEXT_PREFERENCE[preference]), [preference, setPreference]);\n return (\n <Pressable\n onPress={onPress}\n hitSlop={8}\n accessibilityRole=\"button\"\n accessibilityLabel={`${PREFERENCE_LABEL[preference]}. Tap to change.`}\n // A plain style, never a function: the host's NativeWind JSX wrapper\n // drops function styles inside the OTA remote (see canvasUi Pressable).\n style={StyleSheet.flatten([\n toggleStyles.button,\n { backgroundColor: palette.surface, borderColor: palette.border },\n style,\n ])}\n >\n <MaterialCommunityIcons name={PREFERENCE_ICON[preference]} size={size} color={palette.foreground} />\n </Pressable>\n );\n}\n\nconst toggleStyles = StyleSheet.create({\n button: {\n width: 36,\n height: 36,\n borderRadius: 18,\n borderWidth: StyleSheet.hairlineWidth,\n alignItems: 'center',\n justifyContent: 'center',\n },\n pressed: { opacity: 0.7 },\n});\n"],"names":[],"mappings":"wPAAA,IAAA,EAAA;AA0BO,MAAM,wBAA2B,GAAA;AAsExC,MAAM,IAAA,GAAO,CAAC,GAAgB,KAAA,CAAC,UAAkB,CAAQ,KAAA,EAAA,GAAG,IAAI,KAAK,CAAA,CAAA,CAAA;AAC9D,MAAM,YAA8B,GAAA;AAAA,EACzC,IAAM,EAAA,OAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,E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AAU,WAAY,CAAA,MAAM,aAAc,CAAA,eAAA,CAAgB,UAAU,CAAC,CAAG,EAAA,CAAC,UAAY,EAAA,aAAa,CAAC,CAAA;AACzG,EAAO,uBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MAAU,OAAA;AAAA,MAAkB,OAAS,EAAA,CAAA;AAAA,MAAG,iBAAkB,EAAA,QAAA;AAAA,MAAS,kBAAoB,EAAA,CAAA,EAAG,gBAAiB,CAAA,UAAU,CAAC,CAAA,gBAAA,CAAA;AAAA,MAG9H,KAAO,EAAA,UAAA,CAAW,OAAQ,CAAA,CAAC,aAAa,MAAQ,EAAA;AAAA,QAC9C,iBAAiB,OAAQ,CAAA,OAAA;AAAA,QACzB,aAAa,OAAQ,CAAA;AAAA,OACvB,EAAG,KAAK,CAAC,CAAA;AAAA,MACC,QAAA,kBAAA,GAAA,CAAC,0BAAuB,IAAM,EAAA,eAAA,CAAgB,UAAU,CAAG,EAAA,IAAA,EAAY,KAAO,EAAA,OAAA,CAAQ,UAAY,EAAA;AAAA;AAAA,GACtG;AACR;AACA,MAAM,YAAA,GAAe,WAAW,MAAO,CAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,aAAa,UAAW,CAAA,aAAA;AAAA,IACxB,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAS,EAAA;AAAA;AAEb,CAAC,CAAA"}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {MaterialCommunityIcons}from'@expo/vector-icons';import {forwardRef,useState,useCallback,useRef,useEffect}from'react';import {Pressable as Pressable$1,StyleSheet,ScrollView,Text,View,Animated,Easing}from'react-native';import {themedStyles,useCanvasTheme}from'./canvasTheme.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
const flattenStyle = (style) => typeof StyleSheet.flatten === "function" && typeof style !== "function" ? StyleSheet.flatten(style) : style;
|
|
33
|
+
const Pressable = forwardRef(function Pressable2(_a, ref) {
|
|
34
|
+
var _b = _a, {
|
|
35
|
+
style,
|
|
36
|
+
children,
|
|
37
|
+
onPressIn,
|
|
38
|
+
onPressOut
|
|
39
|
+
} = _b, rest = __objRest(_b, [
|
|
40
|
+
"style",
|
|
41
|
+
"children",
|
|
42
|
+
"onPressIn",
|
|
43
|
+
"onPressOut"
|
|
44
|
+
]);
|
|
45
|
+
const [pressed, setPressed] = useState(false);
|
|
46
|
+
const handleIn = useCallback((event) => {
|
|
47
|
+
setPressed(true);
|
|
48
|
+
onPressIn == null ? void 0 : onPressIn(event);
|
|
49
|
+
}, [onPressIn]);
|
|
50
|
+
const handleOut = useCallback((event) => {
|
|
51
|
+
setPressed(false);
|
|
52
|
+
onPressOut == null ? void 0 : onPressOut(event);
|
|
53
|
+
}, [onPressOut]);
|
|
54
|
+
const state = {
|
|
55
|
+
pressed,
|
|
56
|
+
hovered: false
|
|
57
|
+
};
|
|
58
|
+
const resolvedStyle = typeof style === "function" ? style(state) : style;
|
|
59
|
+
const resolvedChildren = typeof children === "function" ? children(state) : children;
|
|
60
|
+
return /* @__PURE__ */ jsx(Pressable$1, __spreadProps(__spreadValues({ ref }, rest), { onPressIn: handleIn, onPressOut: handleOut, style: flattenStyle(resolvedStyle), children: resolvedChildren }));
|
|
61
|
+
});
|
|
62
|
+
const SPACE = {
|
|
63
|
+
xs: 4,
|
|
64
|
+
sm: 8,
|
|
65
|
+
md: 12,
|
|
66
|
+
lg: 16,
|
|
67
|
+
xl: 24,
|
|
68
|
+
xxl: 32
|
|
69
|
+
};
|
|
70
|
+
const RADIUS = {
|
|
71
|
+
sm: 8,
|
|
72
|
+
md: 12,
|
|
73
|
+
lg: 16,
|
|
74
|
+
xl: 20,
|
|
75
|
+
pill: 999
|
|
76
|
+
};
|
|
77
|
+
const TYPE = {
|
|
78
|
+
caption: {
|
|
79
|
+
fontSize: 12,
|
|
80
|
+
lineHeight: 16,
|
|
81
|
+
fontWeight: "500"
|
|
82
|
+
},
|
|
83
|
+
label: {
|
|
84
|
+
fontSize: 13,
|
|
85
|
+
lineHeight: 18,
|
|
86
|
+
fontWeight: "600"
|
|
87
|
+
},
|
|
88
|
+
body: {
|
|
89
|
+
fontSize: 15,
|
|
90
|
+
lineHeight: 21,
|
|
91
|
+
fontWeight: "400"
|
|
92
|
+
},
|
|
93
|
+
title: {
|
|
94
|
+
fontSize: 17,
|
|
95
|
+
lineHeight: 22,
|
|
96
|
+
fontWeight: "600"
|
|
97
|
+
},
|
|
98
|
+
heading: {
|
|
99
|
+
fontSize: 22,
|
|
100
|
+
lineHeight: 28,
|
|
101
|
+
fontWeight: "700"
|
|
102
|
+
},
|
|
103
|
+
display: {
|
|
104
|
+
fontSize: 28,
|
|
105
|
+
lineHeight: 34,
|
|
106
|
+
fontWeight: "700"
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const HIT = 44;
|
|
110
|
+
function SectionHeader({
|
|
111
|
+
title,
|
|
112
|
+
detail,
|
|
113
|
+
action,
|
|
114
|
+
onAction,
|
|
115
|
+
style
|
|
116
|
+
}) {
|
|
117
|
+
const styles = makeStyles(useCanvasTheme());
|
|
118
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.sectionHeader, style], children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(View, { style: styles.sectionTitleRow, children: [
|
|
120
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionTitle, accessibilityRole: "header", children: title }),
|
|
121
|
+
detail ? /* @__PURE__ */ jsx(Text, { style: styles.sectionDetail, children: detail }) : null
|
|
122
|
+
] }),
|
|
123
|
+
action && onAction ? /* @__PURE__ */ jsx(Pressable, { onPress: onAction, hitSlop: 10, accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: styles.sectionAction, children: action }) }) : null
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
function Segmented({
|
|
127
|
+
options,
|
|
128
|
+
value,
|
|
129
|
+
onChange,
|
|
130
|
+
style
|
|
131
|
+
}) {
|
|
132
|
+
const styles = makeStyles(useCanvasTheme());
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
ScrollView,
|
|
135
|
+
{
|
|
136
|
+
horizontal: true,
|
|
137
|
+
showsHorizontalScrollIndicator: false,
|
|
138
|
+
style: [styles.segmentScroll, style],
|
|
139
|
+
contentContainerStyle: styles.segmentTrack,
|
|
140
|
+
children: options.map((option) => {
|
|
141
|
+
const on = option.id === value;
|
|
142
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: () => onChange(option.id), style: [styles.segment, on && styles.segmentOn], accessibilityRole: "tab", accessibilityState: {
|
|
143
|
+
selected: on
|
|
144
|
+
}, children: /* @__PURE__ */ jsx(Text, { style: [styles.segmentLabel, on && styles.segmentLabelOn], children: option.label }) }, option.id);
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function IconButton({
|
|
150
|
+
icon,
|
|
151
|
+
onPress,
|
|
152
|
+
label,
|
|
153
|
+
tone = "plain",
|
|
154
|
+
size = 40
|
|
155
|
+
}) {
|
|
156
|
+
const theme = useCanvasTheme();
|
|
157
|
+
const styles = makeStyles(theme);
|
|
158
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress, hitSlop: Math.max(0, (HIT - size) / 2), style: ({
|
|
159
|
+
pressed
|
|
160
|
+
}) => [styles.iconButton, {
|
|
161
|
+
width: size,
|
|
162
|
+
height: size,
|
|
163
|
+
borderRadius: size / 2
|
|
164
|
+
}, tone === "filled" && styles.iconButtonFilled, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: label, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: Math.round(size * 0.5), color: theme.foreground }) });
|
|
165
|
+
}
|
|
166
|
+
function ActionButton({
|
|
167
|
+
label,
|
|
168
|
+
icon,
|
|
169
|
+
onPress,
|
|
170
|
+
variant = "primary",
|
|
171
|
+
disabled,
|
|
172
|
+
style
|
|
173
|
+
}) {
|
|
174
|
+
const theme = useCanvasTheme();
|
|
175
|
+
const styles = makeStyles(theme);
|
|
176
|
+
const primary = variant === "primary";
|
|
177
|
+
const ink = primary ? theme.primaryForeground : theme.foreground;
|
|
178
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, disabled, style: ({
|
|
179
|
+
pressed
|
|
180
|
+
}) => [styles.action, primary ? styles.actionPrimary : styles.actionSecondary, disabled && styles.disabled, pressed && !disabled && styles.pressed, style], accessibilityRole: "button", accessibilityState: {
|
|
181
|
+
disabled: Boolean(disabled)
|
|
182
|
+
}, children: [
|
|
183
|
+
icon ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 18, color: ink }) : null,
|
|
184
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, {
|
|
185
|
+
color: ink
|
|
186
|
+
}], children: label })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
function Skeleton({
|
|
190
|
+
style,
|
|
191
|
+
radius = 0
|
|
192
|
+
}) {
|
|
193
|
+
const theme = useCanvasTheme();
|
|
194
|
+
const pulse = useRef(new Animated.Value(0.45)).current;
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
const loop = Animated.loop(Animated.sequence([Animated.timing(pulse, {
|
|
197
|
+
toValue: 1,
|
|
198
|
+
duration: 900,
|
|
199
|
+
easing: Easing.out(Easing.quad),
|
|
200
|
+
useNativeDriver: true
|
|
201
|
+
}), Animated.timing(pulse, {
|
|
202
|
+
toValue: 0.45,
|
|
203
|
+
duration: 900,
|
|
204
|
+
easing: Easing.in(Easing.quad),
|
|
205
|
+
useNativeDriver: true
|
|
206
|
+
})]));
|
|
207
|
+
loop.start();
|
|
208
|
+
return () => loop.stop();
|
|
209
|
+
}, [pulse]);
|
|
210
|
+
return /* @__PURE__ */ jsx(Animated.View, { pointerEvents: "none", style: [style != null ? style : StyleSheet.absoluteFillObject, {
|
|
211
|
+
borderRadius: radius,
|
|
212
|
+
backgroundColor: theme.isDark ? "#262626" : "#e7e7ea",
|
|
213
|
+
opacity: pulse
|
|
214
|
+
}] });
|
|
215
|
+
}
|
|
216
|
+
const COVER_WASHES = [{
|
|
217
|
+
light: ["#fde7d9", "#c2410c"],
|
|
218
|
+
dark: ["#3a2418", "#fdba74"]
|
|
219
|
+
}, {
|
|
220
|
+
light: ["#e0ecff", "#1d4ed8"],
|
|
221
|
+
dark: ["#1a2540", "#93c5fd"]
|
|
222
|
+
}, {
|
|
223
|
+
light: ["#e6f6ec", "#047857"],
|
|
224
|
+
dark: ["#15291f", "#6ee7b7"]
|
|
225
|
+
}, {
|
|
226
|
+
light: ["#efe7ff", "#6d28d9"],
|
|
227
|
+
dark: ["#261d3d", "#c4b5fd"]
|
|
228
|
+
}, {
|
|
229
|
+
light: ["#fde4ec", "#be185d"],
|
|
230
|
+
dark: ["#3a1a27", "#f9a8d4"]
|
|
231
|
+
}, {
|
|
232
|
+
light: ["#fdf3d4", "#a16207"],
|
|
233
|
+
dark: ["#33290f", "#fcd34d"]
|
|
234
|
+
}];
|
|
235
|
+
function coverWash(seed, isDark) {
|
|
236
|
+
let h = 0;
|
|
237
|
+
for (let i = 0; i < seed.length; i += 1) h = h * 31 + seed.charCodeAt(i) | 0;
|
|
238
|
+
const pick = COVER_WASHES[Math.abs(h) % COVER_WASHES.length];
|
|
239
|
+
const [wash, ink] = isDark ? pick.dark : pick.light;
|
|
240
|
+
return {
|
|
241
|
+
wash,
|
|
242
|
+
ink
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function CoverPlaceholder({
|
|
246
|
+
seed,
|
|
247
|
+
icon,
|
|
248
|
+
label
|
|
249
|
+
}) {
|
|
250
|
+
const theme = useCanvasTheme();
|
|
251
|
+
const {
|
|
252
|
+
wash,
|
|
253
|
+
ink
|
|
254
|
+
} = coverWash(seed, theme.isDark);
|
|
255
|
+
return /* @__PURE__ */ jsxs(View, { style: [StyleSheet.absoluteFillObject, placeholderStyles.wrap, {
|
|
256
|
+
backgroundColor: wash
|
|
257
|
+
}], children: [
|
|
258
|
+
/* @__PURE__ */ jsx(View, { style: [placeholderStyles.badge, {
|
|
259
|
+
backgroundColor: theme.isDark ? "rgba(255,255,255,0.08)" : "rgba(255,255,255,0.7)"
|
|
260
|
+
}], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 26, color: ink }) }),
|
|
261
|
+
label ? /* @__PURE__ */ jsx(Text, { style: [placeholderStyles.label, {
|
|
262
|
+
color: ink
|
|
263
|
+
}], children: label }) : null
|
|
264
|
+
] });
|
|
265
|
+
}
|
|
266
|
+
const placeholderStyles = StyleSheet.create({
|
|
267
|
+
wrap: {
|
|
268
|
+
alignItems: "center",
|
|
269
|
+
justifyContent: "center",
|
|
270
|
+
gap: SPACE.sm
|
|
271
|
+
},
|
|
272
|
+
badge: {
|
|
273
|
+
width: 56,
|
|
274
|
+
height: 56,
|
|
275
|
+
borderRadius: 28,
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
justifyContent: "center"
|
|
278
|
+
},
|
|
279
|
+
label: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
280
|
+
fontWeight: "600"
|
|
281
|
+
})
|
|
282
|
+
});
|
|
283
|
+
const pressedStyle = (pressed) => pressed ? {
|
|
284
|
+
opacity: 0.72,
|
|
285
|
+
transform: [{
|
|
286
|
+
scale: 0.98
|
|
287
|
+
}]
|
|
288
|
+
} : null;
|
|
289
|
+
const makeStyles = themedStyles((theme) => StyleSheet.create({
|
|
290
|
+
sectionHeader: {
|
|
291
|
+
flexDirection: "row",
|
|
292
|
+
alignItems: "baseline",
|
|
293
|
+
justifyContent: "space-between",
|
|
294
|
+
gap: SPACE.md,
|
|
295
|
+
marginBottom: SPACE.md
|
|
296
|
+
},
|
|
297
|
+
sectionTitleRow: {
|
|
298
|
+
flexDirection: "row",
|
|
299
|
+
alignItems: "baseline",
|
|
300
|
+
gap: SPACE.sm,
|
|
301
|
+
flexShrink: 1
|
|
302
|
+
},
|
|
303
|
+
sectionTitle: __spreadProps(__spreadValues({}, TYPE.title), {
|
|
304
|
+
color: theme.foreground
|
|
305
|
+
}),
|
|
306
|
+
sectionDetail: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
307
|
+
color: theme.mutedForeground
|
|
308
|
+
}),
|
|
309
|
+
sectionAction: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
310
|
+
color: theme.mutedForeground
|
|
311
|
+
}),
|
|
312
|
+
segmentScroll: {
|
|
313
|
+
flexGrow: 0,
|
|
314
|
+
alignSelf: "flex-start"
|
|
315
|
+
},
|
|
316
|
+
segmentTrack: {
|
|
317
|
+
flexDirection: "row",
|
|
318
|
+
padding: 3,
|
|
319
|
+
gap: 2,
|
|
320
|
+
borderRadius: RADIUS.pill,
|
|
321
|
+
backgroundColor: theme.card
|
|
322
|
+
},
|
|
323
|
+
segment: {
|
|
324
|
+
minHeight: 34,
|
|
325
|
+
paddingHorizontal: SPACE.lg,
|
|
326
|
+
borderRadius: RADIUS.pill,
|
|
327
|
+
alignItems: "center",
|
|
328
|
+
justifyContent: "center"
|
|
329
|
+
},
|
|
330
|
+
segmentOn: {
|
|
331
|
+
backgroundColor: theme.isDark ? theme.secondary : theme.surface,
|
|
332
|
+
shadowColor: "#000",
|
|
333
|
+
shadowOpacity: theme.isDark ? 0 : 0.08,
|
|
334
|
+
shadowRadius: 4,
|
|
335
|
+
shadowOffset: {
|
|
336
|
+
width: 0,
|
|
337
|
+
height: 1
|
|
338
|
+
},
|
|
339
|
+
elevation: theme.isDark ? 0 : 1
|
|
340
|
+
},
|
|
341
|
+
segmentLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
342
|
+
color: theme.mutedForeground
|
|
343
|
+
}),
|
|
344
|
+
segmentLabelOn: {
|
|
345
|
+
color: theme.foreground
|
|
346
|
+
},
|
|
347
|
+
iconButton: {
|
|
348
|
+
alignItems: "center",
|
|
349
|
+
justifyContent: "center"
|
|
350
|
+
},
|
|
351
|
+
iconButtonFilled: {
|
|
352
|
+
backgroundColor: theme.card
|
|
353
|
+
},
|
|
354
|
+
action: {
|
|
355
|
+
minHeight: HIT,
|
|
356
|
+
paddingHorizontal: SPACE.lg + 2,
|
|
357
|
+
borderRadius: RADIUS.pill,
|
|
358
|
+
flexDirection: "row",
|
|
359
|
+
alignItems: "center",
|
|
360
|
+
justifyContent: "center",
|
|
361
|
+
gap: SPACE.sm
|
|
362
|
+
},
|
|
363
|
+
actionPrimary: {
|
|
364
|
+
backgroundColor: theme.primary
|
|
365
|
+
},
|
|
366
|
+
actionSecondary: {
|
|
367
|
+
backgroundColor: theme.card
|
|
368
|
+
},
|
|
369
|
+
actionLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
370
|
+
fontSize: 15
|
|
371
|
+
}),
|
|
372
|
+
disabled: {
|
|
373
|
+
opacity: 0.4
|
|
374
|
+
},
|
|
375
|
+
pressed: {
|
|
376
|
+
opacity: 0.72,
|
|
377
|
+
transform: [{
|
|
378
|
+
scale: 0.98
|
|
379
|
+
}]
|
|
380
|
+
}
|
|
381
|
+
}));export{ActionButton,CoverPlaceholder,HIT,IconButton,Pressable,RADIUS,SPACE,SectionHeader,Segmented,Skeleton,TYPE,coverWash,pressedStyle};//# sourceMappingURL=canvasUi.js.map
|