@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.
Files changed (118) hide show
  1. package/lib/features/canvas/AudioEditorExperience.js +207 -109
  2. package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
  3. package/lib/features/canvas/CanvasAgentChatPane.js +87 -72
  4. package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
  5. package/lib/features/canvas/CanvasBoardsGrid.js +494 -387
  6. package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
  7. package/lib/features/canvas/CanvasChatResultCard.js +78 -59
  8. package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
  9. package/lib/features/canvas/CanvasEditToolsPanel.js +126 -84
  10. package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
  11. package/lib/features/canvas/CanvasExperience.js +108 -126
  12. package/lib/features/canvas/CanvasExperience.js.map +1 -1
  13. package/lib/features/canvas/CanvasGeneratePanel.js +178 -166
  14. package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
  15. package/lib/features/canvas/CanvasLibrarySheet.js +119 -123
  16. package/lib/features/canvas/CanvasLibrarySheet.js.map +1 -1
  17. package/lib/features/canvas/CanvasLooksPanel.js +113 -89
  18. package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
  19. package/lib/features/canvas/CanvasModelPicker.js +79 -79
  20. package/lib/features/canvas/CanvasModelPicker.js.map +1 -1
  21. package/lib/features/canvas/CanvasTasksPanel.js +193 -128
  22. package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
  23. package/lib/features/canvas/CanvasTemplatesPanel.js +106 -94
  24. package/lib/features/canvas/CanvasTemplatesPanel.js.map +1 -1
  25. package/lib/features/canvas/CanvasToolDock.js +195 -127
  26. package/lib/features/canvas/CanvasToolDock.js.map +1 -1
  27. package/lib/features/canvas/FrameExtractorExperience.js +163 -100
  28. package/lib/features/canvas/FrameExtractorExperience.js.map +1 -1
  29. package/lib/features/canvas/GeneratorReferenceSlots.js +132 -69
  30. package/lib/features/canvas/GeneratorReferenceSlots.js.map +1 -1
  31. package/lib/features/canvas/ImageEditorExperience.js +278 -209
  32. package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
  33. package/lib/features/canvas/InfluencerStudioExperience.js +167 -125
  34. package/lib/features/canvas/InfluencerStudioExperience.js.map +1 -1
  35. package/lib/features/canvas/MoodboardExperience.js +102 -85
  36. package/lib/features/canvas/MoodboardExperience.js.map +1 -1
  37. package/lib/features/canvas/NativeCanvasViewer.js +203 -192
  38. package/lib/features/canvas/NativeCanvasViewer.js.map +1 -1
  39. package/lib/features/canvas/PromoContextFields.js +125 -92
  40. package/lib/features/canvas/PromoContextFields.js.map +1 -1
  41. package/lib/features/canvas/SetStudioExperience.js +225 -143
  42. package/lib/features/canvas/SetStudioExperience.js.map +1 -1
  43. package/lib/features/canvas/VideoClipsExperience.js +126 -92
  44. package/lib/features/canvas/VideoClipsExperience.js.map +1 -1
  45. package/lib/features/canvas/VideoEditExperience.js +154 -142
  46. package/lib/features/canvas/VideoEditExperience.js.map +1 -1
  47. package/lib/features/canvas/VideoEditorExperience.js +551 -492
  48. package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
  49. package/lib/features/canvas/VideoGeneratorExperience.js +284 -131
  50. package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
  51. package/lib/features/canvas/canvasTasks.js +7 -3
  52. package/lib/features/canvas/canvasTasks.js.map +1 -1
  53. package/lib/features/canvas/canvasTheme.js +265 -0
  54. package/lib/features/canvas/canvasTheme.js.map +1 -0
  55. package/lib/features/canvas/canvasUi.js +381 -0
  56. package/lib/features/canvas/canvasUi.js.map +1 -0
  57. package/lib/features/canvas/recorder/CameraRecorderExperience.js +109 -52
  58. package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
  59. package/lib/features/canvas/serverTasks.js +1 -1
  60. package/lib/features/canvas/serverTasks.js.map +1 -1
  61. package/lib/features/canvas/set/SetViewportWebView.js +1 -1
  62. package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
  63. package/lib/features/canvas/videoEditor/BlurBoxOverlay.js +8 -7
  64. package/lib/features/canvas/videoEditor/BlurBoxOverlay.js.map +1 -1
  65. package/lib/features/canvas/videoEditor/ExportTaskCard.js +44 -41
  66. package/lib/features/canvas/videoEditor/ExportTaskCard.js.map +1 -1
  67. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +50 -45
  68. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
  69. package/lib/features/canvas/videoEditor/exportTask.js +3 -2
  70. package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
  71. package/lib/features/canvas/videoEditor/formWidgets.js +116 -64
  72. package/lib/features/canvas/videoEditor/formWidgets.js.map +1 -1
  73. package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js +77 -63
  74. package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js.map +1 -1
  75. package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js +95 -79
  76. package/lib/features/canvas/videoEditor/tools/ToolsDrawer.js.map +1 -1
  77. package/lib/features/design/DesignEditorExperience.js +241 -160
  78. package/lib/features/design/DesignEditorExperience.js.map +1 -1
  79. package/lib/features/design/DesignExperience.js +300 -143
  80. package/lib/features/design/DesignExperience.js.map +1 -1
  81. package/lib/features/health/HealthSyncRunner.js +9 -1
  82. package/lib/features/health/HealthSyncRunner.js.map +1 -1
  83. package/lib/features/health/backgroundSync.js +41 -0
  84. package/lib/features/health/backgroundSync.js.map +1 -0
  85. package/lib/features/health/healthConnectBackground.js +32 -0
  86. package/lib/features/health/healthConnectBackground.js.map +1 -0
  87. package/lib/features/health/healthConnectReader.js +16 -2
  88. package/lib/features/health/healthConnectReader.js.map +1 -1
  89. package/lib/features/health/healthSync.js +31 -3
  90. package/lib/features/health/healthSync.js.map +1 -1
  91. package/lib/features/health/healthSyncStore.js +89 -5
  92. package/lib/features/health/healthSyncStore.js.map +1 -1
  93. package/lib/features/health/healthkitBackground.js +17 -0
  94. package/lib/features/health/healthkitBackground.js.map +1 -0
  95. package/lib/features/health/reader.js.map +1 -1
  96. package/lib/features/health/sessionVault.js +38 -0
  97. package/lib/features/health/sessionVault.js.map +1 -0
  98. package/lib/features/health/syncState.js.map +1 -1
  99. package/lib/features/webbuilder/WebBuilderExperience.js +1 -1
  100. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  101. package/lib/features/webbuilder/buildFragments.js +3 -2
  102. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  103. package/lib/features/webbuilder/components/PublishSheet.js +1 -1
  104. package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
  105. package/lib/features/webbuilder/webbuilderPrompts.js +2 -5
  106. package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -1
  107. package/lib/index.js +1 -1
  108. package/lib/index.js.map +1 -1
  109. package/lib/screens/Health/index.js +12 -2
  110. package/lib/screens/Health/index.js.map +1 -1
  111. package/lib/screens/WebBuilderNative/sandboxProxyApi.js +120 -0
  112. package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -0
  113. package/lib/screens/WebBuilderNative/useRestoredSandboxes.js.map +1 -1
  114. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +26 -4
  115. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  116. package/lib/screens/WebBuilderNative/webbuilderTransport.js +110 -7
  117. package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
  118. package/package.json +6 -4
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect,useCallback}from'react';import {StyleSheet,View,Text,Pressable,ActivityIndicator,Linking,Share,ScrollView}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Image}from'expo-image';import {friendlyMediaError}from'../canvas/videoEditor/mediaActions.js';import {createRemoteRunAction,createRemoteUploadMedia}from'../canvas/videoEditor/remoteMediaClient.js';import {frameForUpload,newBoardId,buildBoardState}from'../canvas/canvasCore.js';import {fetchMyCanvasBoards,pushCanvasBoard,newBoardChannelId}from'../canvas/surfaceIndex.js';import {newDesignDoc,newDesignChannelId,designSignature,buildDesignState,parseDesignDoc}from'./designCore.js';import {fetchMyDesigns,pushDesignDoc,defaultTitle}from'./designIndex.js';import {deriveBlankPixelUrl,renderDesignDoc}from'./exportDesign.js';import {DesignEditorExperience}from'./DesignEditorExperience.js';var __defProp = Object.defineProperty;
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect,useCallback}from'react';import {View,Text,ActivityIndicator,Linking,Share,ScrollView,StyleSheet}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Image}from'expo-image';import {friendlyMediaError}from'../canvas/videoEditor/mediaActions.js';import {createRemoteRunAction,createRemoteUploadMedia}from'../canvas/videoEditor/remoteMediaClient.js';import {newBoardId,buildBoardState,frameForUpload}from'../canvas/canvasCore.js';import {fetchMyCanvasBoards,pushCanvasBoard,newBoardChannelId}from'../canvas/surfaceIndex.js';import {useCanvasTheme,themedStyles}from'../canvas/canvasTheme.js';import {Pressable,SectionHeader,Skeleton,RADIUS,pressedStyle,SPACE,HIT,TYPE}from'../canvas/canvasUi.js';import {newDesignDoc,newDesignChannelId,designSignature,buildDesignState,parseDesignDoc}from'./designCore.js';import {fetchMyDesigns,pushDesignDoc,defaultTitle}from'./designIndex.js';import {deriveBlankPixelUrl,renderDesignDoc}from'./exportDesign.js';import {DesignEditorExperience}from'./DesignEditorExperience.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -28,6 +28,8 @@ function DesignExperience({
28
28
  runMediaAction,
