@adminide-stack/yantra-mobile 12.0.128 → 12.0.129-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/compute.js +57 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +3 -2
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +11 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/canvas/AudioEditorExperience.js +448 -105
- package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
- package/lib/features/canvas/CanvasAgentChatPane.js +33 -14
- package/lib/features/canvas/CanvasAgentChatPane.js.map +1 -1
- package/lib/features/canvas/CanvasBoardsGrid.js +493 -41
- package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
- package/lib/features/canvas/CanvasChatResultCard.js.map +1 -1
- package/lib/features/canvas/CanvasEditToolsPanel.js +37 -1
- package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
- package/lib/features/canvas/CanvasExperience.js +237 -22
- package/lib/features/canvas/CanvasExperience.js.map +1 -1
- package/lib/features/canvas/CanvasGeneratePanel.js +119 -26
- package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
- package/lib/features/canvas/CanvasLooksPanel.js +17 -6
- package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasTasksPanel.js +18 -1
- package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
- package/lib/features/canvas/DesignCategoryGallery.js +423 -0
- package/lib/features/canvas/DesignCategoryGallery.js.map +1 -0
- package/lib/features/canvas/ImageEditorExperience.js +763 -187
- package/lib/features/canvas/ImageEditorExperience.js.map +1 -1
- package/lib/features/canvas/SetStudioExperience.js +199 -11
- package/lib/features/canvas/SetStudioExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditorExperience.js +59 -40
- package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
- package/lib/features/canvas/VideoGeneratorExperience.js +134 -34
- package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
- package/lib/features/canvas/aiEdit.js +4 -2
- package/lib/features/canvas/aiEdit.js.map +1 -1
- package/lib/features/canvas/audioEditor/AudioWaveform.js +96 -0
- package/lib/features/canvas/audioEditor/AudioWaveform.js.map +1 -0
- package/lib/features/canvas/audioEditor/audioPeaks.js +93 -0
- package/lib/features/canvas/audioEditor/audioPeaks.js.map +1 -0
- package/lib/features/canvas/canvasTaskSync.js +34 -7
- package/lib/features/canvas/canvasTaskSync.js.map +1 -1
- package/lib/features/canvas/canvasTasks.js +23 -3
- package/lib/features/canvas/canvasTasks.js.map +1 -1
- package/lib/features/canvas/canvasTheme.js +10 -24
- package/lib/features/canvas/canvasTheme.js.map +1 -1
- package/lib/features/canvas/canvasUi.js +1 -1
- package/lib/features/canvas/canvasUi.js.map +1 -1
- package/lib/features/canvas/createTiles.js +17 -9
- package/lib/features/canvas/createTiles.js.map +1 -1
- package/lib/features/canvas/deepLinks.js +35 -5
- package/lib/features/canvas/deepLinks.js.map +1 -1
- package/lib/features/canvas/designCatalog.js +165 -0
- package/lib/features/canvas/designCatalog.js.map +1 -0
- package/lib/features/canvas/designCategories.js +262 -0
- package/lib/features/canvas/designCategories.js.map +1 -0
- package/lib/features/canvas/editorControls.js +406 -0
- package/lib/features/canvas/editorControls.js.map +1 -0
- package/lib/features/canvas/generationModels.js +5 -3
- package/lib/features/canvas/generationModels.js.map +1 -1
- package/lib/features/canvas/generationTasks.js +162 -0
- package/lib/features/canvas/generationTasks.js.map +1 -0
- package/lib/features/canvas/generator/BottomSheet.js +167 -0
- package/lib/features/canvas/generator/BottomSheet.js.map +1 -0
- package/lib/features/canvas/generator/BusinessCardChatCard.js +155 -0
- package/lib/features/canvas/generator/BusinessCardChatCard.js.map +1 -0
- package/lib/features/canvas/generator/DirectorSheet.js +163 -0
- package/lib/features/canvas/generator/DirectorSheet.js.map +1 -0
- package/lib/features/canvas/generator/ReframePreview.js +122 -0
- package/lib/features/canvas/generator/ReframePreview.js.map +1 -0
- package/lib/features/canvas/generator/RunLogCard.js +119 -0
- package/lib/features/canvas/generator/RunLogCard.js.map +1 -0
- package/lib/features/canvas/generator/ShotPanel.js +261 -0
- package/lib/features/canvas/generator/ShotPanel.js.map +1 -0
- package/lib/features/canvas/generator/businessCardWidget.js +117 -0
- package/lib/features/canvas/generator/businessCardWidget.js.map +1 -0
- package/lib/features/canvas/generator/cameraVocabulary.js +142 -0
- package/lib/features/canvas/generator/cameraVocabulary.js.map +1 -0
- package/lib/features/canvas/generator/cinematicVocabulary.js +416 -0
- package/lib/features/canvas/generator/cinematicVocabulary.js.map +1 -0
- package/lib/features/canvas/generator/direction.js +41 -0
- package/lib/features/canvas/generator/direction.js.map +1 -0
- package/lib/features/canvas/generator/reframeGeometry.js +108 -0
- package/lib/features/canvas/generator/reframeGeometry.js.map +1 -0
- package/lib/features/canvas/generator/runLog.js +71 -0
- package/lib/features/canvas/generator/runLog.js.map +1 -0
- package/lib/features/canvas/generator/shot.js +133 -0
- package/lib/features/canvas/generator/shot.js.map +1 -0
- package/lib/features/canvas/generator/useShotSpec.js +87 -0
- package/lib/features/canvas/generator/useShotSpec.js.map +1 -0
- package/lib/features/canvas/home/HeroComposer.js +214 -0
- package/lib/features/canvas/home/HeroComposer.js.map +1 -0
- package/lib/features/canvas/home/HeroMonitor.js +225 -0
- package/lib/features/canvas/home/HeroMonitor.js.map +1 -0
- package/lib/features/canvas/home/LookDetail.js +185 -0
- package/lib/features/canvas/home/LookDetail.js.map +1 -0
- package/lib/features/canvas/home/LoopingVideo.js +37 -0
- package/lib/features/canvas/home/LoopingVideo.js.map +1 -0
- package/lib/features/canvas/home/TemplatesGallery.js +253 -0
- package/lib/features/canvas/home/TemplatesGallery.js.map +1 -0
- package/lib/features/canvas/home/heroShots.js +100 -0
- package/lib/features/canvas/home/heroShots.js.map +1 -0
- package/lib/features/canvas/homeWork.js +62 -3
- package/lib/features/canvas/homeWork.js.map +1 -1
- package/lib/features/canvas/imageEditor/ImageMarkup.js +195 -0
- package/lib/features/canvas/imageEditor/ImageMarkup.js.map +1 -0
- package/lib/features/canvas/imageEditor/imageEditOps.js +367 -0
- package/lib/features/canvas/imageEditor/imageEditOps.js.map +1 -0
- package/lib/features/canvas/nativeViewerRegistry.js.map +1 -1
- package/lib/features/canvas/rankedCatalogSearch.js +375 -0
- package/lib/features/canvas/rankedCatalogSearch.js.map +1 -0
- package/lib/features/canvas/recorder/CameraRecorderExperience.js +68 -20
- package/lib/features/canvas/recorder/CameraRecorderExperience.js.map +1 -1
- package/lib/features/canvas/recorder/RecordingReview.js +272 -0
- package/lib/features/canvas/recorder/RecordingReview.js.map +1 -0
- package/lib/features/canvas/recorder/RecordingsList.js +179 -0
- package/lib/features/canvas/recorder/RecordingsList.js.map +1 -0
- package/lib/features/canvas/recorder/recorderOps.js +99 -0
- package/lib/features/canvas/recorder/recorderOps.js.map +1 -0
- package/lib/features/canvas/seedanceShowcase.js +314 -0
- package/lib/features/canvas/seedanceShowcase.js.map +1 -0
- package/lib/features/canvas/serverTasks.js +149 -15
- package/lib/features/canvas/serverTasks.js.map +1 -1
- package/lib/features/canvas/sessionRenewal.js +114 -0
- package/lib/features/canvas/sessionRenewal.js.map +1 -0
- package/lib/features/canvas/set/SetViewportWebView.js +34 -1
- package/lib/features/canvas/set/SetViewportWebView.js.map +1 -1
- package/lib/features/canvas/set/agent/setTurn.js +4 -2
- package/lib/features/canvas/set/agent/setTurn.js.map +1 -1
- package/lib/features/canvas/set/setPresets.js +85 -0
- package/lib/features/canvas/set/setPresets.js.map +1 -0
- package/lib/features/canvas/set/setProject.js +4 -1
- package/lib/features/canvas/set/setProject.js.map +1 -1
- package/lib/features/canvas/studioCatalog.js +59 -4
- package/lib/features/canvas/studioCatalog.js.map +1 -1
- package/lib/features/canvas/studioLooks.js +31 -4
- package/lib/features/canvas/studioLooks.js.map +1 -1
- package/lib/features/canvas/surfaceIndex.js +1 -14
- package/lib/features/canvas/surfaceIndex.js.map +1 -1
- package/lib/features/canvas/templateSearch.js +489 -0
- package/lib/features/canvas/templateSearch.js.map +1 -0
- package/lib/features/canvas/useCanvasSession.js +28 -6
- package/lib/features/canvas/useCanvasSession.js.map +1 -1
- package/lib/features/canvas/useStudioCatalogTemplates.js +41 -5
- package/lib/features/canvas/useStudioCatalogTemplates.js.map +1 -1
- package/lib/features/canvas/videoEditor/EditorPanels.js +531 -0
- package/lib/features/canvas/videoEditor/EditorPanels.js.map +1 -0
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js +48 -4
- package/lib/features/canvas/videoEditor/agent/AgentCutPane.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/agentLoop.js +2 -0
- package/lib/features/canvas/videoEditor/agent/agentLoop.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/brainClient.js +97 -27
- package/lib/features/canvas/videoEditor/agent/brainClient.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/cutTools.js +707 -3
- package/lib/features/canvas/videoEditor/agent/cutTools.js.map +1 -1
- package/lib/features/canvas/videoEditor/audioServices.js +165 -0
- package/lib/features/canvas/videoEditor/audioServices.js.map +1 -0
- package/lib/features/canvas/videoEditor/captions.js +144 -0
- package/lib/features/canvas/videoEditor/captions.js.map +1 -0
- package/lib/features/canvas/videoEditor/compileTimeline.js +24 -16
- package/lib/features/canvas/videoEditor/compileTimeline.js.map +1 -1
- package/lib/features/canvas/videoEditor/editorModel.js +12 -2
- package/lib/features/canvas/videoEditor/editorModel.js.map +1 -1
- package/lib/features/canvas/videoEditor/exportTask.js +89 -7
- package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
- package/lib/features/canvas/videoEditor/layers.js +117 -0
- package/lib/features/canvas/videoEditor/layers.js.map +1 -0
- package/lib/features/canvas/videoEditor/remoteMediaClient.js +45 -18
- package/lib/features/canvas/videoEditor/remoteMediaClient.js.map +1 -1
- package/lib/features/canvas/videoEditor/renderTimeline.js +18 -6
- package/lib/features/canvas/videoEditor/renderTimeline.js.map +1 -1
- package/lib/features/canvas/videoEditor/revoice.js +138 -0
- package/lib/features/canvas/videoEditor/revoice.js.map +1 -0
- package/lib/features/canvas/videoEditor/storageUpload.js +34 -0
- package/lib/features/canvas/videoEditor/storageUpload.js.map +1 -0
- package/lib/features/canvas/videoEditor/textMotion.js +109 -0
- package/lib/features/canvas/videoEditor/textMotion.js.map +1 -0
- package/lib/features/canvas/videoEditor/transitions.js +31 -0
- package/lib/features/canvas/videoEditor/transitions.js.map +1 -0
- package/lib/features/chat/TemplatesChatCards.js +8 -3
- package/lib/features/chat/TemplatesChatCards.js.map +1 -1
- package/lib/features/design/DesignEditorExperience.js +674 -644
- package/lib/features/design/DesignEditorExperience.js.map +1 -1
- package/lib/features/design/DesignExperience.js +285 -538
- package/lib/features/design/DesignExperience.js.map +1 -1
- package/lib/features/design/designCore.js +2 -212
- package/lib/features/design/designCore.js.map +1 -1
- package/lib/features/design/designIndex.js +1 -50
- package/lib/features/design/designIndex.js.map +1 -1
- package/lib/features/design/doc/aiDesign.js +247 -0
- package/lib/features/design/doc/aiDesign.js.map +1 -0
- package/lib/features/design/doc/artifacts.js +280 -0
- package/lib/features/design/doc/artifacts.js.map +1 -0
- package/lib/features/design/doc/chart.js +98 -0
- package/lib/features/design/doc/chart.js.map +1 -0
- package/lib/features/design/doc/crop.js +104 -0
- package/lib/features/design/doc/crop.js.map +1 -0
- package/lib/features/design/doc/curve.js +49 -0
- package/lib/features/design/doc/curve.js.map +1 -0
- package/lib/features/design/doc/docOps.js +397 -0
- package/lib/features/design/doc/docOps.js.map +1 -0
- package/lib/features/design/doc/findReplace.js +112 -0
- package/lib/features/design/doc/findReplace.js.map +1 -0
- package/lib/features/design/doc/fonts.js +79 -0
- package/lib/features/design/doc/fonts.js.map +1 -0
- package/lib/features/design/doc/frames.js +17 -0
- package/lib/features/design/doc/frames.js.map +1 -0
- package/lib/features/design/doc/geometry.js +133 -0
- package/lib/features/design/doc/geometry.js.map +1 -0
- package/lib/features/design/doc/imageAdjust.js +203 -0
- package/lib/features/design/doc/imageAdjust.js.map +1 -0
- package/lib/features/design/doc/legacyDoc.js +107 -0
- package/lib/features/design/doc/legacyDoc.js.map +1 -0
- package/lib/features/design/doc/newDoc.js +335 -0
- package/lib/features/design/doc/newDoc.js.map +1 -0
- package/lib/features/design/doc/pageRange.js +17 -0
- package/lib/features/design/doc/pageRange.js.map +1 -0
- package/lib/features/design/doc/pathScale.js +68 -0
- package/lib/features/design/doc/pathScale.js.map +1 -0
- package/lib/features/design/doc/qr.js +62 -0
- package/lib/features/design/doc/qr.js.map +1 -0
- package/lib/features/design/doc/shapes.js +366 -0
- package/lib/features/design/doc/shapes.js.map +1 -0
- package/lib/features/design/doc/sizes.js +230 -0
- package/lib/features/design/doc/sizes.js.map +1 -0
- package/lib/features/design/doc/textEffects.js +134 -0
- package/lib/features/design/doc/textEffects.js.map +1 -0
- package/lib/features/design/doc/textLayout.js +182 -0
- package/lib/features/design/doc/textLayout.js.map +1 -0
- package/lib/features/design/doc/types.js +30 -0
- package/lib/features/design/doc/types.js.map +1 -0
- package/lib/features/design/editor/AiPanel.js +194 -0
- package/lib/features/design/editor/AiPanel.js.map +1 -0
- package/lib/features/design/editor/ChartDataPanel.js +182 -0
- package/lib/features/design/editor/ChartDataPanel.js.map +1 -0
- package/lib/features/design/editor/CropOverlay.js +199 -0
- package/lib/features/design/editor/CropOverlay.js.map +1 -0
- package/lib/features/design/editor/DesignCanvas.js +363 -0
- package/lib/features/design/editor/DesignCanvas.js.map +1 -0
- package/lib/features/design/editor/ExportSheet.js +123 -0
- package/lib/features/design/editor/ExportSheet.js.map +1 -0
- package/lib/features/design/editor/FindReplacePanel.js +93 -0
- package/lib/features/design/editor/FindReplacePanel.js.map +1 -0
- package/lib/features/design/editor/ImageTools.js +188 -0
- package/lib/features/design/editor/ImageTools.js.map +1 -0
- package/lib/features/design/editor/LayerTools.js +485 -0
- package/lib/features/design/editor/LayerTools.js.map +1 -0
- package/lib/features/design/editor/PageStrip.js +203 -0
- package/lib/features/design/editor/PageStrip.js.map +1 -0
- package/lib/features/design/editor/Slideshow.js +97 -0
- package/lib/features/design/editor/Slideshow.js.map +1 -0
- package/lib/features/design/editor/ToolPanels.js +695 -0
- package/lib/features/design/editor/ToolPanels.js.map +1 -0
- package/lib/features/design/editor/controls.js +630 -0
- package/lib/features/design/editor/controls.js.map +1 -0
- package/lib/features/design/editor/useDesignSave.js +91 -0
- package/lib/features/design/editor/useDesignSave.js.map +1 -0
- package/lib/features/design/export/exportDesign.js +170 -0
- package/lib/features/design/export/exportDesign.js.map +1 -0
- package/lib/features/design/export/pdf.js +143 -0
- package/lib/features/design/export/pdf.js.map +1 -0
- package/lib/features/design/home/DesignHome.js +688 -0
- package/lib/features/design/home/DesignHome.js.map +1 -0
- package/lib/features/design/home/studioHome.js +61 -0
- package/lib/features/design/home/studioHome.js.map +1 -0
- package/lib/features/design/pickDesignImage.js +60 -0
- package/lib/features/design/pickDesignImage.js.map +1 -0
- package/lib/features/design/render/DesignPageView.js +69 -0
- package/lib/features/design/render/DesignPageView.js.map +1 -0
- package/lib/features/design/render/PageCapture.js +288 -0
- package/lib/features/design/render/PageCapture.js.map +1 -0
- package/lib/features/design/render/TextMeasure.js +115 -0
- package/lib/features/design/render/TextMeasure.js.map +1 -0
- package/lib/features/design/render/fontRegistry.js +110 -0
- package/lib/features/design/render/fontRegistry.js.map +1 -0
- package/lib/features/design/render/layers.js +392 -0
- package/lib/features/design/render/layers.js.map +1 -0
- package/lib/features/design/render/svg.js +35 -0
- package/lib/features/design/render/svg.js.map +1 -0
- package/lib/features/design/render/svgParts.js +435 -0
- package/lib/features/design/render/svgParts.js.map +1 -0
- package/lib/features/design/surface/BoardScreen.js +529 -0
- package/lib/features/design/surface/BoardScreen.js.map +1 -0
- package/lib/features/design/surface/CompareView.js +138 -0
- package/lib/features/design/surface/CompareView.js.map +1 -0
- package/lib/features/design/surface/CreationScreen.js +294 -0
- package/lib/features/design/surface/CreationScreen.js.map +1 -0
- package/lib/features/design/surface/DesignAgentChatPane.js +444 -0
- package/lib/features/design/surface/DesignAgentChatPane.js.map +1 -0
- package/lib/features/design/surface/DesignBoards.js +441 -0
- package/lib/features/design/surface/DesignBoards.js.map +1 -0
- package/lib/features/design/surface/DesignPreview.js +159 -0
- package/lib/features/design/surface/DesignPreview.js.map +1 -0
- package/lib/features/design/surface/DesignSurfaceExperience.js +80 -0
- package/lib/features/design/surface/DesignSurfaceExperience.js.map +1 -0
- package/lib/features/design/surface/FullScreenPreview.js +59 -0
- package/lib/features/design/surface/FullScreenPreview.js.map +1 -0
- package/lib/features/design/surface/NewSystemDialog.js +122 -0
- package/lib/features/design/surface/NewSystemDialog.js.map +1 -0
- package/lib/features/design/surface/PickerSheet.js +175 -0
- package/lib/features/design/surface/PickerSheet.js.map +1 -0
- package/lib/features/design/surface/TemplatesGallery.js +156 -0
- package/lib/features/design/surface/TemplatesGallery.js.map +1 -0
- package/lib/features/design/surface/WetPaint.js +140 -0
- package/lib/features/design/surface/WetPaint.js.map +1 -0
- package/lib/features/design/surface/agentTurn.js +229 -0
- package/lib/features/design/surface/agentTurn.js.map +1 -0
- package/lib/features/design/surface/designBoard.js +218 -0
- package/lib/features/design/surface/designBoard.js.map +1 -0
- package/lib/features/design/surface/designChannel.js +186 -0
- package/lib/features/design/surface/designChannel.js.map +1 -0
- package/lib/features/design/surface/designChat.js +141 -0
- package/lib/features/design/surface/designChat.js.map +1 -0
- package/lib/features/design/surface/designConnector.js +266 -0
- package/lib/features/design/surface/designConnector.js.map +1 -0
- package/lib/features/design/surface/designDocument.js +40 -0
- package/lib/features/design/surface/designDocument.js.map +1 -0
- package/lib/features/design/surface/designExport.js +55 -0
- package/lib/features/design/surface/designExport.js.map +1 -0
- package/lib/features/design/surface/designLinks.js +64 -0
- package/lib/features/design/surface/designLinks.js.map +1 -0
- package/lib/features/design/surface/designPalette.js +24 -0
- package/lib/features/design/surface/designPalette.js.map +1 -0
- package/lib/features/design/surface/designRun.js +161 -0
- package/lib/features/design/surface/designRun.js.map +1 -0
- package/lib/features/design/surface/designTheme.js +119 -0
- package/lib/features/design/surface/designTheme.js.map +1 -0
- package/lib/features/design/surface/execStream.js +206 -0
- package/lib/features/design/surface/execStream.js.map +1 -0
- package/lib/features/design/surface/metaball.js +48 -0
- package/lib/features/design/surface/metaball.js.map +1 -0
- package/lib/features/design/surface/pickReferenceFiles.js +35 -0
- package/lib/features/design/surface/pickReferenceFiles.js.map +1 -0
- package/lib/features/design/surface/useDesignSurface.js +379 -0
- package/lib/features/design/surface/useDesignSurface.js.map +1 -0
- package/lib/features/docs/DocBlockRow.js +336 -0
- package/lib/features/docs/DocBlockRow.js.map +1 -0
- package/lib/features/docs/DocsEditorExperience.js +949 -0
- package/lib/features/docs/DocsEditorExperience.js.map +1 -0
- package/lib/features/docs/DocsToolbar.js +247 -0
- package/lib/features/docs/DocsToolbar.js.map +1 -0
- package/lib/features/docs/blocks.js +560 -0
- package/lib/features/docs/blocks.js.map +1 -0
- package/lib/features/docs/docArtifacts.js +129 -0
- package/lib/features/docs/docArtifacts.js.map +1 -0
- package/lib/features/docs/docEdits.js +201 -0
- package/lib/features/docs/docEdits.js.map +1 -0
- package/lib/features/docs/docExport.js +235 -0
- package/lib/features/docs/docExport.js.map +1 -0
- package/lib/features/docs/docShare.js +62 -0
- package/lib/features/docs/docShare.js.map +1 -0
- package/lib/features/links/openInApp.js +38 -2
- package/lib/features/links/openInApp.js.map +1 -1
- package/lib/routes.json +54 -0
- package/lib/screens/DesignNative/index.js +35 -0
- package/lib/screens/DesignNative/index.js.map +1 -0
- package/package.json +4 -4
- package/lib/features/design/exportDesign.js +0 -133
- package/lib/features/design/exportDesign.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,
|
|
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
|
|
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
|
|
34
|
-
|
|
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(
|
|
37
|
-
const [
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 (!
|
|
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
|
|
55
|
-
url: indexUrl,
|
|
56
|
-
token,
|
|
105
|
+
void listDesignArtifacts(__spreadProps(__spreadValues({}, index), {
|
|
57
106
|
signal: controller.signal
|
|
58
|
-
}).then((result) => {
|
|
59
|
-
if (
|
|
107
|
+
})).then((result) => {
|
|
108
|
+
if (controller.signal.aborted) return;
|
|
60
109
|
setDesigns(result.designs);
|
|
61
|
-
|
|
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
|
-
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
}
|
|
161
|
-
|
|
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
|
-
}, [
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
|
|
222
|
-
/* @__PURE__ */ jsx(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
/* @__PURE__ */ jsx(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
}
|
|
257
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
534
|
-
|
|
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
|