@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.
- 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
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState}from'react';import {View,Text,StyleSheet,ScrollView,TextInput,FlatList,RefreshControl}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {useCanvasTheme,themedStyles}from'../../canvas/canvasTheme.js';import {IconButton,Pressable,RADIUS,SPACE,ActionButton,SectionHeader,Skeleton,pressedStyle,TYPE}from'../../canvas/canvasUi.js';import {SEARCH_SECTIONS,designCategoryFor,DESIGN_CATEGORY_GROUPS,FORMAT_INTRO}from'../../canvas/designCategories.js';import {CatalogPreviewShelf}from'../../canvas/DesignCategoryGallery.js';import {useSafeInsets}from'../../canvas/withRemoteSafeArea.js';import {sizesIn,MIN_PX,MAX_PX}from'../doc/sizes.js';import {designTitle}from'../doc/types.js';import {DesignPageView}from'../render/DesignPageView.js';import {STUDIO_VIEWS,searchStudioSizes,visibleRecents,sizeLabel,pagesLabel,relativeTime}from'./studioHome.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const GUTTER = SPACE.lg;
|
|
21
|
+
const CATEGORY_ICON = {
|
|
22
|
+
social: "share-variant-outline",
|
|
23
|
+
carousel: "layers-outline",
|
|
24
|
+
flyer: "file-image-outline",
|
|
25
|
+
"business-card": "card-account-details-outline",
|
|
26
|
+
presentation: "presentation",
|
|
27
|
+
"pitch-deck": "chart-bar",
|
|
28
|
+
logo: "shape-outline",
|
|
29
|
+
banner: "flag-outline",
|
|
30
|
+
brochure: "book-open-page-variant-outline",
|
|
31
|
+
branding: "palette-outline",
|
|
32
|
+
certificate: "certificate-outline",
|
|
33
|
+
worksheet: "notebook-edit-outline",
|
|
34
|
+
proposal: "file-document-outline",
|
|
35
|
+
newsletter: "newspaper-variant-outline",
|
|
36
|
+
menu: "silverware-fork-knife",
|
|
37
|
+
infographic: "page-layout-header",
|
|
38
|
+
technology: "chip"
|
|
39
|
+
};
|
|
40
|
+
function DesignHome({
|
|
41
|
+
designs,
|
|
42
|
+
loading,
|
|
43
|
+
error,
|
|
44
|
+
onRefresh,
|
|
45
|
+
onClose,
|
|
46
|
+
onOpenDesign,
|
|
47
|
+
onDesignAction,
|
|
48
|
+
onRenameDesign,
|
|
49
|
+
onCreate,
|
|
50
|
+
onCustom,
|
|
51
|
+
onOpenCategory,
|
|
52
|
+
onOpenTemplate,
|
|
53
|
+
loadCatalog
|
|
54
|
+
}) {
|
|
55
|
+
const theme = useCanvasTheme();
|
|
56
|
+
const styles = makeStyles(theme);
|
|
57
|
+
const insets = useSafeInsets();
|
|
58
|
+
const [view, setView] = useState("browse");
|
|
59
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.root, {
|
|
60
|
+
paddingTop: insets.top
|
|
61
|
+
}], children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(View, { style: styles.bar, children: [
|
|
63
|
+
onClose ? /* @__PURE__ */ jsx(IconButton, { icon: "chevron-left", label: "Back", onPress: onClose, size: 36 }) : null,
|
|
64
|
+
/* @__PURE__ */ jsx(Text, { style: styles.barTitle, accessibilityRole: "header", numberOfLines: 1, children: "Design" })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx(View, { style: styles.switchWrap, children: /* @__PURE__ */ jsx(View, { style: styles.viewSwitch, accessibilityRole: "tablist", accessibilityLabel: "Studio view", children: STUDIO_VIEWS.map((option) => {
|
|
67
|
+
const on = option.id === view;
|
|
68
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => setView(option.id), style: [styles.viewButton, on && styles.viewButtonOn], accessibilityRole: "tab", accessibilityState: {
|
|
69
|
+
selected: on
|
|
70
|
+
}, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: option.id === "browse" ? "view-grid-outline" : "layers-outline", size: 16, color: on ? theme.foreground : theme.mutedForeground }),
|
|
72
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.viewLabel, on && styles.viewLabelOn], numberOfLines: 1, children: option.label })
|
|
73
|
+
] }, option.id);
|
|
74
|
+
}) }) }),
|
|
75
|
+
view === "browse" ? /* @__PURE__ */ jsx(Browse, { bottomInset: insets.bottom, onCreate, onCustom, onOpenCategory, onOpenTemplate, loadCatalog }) : /* @__PURE__ */ jsx(Recent, { bottomInset: insets.bottom, designs, loading, error, onRefresh, onOpenDesign, onDesignAction, onRenameDesign })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
function Browse({
|
|
79
|
+
bottomInset,
|
|
80
|
+
onCreate,
|
|
81
|
+
onCustom,
|
|
82
|
+
onOpenCategory,
|
|
83
|
+
onOpenTemplate,
|
|
84
|
+
loadCatalog
|
|
85
|
+
}) {
|
|
86
|
+
const theme = useCanvasTheme();
|
|
87
|
+
const styles = makeStyles(theme);
|
|
88
|
+
const [query, setQuery] = useState("");
|
|
89
|
+
const [custom, setCustom] = useState(false);
|
|
90
|
+
const q = query.trim();
|
|
91
|
+
const results = searchStudioSizes(q);
|
|
92
|
+
const submit = () => {
|
|
93
|
+
if (results.typed) onCustom(results.typed.width, results.typed.height);
|
|
94
|
+
else if (results.sizes[0]) onCreate(results.sizes[0]);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsxs(ScrollView, { style: styles.fill, contentContainerStyle: {
|
|
97
|
+
paddingBottom: bottomInset + SPACE.xxl
|
|
98
|
+
}, keyboardShouldPersistTaps: "handled", keyboardDismissMode: "on-drag", children: [
|
|
99
|
+
/* @__PURE__ */ jsx(View, { style: styles.searchRow, children: /* @__PURE__ */ jsxs(View, { style: styles.searchBox, children: [
|
|
100
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "magnify", size: 20, color: theme.mutedForeground }),
|
|
101
|
+
/* @__PURE__ */ jsx(TextInput, { value: query, onChangeText: setQuery, onSubmitEditing: submit, placeholder: "Search templates or type 1200 \xD7 800", placeholderTextColor: theme.mutedForeground, style: styles.searchInput, returnKeyType: "search", autoCorrect: false, accessibilityLabel: "Search design sizes and templates" }),
|
|
102
|
+
query ? /* @__PURE__ */ jsx(IconButton, { icon: "close", label: "Clear search", onPress: () => setQuery(""), size: 32 }) : null
|
|
103
|
+
] }) }),
|
|
104
|
+
q ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionTitle, accessibilityRole: "header", children: "Search results" }),
|
|
107
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionIntro, children: `Sizes and templates matching "${q}".` })
|
|
108
|
+
] }),
|
|
109
|
+
results.typed || results.sizes.length ? /* @__PURE__ */ jsx(View, { style: styles.section, children: /* @__PURE__ */ jsxs(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.rail, contentContainerStyle: styles.railContent, children: [
|
|
110
|
+
results.typed ? /* @__PURE__ */ jsx(SizeCard, { label: "Custom size", width: results.typed.width, height: results.typed.height, detail: `${results.typed.width} \xD7 ${results.typed.height}`, onPress: () => onCustom(results.typed.width, results.typed.height) }) : null,
|
|
111
|
+
results.sizes.map((size) => {
|
|
112
|
+
var _a;
|
|
113
|
+
return /* @__PURE__ */ jsx(SizeCard, { label: size.label, width: size.width, height: size.height, detail: (_a = size.physical) != null ? _a : `${size.width} \xD7 ${size.height}`, onPress: () => onCreate(size) }, size.id);
|
|
114
|
+
})
|
|
115
|
+
] }) }) : /* @__PURE__ */ jsxs(View, { style: [styles.section, styles.noMatch], children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionIntro, children: `No sizes match "${q}".` }),
|
|
117
|
+
/* @__PURE__ */ jsx(ActionButton, { label: "Enter a custom size", variant: "secondary", onPress: () => {
|
|
118
|
+
setQuery("");
|
|
119
|
+
setCustom(true);
|
|
120
|
+
} })
|
|
121
|
+
] }),
|
|
122
|
+
loadCatalog ? /* @__PURE__ */ jsx(View, { style: styles.shelves, children: SEARCH_SECTIONS.map((section) => /* @__PURE__ */ jsx(CatalogPreviewShelf, { group: section.group, title: section.title, query: q, load: loadCatalog, onOpen: onOpenTemplate, onSeeAll: () => {
|
|
123
|
+
const category = designCategoryFor(section.category);
|
|
124
|
+
if (category) onOpenCategory(category, q);
|
|
125
|
+
} }, section.group)) }) : null
|
|
126
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
+
DESIGN_CATEGORY_GROUPS.map((group) => /* @__PURE__ */ jsxs(View, { style: [styles.section, group.id === "topics" && styles.topics], children: [
|
|
128
|
+
/* @__PURE__ */ jsx(SectionHeader, { title: group.label }),
|
|
129
|
+
/* @__PURE__ */ jsxs(View, { style: styles.categoryGrid, accessibilityLabel: group.label, children: [
|
|
130
|
+
group.items.map((category) => {
|
|
131
|
+
var _a;
|
|
132
|
+
return /* @__PURE__ */ jsx(CategoryTile, { icon: (_a = CATEGORY_ICON[category.id]) != null ? _a : "shape-outline", label: category.title, onPress: () => onOpenCategory(category) }, category.id);
|
|
133
|
+
}),
|
|
134
|
+
group.id === "topics" ? /* @__PURE__ */ jsx(CategoryTile, { icon: "ruler", label: "Custom size", active: custom, onPress: () => setCustom((v) => !v) }) : null
|
|
135
|
+
] }),
|
|
136
|
+
group.id === "topics" && custom ? /* @__PURE__ */ jsx(CustomSize, { onCreate: onCustom }) : null
|
|
137
|
+
] }, group.id)),
|
|
138
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
139
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionTitle, accessibilityRole: "header", children: "Popular formats" }),
|
|
140
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.sectionIntro, styles.introGap], children: FORMAT_INTRO }),
|
|
141
|
+
/* @__PURE__ */ jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.rail, contentContainerStyle: styles.railContent, children: sizesIn().map((size) => {
|
|
142
|
+
var _a;
|
|
143
|
+
return /* @__PURE__ */ jsx(SizeCard, { label: size.label, width: size.width, height: size.height, detail: (_a = size.physical) != null ? _a : `${size.width} \xD7 ${size.height}`, onPress: () => onCreate(size) }, size.id);
|
|
144
|
+
}) })
|
|
145
|
+
] }),
|
|
146
|
+
loadCatalog ? /* @__PURE__ */ jsx(View, { style: styles.shelves, children: ["flyer", "presentation", "social"].map((id) => {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
const section = SEARCH_SECTIONS.find((s) => s.category === id);
|
|
149
|
+
const category = designCategoryFor(id);
|
|
150
|
+
return /* @__PURE__ */ jsx(CatalogPreviewShelf, { group: section.group, title: (_b = (_a = category == null ? void 0 : category.shelves[0]) == null ? void 0 : _a.title) != null ? _b : section.title, load: loadCatalog, onOpen: onOpenTemplate, onSeeAll: category ? () => onOpenCategory(category) : void 0 }, section.group);
|
|
151
|
+
}) }) : null
|
|
152
|
+
] })
|
|
153
|
+
] });
|
|
154
|
+
}
|
|
155
|
+
function CategoryTile({
|
|
156
|
+
icon,
|
|
157
|
+
label,
|
|
158
|
+
active,
|
|
159
|
+
onPress
|
|
160
|
+
}) {
|
|
161
|
+
const theme = useCanvasTheme();
|
|
162
|
+
const styles = makeStyles(theme);
|
|
163
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, style: ({
|
|
164
|
+
pressed
|
|
165
|
+
}) => [styles.category, pressedStyle(pressed)], accessibilityRole: "button", accessibilityState: active === void 0 ? void 0 : {
|
|
166
|
+
expanded: active
|
|
167
|
+
}, children: [
|
|
168
|
+
/* @__PURE__ */ jsx(View, { style: [styles.categoryIcon, active && styles.categoryIconOn], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 22, color: theme.foreground }) }),
|
|
169
|
+
/* @__PURE__ */ jsx(Text, { style: styles.categoryLabel, numberOfLines: 2, children: label })
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
function SizeCard({
|
|
173
|
+
label,
|
|
174
|
+
width,
|
|
175
|
+
height,
|
|
176
|
+
detail,
|
|
177
|
+
onPress
|
|
178
|
+
}) {
|
|
179
|
+
const theme = useCanvasTheme();
|
|
180
|
+
const styles = makeStyles(theme);
|
|
181
|
+
const h = 86;
|
|
182
|
+
const w = Math.max(48, Math.min(108, h * width / height));
|
|
183
|
+
const hh = Math.max(8, Math.min(h, w * height / width));
|
|
184
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, style: ({
|
|
185
|
+
pressed
|
|
186
|
+
}) => [styles.sizeCard, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: `New ${label}, ${detail}`, children: [
|
|
187
|
+
/* @__PURE__ */ jsx(View, { style: styles.sizeFrame, children: /* @__PURE__ */ jsx(View, { style: [styles.sizeShape, {
|
|
188
|
+
width: w,
|
|
189
|
+
height: hh
|
|
190
|
+
}] }) }),
|
|
191
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sizeLabel, numberOfLines: 1, children: label }),
|
|
192
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sizeDetail, children: detail })
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
function CustomSize({
|
|
196
|
+
onCreate
|
|
197
|
+
}) {
|
|
198
|
+
const theme = useCanvasTheme();
|
|
199
|
+
const styles = makeStyles(theme);
|
|
200
|
+
const [w, setW] = useState("1080");
|
|
201
|
+
const [h, setH] = useState("1080");
|
|
202
|
+
const width = Number(w);
|
|
203
|
+
const height = Number(h);
|
|
204
|
+
const ok = [width, height].every((v) => Number.isFinite(v) && v >= MIN_PX && v <= MAX_PX);
|
|
205
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.custom, children: [
|
|
206
|
+
/* @__PURE__ */ jsx(TextInput, { value: w, onChangeText: setW, keyboardType: "number-pad", style: styles.customInput, accessibilityLabel: "Width in pixels" }),
|
|
207
|
+
/* @__PURE__ */ jsx(Text, { style: styles.customX, children: "\xD7" }),
|
|
208
|
+
/* @__PURE__ */ jsx(TextInput, { value: h, onChangeText: setH, keyboardType: "number-pad", style: styles.customInput, accessibilityLabel: "Height in pixels" }),
|
|
209
|
+
/* @__PURE__ */ jsx(Text, { style: styles.customX, children: "px" }),
|
|
210
|
+
/* @__PURE__ */ jsx(ActionButton, { label: "Create", disabled: !ok, onPress: () => onCreate(Math.round(width), Math.round(height)) })
|
|
211
|
+
] });
|
|
212
|
+
}
|
|
213
|
+
function Recent({
|
|
214
|
+
bottomInset,
|
|
215
|
+
designs,
|
|
216
|
+
loading,
|
|
217
|
+
error,
|
|
218
|
+
onRefresh,
|
|
219
|
+
onOpenDesign,
|
|
220
|
+
onDesignAction,
|
|
221
|
+
onRenameDesign
|
|
222
|
+
}) {
|
|
223
|
+
const theme = useCanvasTheme();
|
|
224
|
+
const styles = makeStyles(theme);
|
|
225
|
+
const [expanded, setExpanded] = useState(false);
|
|
226
|
+
const [openActions, setOpenActions] = useState(null);
|
|
227
|
+
const {
|
|
228
|
+
shown,
|
|
229
|
+
more
|
|
230
|
+
} = visibleRecents(designs, expanded);
|
|
231
|
+
const firstLoad = loading && designs.length === 0;
|
|
232
|
+
const failed = Boolean(error) && designs.length === 0 && !loading;
|
|
233
|
+
const footer = /* @__PURE__ */ jsx(View, { style: styles.recentFooter, children: more ? /* @__PURE__ */ jsx(ActionButton, { label: expanded ? "Show fewer designs" : "See all designs", variant: "secondary", onPress: () => setExpanded((v) => !v), style: styles.fullWidth }) : null });
|
|
234
|
+
let empty = null;
|
|
235
|
+
if (firstLoad) {
|
|
236
|
+
empty = /* @__PURE__ */ jsx(View, { style: styles.recentList, accessibilityState: {
|
|
237
|
+
busy: true
|
|
238
|
+
}, children: Array.from({
|
|
239
|
+
length: 6
|
|
240
|
+
}, (_, i) => /* @__PURE__ */ jsxs(View, { style: styles.skeletonRow, children: [
|
|
241
|
+
/* @__PURE__ */ jsx(Skeleton, { style: styles.skeletonThumb, radius: RADIUS.sm }),
|
|
242
|
+
/* @__PURE__ */ jsxs(View, { style: styles.skeletonText, children: [
|
|
243
|
+
/* @__PURE__ */ jsx(Skeleton, { style: {
|
|
244
|
+
height: 12,
|
|
245
|
+
width: "75%"
|
|
246
|
+
}, radius: 4 }),
|
|
247
|
+
/* @__PURE__ */ jsx(Skeleton, { style: {
|
|
248
|
+
height: 12,
|
|
249
|
+
width: "50%"
|
|
250
|
+
}, radius: 4 })
|
|
251
|
+
] })
|
|
252
|
+
] }, i)) });
|
|
253
|
+
} else if (failed) {
|
|
254
|
+
empty = /* @__PURE__ */ jsxs(View, { style: styles.alert, accessibilityRole: "alert", children: [
|
|
255
|
+
/* @__PURE__ */ jsx(Text, { style: styles.alertText, children: "Couldn\u2019t load your designs. Your saved work will appear here when the connection returns." }),
|
|
256
|
+
error ? /* @__PURE__ */ jsx(Text, { style: styles.rowDetail, children: error }) : null,
|
|
257
|
+
/* @__PURE__ */ jsx(ActionButton, { label: "Retry", variant: "secondary", onPress: onRefresh })
|
|
258
|
+
] });
|
|
259
|
+
} else {
|
|
260
|
+
empty = /* @__PURE__ */ jsxs(View, { style: styles.emptyBox, children: [
|
|
261
|
+
/* @__PURE__ */ jsx(Text, { style: styles.emptyTitle, children: "Your work starts here" }),
|
|
262
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionIntro, children: "Choose a format or template to create your first design. Your saved work will appear here." })
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.fill, children: [
|
|
266
|
+
/* @__PURE__ */ jsxs(View, { style: styles.recentHeader, children: [
|
|
267
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionTitle, accessibilityRole: "header", children: "Recent designs" }),
|
|
268
|
+
/* @__PURE__ */ jsx(Text, { style: styles.sectionIntro, children: "Pick up where you left off." })
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ jsx(FlatList, { data: firstLoad || failed ? [] : shown, keyExtractor: (design) => design.id, style: styles.fill, contentContainerStyle: [styles.recentContent, {
|
|
271
|
+
paddingBottom: bottomInset + SPACE.xxl
|
|
272
|
+
}], keyboardShouldPersistTaps: "handled", refreshControl: /* @__PURE__ */ jsx(RefreshControl, { refreshing: false, onRefresh }), ItemSeparatorComponent: () => /* @__PURE__ */ jsx(View, { style: {
|
|
273
|
+
height: SPACE.sm
|
|
274
|
+
} }), ListEmptyComponent: empty, ListFooterComponent: footer, renderItem: ({
|
|
275
|
+
item
|
|
276
|
+
}) => /* @__PURE__ */ jsx(RecentRow, { design: item, actionsOpen: openActions === item.id, onToggleActions: () => setOpenActions((id) => id === item.id ? null : item.id), onOpen: () => onOpenDesign(item), onRename: (title) => onRenameDesign(item, title), onAction: (action) => {
|
|
277
|
+
setOpenActions(null);
|
|
278
|
+
onDesignAction(item, action);
|
|
279
|
+
} }) })
|
|
280
|
+
] });
|
|
281
|
+
}
|
|
282
|
+
function RecentRow({
|
|
283
|
+
design,
|
|
284
|
+
actionsOpen,
|
|
285
|
+
onToggleActions,
|
|
286
|
+
onOpen,
|
|
287
|
+
onRename,
|
|
288
|
+
onAction
|
|
289
|
+
}) {
|
|
290
|
+
const theme = useCanvasTheme();
|
|
291
|
+
const styles = makeStyles(theme);
|
|
292
|
+
const {
|
|
293
|
+
doc
|
|
294
|
+
} = design;
|
|
295
|
+
const title = designTitle(doc) || design.title || "Untitled design";
|
|
296
|
+
const [editing, setEditing] = useState(false);
|
|
297
|
+
const [draft, setDraft] = useState(title);
|
|
298
|
+
const page = doc.pages[0];
|
|
299
|
+
const THUMB_W = 80;
|
|
300
|
+
const THUMB_H = 64;
|
|
301
|
+
const pad = 6;
|
|
302
|
+
const ratio = doc.pageHeight / doc.pageWidth;
|
|
303
|
+
const pageW = Math.min(THUMB_W - pad * 2, (THUMB_H - pad * 2) / ratio);
|
|
304
|
+
const commit = () => {
|
|
305
|
+
setEditing(false);
|
|
306
|
+
if (draft.trim() !== title) onRename(draft);
|
|
307
|
+
};
|
|
308
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
309
|
+
/* @__PURE__ */ jsxs(View, { style: styles.rowMain, children: [
|
|
310
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: onOpen, onLongPress: onToggleActions, style: ({
|
|
311
|
+
pressed
|
|
312
|
+
}) => [styles.rowOpen, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: `Open ${title}`, children: [
|
|
313
|
+
/* @__PURE__ */ jsx(View, { style: styles.rowThumb, children: page ? /* @__PURE__ */ jsx(DesignPageView, { doc, page, width: pageW, style: styles.rowPage }) : null }),
|
|
314
|
+
/* @__PURE__ */ jsxs(View, { style: styles.rowText, children: [
|
|
315
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowTitle, numberOfLines: 2, children: title }),
|
|
316
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowDetail, numberOfLines: 1, children: sizeLabel(doc, design.kind) }),
|
|
317
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowDetail, children: `${pagesLabel(doc)} \xB7 ${relativeTime(design.updatedAt)}` })
|
|
318
|
+
] })
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ jsx(IconButton, { icon: "dots-horizontal", label: `More for ${title}`, onPress: onToggleActions, size: 32 })
|
|
321
|
+
] }),
|
|
322
|
+
editing ? /* @__PURE__ */ jsxs(View, { style: styles.renameRow, children: [
|
|
323
|
+
/* @__PURE__ */ jsx(TextInput, { value: draft, autoFocus: true, selectTextOnFocus: true, onChangeText: setDraft, onSubmitEditing: commit, onBlur: commit, maxLength: 80, returnKeyType: "done", style: styles.renameInput, accessibilityLabel: "Design name" }),
|
|
324
|
+
/* @__PURE__ */ jsx(IconButton, { icon: "check", label: "Save name", onPress: commit, size: 36 })
|
|
325
|
+
] }) : null,
|
|
326
|
+
actionsOpen && !editing ? /* @__PURE__ */ jsxs(View, { style: styles.actions, accessibilityLabel: `Actions for ${title}`, children: [
|
|
327
|
+
/* @__PURE__ */ jsx(RowAction, { icon: "pencil-outline", label: "Rename", a11y: `Rename ${title}`, onPress: () => {
|
|
328
|
+
onToggleActions();
|
|
329
|
+
setDraft(title);
|
|
330
|
+
setEditing(true);
|
|
331
|
+
} }),
|
|
332
|
+
/* @__PURE__ */ jsx(RowAction, { icon: "content-copy", label: "Copy", a11y: `Duplicate ${title}`, onPress: () => onAction("duplicate") }),
|
|
333
|
+
/* @__PURE__ */ jsx(RowAction, { icon: "trash-can-outline", label: "Delete", a11y: `Delete ${title}`, danger: true, onPress: () => onAction("delete") })
|
|
334
|
+
] }) : null
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
function RowAction({
|
|
338
|
+
icon,
|
|
339
|
+
label,
|
|
340
|
+
a11y,
|
|
341
|
+
danger,
|
|
342
|
+
onPress
|
|
343
|
+
}) {
|
|
344
|
+
const theme = useCanvasTheme();
|
|
345
|
+
const styles = makeStyles(theme);
|
|
346
|
+
const ink = danger ? theme.destructiveText : theme.inkSoft;
|
|
347
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, style: ({
|
|
348
|
+
pressed
|
|
349
|
+
}) => [styles.action, pressedStyle(pressed)], accessibilityRole: "button", accessibilityLabel: a11y, children: [
|
|
350
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 15, color: ink }),
|
|
351
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, {
|
|
352
|
+
color: ink
|
|
353
|
+
}], children: label })
|
|
354
|
+
] });
|
|
355
|
+
}
|
|
356
|
+
const makeStyles = themedStyles((theme) => StyleSheet.create({
|
|
357
|
+
root: {
|
|
358
|
+
flex: 1,
|
|
359
|
+
backgroundColor: theme.background
|
|
360
|
+
},
|
|
361
|
+
fill: {
|
|
362
|
+
flex: 1
|
|
363
|
+
},
|
|
364
|
+
// The shared studio bar: 44pt on phones, no large title under it.
|
|
365
|
+
bar: {
|
|
366
|
+
flexDirection: "row",
|
|
367
|
+
alignItems: "center",
|
|
368
|
+
gap: SPACE.xs,
|
|
369
|
+
height: 44,
|
|
370
|
+
paddingHorizontal: SPACE.sm
|
|
371
|
+
},
|
|
372
|
+
barTitle: __spreadProps(__spreadValues({}, TYPE.title), {
|
|
373
|
+
color: theme.foreground,
|
|
374
|
+
paddingHorizontal: SPACE.sm
|
|
375
|
+
}),
|
|
376
|
+
switchWrap: {
|
|
377
|
+
paddingHorizontal: GUTTER,
|
|
378
|
+
paddingBottom: SPACE.md,
|
|
379
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
380
|
+
borderColor: theme.border
|
|
381
|
+
},
|
|
382
|
+
viewSwitch: {
|
|
383
|
+
flexDirection: "row",
|
|
384
|
+
gap: SPACE.xs,
|
|
385
|
+
padding: SPACE.xs,
|
|
386
|
+
borderRadius: RADIUS.sm,
|
|
387
|
+
backgroundColor: theme.card
|
|
388
|
+
},
|
|
389
|
+
viewButton: {
|
|
390
|
+
flex: 1,
|
|
391
|
+
minHeight: 40,
|
|
392
|
+
flexDirection: "row",
|
|
393
|
+
alignItems: "center",
|
|
394
|
+
justifyContent: "center",
|
|
395
|
+
gap: SPACE.sm,
|
|
396
|
+
paddingHorizontal: SPACE.md,
|
|
397
|
+
borderRadius: 6
|
|
398
|
+
},
|
|
399
|
+
viewButtonOn: {
|
|
400
|
+
backgroundColor: theme.background
|
|
401
|
+
},
|
|
402
|
+
viewLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
403
|
+
fontWeight: "500",
|
|
404
|
+
color: theme.mutedForeground
|
|
405
|
+
}),
|
|
406
|
+
viewLabelOn: {
|
|
407
|
+
color: theme.foreground,
|
|
408
|
+
fontWeight: "600"
|
|
409
|
+
},
|
|
410
|
+
searchRow: {
|
|
411
|
+
flexDirection: "row",
|
|
412
|
+
alignItems: "center",
|
|
413
|
+
gap: SPACE.md,
|
|
414
|
+
padding: GUTTER,
|
|
415
|
+
paddingBottom: SPACE.lg
|
|
416
|
+
},
|
|
417
|
+
searchBox: {
|
|
418
|
+
flex: 1,
|
|
419
|
+
flexDirection: "row",
|
|
420
|
+
alignItems: "center",
|
|
421
|
+
gap: SPACE.sm,
|
|
422
|
+
height: 44,
|
|
423
|
+
paddingLeft: SPACE.md,
|
|
424
|
+
paddingRight: SPACE.xs,
|
|
425
|
+
borderRadius: RADIUS.sm,
|
|
426
|
+
backgroundColor: theme.surface,
|
|
427
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
428
|
+
borderColor: theme.borderStrong
|
|
429
|
+
},
|
|
430
|
+
searchInput: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
431
|
+
fontSize: 14,
|
|
432
|
+
flex: 1,
|
|
433
|
+
paddingVertical: 0,
|
|
434
|
+
color: theme.foreground
|
|
435
|
+
}),
|
|
436
|
+
section: {
|
|
437
|
+
paddingHorizontal: GUTTER,
|
|
438
|
+
marginBottom: SPACE.xl
|
|
439
|
+
},
|
|
440
|
+
shelves: {
|
|
441
|
+
paddingHorizontal: GUTTER
|
|
442
|
+
},
|
|
443
|
+
topics: {
|
|
444
|
+
paddingTop: SPACE.lg,
|
|
445
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
446
|
+
borderColor: theme.border,
|
|
447
|
+
marginHorizontal: GUTTER,
|
|
448
|
+
paddingHorizontal: 0
|
|
449
|
+
},
|
|
450
|
+
sectionTitle: {
|
|
451
|
+
fontSize: 18,
|
|
452
|
+
lineHeight: 25,
|
|
453
|
+
fontWeight: "600",
|
|
454
|
+
color: theme.foreground
|
|
455
|
+
},
|
|
456
|
+
sectionIntro: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
457
|
+
fontSize: 14,
|
|
458
|
+
lineHeight: 20,
|
|
459
|
+
color: theme.mutedForeground
|
|
460
|
+
}),
|
|
461
|
+
introGap: {
|
|
462
|
+
marginTop: 2,
|
|
463
|
+
marginBottom: SPACE.md
|
|
464
|
+
},
|
|
465
|
+
noMatch: {
|
|
466
|
+
flexDirection: "row",
|
|
467
|
+
flexWrap: "wrap",
|
|
468
|
+
alignItems: "center",
|
|
469
|
+
gap: SPACE.md
|
|
470
|
+
},
|
|
471
|
+
categoryGrid: {
|
|
472
|
+
flexDirection: "row",
|
|
473
|
+
flexWrap: "wrap",
|
|
474
|
+
gap: SPACE.sm
|
|
475
|
+
},
|
|
476
|
+
category: {
|
|
477
|
+
width: "23%",
|
|
478
|
+
alignItems: "center",
|
|
479
|
+
gap: SPACE.xs,
|
|
480
|
+
paddingVertical: SPACE.xs
|
|
481
|
+
},
|
|
482
|
+
categoryIcon: {
|
|
483
|
+
width: 52,
|
|
484
|
+
height: 52,
|
|
485
|
+
borderRadius: 26,
|
|
486
|
+
backgroundColor: theme.card,
|
|
487
|
+
alignItems: "center",
|
|
488
|
+
justifyContent: "center"
|
|
489
|
+
},
|
|
490
|
+
categoryIconOn: {
|
|
491
|
+
borderWidth: 1.5,
|
|
492
|
+
borderColor: theme.foreground
|
|
493
|
+
},
|
|
494
|
+
categoryLabel: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
495
|
+
color: theme.foreground,
|
|
496
|
+
textAlign: "center"
|
|
497
|
+
}),
|
|
498
|
+
rail: {
|
|
499
|
+
flexGrow: 0,
|
|
500
|
+
marginHorizontal: -16
|
|
501
|
+
},
|
|
502
|
+
railContent: {
|
|
503
|
+
paddingHorizontal: GUTTER,
|
|
504
|
+
gap: SPACE.md
|
|
505
|
+
},
|
|
506
|
+
sizeCard: {
|
|
507
|
+
width: 128,
|
|
508
|
+
gap: 2
|
|
509
|
+
},
|
|
510
|
+
sizeFrame: {
|
|
511
|
+
height: 104,
|
|
512
|
+
borderRadius: RADIUS.md,
|
|
513
|
+
backgroundColor: theme.card,
|
|
514
|
+
alignItems: "center",
|
|
515
|
+
justifyContent: "center"
|
|
516
|
+
},
|
|
517
|
+
sizeShape: {
|
|
518
|
+
backgroundColor: theme.surface,
|
|
519
|
+
borderRadius: 3,
|
|
520
|
+
borderWidth: 1,
|
|
521
|
+
borderColor: theme.borderStrong
|
|
522
|
+
},
|
|
523
|
+
sizeLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
524
|
+
color: theme.foreground,
|
|
525
|
+
marginTop: SPACE.xs
|
|
526
|
+
}),
|
|
527
|
+
sizeDetail: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
528
|
+
color: theme.mutedForeground
|
|
529
|
+
}),
|
|
530
|
+
custom: {
|
|
531
|
+
flexDirection: "row",
|
|
532
|
+
alignItems: "center",
|
|
533
|
+
gap: SPACE.sm,
|
|
534
|
+
marginTop: SPACE.md
|
|
535
|
+
},
|
|
536
|
+
customInput: __spreadValues({
|
|
537
|
+
width: 76,
|
|
538
|
+
height: 44,
|
|
539
|
+
borderRadius: RADIUS.sm,
|
|
540
|
+
paddingHorizontal: SPACE.md,
|
|
541
|
+
backgroundColor: theme.card,
|
|
542
|
+
color: theme.foreground
|
|
543
|
+
}, TYPE.body),
|
|
544
|
+
customX: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
545
|
+
color: theme.mutedForeground
|
|
546
|
+
}),
|
|
547
|
+
// Recent designs
|
|
548
|
+
recentHeader: {
|
|
549
|
+
paddingHorizontal: GUTTER,
|
|
550
|
+
paddingTop: SPACE.lg,
|
|
551
|
+
paddingBottom: SPACE.md,
|
|
552
|
+
gap: 2
|
|
553
|
+
},
|
|
554
|
+
recentContent: {
|
|
555
|
+
paddingHorizontal: GUTTER - SPACE.xs,
|
|
556
|
+
paddingTop: SPACE.xs
|
|
557
|
+
},
|
|
558
|
+
recentList: {
|
|
559
|
+
gap: SPACE.sm
|
|
560
|
+
},
|
|
561
|
+
recentFooter: {
|
|
562
|
+
paddingTop: SPACE.lg,
|
|
563
|
+
paddingHorizontal: SPACE.xs
|
|
564
|
+
},
|
|
565
|
+
fullWidth: {
|
|
566
|
+
alignSelf: "stretch"
|
|
567
|
+
},
|
|
568
|
+
row: {
|
|
569
|
+
borderRadius: RADIUS.sm,
|
|
570
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
571
|
+
borderColor: "transparent"
|
|
572
|
+
},
|
|
573
|
+
rowMain: {
|
|
574
|
+
flexDirection: "row",
|
|
575
|
+
alignItems: "flex-start",
|
|
576
|
+
gap: SPACE.xs,
|
|
577
|
+
padding: SPACE.sm
|
|
578
|
+
},
|
|
579
|
+
rowOpen: {
|
|
580
|
+
flex: 1,
|
|
581
|
+
minWidth: 0,
|
|
582
|
+
flexDirection: "row",
|
|
583
|
+
alignItems: "center",
|
|
584
|
+
gap: SPACE.md
|
|
585
|
+
},
|
|
586
|
+
rowThumb: {
|
|
587
|
+
width: 80,
|
|
588
|
+
height: 64,
|
|
589
|
+
borderRadius: RADIUS.sm - 2,
|
|
590
|
+
backgroundColor: theme.card,
|
|
591
|
+
alignItems: "center",
|
|
592
|
+
justifyContent: "center",
|
|
593
|
+
overflow: "hidden"
|
|
594
|
+
},
|
|
595
|
+
rowPage: {
|
|
596
|
+
borderRadius: 3
|
|
597
|
+
},
|
|
598
|
+
rowText: {
|
|
599
|
+
flex: 1,
|
|
600
|
+
minWidth: 0,
|
|
601
|
+
gap: 4
|
|
602
|
+
},
|
|
603
|
+
rowTitle: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
604
|
+
fontWeight: "500",
|
|
605
|
+
fontSize: 14,
|
|
606
|
+
lineHeight: 19,
|
|
607
|
+
color: theme.foreground
|
|
608
|
+
}),
|
|
609
|
+
rowDetail: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
610
|
+
fontWeight: "400",
|
|
611
|
+
color: theme.mutedForeground
|
|
612
|
+
}),
|
|
613
|
+
renameRow: {
|
|
614
|
+
flexDirection: "row",
|
|
615
|
+
alignItems: "center",
|
|
616
|
+
gap: SPACE.xs,
|
|
617
|
+
marginHorizontal: SPACE.sm,
|
|
618
|
+
marginBottom: SPACE.sm
|
|
619
|
+
},
|
|
620
|
+
renameInput: {
|
|
621
|
+
flex: 1,
|
|
622
|
+
height: 36,
|
|
623
|
+
paddingHorizontal: SPACE.sm,
|
|
624
|
+
borderRadius: RADIUS.sm,
|
|
625
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
626
|
+
borderColor: theme.borderStrong,
|
|
627
|
+
backgroundColor: theme.surface,
|
|
628
|
+
color: theme.foreground,
|
|
629
|
+
fontSize: 14
|
|
630
|
+
},
|
|
631
|
+
actions: {
|
|
632
|
+
flexDirection: "row",
|
|
633
|
+
gap: SPACE.xs,
|
|
634
|
+
padding: 6,
|
|
635
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
636
|
+
borderColor: theme.border
|
|
637
|
+
},
|
|
638
|
+
action: {
|
|
639
|
+
flex: 1,
|
|
640
|
+
minHeight: 36,
|
|
641
|
+
flexDirection: "row",
|
|
642
|
+
alignItems: "center",
|
|
643
|
+
justifyContent: "center",
|
|
644
|
+
gap: 6,
|
|
645
|
+
borderRadius: 6
|
|
646
|
+
},
|
|
647
|
+
actionLabel: __spreadValues({}, TYPE.caption),
|
|
648
|
+
skeletonRow: {
|
|
649
|
+
flexDirection: "row",
|
|
650
|
+
alignItems: "center",
|
|
651
|
+
gap: SPACE.md,
|
|
652
|
+
padding: SPACE.sm
|
|
653
|
+
},
|
|
654
|
+
skeletonThumb: {
|
|
655
|
+
width: 80,
|
|
656
|
+
height: 64
|
|
657
|
+
},
|
|
658
|
+
skeletonText: {
|
|
659
|
+
flex: 1,
|
|
660
|
+
gap: SPACE.sm
|
|
661
|
+
},
|
|
662
|
+
alert: {
|
|
663
|
+
gap: SPACE.md,
|
|
664
|
+
alignItems: "flex-start",
|
|
665
|
+
padding: SPACE.lg,
|
|
666
|
+
borderRadius: RADIUS.sm,
|
|
667
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
668
|
+
borderColor: theme.border
|
|
669
|
+
},
|
|
670
|
+
alertText: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
671
|
+
fontSize: 14,
|
|
672
|
+
lineHeight: 20,
|
|
673
|
+
color: theme.mutedForeground
|
|
674
|
+
}),
|
|
675
|
+
emptyBox: {
|
|
676
|
+
gap: SPACE.sm,
|
|
677
|
+
paddingHorizontal: SPACE.lg,
|
|
678
|
+
paddingVertical: SPACE.xl,
|
|
679
|
+
borderRadius: RADIUS.sm,
|
|
680
|
+
borderWidth: 1,
|
|
681
|
+
borderStyle: "dashed",
|
|
682
|
+
borderColor: theme.borderStrong
|
|
683
|
+
},
|
|
684
|
+
emptyTitle: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
685
|
+
fontSize: 14,
|
|
686
|
+
color: theme.foreground
|
|
687
|
+
})
|
|
688
|
+
}));export{DesignHome};//# sourceMappingURL=DesignHome.js.map
|