29
29
  testID
30
30
  }) {
31
+ const theme = useCanvasTheme();
32
+ const styles = makeStyles(theme);
31
33
  const effectiveRunAction = useMemo(() => runMediaAction != null ? runMediaAction : token && indexUrl ? createRemoteRunAction(token, indexUrl) : void 0, [runMediaAction, token, indexUrl]);
32
34
  const effectiveUploadMedia = useMemo(() => uploadMedia != null ? uploadMedia : token && indexUrl ? createRemoteUploadMedia(token, indexUrl) : void 0, [uploadMedia, token, indexUrl]);
33
35
  const [designs, setDesigns] = useState([]);
@@ -192,7 +194,7 @@ function DesignExperience({
192
194
  /* @__PURE__ */ jsx(Text, { style: styles.overlayStage, numberOfLines: 4, children: exporting.error }),
193
195
  /* @__PURE__ */ jsx(Pressable, { onPress: () => setExporting(null), style: styles.overlayDismiss, children: /* @__PURE__ */ jsx(Text, { style: styles.overlayDismissLabel, children: "Dismiss" }) })
194
196
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
195
- /* @__PURE__ */ jsx(ActivityIndicator, { color: "#F7F7FA" }),
197
+ /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.foreground }),
196
198
  /* @__PURE__ */ jsx(Text, { style: styles.overlayStage, children: exporting.stage })
197
199
  ] }) }) }) : null,
