@adminide-stack/yantra-mobile 12.0.129-alpha.0 → 12.0.129

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 (360) hide show
  1. package/lib/compute.js +57 -1
  2. package/lib/compute.js.map +1 -1
  3. package/lib/features/agent-chat/NativeAgentChat.js +3 -2
  4. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  5. package/lib/features/apps/AppsCatalog.js +10 -0
  6. package/lib/features/apps/AppsCatalog.js.map +1 -1
  7. package/lib/features/apps/mobileAppCatalog.js +11 -0
  8. package/lib/features/apps/mobileAppCatalog.js.map +1 -1
  9. package/lib/features/canvas/AudioEditorExperience.js +448 -105
  10. package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
  11. package/lib/features/canvas/CanvasAgentChatPane.js +33 -14
  12. package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
  13. package/lib/features/canvas/CanvasBoardsGrid.js +493 -41
  14. package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
  15. package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
  16. package/lib/features/canvas/CanvasEditToolsPanel.js +37 -1
  17. package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
  18. package/lib/features/canvas/CanvasExperience.js +237 -22
  19. package/lib/features/canvas/CanvasExperience.js.map +1 -1
  20. package/lib/features/canvas/CanvasGeneratePanel.js +119 -26
  21. package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
  22. package/lib/features/canvas/CanvasLooksPanel.js +17 -6
  23. package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
  24. package/lib/features/canvas/CanvasTasksPanel.js +18 -1
  25. package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
  26. package/lib/features/canvas/DesignCategoryGallery.js +423 -0
  27. package/lib/features/canvas/DesignCategoryGallery.js.map +1 -0
  28. package/lib/features/canvas/ImageEditorExperience.js +763 -187
  29. package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
  30. package/lib/features/canvas/SetStudioExperience.js +199 -11
  31. package/lib/features/canvas/SetStudioExperience.js.map +1 -1
  32. package/lib/features/canvas/VideoEditorExperience.js +59 -40
  33. package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
  34. package/lib/features/canvas/VideoGeneratorExperience.js +134 -34
  35. package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
  36. package/lib/features/canvas/aiEdit.js +4 -2
  37. package/lib/features/canvas/aiEdit.js.map +1 -1
  38. package/lib/features/canvas/audioEditor/AudioWaveform.js +96 -0
  39. package/lib/features/canvas/audioEditor/AudioWaveform.js.map +1 -0
  40. package/lib/features/canvas/audioEditor/audioPeaks.js +93 -0
  41. package/lib/features/canvas/audioEditor/audioPeaks.js.map +1 -0
  42. package/lib/features/canvas/canvasTaskSync.js +34 -7
  43. package/lib/features/canvas/canvasTaskSync.js.map +1 -1
  44. package/lib/features/canvas/canvasTasks.js +23 -3
  45. package/lib/features/canvas/canvasTasks.js.map +1 -1
  46. package/lib/features/canvas/canvasTheme.js +10 -24
  47. package/lib/features/canvas/canvasTheme.js.map +1 -1
  48. package/lib/features/canvas/canvasUi.js +1 -1
  49. package/lib/features/canvas/canvasUi.js.map +1 -1
  50. package/lib/features/canvas/createTiles.js +17 -9
  51. package/lib/features/canvas/createTiles.js.map +1 -1
  52. package/lib/features/canvas/deepLinks.js +35 -5
  53. package/lib/features/canvas/deepLinks.js.map +1 -1
  54. package/lib/features/canvas/designCatalog.js +165 -0
  55. package/lib/features/canvas/designCatalog.js.map +1 -0
  56. package/lib/features/canvas/designCategories.js +262 -0
  57. package/lib/features/canvas/designCategories.js.map +1 -0
  58. package/lib/features/canvas/editorControls.js +406 -0
  59. package/lib/features/canvas/editorControls.js.map +1 -0
  60. package/lib/features/canvas/generationModels.js +5 -3
  61. package/lib/features/canvas/generationModels.js.map +1 -1
  62. package/lib/features/canvas/generationTasks.js +162 -0
  63. package/lib/features/canvas/generationTasks.js.map +1 -0
  64. package/lib/features/canvas/generator/BottomSheet.js +167 -0
  65. package/lib/features/canvas/generator/BottomSheet.js.map +1 -0
  66. package/lib/features/canvas/generator/BusinessCardChatCard.js +155 -0
  67. package/lib/features/canvas/generator/BusinessCardChatCard.js.map +1 -0
  68. package/lib/features/canvas/generator/DirectorSheet.js +163 -0
  69. package/lib/features/canvas/generator/DirectorSheet.js.map +1 -0
  70. package/lib/features/canvas/generator/ReframePreview.js +122 -0
  71. package/lib/features/canvas/generator/ReframePreview.js.map +1 -0
  72. package/lib/features/canvas/generator/RunLogCard.js +119 -0
  73. package/lib/features/canvas/generator/RunLogCard.js.map +1 -0
  74. package/lib/features/canvas/generator/ShotPanel.js +261 -0
  75. package/lib/features/canvas/generator/ShotPanel.js.map +1 -0
  76. package/lib/features/canvas/generator/businessCardWidget.js +117 -0
  77. package/lib/features/canvas/generator/businessCardWidget.js.map +1 -0
  78. package/lib/features/canvas/generator/cameraVocabulary.js +142 -0
  79. package/lib/features/canvas/generator/cameraVocabulary.js.map +1 -0
  80. package/lib/features/canvas/generator/cinematicVocabulary.js +416 -0
  81. package/lib/features/canvas/generator/cinematicVocabulary.js.map +1 -0
  82. package/lib/features/canvas/generator/direction.js +41 -0
  83. package/lib/features/canvas/generator/direction.js.map +1 -0
  84. package/lib/features/canvas/generator/reframeGeometry.js +108 -0
  85. package/lib/features/canvas/generator/reframeGeometry.js.map +1 -0
  86. package/lib/features/canvas/generator/runLog.js +71 -0
  87. package/lib/features/canvas/generator/runLog.js.map +1 -0
  88. package/lib/features/canvas/generator/shot.js +133 -0
  89. package/lib/features/canvas/generator/shot.js.map +1 -0
  90. package/lib/features/canvas/generator/useShotSpec.js +87 -0
  91. package/lib/features/canvas/generator/useShotSpec.js.map +1 -0
  92. package/lib/features/canvas/home/HeroComposer.js +214 -0
  93. package/lib/features/canvas/home/HeroComposer.js.map +1 -0
  94. package/lib/features/canvas/home/HeroMonitor.js +225 -0
  95. package/lib/features/canvas/home/HeroMonitor.js.map +1 -0
  96. package/lib/features/canvas/home/LookDetail.js +185 -0
  97. package/lib/features/canvas/home/LookDetail.js.map +1 -0
  98. package/lib/features/canvas/home/LoopingVideo.js +37 -0
  99. package/lib/features/canvas/home/LoopingVideo.js.map +1 -0
  100. package/lib/features/canvas/home/TemplatesGallery.js +253 -0
  101. package/lib/features/canvas/home/TemplatesGallery.js.map +1 -0
  102. package/lib/features/canvas/home/heroShots.js +100 -0
  103. package/lib/features/canvas/home/heroShots.js.map +1 -0
  104. package/lib/features/canvas/homeWork.js +62 -3
  105. package/lib/features/canvas/homeWork.js.map +1 -1
  106. package/lib/features/canvas/imageEditor/ImageMarkup.js +195 -0
  107. package/lib/features/canvas/imageEditor/ImageMarkup.js.map +1 -0
  108. package/lib/features/canvas/imageEditor/imageEditOps.js +367 -0
  109. package/lib/features/canvas/imageEditor/imageEditOps.js.map +1 -0
  110. package/lib/features/canvas/nativeViewerRegistry.js.map +1 -1
  111. package/lib/features/canvas/rankedCatalogSearch.js +375 -0
  112. package/lib/features/canvas/rankedCatalogSearch.js.map +1 -0
  113. package/lib/features/canvas/recorder/CameraRecorderExperience.js +68 -20
  114. package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
  115. package/lib/features/canvas/recorder/RecordingReview.js +272 -0
  116. package/lib/features/canvas/recorder/RecordingReview.js.map +1 -0
  117. package/lib/features/canvas/recorder/RecordingsList.js +179 -0
  118. package/lib/features/canvas/recorder/RecordingsList.js.map +1 -0
  119. package/lib/features/canvas/recorder/recorderOps.js +99 -0
  120. package/lib/features/canvas/recorder/recorderOps.js.map +1 -0
  121. package/lib/features/canvas/seedanceShowcase.js +314 -0
  122. package/lib/features/canvas/seedanceShowcase.js.map +1 -0
  123. package/lib/features/canvas/serverTasks.js +149 -15
  124. package/lib/features/canvas/serverTasks.js.map +1 -1
  125. package/lib/features/canvas/sessionRenewal.js +114 -0
  126. package/lib/features/canvas/sessionRenewal.js.map +1 -0
  127. package/lib/features/canvas/set/SetViewportWebView.js +34 -1
  128. package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
  129. package/lib/features/canvas/set/agent/setTurn.js +4 -2
  130. package/lib/features/canvas/set/agent/setTurn.js.map +1 -1
  131. package/lib/features/canvas/set/setPresets.js +85 -0
  132. package/lib/features/canvas/set/setPresets.js.map +1 -0
  133. package/lib/features/canvas/set/setProject.js +4 -1
  134. package/lib/features/canvas/set/setProject.js.map +1 -1
  135. package/lib/features/canvas/studioCatalog.js +59 -4
  136. package/lib/features/canvas/studioCatalog.js.map +1 -1
  137. package/lib/features/canvas/studioLooks.js +31 -4
  138. package/lib/features/canvas/studioLooks.js.map +1 -1
  139. package/lib/features/canvas/surfaceIndex.js +1 -14
  140. package/lib/features/canvas/surfaceIndex.js.map +1 -1
  141. package/lib/features/canvas/templateSearch.js +489 -0
  142. package/lib/features/canvas/templateSearch.js.map +1 -0
  143. package/lib/features/canvas/useCanvasSession.js +28 -6
  144. package/lib/features/canvas/useCanvasSession.js.map +1 -1
  145. package/lib/features/canvas/useStudioCatalogTemplates.js +41 -5
  146. package/lib/features/canvas/useStudioCatalogTemplates.js.map +1 -1
  147. package/lib/features/canvas/videoEditor/EditorPanels.js +531 -0
  148. package/lib/features/canvas/videoEditor/EditorPanels.js.map +1 -0
  149. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +48 -4
  150. package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
  151. package/lib/features/canvas/videoEditor/agent/agentLoop.js +2 -0
  152. package/lib/features/canvas/videoEditor/agent/agentLoop.js.map +1 -1
  153. package/lib/features/canvas/videoEditor/agent/brainClient.js +97 -27
  154. package/lib/features/canvas/videoEditor/agent/brainClient.js.map +1 -1
  155. package/lib/features/canvas/videoEditor/agent/cutTools.js +707 -3
  156. package/lib/features/canvas/videoEditor/agent/cutTools.js.map +1 -1
  157. package/lib/features/canvas/videoEditor/audioServices.js +165 -0
  158. package/lib/features/canvas/videoEditor/audioServices.js.map +1 -0
  159. package/lib/features/canvas/videoEditor/captions.js +144 -0
  160. package/lib/features/canvas/videoEditor/captions.js.map +1 -0
  161. package/lib/features/canvas/videoEditor/compileTimeline.js +24 -16
  162. package/lib/features/canvas/videoEditor/compileTimeline.js.map +1 -1
  163. package/lib/features/canvas/videoEditor/editorModel.js +12 -2
  164. package/lib/features/canvas/videoEditor/editorModel.js.map +1 -1
  165. package/lib/features/canvas/videoEditor/exportTask.js +89 -7
  166. package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
  167. package/lib/features/canvas/videoEditor/layers.js +117 -0
  168. package/lib/features/canvas/videoEditor/layers.js.map +1 -0
  169. package/lib/features/canvas/videoEditor/remoteMediaClient.js +45 -18
  170. package/lib/features/canvas/videoEditor/remoteMediaClient.js.map +1 -1
  171. package/lib/features/canvas/videoEditor/renderTimeline.js +18 -6
  172. package/lib/features/canvas/videoEditor/renderTimeline.js.map +1 -1
  173. package/lib/features/canvas/videoEditor/revoice.js +138 -0
  174. package/lib/features/canvas/videoEditor/revoice.js.map +1 -0
  175. package/lib/features/canvas/videoEditor/storageUpload.js +34 -0
  176. package/lib/features/canvas/videoEditor/storageUpload.js.map +1 -0
  177. package/lib/features/canvas/videoEditor/textMotion.js +109 -0
  178. package/lib/features/canvas/videoEditor/textMotion.js.map +1 -0
  179. package/lib/features/canvas/videoEditor/transitions.js +31 -0
  180. package/lib/features/canvas/videoEditor/transitions.js.map +1 -0
  181. package/lib/features/chat/TemplatesChatCards.js +8 -3
  182. package/lib/features/chat/TemplatesChatCards.js.map +1 -1
  183. package/lib/features/design/DesignEditorExperience.js +674 -644
  184. package/lib/features/design/DesignEditorExperience.js.map +1 -1
  185. package/lib/features/design/DesignExperience.js +285 -538
  186. package/lib/features/design/DesignExperience.js.map +1 -1
  187. package/lib/features/design/designCore.js +2 -212
  188. package/lib/features/design/designCore.js.map +1 -1
  189. package/lib/features/design/designIndex.js +1 -50
  190. package/lib/features/design/designIndex.js.map +1 -1
  191. package/lib/features/design/doc/aiDesign.js +247 -0
  192. package/lib/features/design/doc/aiDesign.js.map +1 -0
  193. package/lib/features/design/doc/artifacts.js +280 -0
  194. package/lib/features/design/doc/artifacts.js.map +1 -0
  195. package/lib/features/design/doc/chart.js +98 -0
  196. package/lib/features/design/doc/chart.js.map +1 -0
  197. package/lib/features/design/doc/crop.js +104 -0
  198. package/lib/features/design/doc/crop.js.map +1 -0
  199. package/lib/features/design/doc/curve.js +49 -0
  200. package/lib/features/design/doc/curve.js.map +1 -0
  201. package/lib/features/design/doc/docOps.js +397 -0
  202. package/lib/features/design/doc/docOps.js.map +1 -0
  203. package/lib/features/design/doc/findReplace.js +112 -0
  204. package/lib/features/design/doc/findReplace.js.map +1 -0
  205. package/lib/features/design/doc/fonts.js +79 -0
  206. package/lib/features/design/doc/fonts.js.map +1 -0
  207. package/lib/features/design/doc/frames.js +17 -0
  208. package/lib/features/design/doc/frames.js.map +1 -0
  209. package/lib/features/design/doc/geometry.js +133 -0
  210. package/lib/features/design/doc/geometry.js.map +1 -0
  211. package/lib/features/design/doc/imageAdjust.js +203 -0
  212. package/lib/features/design/doc/imageAdjust.js.map +1 -0
  213. package/lib/features/design/doc/legacyDoc.js +107 -0
  214. package/lib/features/design/doc/legacyDoc.js.map +1 -0
  215. package/lib/features/design/doc/newDoc.js +335 -0
  216. package/lib/features/design/doc/newDoc.js.map +1 -0
  217. package/lib/features/design/doc/pageRange.js +17 -0
  218. package/lib/features/design/doc/pageRange.js.map +1 -0
  219. package/lib/features/design/doc/pathScale.js +68 -0
  220. package/lib/features/design/doc/pathScale.js.map +1 -0
  221. package/lib/features/design/doc/qr.js +62 -0
  222. package/lib/features/design/doc/qr.js.map +1 -0
  223. package/lib/features/design/doc/shapes.js +366 -0
  224. package/lib/features/design/doc/shapes.js.map +1 -0
  225. package/lib/features/design/doc/sizes.js +230 -0
  226. package/lib/features/design/doc/sizes.js.map +1 -0
  227. package/lib/features/design/doc/textEffects.js +134 -0
  228. package/lib/features/design/doc/textEffects.js.map +1 -0
  229. package/lib/features/design/doc/textLayout.js +182 -0
  230. package/lib/features/design/doc/textLayout.js.map +1 -0
  231. package/lib/features/design/doc/types.js +30 -0
  232. package/lib/features/design/doc/types.js.map +1 -0
  233. package/lib/features/design/editor/AiPanel.js +194 -0
  234. package/lib/features/design/editor/AiPanel.js.map +1 -0
  235. package/lib/features/design/editor/ChartDataPanel.js +182 -0
  236. package/lib/features/design/editor/ChartDataPanel.js.map +1 -0
  237. package/lib/features/design/editor/CropOverlay.js +199 -0
  238. package/lib/features/design/editor/CropOverlay.js.map +1 -0
  239. package/lib/features/design/editor/DesignCanvas.js +363 -0
  240. package/lib/features/design/editor/DesignCanvas.js.map +1 -0
  241. package/lib/features/design/editor/ExportSheet.js +123 -0
  242. package/lib/features/design/editor/ExportSheet.js.map +1 -0
  243. package/lib/features/design/editor/FindReplacePanel.js +93 -0
  244. package/lib/features/design/editor/FindReplacePanel.js.map +1 -0
  245. package/lib/features/design/editor/ImageTools.js +188 -0
  246. package/lib/features/design/editor/ImageTools.js.map +1 -0
  247. package/lib/features/design/editor/LayerTools.js +485 -0
  248. package/lib/features/design/editor/LayerTools.js.map +1 -0
  249. package/lib/features/design/editor/PageStrip.js +203 -0
  250. package/lib/features/design/editor/PageStrip.js.map +1 -0
  251. package/lib/features/design/editor/Slideshow.js +97 -0
  252. package/lib/features/design/editor/Slideshow.js.map +1 -0
  253. package/lib/features/design/editor/ToolPanels.js +695 -0
  254. package/lib/features/design/editor/ToolPanels.js.map +1 -0
  255. package/lib/features/design/editor/controls.js +630 -0
  256. package/lib/features/design/editor/controls.js.map +1 -0
  257. package/lib/features/design/editor/useDesignSave.js +91 -0
  258. package/lib/features/design/editor/useDesignSave.js.map +1 -0
  259. package/lib/features/design/export/exportDesign.js +170 -0
  260. package/lib/features/design/export/exportDesign.js.map +1 -0
  261. package/lib/features/design/export/pdf.js +143 -0
  262. package/lib/features/design/export/pdf.js.map +1 -0
  263. package/lib/features/design/home/DesignHome.js +688 -0
  264. package/lib/features/design/home/DesignHome.js.map +1 -0
  265. package/lib/features/design/home/studioHome.js +61 -0
  266. package/lib/features/design/home/studioHome.js.map +1 -0
  267. package/lib/features/design/pickDesignImage.js +60 -0
  268. package/lib/features/design/pickDesignImage.js.map +1 -0
  269. package/lib/features/design/render/DesignPageView.js +69 -0
  270. package/lib/features/design/render/DesignPageView.js.map +1 -0
  271. package/lib/features/design/render/PageCapture.js +288 -0
  272. package/lib/features/design/render/PageCapture.js.map +1 -0
  273. package/lib/features/design/render/TextMeasure.js +115 -0
  274. package/lib/features/design/render/TextMeasure.js.map +1 -0
  275. package/lib/features/design/render/fontRegistry.js +110 -0
  276. package/lib/features/design/render/fontRegistry.js.map +1 -0
  277. package/lib/features/design/render/layers.js +392 -0
  278. package/lib/features/design/render/layers.js.map +1 -0
  279. package/lib/features/design/render/svg.js +35 -0
  280. package/lib/features/design/render/svg.js.map +1 -0
  281. package/lib/features/design/render/svgParts.js +435 -0
  282. package/lib/features/design/render/svgParts.js.map +1 -0
  283. package/lib/features/design/surface/BoardScreen.js +529 -0
  284. package/lib/features/design/surface/BoardScreen.js.map +1 -0
  285. package/lib/features/design/surface/CompareView.js +138 -0
  286. package/lib/features/design/surface/CompareView.js.map +1 -0
  287. package/lib/features/design/surface/CreationScreen.js +294 -0
  288. package/lib/features/design/surface/CreationScreen.js.map +1 -0
  289. package/lib/features/design/surface/DesignAgentChatPane.js +444 -0
  290. package/lib/features/design/surface/DesignAgentChatPane.js.map +1 -0
  291. package/lib/features/design/surface/DesignBoards.js +441 -0
  292. package/lib/features/design/surface/DesignBoards.js.map +1 -0
  293. package/lib/features/design/surface/DesignPreview.js +159 -0
  294. package/lib/features/design/surface/DesignPreview.js.map +1 -0
  295. package/lib/features/design/surface/DesignSurfaceExperience.js +80 -0
  296. package/lib/features/design/surface/DesignSurfaceExperience.js.map +1 -0
  297. package/lib/features/design/surface/FullScreenPreview.js +59 -0
  298. package/lib/features/design/surface/FullScreenPreview.js.map +1 -0
  299. package/lib/features/design/surface/NewSystemDialog.js +122 -0
  300. package/lib/features/design/surface/NewSystemDialog.js.map +1 -0
  301. package/lib/features/design/surface/PickerSheet.js +175 -0
  302. package/lib/features/design/surface/PickerSheet.js.map +1 -0
  303. package/lib/features/design/surface/TemplatesGallery.js +156 -0
  304. package/lib/features/design/surface/TemplatesGallery.js.map +1 -0
  305. package/lib/features/design/surface/WetPaint.js +140 -0
  306. package/lib/features/design/surface/WetPaint.js.map +1 -0
  307. package/lib/features/design/surface/agentTurn.js +229 -0
  308. package/lib/features/design/surface/agentTurn.js.map +1 -0
  309. package/lib/features/design/surface/designBoard.js +218 -0
  310. package/lib/features/design/surface/designBoard.js.map +1 -0
  311. package/lib/features/design/surface/designChannel.js +186 -0
  312. package/lib/features/design/surface/designChannel.js.map +1 -0
  313. package/lib/features/design/surface/designChat.js +141 -0
  314. package/lib/features/design/surface/designChat.js.map +1 -0
  315. package/lib/features/design/surface/designConnector.js +266 -0
  316. package/lib/features/design/surface/designConnector.js.map +1 -0
  317. package/lib/features/design/surface/designDocument.js +40 -0
  318. package/lib/features/design/surface/designDocument.js.map +1 -0
  319. package/lib/features/design/surface/designExport.js +55 -0
  320. package/lib/features/design/surface/designExport.js.map +1 -0
  321. package/lib/features/design/surface/designLinks.js +64 -0
  322. package/lib/features/design/surface/designLinks.js.map +1 -0
  323. package/lib/features/design/surface/designPalette.js +24 -0
  324. package/lib/features/design/surface/designPalette.js.map +1 -0
  325. package/lib/features/design/surface/designRun.js +161 -0
  326. package/lib/features/design/surface/designRun.js.map +1 -0
  327. package/lib/features/design/surface/designTheme.js +119 -0
  328. package/lib/features/design/surface/designTheme.js.map +1 -0
  329. package/lib/features/design/surface/execStream.js +206 -0
  330. package/lib/features/design/surface/execStream.js.map +1 -0
  331. package/lib/features/design/surface/metaball.js +48 -0
  332. package/lib/features/design/surface/metaball.js.map +1 -0
  333. package/lib/features/design/surface/pickReferenceFiles.js +35 -0
  334. package/lib/features/design/surface/pickReferenceFiles.js.map +1 -0
  335. package/lib/features/design/surface/useDesignSurface.js +379 -0
  336. package/lib/features/design/surface/useDesignSurface.js.map +1 -0
  337. package/lib/features/docs/DocBlockRow.js +336 -0
  338. package/lib/features/docs/DocBlockRow.js.map +1 -0
  339. package/lib/features/docs/DocsEditorExperience.js +949 -0
  340. package/lib/features/docs/DocsEditorExperience.js.map +1 -0
  341. package/lib/features/docs/DocsToolbar.js +247 -0
  342. package/lib/features/docs/DocsToolbar.js.map +1 -0
  343. package/lib/features/docs/blocks.js +560 -0
  344. package/lib/features/docs/blocks.js.map +1 -0
  345. package/lib/features/docs/docArtifacts.js +129 -0
  346. package/lib/features/docs/docArtifacts.js.map +1 -0
  347. package/lib/features/docs/docEdits.js +201 -0
  348. package/lib/features/docs/docEdits.js.map +1 -0
  349. package/lib/features/docs/docExport.js +235 -0
  350. package/lib/features/docs/docExport.js.map +1 -0
  351. package/lib/features/docs/docShare.js +62 -0
  352. package/lib/features/docs/docShare.js.map +1 -0
  353. package/lib/features/links/openInApp.js +38 -2
  354. package/lib/features/links/openInApp.js.map +1 -1
  355. package/lib/routes.json +54 -0
  356. package/lib/screens/DesignNative/index.js +35 -0
  357. package/lib/screens/DesignNative/index.js.map +1 -0
  358. package/package.json +4 -4
  359. package/lib/features/design/exportDesign.js +0 -133
  360. package/lib/features/design/exportDesign.js.map +0 -1