198
200
  results ? /* @__PURE__ */ jsx(View, { style: styles.overlay, children: /* @__PURE__ */ jsxs(View, { style: styles.overlayCard, children: [
@@ -209,36 +211,42 @@ function DesignExperience({
209
211
  }), hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: styles.resultAction, children: "Share" }) })
210
212
  ] }, p.url)),
211
213
  /* @__PURE__ */ jsxs(Pressable, { onPress: () => void saveResultsToCanvas(), style: [styles.overlayCta, results.savedToCanvas && styles.overlayCtaDone], disabled: results.savedToCanvas, children: [
212
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: results.savedToCanvas ? "check" : "view-dashboard-outline", size: 15, color: "#0f172a" }),
213
- /* @__PURE__ */ jsx(Text, { style: styles.overlayCtaLabel, children: results.savedToCanvas ? "Saved to canvas" : "Save to canvas" })
214
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: results.savedToCanvas ? "check" : "view-dashboard-outline", size: 18, color: results.savedToCanvas ? theme.foreground : theme.primaryForeground }),
215
+ /* @__PURE__ */ jsx(Text, { style: [styles.overlayCtaLabel, results.savedToCanvas && styles.overlayCtaLabelDone], children: results.savedToCanvas ? "Saved to canvas" : "Save to canvas" })
214
216
  ] }),
215
217
  /* @__PURE__ */ jsx(Pressable, { onPress: () => setResults(null), style: styles.overlayDismiss, children: /* @__PURE__ */ jsx(Text, { style: styles.overlayDismissLabel, children: "Done" }) })
216
218
  ] }) }) : null
217
219
  ] });
218
220
  }
219
221
  return /* @__PURE__ */ jsxs(ScrollView, { style: styles.home, contentContainerStyle: styles.homeContent, testID, children: [
220
- /* @__PURE__ */ jsx(Text, { style: styles.homeTitle, children: "Design studio" }),
222
+ /* @__PURE__ */ jsx(Text, { style: styles.homeTitle, accessibilityRole: "header", children: "Design studio" }),
223
+ /* @__PURE__ */ jsx(SectionHeader, { title: "Start a design" }),
221
224
  /* @__PURE__ */ jsxs(View, { style: styles.templateRow, children: [
222
- /* @__PURE__ */ jsx(TemplateCard, { icon: "shape-square-plus", label: "Design", hint: "1080 \xD7 1080", onPress: () => setOpen({
225
+ /* @__PURE__ */ jsx(TemplateCard, { icon: "shape-square-plus", label: "Design", hint: "1080 \xD7 1080", shape: "design", onPress: () => setOpen({
223
226
  channelId: newDesignChannelId(),
224
227
  doc: newDesignDoc("design")
225
228
  }) }),
226
- /* @__PURE__ */ jsx(TemplateCard, { icon: "tshirt-crew-outline", label: "T-shirt", hint: "Front & back", onPress: () => setOpen({
229
+ /* @__PURE__ */ jsx(TemplateCard, { icon: "tshirt-crew-outline", label: "T-shirt", hint: "Front & back", shape: "tshirt", onPress: () => setOpen({
227
230
  channelId: newDesignChannelId(),
228
231
  doc: newDesignDoc("tshirt")
229
232
  }) }),
230
- /* @__PURE__ */ jsx(TemplateCard, { icon: "email-outline", label: "Postcard", hint: "Front & back", onPress: () => setOpen({
233
+ /* @__PURE__ */ jsx(TemplateCard, { icon: "email-outline", label: "Postcard", hint: "Front & back", shape: "postcard", onPress: () => setOpen({
231
234
  channelId: newDesignChannelId(),
232
235
  doc: newDesignDoc("postcard")
233
236
  }) }),
234
- /* @__PURE__ */ jsx(TemplateCard, { icon: "view-carousel-outline", label: "Carousel", hint: "3 slides", onPress: () => setOpen({
237
+ /* @__PURE__ */ jsx(TemplateCard, { icon: "view-carousel-outline", label: "Carousel", hint: "3 slides", shape: "carousel", onPress: () => setOpen({
235
238
  channelId: newDesignChannelId(),
236
239
  doc: newDesignDoc("carousel")
237
240
  }) })
238
241
  ] }),
239
- loading ? /* @__PURE__ */ jsx(ActivityIndicator, { style: styles.homeSpinner }) : error ? /* @__PURE__ */ jsx(Text, { style: styles.homeError, children: error }) : designs.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
240
- /* @__PURE__ */ jsx(Text, { style: styles.homeSection, children: "Your designs" }),
241
- designs.map((d) => /* @__PURE__ */ jsxs(Pressable, { style: styles.designRow, onPress: () => {
242
+ loading ? /* @__PURE__ */ jsx(View, { style: styles.designGrid, children: [0, 1].map((i) => /* @__PURE__ */ jsxs(View, { style: styles.designTile, children: [
243
+ /* @__PURE__ */ jsx(View, { style: styles.designCover, children: /* @__PURE__ */ jsx(Skeleton, { radius: RADIUS.lg }) }),
244
+ /* @__PURE__ */ jsx(Skeleton, { style: styles.skeletonLine, radius: 4 })
245
+ ] }, i)) }) : error ? /* @__PURE__ */ jsx(Text, { style: styles.homeError, children: error }) : designs.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
246
+ /* @__PURE__ */ jsx(SectionHeader, { title: "Your designs", detail: String(designs.length), style: styles.sectionGap }),
247
+ /* @__PURE__ */ jsx(View, { style: styles.designGrid, children: designs.map((d) => /* @__PURE__ */ jsxs(Pressable, { style: ({
248
+ pressed
249
+ }) => [styles.designTile, pressedStyle(pressed)], onPress: () => {
242
250
  var _a;
243
251
  const doc = (_a = parseDesignDoc(d.doc)) != null ? _a : d.doc;
244
252
  setOpen({
@@ -246,199 +254,348 @@ function DesignExperience({
246
254
  doc
247
255
  });
248
256
  }, children: [
249
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: d.doc.kind === "tshirt" ? "tshirt-crew-outline" : d.doc.kind === "postcard" ? "email-outline" : d.doc.kind === "carousel" ? "view-carousel-outline" : "shape-square-plus", size: 20, color: "#475569" }),
250
- /* @__PURE__ */ jsxs(View, { style: styles.designMeta, children: [
251
- /* @__PURE__ */ jsx(Text, { style: styles.designTitle, children: d.title || defaultTitle(d.doc) }),
252
- /* @__PURE__ */ jsxs(Text, { style: styles.designSub, children: [
253
- d.doc.pages.length,
254
- " page",
255
- d.doc.pages.length === 1 ? "" : "s",
256
- " \xB7",
257
- " ",
258
- d.doc.pages.reduce((n, p) => n + p.layers.length, 0),
259
- " layers"
260
- ] })
261
- ] }),
262
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-right", size: 20, color: "#94a3b8" })
263
- ] }, d.channelId))
264
- ] }) : /* @__PURE__ */ jsx(Text, { style: styles.homeHint, children: "Pick a template to start - designs save automatically." })
257
+ /* @__PURE__ */ jsx(View, { style: styles.designCover, children: /* @__PURE__ */ jsx(DesignPreview, { doc: d.doc }) }),
258
+ /* @__PURE__ */ jsx(Text, { style: styles.designTitle, numberOfLines: 1, children: d.title || defaultTitle(d.doc) }),
259
+ /* @__PURE__ */ jsxs(Text, { style: styles.designSub, numberOfLines: 1, children: [
260
+ d.doc.pages.length,
261
+ " page",
262
+ d.doc.pages.length === 1 ? "" : "s",
263
+ " \xB7",
264
+ " ",
265
+ d.doc.pages.reduce((n, p) => n + p.layers.length, 0),
266
+ " layers"
267
+ ] })
268
+ ] }, d.channelId)) })
269
+ ] }) : /* @__PURE__ */ jsx(Text, { style: styles.homeHint, children: "Pick a template to start. Designs save automatically." })
265
270
  ] });
266
271
  }
267
272
  function TemplateCard({
268
273
  icon,
269
274
  label,
270
275
  hint,
276
+ shape,
271
277
  onPress
272
278
  }) {
273
- return /* @__PURE__ */ jsxs(Pressable, { onPress, style: styles.templateCard, accessibilityRole: "button", children: [
274
- /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 26, color: "#0f172a" }),
279
+ const theme = useCanvasTheme();
280
+ const styles = makeStyles(theme);
281
+ return /* @__PURE__ */ jsxs(Pressable, { onPress, style: ({
282
+ pressed
283
+ }) => [styles.templateCard, pressedStyle(pressed)], accessibilityRole: "button", children: [
284
+ /* @__PURE__ */ jsx(View, { style: styles.templateCover, children: shape === "design" ? (
285
+ // The everyday start: the one lime action on the home.
286
+ /* @__PURE__ */ jsx(View, { style: styles.newPlus, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "plus", size: 24, color: theme.primaryForeground }) })
287
+ ) : shape === "tshirt" ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 56, color: theme.mutedForeground }) : shape === "postcard" ? /* @__PURE__ */ jsx(View, { style: [styles.sketchPage, {
288
+ width: "72%",
289
+ aspectRatio: 1.5
290
+ }], children: /* @__PURE__ */ jsx(SketchBars, {}) }) : /* @__PURE__ */ jsxs(View, { style: styles.carouselStack, children: [
291
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchPage, styles.carouselBack] }),
292
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchPage, styles.carouselFront], children: /* @__PURE__ */ jsx(SketchBars, {}) })
293
+ ] }) }),
275
294
  /* @__PURE__ */ jsx(Text, { style: styles.templateLabel, children: label }),
276
295
  /* @__PURE__ */ jsx(Text, { style: styles.templateHint, children: hint })
277
296
  ] });
278
297
  }