@@ -1,4 +1,4 @@
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;
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useCallback,useState,useRef,useEffect}from'react';import {Alert,View,ActivityIndicator,Text,StyleSheet}from'react-native';import {gql}from'@apollo/client/index.js';import {useCanvasTheme,themedStyles}from'../canvas/canvasTheme.js';import {ActionButton,SPACE,TYPE}from'../canvas/canvasUi.js';import {DESIGN_CATALOG_QUERY,fetchDesignCatalog,fetchDesignCatalogViaClient}from'../canvas/designCatalog.js';import {designCategoryFor}from'../canvas/designCategories.js';import {DesignCategoryGallery}from'../canvas/DesignCategoryGallery.js';import {deriveBackendGraphqlUrl,createRemoteUploadMedia,createRemoteConnectorExec}from'../canvas/videoEditor/remoteMediaClient.js';import {CAROUSEL_CONNECTOR}from'./doc/aiDesign.js';import {listDesignArtifacts,loadOwnedDesignArtifact,isDesignArtifactId,deleteDesignArtifact,buildDesignArtifact,newArtifactId,saveDesignArtifact}from'./doc/artifacts.js';import {backendCatalogRows,findDesignTemplate,blankDocForSize,catalogToDoc,catalogKind,blankDocCustom}from'./doc/newDoc.js';import {DESIGN_SIZES}from'./doc/sizes.js';import {legacyToDoc,legacyKind}from'./doc/legacyDoc.js';import {newDesignDoc}from'./designCore.js';import {fetchMyDesigns}from'./designIndex.js';import {DesignEditorExperience}from'./DesignEditorExperience.js';import {DesignHome}from'./home/DesignHome.js';import {createDesignImagePicker}from'./pickDesignImage.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -17,585 +17,332 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- const SAVE_DEBOUNCE_MS = 2200;
20
+ const TEMPLATE_DOC = gql(DESIGN_CATALOG_QUERY);
21
+ function fullSize(blank) {
22
+ var _a;
23
+ return (_a = DESIGN_SIZES.find((s) => s.id === blank.id)) != null ? _a : null;
24
+ }
25
+ let editorKeyCounter = 0;
26
+ const editorKey = () => `ed-${Date.now().toString(36)}-${editorKeyCounter += 1}`;
21
27
  function DesignExperience({
22
28
  token,
23
29
  indexUrl,
30
+ graphqlUrl: graphqlUrlProp,
31
+ apolloClient,
24
32
  entry,
25
33
  onClose,
26
34
  onPickLocalMedia,
27
35
  uploadMedia,
36
+ sessionId,
37
+ sessionError,
38
+ runAction,
28
39
  runMediaAction,
29
40
  testID
30
41
  }) {
31
42
  const theme = useCanvasTheme();
32
43
  const styles = makeStyles(theme);
33
- const effectiveRunAction = useMemo(() => runMediaAction != null ? runMediaAction : token && indexUrl ? createRemoteRunAction(token, indexUrl) : void 0, [runMediaAction, token, indexUrl]);
34
- const effectiveUploadMedia = useMemo(() => uploadMedia != null ? uploadMedia : token && indexUrl ? createRemoteUploadMedia(token, indexUrl) : void 0, [uploadMedia, token, indexUrl]);
44
+ const index = useMemo(() => indexUrl ? {
45
+ url: indexUrl,
46
+ token
47
+ } : null, [indexUrl, token]);
48
+ const graphqlUrl = useMemo(() => graphqlUrlProp || (indexUrl ? deriveBackendGraphqlUrl(indexUrl) : null), [graphqlUrlProp, indexUrl]);
49
+ const loadCatalog = useMemo(() => {
50
+ if (graphqlUrl) return (group, opts) => fetchDesignCatalog(graphqlUrl, token, group, opts);
51
+ if (apolloClient) return (group, opts) => fetchDesignCatalogViaClient(apolloClient, group, opts);
52
+ return void 0;
53
+ }, [graphqlUrl, token, apolloClient]);
54
+ const readRows = useMemo(() => {
55
+ if (graphqlUrl) return backendCatalogRows(graphqlUrl, token);
56
+ if (apolloClient) {
57
+ return async (filter) => {
58
+ var _a;
59
+ const {
60
+ data
61
+ } = await apolloClient.query({
62
+ query: TEMPLATE_DOC,
63
+ variables: {
64
+ filter
65
+ },
66
+ fetchPolicy: "no-cache"
67
+ });
68
+ const nodes = (_a = data == null ? void 0 : data.formTemplateSubmissions) == null ? void 0 : _a.nodes;
69
+ return Array.isArray(nodes) ? nodes : [];
70
+ };
71
+ }
72
+ return null;
73
+ }, [graphqlUrl, token, apolloClient]);
74
+ const readTemplate = useCallback((id) => readRows ? findDesignTemplate(id, readRows) : Promise.resolve(null), [readRows]);
75
+ const effectiveUpload = useMemo(() => uploadMedia != null ? uploadMedia : token && indexUrl ? createRemoteUploadMedia(token, indexUrl) : void 0, [uploadMedia, token, indexUrl]);
76
+ const pickImage = useMemo(() => createDesignImagePicker(onPickLocalMedia, effectiveUpload), [onPickLocalMedia, effectiveUpload]);
77
+ const runCarousel = useMemo(() => {
78
+ const seam = runAction != null ? runAction : typeof runMediaAction === "function" ? runMediaAction : void 0;
79
+ if (seam) return (action, params) => seam(CAROUSEL_CONNECTOR, action, params);
80
+ if (token && indexUrl) {
81
+ const exec = createRemoteConnectorExec(token, indexUrl);
82
+ return (action, params, timeoutMs) => exec(CAROUSEL_CONNECTOR, action, params, {
83
+ timeoutMs
84
+ });
85
+ }
86
+ return void 0;
87
+ }, [runAction, runMediaAction, token, indexUrl]);
35
88
  const [designs, setDesigns] = useState([]);
36
- const [loading, setLoading] = useState(true);
37
- const [error, setError] = useState(null);
38
- const [open, setOpen] = useState(() => entry && "kind" in entry ? {
39
- channelId: newDesignChannelId(),
40
- doc: newDesignDoc(entry.kind)
41
- } : null);
42
- const [canvasImages, setCanvasImages] = useState([]);
43
- const [exporting, setExporting] = useState(null);
44
- const [results, setResults] = useState(null);
45
- const lastSavedRef = useRef({});
89
+ const [loading, setLoading] = useState(Boolean(index));
90
+ const [listError, setListError] = useState(null);
91
+ const [listRead, setListRead] = useState(0);
92
+ const refresh = useCallback(() => setListRead((n) => n + 1), []);
93
+ const [screen, setScreen] = useState(() => entry ? {
94
+ kind: "loading",
95
+ label: "Opening\u2026"
96
+ } : {
97
+ kind: "home"
98
+ });
99
+ const directEntry = useRef(Boolean(entry));
100
+ const onHome = screen.kind === "home";
46
101
  useEffect(() => {
47
- if (!token || !indexUrl) {
48
- setLoading(false);
49
- return void 0;
50
- }
102
+ if (!index || !onHome) return void 0;
51
103
  const controller = new AbortController();
52
- let cancelled = false;
53
104
  setLoading(true);
54
- void fetchMyDesigns({
55
- url: indexUrl,
56
- token,
105
+ void listDesignArtifacts(__spreadProps(__spreadValues({}, index), {
57
106
  signal: controller.signal
58
- }).then((result) => {
59
- if (cancelled) return;
107
+ })).then((result) => {
108
+ if (controller.signal.aborted) return;
60
109
  setDesigns(result.designs);
61
- setError(result.error);
110
+ setListError(result.error);
62
111
  setLoading(false);
63
- if (entry && "channelId" in entry) {
64
- const match = result.designs.find((d) => d.channelId === entry.channelId);
65
- if (match) setOpen({
66
- channelId: match.channelId,
67
- doc: match.doc
68
- });
69
- }
70
- });
71
- return () => {
72
- cancelled = true;
73
- controller.abort();
74
- };
75
- }, [token, indexUrl]);
76
- useEffect(() => {
77
- if (!token || !indexUrl || !open) return void 0;
78
- const controller = new AbortController();
79
- void fetchMyCanvasBoards({
80
- url: indexUrl,
81
- token,
82
- signal: controller.signal
83
- }).then((result) => {
84
- const urls = [];
85
- for (const board of result.boards) {
86
- for (const item of board.board.items) {
87
- if (item.type === "image" && /^https?:/i.test(item.src)) urls.push(item.src);
88
- }
89
- }
90
- setCanvasImages([...new Set(urls)].slice(0, 24));
91
112
  });
92
113
  return () => controller.abort();
93
- }, [token, indexUrl, open == null ? void 0 : open.channelId]);
94
- useEffect(() => {
95
- if (!open || !token || !indexUrl) return void 0;
96
- const sig = designSignature(open.doc);
97
- if (lastSavedRef.current[open.channelId] === sig) return void 0;
98
- const timer = setTimeout(() => {
99
- const state = buildDesignState(open.doc);
100
- void pushDesignDoc({
101
- url: indexUrl,
102
- token,
103
- channelId: open.channelId,
104
- doc: state
105
- }).then((ok) => {
106
- if (ok) lastSavedRef.current[open.channelId] = sig;
114
+ }, [index, onHome, listRead]);
115
+ const openDoc = useCallback((doc, docKind, opened) => {
116
+ setScreen({
117
+ kind: "editor",
118
+ doc,
119
+ docKind,
120
+ opened: opened != null ? opened : null,
121
+ key: editorKey()
122
+ });
123
+ }, []);
124
+ const openSize = useCallback((size) => openDoc(blankDocForSize(size), size.kind), [openDoc]);
125
+ const openTemplate = useCallback(async (id) => {
126
+ setScreen({
127
+ kind: "loading",
128
+ label: "Opening template\u2026"
129
+ });
130
+ try {
131
+ const template = await readTemplate(id);
132
+ if (!template) {
133
+ setScreen({
134
+ kind: "error",
135
+ message: "That template is no longer in the catalog."
136
+ });
137
+ return;
138
+ }
139
+ openDoc(catalogToDoc(template), catalogKind(template));
140
+ } catch (err) {
141
+ setScreen({
142
+ kind: "error",
143
+ message: err instanceof Error ? err.message : "The template could not be opened."
144
+ });
145
+ }
146
+ }, [readTemplate, openDoc]);
147
+ const openSaved = useCallback(async (id) => {
148
+ if (!index) {
149
+ setScreen({
150
+ kind: "error",
151
+ message: "Sign in to open your designs."
107
152
  });
108
- }, SAVE_DEBOUNCE_MS);
109
- return () => clearTimeout(timer);
110
- }, [open, token, indexUrl]);
111
- const closeEditor = useCallback(() => {
112
- setOpen(null);
113
- setResults(null);
114
- if (entry) onClose == null ? void 0 : onClose();
115
- else if (token && indexUrl) {
116
- void fetchMyDesigns({
117
- url: indexUrl,
118
- token
119
- }).then((r) => setDesigns(r.designs));
153
+ return;
120
154
  }
121
- }, [entry, onClose, token, indexUrl]);
122
- const exportBusyRef = useRef(false);
123
- const handleExport = useCallback((doc) => {
124
- const runAction = effectiveRunAction;
125
- const blankUrl = deriveBlankPixelUrl(indexUrl);
126
- if (!runAction || !blankUrl) {
127
- setExporting({
128
- stage: "",
129
- error: "Export needs a signed-in session."
155
+ setScreen({
156
+ kind: "loading",
157
+ label: "Opening design\u2026"
158
+ });
159
+ const {
160
+ artifact,
161
+ error
162
+ } = await loadOwnedDesignArtifact(index, id);
163
+ if (artifact) openDoc(artifact.doc, artifact.kind, artifact);
164
+ else setScreen({
165
+ kind: "error",
166
+ message: error != null ? error : "That design is not one of yours, or it was deleted."
167
+ });
168
+ }, [index, openDoc]);
169
+ const openLegacy = useCallback(async (channelId) => {
170
+ var _a, _b;
171
+ if (!index) {
172
+ setScreen({
173
+ kind: "error",
174
+ message: "Sign in to open your designs."
130
175
  });
131
176
  return;
132
177
  }
133
- if (exportBusyRef.current) return;
134
- exportBusyRef.current = true;
135
- setExporting({
136
- stage: "Starting render"
178
+ setScreen({
179
+ kind: "loading",
180
+ label: "Opening design\u2026"
181
+ });
182
+ const result = await fetchMyDesigns({
183
+ url: index.url,
184
+ token: index.token
137
185
  });
138
- void renderDesignDoc(doc.pages, {
139
- runAction,
140
- blankUrl,
141
- uploadMedia: effectiveUploadMedia,
142
- onProgress: (p) => setExporting(p)
143
- }).then((urls) => {
144
- setExporting(null);
145
- setResults({
146
- pages: urls.map((url, i) => {
147
- var _a, _b;
148
- return {
149
- name: (_b = (_a = doc.pages[i]) == null ? void 0 : _a.name) != null ? _b : `Page ${i + 1}`,
150
- url
151
- };
152
- }),
153
- savedToCanvas: false
186
+ const match = result.designs.find((d) => d.channelId === channelId);
187
+ if (match) openDoc(legacyToDoc(__spreadProps(__spreadValues({}, match.doc), {
188
+ title: (_a = match.doc.title) != null ? _a : match.title
189
+ })), legacyKind(match.doc));
190
+ else setScreen({
191
+ kind: "error",
192
+ message: (_b = result.error) != null ? _b : "That design is not one of yours, or it was deleted."
193
+ });
194
+ }, [index, openDoc]);
195
+ const entryRan = useRef(false);
196
+ useEffect(() => {
197
+ if (entryRan.current || !entry) return;
198
+ entryRan.current = true;
199
+ if ("templateId" in entry) void openTemplate(entry.templateId);
200
+ else if ("artifactId" in entry) void openSaved(entry.artifactId);
201
+ else if ("sizeId" in entry) {
202
+ const size = DESIGN_SIZES.find((s) => s.id === entry.sizeId);
203
+ if (size) openSize(size);
204
+ else setScreen({
205
+ kind: "home"
154
206
  });
155
- }).catch((err) => {
156
- setExporting({
157
- stage: "",
158
- error: friendlyMediaError(err, "design export")
207
+ } else if ("kind" in entry) {
208
+ if (entry.kind === "tshirt") openDoc(legacyToDoc(newDesignDoc("tshirt")), "flyer");
209
+ else if (entry.kind === "postcard") openSize(DESIGN_SIZES.find((s) => s.id === "postcard"));
210
+ else if (entry.kind === "carousel") {
211
+ directEntry.current = false;
212
+ setScreen({
213
+ kind: "category",
214
+ category: designCategoryFor("carousel")
215
+ });
216
+ } else {
217
+ directEntry.current = false;
218
+ setScreen({
219
+ kind: "home"
220
+ });
221
+ }
222
+ } else if ("channelId" in entry) {
223
+ if (isDesignArtifactId(entry.channelId)) void openSaved(entry.channelId);
224
+ else void openLegacy(entry.channelId);
225
+ } else if ("categoryId" in entry) {
226
+ const category = designCategoryFor(entry.categoryId);
227
+ directEntry.current = false;
228
+ setScreen(category ? {
229
+ kind: "category",
230
+ category
231
+ } : {
232
+ kind: "home"
159
233
  });
160
- }).finally(() => {
161
- exportBusyRef.current = false;
234
+ } else {
235
+ openDoc(blankDocCustom(entry.blank.width, entry.blank.height), "deck");
236
+ }
237
+ }, [entry, openTemplate, openSaved, openLegacy, openSize, openDoc]);
238
+ const leaveEditor = useCallback(() => {
239
+ if (directEntry.current && onClose) {
240
+ onClose();
241
+ return;
242
+ }
243
+ directEntry.current = false;
244
+ setScreen({
245
+ kind: "home"
162
246
  });
163
- }, [effectiveRunAction, effectiveUploadMedia, indexUrl]);
164
- const saveResultsToCanvas = useCallback(async () => {
165
- if (!results || !token || !indexUrl || !open) return;
166
- const items = results.pages.map((p, i) => __spreadProps(__spreadValues({
167
- id: newBoardId(),
168
- type: "image",
169
- src: p.url,
170
- generatedAssetName: `${open.doc.title || defaultTitle(open.doc)} - ${p.name}`,
171
- zIndex: i + 1
172
- }, frameForUpload("image")), {
173
- x: 100 + i * 560
174
- }));
175
- const state = buildBoardState(items, 1, open.doc.title || defaultTitle(open.doc));
176
- const ok = await pushCanvasBoard({
177
- url: indexUrl,
178
- token,
179
- channelId: newBoardChannelId(),
180
- state
247
+ }, [onClose]);
248
+ const designAction = useCallback(async (design, action) => {
249
+ var _a;
250
+ if (!index) return;
251
+ if (action === "delete") {
252
+ Alert.alert("Delete this design?", `"${design.title}" will be gone from the phone and the web.`, [{
253
+ text: "Cancel",
254
+ style: "cancel"
255
+ }, {
256
+ text: "Delete",
257
+ style: "destructive",
258
+ onPress: async () => {
259
+ setDesigns((prev) => prev.filter((d) => d.id !== design.id));
260
+ const ok = await deleteDesignArtifact(index, design.id);
261
+ if (!ok) {
262
+ Alert.alert("Could not delete", "Check your connection and try again.");
263
+ refresh();
264
+ }
265
+ }
266
+ }]);
267
+ return;
268
+ }
269
+ const doc = __spreadProps(__spreadValues({}, design.doc), {
270
+ title: `${design.title} (copy)`
181
271
  });
182
- setResults((prev) => prev ? __spreadProps(__spreadValues({}, prev), {
183
- savedToCanvas: ok
184
- }) : prev);
185
- }, [results, token, indexUrl, open]);
186
- if (open) {
187
- return /* @__PURE__ */ jsxs(View, { style: styles.fill, testID, children: [
188
- /* @__PURE__ */ jsx(DesignEditorExperience, { doc: open.doc, onChange: (doc) => setOpen({
189
- channelId: open.channelId,
190
- doc
191
- }), onClose: closeEditor, onExport: handleExport, onPickLocalMedia, canvasImages }),
192
- exporting ? /* @__PURE__ */ jsx(View, { style: styles.overlay, children: /* @__PURE__ */ jsx(View, { style: styles.overlayCard, children: exporting.error ? /* @__PURE__ */ jsxs(Fragment, { children: [
193
- /* @__PURE__ */ jsx(Text, { style: styles.overlayError, children: "Export failed" }),
194
- /* @__PURE__ */ jsx(Text, { style: styles.overlayStage, numberOfLines: 4, children: exporting.error }),
195
- /* @__PURE__ */ jsx(Pressable, { onPress: () => setExporting(null), style: styles.overlayDismiss, children: /* @__PURE__ */ jsx(Text, { style: styles.overlayDismissLabel, children: "Dismiss" }) })
196
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
197
- /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.foreground }),
198
- /* @__PURE__ */ jsx(Text, { style: styles.overlayStage, children: exporting.stage })
199
- ] }) }) }) : null,
200
- results ? /* @__PURE__ */ jsx(View, { style: styles.overlay, children: /* @__PURE__ */ jsxs(View, { style: styles.overlayCard, children: [
201
- /* @__PURE__ */ jsx(Text, { style: styles.overlayTitle, children: "Design exported" }),
202
- results.pages.map((p) => /* @__PURE__ */ jsxs(View, { style: styles.resultRow, children: [
203
- /* @__PURE__ */ jsx(Image, { source: {
204
- uri: p.url
205
- }, style: styles.resultThumb, contentFit: "cover" }),
206
- /* @__PURE__ */ jsx(Text, { style: styles.resultName, children: p.name }),
207
- /* @__PURE__ */ jsx(Pressable, { onPress: () => void Linking.openURL(p.url), hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: styles.resultAction, children: "Open" }) }),
208
- /* @__PURE__ */ jsx(Pressable, { onPress: () => void Share.share({
209
- url: p.url,
210
- message: p.url
211
- }), hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: styles.resultAction, children: "Share" }) })
212
- ] }, p.url)),
213
- /* @__PURE__ */ jsxs(Pressable, { onPress: () => void saveResultsToCanvas(), style: [styles.overlayCta, results.savedToCanvas && styles.overlayCtaDone], disabled: results.savedToCanvas, children: [
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" })
216
- ] }),
217
- /* @__PURE__ */ jsx(Pressable, { onPress: () => setResults(null), style: styles.overlayDismiss, children: /* @__PURE__ */ jsx(Text, { style: styles.overlayDismissLabel, children: "Done" }) })
218
- ] }) }) : null
219
- ] });
272
+ const copy = buildDesignArtifact(newArtifactId(design.kind), design.kind, doc, {
273
+ sessionId: design.sessionId,
274
+ thumbUrl: design.thumbUrl,
275
+ exportUrl: design.exportUrl
276
+ });
277
+ const result = await saveDesignArtifact(index, copy);
278
+ if (result.ok) setDesigns((prev) => [copy, ...prev]);
279
+ else Alert.alert("Could not copy", (_a = result.error) != null ? _a : "Try again.");
280
+ }, [index, refresh]);
281
+ const renameDesign = useCallback(async (design, title) => {
282
+ var _a;
283
+ if (!index) return;
284
+ const doc = __spreadProps(__spreadValues({}, design.doc), {
285
+ title: title.trim() || void 0
286
+ });
287
+ const renamed = buildDesignArtifact(design.id, design.kind, doc, {
288
+ sessionId: design.sessionId,
289
+ thumbUrl: design.thumbUrl,
290
+ exportUrl: design.exportUrl
291
+ });
292
+ setDesigns((prev) => prev.map((d) => d.id === design.id ? renamed : d));
293
+ const result = await saveDesignArtifact(index, renamed);
294
+ if (!result.ok) {
295
+ Alert.alert("Could not rename that design", (_a = result.error) != null ? _a : "Try again.");
296
+ refresh();
297
+ }
298
+ }, [index, refresh]);
299
+ if (screen.kind === "editor") {
300
+ return /* @__PURE__ */ jsx(View, { style: styles.fill, testID, children: /* @__PURE__ */ jsx(DesignEditorExperience, { doc: screen.doc, kind: screen.docKind, opened: screen.opened, index, sessionId, loadCatalog, readTemplate: readRows ? readTemplate : void 0, pickImage, uploadFile: effectiveUpload, runCarousel, onClose: leaveEditor }, screen.key) });
220
301
  }
221
- return /* @__PURE__ */ jsxs(ScrollView, { style: styles.home, contentContainerStyle: styles.homeContent, testID, children: [
222
- /* @__PURE__ */ jsx(Text, { style: styles.homeTitle, accessibilityRole: "header", children: "Design studio" }),
223
- /* @__PURE__ */ jsx(SectionHeader, { title: "Start a design" }),
224
- /* @__PURE__ */ jsxs(View, { style: styles.templateRow, children: [
225
- /* @__PURE__ */ jsx(TemplateCard, { icon: "shape-square-plus", label: "Design", hint: "1080 \xD7 1080", shape: "design", onPress: () => setOpen({
226
- channelId: newDesignChannelId(),
227
- doc: newDesignDoc("design")
228
- }) }),
229
- /* @__PURE__ */ jsx(TemplateCard, { icon: "tshirt-crew-outline", label: "T-shirt", hint: "Front & back", shape: "tshirt", onPress: () => setOpen({
230
- channelId: newDesignChannelId(),
231
- doc: newDesignDoc("tshirt")
232
- }) }),
233
- /* @__PURE__ */ jsx(TemplateCard, { icon: "email-outline", label: "Postcard", hint: "Front & back", shape: "postcard", onPress: () => setOpen({
234
- channelId: newDesignChannelId(),
235
- doc: newDesignDoc("postcard")
236
- }) }),
237
- /* @__PURE__ */ jsx(TemplateCard, { icon: "view-carousel-outline", label: "Carousel", hint: "3 slides", shape: "carousel", onPress: () => setOpen({
238
- channelId: newDesignChannelId(),
239
- doc: newDesignDoc("carousel")
240
- }) })
241
- ] }),
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: () => {
250
- var _a;
251
- const doc = (_a = parseDesignDoc(d.doc)) != null ? _a : d.doc;
252
- setOpen({
253
- channelId: d.channelId,
254
- doc
302
+ if (screen.kind === "category") {
303
+ return /* @__PURE__ */ jsx(View, { style: styles.fill, testID, children: /* @__PURE__ */ jsx(DesignCategoryGallery, { category: screen.category, initialQuery: screen.query, load: loadCatalog, onClose: () => setScreen({
304
+ kind: "home"
305
+ }), onBlank: (blank) => {
306
+ const size = fullSize(blank);
307
+ if (size) openSize(size);
308
+ else openDoc(blankDocCustom(blank.width, blank.height), "deck");
309
+ }, onOpenTemplate: readRows ? (card) => void openTemplate(card.id) : void 0 }) });
310
+ }
311
+ if (screen.kind === "loading" || screen.kind === "error") {
312
+ return /* @__PURE__ */ jsx(View, { style: [styles.fill, styles.center], testID, children: screen.kind === "loading" ? /* @__PURE__ */ jsxs(Fragment, { children: [
313
+ /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.mutedForeground }),
314
+ /* @__PURE__ */ jsx(Text, { style: styles.message, children: screen.label })
315
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
316
+ /* @__PURE__ */ jsx(Text, { style: styles.message, children: screen.message }),
317
+ /* @__PURE__ */ jsx(ActionButton, { label: "Go to Design", onPress: () => {
318
+ directEntry.current = false;
319
+ setScreen({
320
+ kind: "home"
255
321
  });
256
- }, children: [
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." })
270
- ] });
271
- }
272
- function TemplateCard({
273
- icon,
274
- label,
275
- hint,
276
- shape,
277
- onPress
278
- }) {
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
- ] }) }),
294
- /* @__PURE__ */ jsx(Text, { style: styles.templateLabel, children: label }),
295
- /* @__PURE__ */ jsx(Text, { style: styles.templateHint, children: hint })
296
- ] });
297
- }
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 });
322
+ } })
323
+ ] }) });
328
324
  }
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
- }) });
325
+ return /* @__PURE__ */ jsx(View, { style: styles.fill, testID, children: /* @__PURE__ */ jsx(DesignHome, { designs, loading, error: sessionError || listError, onRefresh: refresh, onClose, onOpenDesign: (design) => openDoc(design.doc, design.kind, design), onDesignAction: (design, action) => void designAction(design, action), onRenameDesign: (design, title) => void renameDesign(design, title), onCreate: openSize, onCustom: (w, h) => openDoc(blankDocCustom(w, h), "deck"), onOpenCategory: (category, query) => setScreen({
326
+ kind: "category",
327
+ category,
328
+ query
329
+ }), onOpenTemplate: (card) => {
330
+ if (readRows) void openTemplate(card.id);
331
+ }, loadCatalog }) });
363
332
  }