279
- const styles = StyleSheet.create({
298
+ function SketchBars({
299
+ label
300
+ }) {
301
+ const styles = makeStyles(useCanvasTheme());
302
+ return /* @__PURE__ */ jsxs(View, { style: styles.sketch, children: [
303
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchBar, {
304
+ width: "62%",
305
+ height: "9%"
306
+ }] }),
307
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchBar, {
308
+ width: "86%",
309
+ height: "5%"
310
+ }] }),
311
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchBar, {
312
+ width: "70%",
313
+ height: "5%"
314
+ }] }),
315
+ /* @__PURE__ */ jsx(View, { style: [styles.sketchBar, styles.sketchBlock], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "image-outline", size: 14, color: "#b4b4bb" }) }),
316
+ label ? /* @__PURE__ */ jsx(Text, { style: styles.sketchLabel, children: label }) : null
317
+ ] });
318
+ }
319
+ const PREVIEW_BOX = 120;
320
+ function DesignPreview({
321
+ doc
322
+ }) {
323
+ const theme = useCanvasTheme();
324
+ const styles = makeStyles(theme);
325
+ const page = doc.pages[0];
326
+ if (!page || !(page.width > 0) || !(page.height > 0)) {
327
+ return /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "shape-outline", size: 28, color: theme.mutedForeground });
328
+ }
329
+ const scale = Math.min(PREVIEW_BOX / page.width, PREVIEW_BOX / page.height);
330
+ const layers = [...page.layers].sort((a, b) => a.zIndex - b.zIndex);
331
+ return /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [styles.previewPage, {
332
+ width: page.width * scale,
333
+ height: page.height * scale,
334
+ backgroundColor: page.background || "#ffffff"
335
+ }], children: layers.length === 0 ? /* @__PURE__ */ jsx(SketchBars, { label: defaultTitle(doc) }) : layers.map((layer) => {
336
+ const box = {
337
+ position: "absolute",
338
+ left: layer.x * scale,
339
+ top: layer.y * scale,
340
+ width: layer.width * scale,
341
+ height: layer.height * scale,
342
+ opacity: layer.opacity
343
+ };
344
+ if (layer.type === "image") {
345
+ return /* @__PURE__ */ jsx(Image, { source: {
346
+ uri: layer.src
347
+ }, style: box, contentFit: "cover" }, layer.id);
348
+ }
349
+ if (layer.type === "shape") {
350
+ return /* @__PURE__ */ jsx(View, { style: [box, {
351
+ backgroundColor: layer.fill,
352
+ borderRadius: layer.cornerRadius * scale
353
+ }] }, layer.id);
354
+ }
355
+ return /* @__PURE__ */ jsx(Text, { numberOfLines: 3, style: [box, {
356
+ color: layer.color,
357
+ fontSize: Math.max(4, layer.fontSize * scale),
358
+ lineHeight: Math.max(5, layer.fontSize * scale * 1.15),
359
+ fontWeight: layer.bold ? "700" : "400",
360
+ textAlign: layer.align
361
+ }], children: layer.text }, layer.id);
362
+ }) });
363
+ }
364
+ const GUTTER = SPACE.lg + 4;
365
+ const makeStyles = themedStyles((theme) => StyleSheet.create({
280
366
  fill: {
281
367
  flex: 1
282
368
  },
283
369
  overlay: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
284
- backgroundColor: "rgba(0,0,0,0.65)",
370
+ backgroundColor: "rgba(0,0,0,0.55)",
285
371
  alignItems: "center",
286
372
  justifyContent: "center",
287
- padding: 28
373
+ padding: SPACE.xl
288
374
  }),
289
375
  overlayCard: {
290
376
  width: "100%",
291
377
  maxWidth: 360,
292
378
  alignItems: "center",
293
- gap: 10,
294
- backgroundColor: "#17171C",
295
- borderRadius: 16,
296
- paddingVertical: 20,
297
- paddingHorizontal: 20
298
- },
299
- overlayTitle: {
300
- fontSize: 16,
301
- fontWeight: "600",
302
- color: "#F7F7FA"
379
+ gap: SPACE.md,
380
+ backgroundColor: theme.surface,
381
+ borderRadius: RADIUS.xl,
382
+ paddingVertical: SPACE.xl,
383
+ paddingHorizontal: SPACE.xl - 4
303
384
  },
304
- overlayStage: {
305
- fontSize: 13,
306
- color: "#CBD5E1",
385
+ overlayTitle: __spreadProps(__spreadValues({}, TYPE.title), {
386
+ color: theme.foreground
387
+ }),
388
+ overlayStage: __spreadProps(__spreadValues({}, TYPE.label), {
389
+ fontWeight: "500",
390
+ color: theme.mutedForeground,
307
391
  textAlign: "center"
308
- },
309
- overlayError: {
310
- fontSize: 15,
311
- fontWeight: "600",
312
- color: "#F87171"
313
- },
392
+ }),
393
+ overlayError: __spreadProps(__spreadValues({}, TYPE.title), {
394
+ color: theme.destructiveText
395
+ }),
314
396
  overlayDismiss: {
315
- marginTop: 4,
316
- paddingHorizontal: 14,
317
- paddingVertical: 8
318
- },
319
- overlayDismissLabel: {
320
- fontSize: 13,
321
- fontWeight: "600",
322
- color: "#A5B4FC"
397
+ minHeight: HIT,
398
+ paddingHorizontal: SPACE.lg,
399
+ alignItems: "center",
400
+ justifyContent: "center"
323
401
  },
402
+ overlayDismissLabel: __spreadProps(__spreadValues({}, TYPE.label), {
403
+ fontSize: 15,
404
+ color: theme.foreground
405
+ }),
324
406
  overlayCta: {
325
- marginTop: 6,
407
+ marginTop: SPACE.xs,
408
+ alignSelf: "stretch",
409
+ minHeight: HIT,
326
410
  flexDirection: "row",
327
411
  alignItems: "center",
328
- gap: 6,
329
- backgroundColor: "#A5B4FC",
330
- borderRadius: 16,
331
- paddingHorizontal: 16,
332
- paddingVertical: 9
412
+ justifyContent: "center",
413
+ gap: SPACE.sm,
414
+ backgroundColor: theme.primary,
415
+ borderRadius: RADIUS.pill,
416
+ paddingHorizontal: SPACE.lg
333
417
  },
334
418
  overlayCtaDone: {
335
- backgroundColor: "#86EFAC"
419
+ backgroundColor: theme.card
336
420
  },
337
- overlayCtaLabel: {
338
- fontSize: 13,
339
- fontWeight: "600",
340
- color: "#0f172a"
421
+ overlayCtaLabel: __spreadProps(__spreadValues({}, TYPE.label), {
422
+ fontSize: 15,
423
+ color: theme.primaryForeground
424
+ }),
425
+ overlayCtaLabelDone: {
426
+ color: theme.foreground
341
427
  },
342
428
  resultRow: {
343
429
  flexDirection: "row",
344
430
  alignItems: "center",
345
- gap: 10,
431
+ gap: SPACE.md,
346
432
  alignSelf: "stretch"
347
433
  },
348
434
  resultThumb: {
349
- width: 44,
350
- height: 44,
351
- borderRadius: 8,
352
- backgroundColor: "#26262E"
435
+ width: 48,
436
+ height: 48,
437
+ borderRadius: RADIUS.sm,
438
+ backgroundColor: theme.card
353
439
  },
354
- resultName: {
440
+ resultName: __spreadProps(__spreadValues({}, TYPE.label), {
355
441
  flex: 1,
356
- fontSize: 13,
357
- color: "#E2E8F0"
358
- },
359
- resultAction: {
360
- fontSize: 13,
361
- fontWeight: "600",
362
- color: "#A5B4FC",
363
- paddingHorizontal: 6
364
- },
442
+ color: theme.foreground
443
+ }),
444
+ resultAction: __spreadProps(__spreadValues({}, TYPE.label), {
445
+ color: theme.mutedForeground,
446
+ paddingHorizontal: SPACE.xs + 2
447
+ }),
365
448
  home: {
366
449
  flex: 1,
367
- backgroundColor: "#eef1f4"
450
+ backgroundColor: theme.background
368
451
  },
369
452
  homeContent: {
370
- padding: 20,
371
- gap: 12
453
+ paddingHorizontal: GUTTER,
454
+ paddingTop: SPACE.lg,
455
+ paddingBottom: SPACE.xxl
372
456
  },
373
- homeTitle: {
374
- fontSize: 20,
375
- fontWeight: "600",
376
- color: "#0f172a"
457
+ homeTitle: __spreadProps(__spreadValues({}, TYPE.heading), {
458
+ color: theme.foreground,
459
+ marginBottom: SPACE.xl - 4
460
+ }),
461
+ sectionGap: {
462
+ marginTop: SPACE.xl
377
463
  },
378
464
  templateRow: {
379
465
  flexDirection: "row",
380
- gap: 12
466
+ flexWrap: "wrap",
467
+ columnGap: SPACE.md,
468
+ rowGap: SPACE.lg
381
469
  },
382
470
  templateCard: {
383
- flex: 1,
471
+ flexBasis: "46%",
472
+ flexGrow: 1
473
+ },
474
+ templateCover: {
475
+ aspectRatio: 1.25,
476
+ borderRadius: RADIUS.lg,
477
+ overflow: "hidden",
478
+ backgroundColor: theme.card,
384
479
  alignItems: "center",
385
- gap: 4,
386
- backgroundColor: "#ffffff",
387
- borderRadius: 14,
388
- borderWidth: 1,
389
- borderColor: "rgba(15,23,42,0.08)",
390
- paddingVertical: 18
480
+ justifyContent: "center",
481
+ marginBottom: SPACE.sm
391
482
  },
392
- templateLabel: {
393
- fontSize: 14,
394
- fontWeight: "600",
395
- color: "#0f172a"
483
+ newPlus: {
484
+ width: 48,
485
+ height: 48,
486
+ borderRadius: 24,
487
+ alignItems: "center",
488
+ justifyContent: "center",
489
+ backgroundColor: theme.primary
396
490
  },
397
- templateHint: {
398
- fontSize: 11,
399
- color: "#94a3b8"
491
+ // Sketch pages are paper, not chrome: fixed white with a soft lift.
492
+ sketchPage: {
493
+ backgroundColor: "#ffffff",
494
+ borderRadius: 3,
495
+ overflow: "hidden",
496
+ shadowColor: "#000",
497
+ shadowOpacity: theme.isDark ? 0 : 0.1,
498
+ shadowRadius: 6,
499
+ shadowOffset: {
500
+ width: 0,
501
+ height: 2
502
+ },
503
+ elevation: 2
400
504
  },
401
- homeSection: {
402
- marginTop: 8,
403
- fontSize: 13,
404
- fontWeight: "600",
405
- color: "#475569"
505
+ carouselStack: {
506
+ width: "52%",
507
+ aspectRatio: 1
406
508
  },
407
- homeSpinner: {
408
- marginTop: 24
509
+ carouselBack: {
510
+ position: "absolute",
511
+ top: -6,
512
+ left: 10,
513
+ right: -10,
514
+ bottom: 6,
515
+ opacity: theme.isDark ? 0.35 : 0.7
409
516
  },
410
- homeError: {
411
- marginTop: 16,
412
- fontSize: 13,
413
- color: "#b91c1c"
517
+ carouselFront: __spreadValues({}, StyleSheet.absoluteFillObject),
518
+ sketch: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
519
+ padding: "10%",
520
+ gap: 5
521
+ }),
522
+ sketchBar: {
523
+ borderRadius: 3,
524
+ backgroundColor: "#ececef"
414
525
  },
415
- homeHint: {
416
- marginTop: 12,
417
- fontSize: 13,
418
- color: "#64748b"
526
+ sketchBlock: {
527
+ flex: 1,
528
+ width: "100%",
529
+ marginTop: 3,
530
+ alignItems: "center",
531
+ justifyContent: "center"
419
532
  },
420
- designRow: {
533
+ sketchLabel: {
534
+ fontSize: 10,
535
+ fontWeight: "600",
536
+ color: "#a1a1aa",
537
+ textAlign: "center"
538
+ },
539
+ templateLabel: __spreadProps(__spreadValues({}, TYPE.label), {
540
+ fontSize: 14,
541
+ color: theme.foreground
542
+ }),
543
+ templateHint: __spreadProps(__spreadValues({}, TYPE.caption), {
544
+ marginTop: 1,
545
+ color: theme.mutedForeground
546
+ }),
547
+ homeError: __spreadProps(__spreadValues({}, TYPE.label), {
548
+ fontWeight: "500",
549
+ marginTop: SPACE.xl,
550
+ color: theme.destructiveText
551
+ }),
552
+ homeHint: __spreadProps(__spreadValues({}, TYPE.label), {
553
+ fontWeight: "500",
554
+ marginTop: SPACE.xl,
555
+ color: theme.mutedForeground
556
+ }),
557
+ designGrid: {
421
558
  flexDirection: "row",
559
+ flexWrap: "wrap",
560
+ columnGap: SPACE.md,
561
+ rowGap: SPACE.lg
562
+ },
563
+ designTile: {
564
+ flexBasis: "46%",
565
+ flexGrow: 1,
566
+ maxWidth: "50%"
567
+ },
568
+ designCover: {
569
+ aspectRatio: 1,
570
+ borderRadius: RADIUS.lg,
571
+ overflow: "hidden",
572
+ backgroundColor: theme.card,
422
573
  alignItems: "center",
423
- gap: 12,
424
- backgroundColor: "#ffffff",
425
- borderRadius: 12,
426
- borderWidth: 1,
427
- borderColor: "rgba(15,23,42,0.08)",
428
- paddingHorizontal: 14,
429
- paddingVertical: 12
574
+ justifyContent: "center",
575
+ marginBottom: SPACE.sm
430
576
  },
431
- designMeta: {
432
- flex: 1
577
+ previewPage: {
578
+ overflow: "hidden",
579
+ borderRadius: 3,
580
+ shadowColor: "#000",
581
+ shadowOpacity: theme.isDark ? 0 : 0.1,
582
+ shadowRadius: 6,
583
+ shadowOffset: {
584
+ width: 0,
585
+ height: 2
586
+ },
587
+ elevation: 2
433
588
  },
434
- designTitle: {
435
- fontSize: 14,
436
- fontWeight: "600",
437
- color: "#0f172a"
589
+ skeletonLine: {
590
+ height: 12,
591
+ width: "60%"
438
592
  },
439
- designSub: {
440
- marginTop: 2,
441
- fontSize: 11,
442
- color: "#94a3b8"
443
- }
444
- });export{DesignExperience};//# sourceMappingURL=DesignExperience.js.map
593
+ designTitle: __spreadProps(__spreadValues({}, TYPE.label), {
594
+ fontSize: 14,
595
+ color: theme.foreground
596
+ }),
597
+ designSub: __spreadProps(__spreadValues({}, TYPE.caption), {
598
+ marginTop: 1,
599
+ color: theme.mutedForeground
600
+ })
601
+ }));export{DesignExperience};//# sourceMappingURL=DesignExperience.js.map