364
- const GUTTER = SPACE.lg + 4;
365
333
  const makeStyles = themedStyles((theme) => StyleSheet.create({
366
334
  fill: {
367
- flex: 1
368
- },
369
- overlay: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
370
- backgroundColor: "rgba(0,0,0,0.55)",
371
- alignItems: "center",
372
- justifyContent: "center",
373
- padding: SPACE.xl
374
- }),
375
- overlayCard: {
376
- width: "100%",
377
- maxWidth: 360,
378
- alignItems: "center",
379
- gap: SPACE.md,
380
- backgroundColor: theme.surface,
381
- borderRadius: RADIUS.xl,
382
- paddingVertical: SPACE.xl,
383
- paddingHorizontal: SPACE.xl - 4
384
- },
385
- overlayTitle: __spreadProps(__spreadValues({}, TYPE.title), {
386
- color: theme.foreground
387
- }),
388
- overlayStage: __spreadProps(__spreadValues({}, TYPE.label), {
389
- fontWeight: "500",
390
- color: theme.mutedForeground,
391
- textAlign: "center"
392
- }),
393
- overlayError: __spreadProps(__spreadValues({}, TYPE.title), {
394
- color: theme.destructiveText
395
- }),
396
- overlayDismiss: {
397
- minHeight: HIT,
398
- paddingHorizontal: SPACE.lg,
399
- alignItems: "center",
400
- justifyContent: "center"
401
- },
402
- overlayDismissLabel: __spreadProps(__spreadValues({}, TYPE.label), {
403
- fontSize: 15,
404
- color: theme.foreground
405
- }),
406
- overlayCta: {
407
- marginTop: SPACE.xs,
408
- alignSelf: "stretch",
409
- minHeight: HIT,
410
- flexDirection: "row",
411
- alignItems: "center",
412
- justifyContent: "center",
413
- gap: SPACE.sm,
414
- backgroundColor: theme.primary,
415
- borderRadius: RADIUS.pill,
416
- paddingHorizontal: SPACE.lg
417
- },
418
- overlayCtaDone: {
419
- backgroundColor: theme.card
420
- },
421
- overlayCtaLabel: __spreadProps(__spreadValues({}, TYPE.label), {
422
- fontSize: 15,
423
- color: theme.primaryForeground
424
- }),
425
- overlayCtaLabelDone: {
426
- color: theme.foreground
427
- },
428
- resultRow: {
429
- flexDirection: "row",
430
- alignItems: "center",
431
- gap: SPACE.md,
432
- alignSelf: "stretch"
433
- },
434
- resultThumb: {
435
- width: 48,
436
- height: 48,
437
- borderRadius: RADIUS.sm,
438
- backgroundColor: theme.card
439
- },
440
- resultName: __spreadProps(__spreadValues({}, TYPE.label), {
441
- flex: 1,
442
- color: theme.foreground
443
- }),
444
- resultAction: __spreadProps(__spreadValues({}, TYPE.label), {
445
- color: theme.mutedForeground,
446
- paddingHorizontal: SPACE.xs + 2
447
- }),
448
- home: {
449
335
  flex: 1,
450
336
  backgroundColor: theme.background
451
337
  },
452
- homeContent: {
453
- paddingHorizontal: GUTTER,
454
- paddingTop: SPACE.lg,
455
- paddingBottom: SPACE.xxl
456
- },
457
- homeTitle: __spreadProps(__spreadValues({}, TYPE.heading), {
458
- color: theme.foreground,
459
- marginBottom: SPACE.xl - 4
460
- }),
461
- sectionGap: {
462
- marginTop: SPACE.xl
463
- },
464
- templateRow: {
465
- flexDirection: "row",
466
- flexWrap: "wrap",
467
- columnGap: SPACE.md,
468
- rowGap: SPACE.lg
469
- },
470
- templateCard: {
471
- flexBasis: "46%",
472
- flexGrow: 1
473
- },
474
- templateCover: {
475
- aspectRatio: 1.25,
476
- borderRadius: RADIUS.lg,
477
- overflow: "hidden",
478
- backgroundColor: theme.card,
338
+ center: {
479
339
  alignItems: "center",
480
340
  justifyContent: "center",
481
- marginBottom: SPACE.sm
482
- },
483
- newPlus: {
484
- width: 48,
485
- height: 48,
486
- borderRadius: 24,
487
- alignItems: "center",
488
- justifyContent: "center",
489
- backgroundColor: theme.primary
490
- },
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
504
- },
505
- carouselStack: {
506
- width: "52%",
507
- aspectRatio: 1
508
- },
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
516
- },
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"
525
- },
526
- sketchBlock: {
527
- flex: 1,
528
- width: "100%",
529
- marginTop: 3,
530
- alignItems: "center",
531
- justifyContent: "center"
341
+ gap: SPACE.lg,
342
+ padding: SPACE.xl
532
343
  },
533
- sketchLabel: {
534
- fontSize: 10,
535
- fontWeight: "600",
536
- color: "#a1a1aa",
344
+ message: __spreadProps(__spreadValues({}, TYPE.body), {
345
+ color: theme.mutedForeground,
537
346
  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: {
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,
573
- alignItems: "center",
574
- justifyContent: "center",
575
- marginBottom: SPACE.sm
576
- },
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
588
- },
589
- skeletonLine: {
590
- height: 12,
591
- width: "60%"
592
- },
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
347
  })
601
- }));export{DesignExperience};//# sourceMappingURL=DesignExperience.js.map
348
+ }));export{DesignExperience,DesignExperience as default};//# sourceMappingURL=DesignExperience.js.map