@adminide-stack/yantra-mobile 12.0.129-alpha.0 → 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 +3 -3
- package/lib/features/design/exportDesign.js +0 -133
- package/lib/features/design/exportDesign.js.map +0 -1
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useMemo,useRef}from'react';import {View,TextInput,ActivityIndicator,Text,StyleSheet}from'react-native';import {Image}from'expo-image';import {MaterialCommunityIcons}from'@expo/vector-icons';import {useCanvasTheme,themedStyles}from'../../canvas/canvasTheme.js';import {Pressable,RADIUS,SPACE,TYPE}from'../../canvas/canvasUi.js';import {TEXT_PRESETS}from'../doc/docOps.js';import {catalogGroupOf}from'../doc/newDoc.js';import {scalePath}from'../doc/pathScale.js';import {SHAPE_CATEGORIES,shapesInCategory,SHAPES,isStrokeShape}from'../doc/shapes.js';import {DESIGN_SIZES,fromPx}from'../doc/sizes.js';import {resolveTextFont}from'../render/fontRegistry.js';import {getSvg,svgUsable,SvgBoundary}from'../render/svg.js';import {DEFAULT_QR_STYLE,normaliseQrText}from'../doc/qr.js';import {ColorPicker,FontList}from'./controls.js';import {FramesGrid}from'./ImageTools.js';import {colorsInDoc,fontsInDoc}from'./LayerTools.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 DOCK_TOOLS = [{
|
|
21
|
+
id: "ai",
|
|
22
|
+
label: "AI",
|
|
23
|
+
icon: "creation"
|
|
24
|
+
}, {
|
|
25
|
+
id: "templates",
|
|
26
|
+
label: "Templates",
|
|
27
|
+
icon: "view-dashboard-outline"
|
|
28
|
+
}, {
|
|
29
|
+
id: "elements",
|
|
30
|
+
label: "Elements",
|
|
31
|
+
icon: "shape-outline"
|
|
32
|
+
}, {
|
|
33
|
+
id: "text",
|
|
34
|
+
label: "Text",
|
|
35
|
+
icon: "format-text"
|
|
36
|
+
}, {
|
|
37
|
+
id: "brand",
|
|
38
|
+
label: "Brand",
|
|
39
|
+
icon: "palette-outline"
|
|
40
|
+
}, {
|
|
41
|
+
id: "details",
|
|
42
|
+
label: "Details",
|
|
43
|
+
icon: "tune-variant"
|
|
44
|
+
}, {
|
|
45
|
+
id: "assets",
|
|
46
|
+
label: "Assets",
|
|
47
|
+
icon: "image-multiple-outline"
|
|
48
|
+
}];
|
|
49
|
+
function TemplatesPanel({
|
|
50
|
+
doc,
|
|
51
|
+
load,
|
|
52
|
+
onPick,
|
|
53
|
+
width
|
|
54
|
+
}) {
|
|
55
|
+
var _a;
|
|
56
|
+
const theme = useCanvasTheme();
|
|
57
|
+
const styles = makeStyles(theme);
|
|
58
|
+
const group = (_a = catalogGroupOf(doc)) != null ? _a : "canvas-flyer";
|
|
59
|
+
const [query, setQuery] = useState("");
|
|
60
|
+
const [search, setSearch] = useState("");
|
|
61
|
+
const [cards, setCards] = useState([]);
|
|
62
|
+
const [status, setStatus] = useState("loading");
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const t = setTimeout(() => setSearch(query.trim()), 350);
|
|
65
|
+
return () => clearTimeout(t);
|
|
66
|
+
}, [query]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!load) {
|
|
69
|
+
setStatus("failed");
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
let live = true;
|
|
73
|
+
setStatus("loading");
|
|
74
|
+
load(group, {
|
|
75
|
+
search: search || void 0,
|
|
76
|
+
limit: 24,
|
|
77
|
+
offset: 0
|
|
78
|
+
}).then((page) => {
|
|
79
|
+
if (!live) return;
|
|
80
|
+
setCards(page.cards);
|
|
81
|
+
setStatus("ready");
|
|
82
|
+
}, () => live && setStatus("failed"));
|
|
83
|
+
return () => {
|
|
84
|
+
live = false;
|
|
85
|
+
};
|
|
86
|
+
}, [load, group, search]);
|
|
87
|
+
const col = (width - SPACE.lg * 2 - SPACE.md) / 2;
|
|
88
|
+
return /* @__PURE__ */ jsxs(View, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(TextInput, { value: query, onChangeText: setQuery, placeholder: "Search templates", placeholderTextColor: theme.edInk3, style: styles.search, autoCorrect: false, returnKeyType: "search" }),
|
|
90
|
+
status === "loading" ? /* @__PURE__ */ jsx(ActivityIndicator, { style: styles.spinner, color: theme.edInk2 }) : null,
|
|
91
|
+
status === "failed" ? /* @__PURE__ */ jsx(Text, { style: styles.empty, children: "Templates could not load." }) : null,
|
|
92
|
+
status === "ready" && cards.length === 0 ? /* @__PURE__ */ jsx(Text, { style: styles.empty, children: "No templates match." }) : null,
|
|
93
|
+
/* @__PURE__ */ jsx(View, { style: styles.grid, children: cards.map((card) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => onPick(card), style: ({
|
|
94
|
+
pressed
|
|
95
|
+
}) => [{
|
|
96
|
+
width: col
|
|
97
|
+
}, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: card.title, children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Image, { source: {
|
|
99
|
+
uri: card.coverUrl
|
|
100
|
+
}, style: [styles.cover, {
|
|
101
|
+
width: col,
|
|
102
|
+
height: col * card.pageHeight / card.pageWidth
|
|
103
|
+
}], contentFit: "cover", transition: 150 }),
|
|
104
|
+
/* @__PURE__ */ jsx(Text, { style: styles.cardTitle, numberOfLines: 1, children: card.title })
|
|
105
|
+
] }, card.id)) })
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
function ShapeGlyph({
|
|
109
|
+
shape,
|
|
110
|
+
size,
|
|
111
|
+
color
|
|
112
|
+
}) {
|
|
113
|
+
const svg = getSvg();
|
|
114
|
+
const box = /* @__PURE__ */ jsx(View, { style: {
|
|
115
|
+
width: size,
|
|
116
|
+
height: size,
|
|
117
|
+
backgroundColor: color,
|
|
118
|
+
borderRadius: shape === "ellipse" ? size / 2 : 4
|
|
119
|
+
} });
|
|
120
|
+
if (!svg || !svgUsable()) return box;
|
|
121
|
+
const {
|
|
122
|
+
Svg,
|
|
123
|
+
Path,
|
|
124
|
+
Line
|
|
125
|
+
} = svg;
|
|
126
|
+
return /* @__PURE__ */ jsx(SvgBoundary, { fallback: box, children: /* @__PURE__ */ jsx(Svg, { width: size, height: size, children: isStrokeShape(shape) ? /* @__PURE__ */ jsx(Line, { x1: 2, y1: size / 2, x2: size - 2, y2: size / 2, stroke: color, strokeWidth: 3, strokeLinecap: "round" }) : /* @__PURE__ */ jsx(Path, { d: scalePath(SHAPES[shape].d, size, size), fill: color }) }) });
|
|
127
|
+
}
|
|
128
|
+
const CHARTS = [{
|
|
129
|
+
id: "bar",
|
|
130
|
+
label: "Bar",
|
|
131
|
+
icon: "chart-bar"
|
|
132
|
+
}, {
|
|
133
|
+
id: "row",
|
|
134
|
+
label: "Row",
|
|
135
|
+
icon: "chart-gantt"
|
|
136
|
+
}, {
|
|
137
|
+
id: "line",
|
|
138
|
+
label: "Line",
|
|
139
|
+
icon: "chart-line"
|
|
140
|
+
}, {
|
|
141
|
+
id: "area",
|
|
142
|
+
label: "Area",
|
|
143
|
+
icon: "chart-areaspline"
|
|
144
|
+
}, {
|
|
145
|
+
id: "pie",
|
|
146
|
+
label: "Pie",
|
|
147
|
+
icon: "chart-pie"
|
|
148
|
+
}, {
|
|
149
|
+
id: "donut",
|
|
150
|
+
label: "Donut",
|
|
151
|
+
icon: "chart-donut"
|
|
152
|
+
}];
|
|
153
|
+
const STICKER_EMOJI = ["\u{1F525}", "\u2764\uFE0F", "\u{1F602}", "\u{1F44D}", "\u2B50", "\u{1F389}", "\u{1F4AF}", "\u2728", "\u{1F60D}", "\u{1F680}", "\u{1F44F}", "\u{1F4A1}"];
|
|
154
|
+
const QR_COLORS = [{
|
|
155
|
+
foreground: "#000000",
|
|
156
|
+
background: "#ffffff"
|
|
157
|
+
}, {
|
|
158
|
+
foreground: "#0f172a",
|
|
159
|
+
background: "#f8fafc"
|
|
160
|
+
}, {
|
|
161
|
+
foreground: "#ffffff",
|
|
162
|
+
background: "#000000"
|
|
163
|
+
}, {
|
|
164
|
+
foreground: "#1d4ed8",
|
|
165
|
+
background: "#ffffff"
|
|
166
|
+
}, {
|
|
167
|
+
foreground: "#7c3aed",
|
|
168
|
+
background: "#faf5ff"
|
|
169
|
+
}];
|
|
170
|
+
function QrSection({
|
|
171
|
+
onAdd
|
|
172
|
+
}) {
|
|
173
|
+
const theme = useCanvasTheme();
|
|
174
|
+
const styles = makeStyles(theme);
|
|
175
|
+
const [text, setText] = useState("");
|
|
176
|
+
const [style, setStyle] = useState(DEFAULT_QR_STYLE);
|
|
177
|
+
const [busy, setBusy] = useState(false);
|
|
178
|
+
const [error, setError] = useState(null);
|
|
179
|
+
const value = normaliseQrText(text);
|
|
180
|
+
const add = async () => {
|
|
181
|
+
if (!value || busy) return;
|
|
182
|
+
setBusy(true);
|
|
183
|
+
setError(null);
|
|
184
|
+
try {
|
|
185
|
+
await onAdd(value, style);
|
|
186
|
+
setText("");
|
|
187
|
+
} catch (err) {
|
|
188
|
+
setError(err instanceof Error ? err.message : "The QR code could not be added. Try again.");
|
|
189
|
+
} finally {
|
|
190
|
+
setBusy(false);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
194
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "QR code" }),
|
|
195
|
+
/* @__PURE__ */ jsx(TextInput, { value: text, onChangeText: setText, placeholder: "yantra.app", placeholderTextColor: theme.edInk3, autoCapitalize: "none", autoCorrect: false, keyboardType: "url", style: styles.input, onSubmitEditing: () => void add() }),
|
|
196
|
+
/* @__PURE__ */ jsxs(View, { style: styles.swatchRow, children: [
|
|
197
|
+
QR_COLORS.map((c) => {
|
|
198
|
+
const on = c.foreground === style.foreground && c.background === style.background;
|
|
199
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: () => setStyle((s) => __spreadValues(__spreadValues({}, s), c)), style: [styles.qrSwatch, {
|
|
200
|
+
backgroundColor: c.background,
|
|
201
|
+
borderColor: on ? theme.edAccent : theme.edLineHi
|
|
202
|
+
}], accessibilityRole: "button", accessibilityState: {
|
|
203
|
+
selected: on
|
|
204
|
+
}, accessibilityLabel: `Code ${c.foreground} on ${c.background}`, children: /* @__PURE__ */ jsx(View, { style: [styles.qrDot, {
|
|
205
|
+
backgroundColor: c.foreground
|
|
206
|
+
}] }) }, `${c.foreground}${c.background}`);
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => setStyle((s) => __spreadProps(__spreadValues({}, s), {
|
|
209
|
+
margin: s.margin ? 0 : 2
|
|
210
|
+
})), style: [styles.qrSwatch, {
|
|
211
|
+
borderColor: style.margin ? theme.edAccent : theme.edLineHi
|
|
212
|
+
}], accessibilityRole: "switch", accessibilityState: {
|
|
213
|
+
checked: Boolean(style.margin)
|
|
214
|
+
}, accessibilityLabel: "Quiet zone", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "border-outside", size: 18, color: theme.edInk2 }) })
|
|
215
|
+
] }),
|
|
216
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => void add(), disabled: !value || busy, style: [styles.wideButton, (!value || busy) && styles.dim], accessibilityRole: "button", children: [
|
|
217
|
+
busy ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.edInk2 }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "qrcode-plus", size: 20, color: theme.edInk }),
|
|
218
|
+
/* @__PURE__ */ jsx(Text, { style: styles.wideLabel, children: busy ? "Adding\u2026" : "Add QR code" })
|
|
219
|
+
] }),
|
|
220
|
+
error ? /* @__PURE__ */ jsx(Text, { style: [styles.empty, {
|
|
221
|
+
color: theme.edDanger,
|
|
222
|
+
paddingVertical: 0
|
|
223
|
+
}], children: error }) : null
|
|
224
|
+
] });
|
|
225
|
+
}
|
|
226
|
+
function ElementsPanel({
|
|
227
|
+
onShape,
|
|
228
|
+
onChart,
|
|
229
|
+
onPhoto,
|
|
230
|
+
onSticker,
|
|
231
|
+
onFrame,
|
|
232
|
+
frameCurrent,
|
|
233
|
+
onQr
|
|
234
|
+
}) {
|
|
235
|
+
const theme = useCanvasTheme();
|
|
236
|
+
const styles = makeStyles(theme);
|
|
237
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
238
|
+
onPhoto ? /* @__PURE__ */ jsxs(Pressable, { onPress: onPhoto, style: styles.wideButton, accessibilityRole: "button", children: [
|
|
239
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "image-plus", size: 20, color: theme.edInk }),
|
|
240
|
+
/* @__PURE__ */ jsx(Text, { style: styles.wideLabel, children: "Add a photo" })
|
|
241
|
+
] }) : null,
|
|
242
|
+
SHAPE_CATEGORIES.map((cat) => /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
243
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: cat.label }),
|
|
244
|
+
/* @__PURE__ */ jsx(View, { style: styles.tileGrid, children: shapesInCategory(cat.id).map((shape) => /* @__PURE__ */ jsx(Pressable, { onPress: () => onShape(shape), style: ({
|
|
245
|
+
pressed
|
|
246
|
+
}) => [styles.tile, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: SHAPES[shape].label, children: /* @__PURE__ */ jsx(ShapeGlyph, { shape, size: 34, color: theme.edInk2 }) }, shape)) })
|
|
247
|
+
] }, cat.id)),
|
|
248
|
+
onFrame ? /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
249
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Frames" }),
|
|
250
|
+
/* @__PURE__ */ jsx(FramesGrid, { current: frameCurrent, onPick: onFrame })
|
|
251
|
+
] }) : null,
|
|
252
|
+
onSticker ? /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
253
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Graphics" }),
|
|
254
|
+
/* @__PURE__ */ jsx(View, { style: styles.tileGrid, children: STICKER_EMOJI.map((emoji) => /* @__PURE__ */ jsx(Pressable, { onPress: () => onSticker(emoji), style: ({
|
|
255
|
+
pressed
|
|
256
|
+
}) => [styles.tile, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: `Add ${emoji} sticker`, children: /* @__PURE__ */ jsx(Text, { style: styles.emoji, children: emoji }) }, emoji)) })
|
|
257
|
+
] }) : null,
|
|
258
|
+
onQr ? /* @__PURE__ */ jsx(QrSection, { onAdd: onQr }) : null,
|
|
259
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
260
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Charts" }),
|
|
261
|
+
/* @__PURE__ */ jsx(View, { style: styles.tileGrid, children: CHARTS.map((chart) => /* @__PURE__ */ jsx(Pressable, { onPress: () => onChart(chart.id), style: ({
|
|
262
|
+
pressed
|
|
263
|
+
}) => [styles.tile, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: `${chart.label} chart`, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: chart.icon, size: 30, color: theme.edInk2 }) }, chart.id)) })
|
|
264
|
+
] })
|
|
265
|
+
] });
|
|
266
|
+
}
|
|
267
|
+
function TextPanel({
|
|
268
|
+
doc,
|
|
269
|
+
onAdd,
|
|
270
|
+
onTextBox
|
|
271
|
+
}) {
|
|
272
|
+
var _a, _b, _c;
|
|
273
|
+
const theme = useCanvasTheme();
|
|
274
|
+
const styles = makeStyles(theme);
|
|
275
|
+
const fonts = (_c = (_b = (_a = doc.brandKit) == null ? void 0 : _a.fonts) != null ? _b : doc.fontPair) != null ? _c : {
|
|
276
|
+
display: "Inter",
|
|
277
|
+
body: "Inter"
|
|
278
|
+
};
|
|
279
|
+
const presets = [{
|
|
280
|
+
id: "heading",
|
|
281
|
+
size: 26
|
|
282
|
+
}, {
|
|
283
|
+
id: "subheading",
|
|
284
|
+
size: 19
|
|
285
|
+
}, {
|
|
286
|
+
id: "body",
|
|
287
|
+
size: 14
|
|
288
|
+
}];
|
|
289
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
290
|
+
onTextBox ? /* @__PURE__ */ jsxs(Pressable, { onPress: onTextBox, style: styles.wideButton, accessibilityRole: "button", children: [
|
|
291
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "format-text", size: 20, color: theme.edInk }),
|
|
292
|
+
/* @__PURE__ */ jsx(Text, { style: styles.wideLabel, children: "Add a text box" })
|
|
293
|
+
] }) : null,
|
|
294
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Default text styles" }),
|
|
295
|
+
presets.map(({
|
|
296
|
+
id,
|
|
297
|
+
size
|
|
298
|
+
}) => {
|
|
299
|
+
const p = TEXT_PRESETS[id];
|
|
300
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: () => onAdd(id), style: ({
|
|
301
|
+
pressed
|
|
302
|
+
}) => [styles.textPreset, pressed && styles.pressed], accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: [{
|
|
303
|
+
fontSize: size,
|
|
304
|
+
color: theme.edInk
|
|
305
|
+
}, resolveTextFont(fonts[p.fontToken], p.fontWeight, false)], children: p.content }) }, id);
|
|
306
|
+
})
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
function BrandPanel({
|
|
310
|
+
doc,
|
|
311
|
+
onBrandKit,
|
|
312
|
+
onPlaceLogo,
|
|
313
|
+
onAddLogo
|
|
314
|
+
}) {
|
|
315
|
+
var _a, _b;
|
|
316
|
+
const theme = useCanvasTheme();
|
|
317
|
+
const styles = makeStyles(theme);
|
|
318
|
+
const kit = (_b = doc.brandKit) != null ? _b : {
|
|
319
|
+
colors: [],
|
|
320
|
+
fonts: (_a = doc.fontPair) != null ? _a : {
|
|
321
|
+
display: "Inter",
|
|
322
|
+
body: "Inter"
|
|
323
|
+
},
|
|
324
|
+
logos: []
|
|
325
|
+
};
|
|
326
|
+
const [picking, setPicking] = useState(null);
|
|
327
|
+
if (picking === "color") {
|
|
328
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
329
|
+
/* @__PURE__ */ jsx(BackRow, { label: "Add a brand colour", onBack: () => setPicking(null) }),
|
|
330
|
+
/* @__PURE__ */ jsx(ColorPicker, { used: colorsInDoc(doc), onChange: (c) => {
|
|
331
|
+
if (!kit.colors.includes(c)) onBrandKit(__spreadProps(__spreadValues({}, kit), {
|
|
332
|
+
colors: [...kit.colors, c]
|
|
333
|
+
}));
|
|
334
|
+
setPicking(null);
|
|
335
|
+
} })
|
|
336
|
+
] });
|
|
337
|
+
}
|
|
338
|
+
if (picking === "display" || picking === "body") {
|
|
339
|
+
const role = picking;
|
|
340
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
341
|
+
/* @__PURE__ */ jsx(BackRow, { label: role === "display" ? "Heading font" : "Body font", onBack: () => setPicking(null) }),
|
|
342
|
+
/* @__PURE__ */ jsx(FontList, { value: kit.fonts[role], designFonts: fontsInDoc(doc), onChange: (family) => {
|
|
343
|
+
onBrandKit(__spreadProps(__spreadValues({}, kit), {
|
|
344
|
+
fonts: __spreadProps(__spreadValues({}, kit.fonts), {
|
|
345
|
+
[role]: family
|
|
346
|
+
})
|
|
347
|
+
}));
|
|
348
|
+
setPicking(null);
|
|
349
|
+
} })
|
|
350
|
+
] });
|
|
351
|
+
}
|
|
352
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
353
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
354
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Brand colours" }),
|
|
355
|
+
/* @__PURE__ */ jsxs(View, { style: styles.swatchRow, children: [
|
|
356
|
+
kit.colors.map((c) => /* @__PURE__ */ jsx(Pressable, { onLongPress: () => onBrandKit(__spreadProps(__spreadValues({}, kit), {
|
|
357
|
+
colors: kit.colors.filter((x) => x !== c)
|
|
358
|
+
})), style: [styles.swatch, {
|
|
359
|
+
backgroundColor: c
|
|
360
|
+
}], accessibilityLabel: `${c}, hold to remove` }, c)),
|
|
361
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => setPicking("color"), style: [styles.swatch, styles.swatchAdd], accessibilityLabel: "Add colour", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "plus", size: 18, color: theme.edInk2 }) })
|
|
362
|
+
] }),
|
|
363
|
+
kit.colors.length ? /* @__PURE__ */ jsx(Text, { style: styles.hint, children: "Hold a colour to remove it." }) : null
|
|
364
|
+
] }),
|
|
365
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
366
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Brand fonts" }),
|
|
367
|
+
["display", "body"].map((role) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => setPicking(role), style: styles.row, accessibilityRole: "button", children: [
|
|
368
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: role === "display" ? "Heading" : "Body" }),
|
|
369
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.rowValue, resolveTextFont(kit.fonts[role], role === "display" ? 700 : 400, false)], children: kit.fonts[role] }),
|
|
370
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-right", size: 18, color: theme.edInk3 })
|
|
371
|
+
] }, role))
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
374
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Logos" }),
|
|
375
|
+
/* @__PURE__ */ jsxs(View, { style: styles.swatchRow, children: [
|
|
376
|
+
kit.logos.map((src) => /* @__PURE__ */ jsx(Pressable, { onPress: () => onPlaceLogo(src), onLongPress: () => onBrandKit(__spreadProps(__spreadValues({}, kit), {
|
|
377
|
+
logos: kit.logos.filter((l) => l !== src)
|
|
378
|
+
})), style: styles.logo, accessibilityLabel: "Logo, tap to place, hold to remove", children: /* @__PURE__ */ jsx(Image, { source: {
|
|
379
|
+
uri: src
|
|
380
|
+
}, style: StyleSheet.absoluteFill, contentFit: "contain" }) }, src)),
|
|
381
|
+
onAddLogo ? /* @__PURE__ */ jsx(Pressable, { onPress: onAddLogo, style: [styles.logo, styles.swatchAdd], accessibilityLabel: "Upload a logo", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "upload", size: 20, color: theme.edInk2 }) }) : null
|
|
382
|
+
] })
|
|
383
|
+
] })
|
|
384
|
+
] });
|
|
385
|
+
}
|
|
386
|
+
function BackRow({
|
|
387
|
+
label,
|
|
388
|
+
onBack
|
|
389
|
+
}) {
|
|
390
|
+
const theme = useCanvasTheme();
|
|
391
|
+
const styles = makeStyles(theme);
|
|
392
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: onBack, style: styles.backRow, accessibilityRole: "button", children: [
|
|
393
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-left", size: 20, color: theme.edInk }),
|
|
394
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: label })
|
|
395
|
+
] });
|
|
396
|
+
}
|
|
397
|
+
function DetailsPanel({
|
|
398
|
+
doc,
|
|
399
|
+
page,
|
|
400
|
+
onRename,
|
|
401
|
+
onResize,
|
|
402
|
+
onPage
|
|
403
|
+
}) {
|
|
404
|
+
var _a, _b, _c, _d, _e, _f;
|
|
405
|
+
const theme = useCanvasTheme();
|
|
406
|
+
const styles = makeStyles(theme);
|
|
407
|
+
const [title, setTitle] = useState((_c = (_b = doc.title) != null ? _b : (_a = doc.brief) == null ? void 0 : _a.topic) != null ? _c : "");
|
|
408
|
+
const [showSizes, setShowSizes] = useState(false);
|
|
409
|
+
const print = Boolean(doc.print);
|
|
410
|
+
const sizes = useMemo(() => DESIGN_SIZES.filter((s) => print ? s.kind === "flyer" : s.kind === "deck"), [print]);
|
|
411
|
+
const size = print && ((_d = doc.print) == null ? void 0 : _d.trimMm) ? `${doc.print.trimMm.w} \xD7 ${doc.print.trimMm.h} mm` : `${doc.pageWidth} \xD7 ${doc.pageHeight} px`;
|
|
412
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
413
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
414
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Design name" }),
|
|
415
|
+
/* @__PURE__ */ jsx(TextInput, { value: title, onChangeText: setTitle, onEndEditing: () => onRename(title.trim()), onSubmitEditing: () => onRename(title.trim()), placeholder: "Untitled design", placeholderTextColor: theme.edInk3, style: styles.input, returnKeyType: "done" })
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
418
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "Size" }),
|
|
419
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setShowSizes((v) => !v), style: styles.row, accessibilityRole: "button", children: [
|
|
420
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: size }),
|
|
421
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowValue, children: print ? "Print" : "Screen" }),
|
|
422
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: showSizes ? "chevron-up" : "chevron-down", size: 18, color: theme.edInk3 })
|
|
423
|
+
] }),
|
|
424
|
+
showSizes ? sizes.map((s) => {
|
|
425
|
+
var _a2;
|
|
426
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
427
|
+
onResize(s);
|
|
428
|
+
setShowSizes(false);
|
|
429
|
+
}, style: styles.row, accessibilityRole: "button", children: [
|
|
430
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowLabel, children: s.label }),
|
|
431
|
+
/* @__PURE__ */ jsx(Text, { style: styles.rowValue, children: (_a2 = s.physical) != null ? _a2 : `${s.width} \xD7 ${s.height}` })
|
|
432
|
+
] }, s.id);
|
|
433
|
+
}) : null,
|
|
434
|
+
print && doc.print ? /* @__PURE__ */ jsxs(Text, { style: styles.hint, children: [
|
|
435
|
+
"Bleed ",
|
|
436
|
+
doc.print.bleedMm,
|
|
437
|
+
" mm \xB7 safe area ",
|
|
438
|
+
doc.print.safeAreaMm,
|
|
439
|
+
" mm \xB7",
|
|
440
|
+
" ",
|
|
441
|
+
fromPx(doc.pageWidth),
|
|
442
|
+
" \xD7 ",
|
|
443
|
+
fromPx(doc.pageHeight),
|
|
444
|
+
" in"
|
|
445
|
+
] }) : null
|
|
446
|
+
] }),
|
|
447
|
+
/* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
448
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: "This page" }),
|
|
449
|
+
/* @__PURE__ */ jsx(PageField, { label: "Page name", value: (_e = page.name) != null ? _e : "", onCommit: (name) => onPage({
|
|
450
|
+
name
|
|
451
|
+
}) }),
|
|
452
|
+
/* @__PURE__ */ jsx(PageField, { label: "Notes", value: (_f = page.notes) != null ? _f : "", multiline: true, onCommit: (notes) => onPage({
|
|
453
|
+
notes: notes || void 0
|
|
454
|
+
}) })
|
|
455
|
+
] })
|
|
456
|
+
] });
|
|
457
|
+
}
|
|
458
|
+
function PageField({
|
|
459
|
+
label,
|
|
460
|
+
value,
|
|
461
|
+
onCommit,
|
|
462
|
+
multiline
|
|
463
|
+
}) {
|
|
464
|
+
const theme = useCanvasTheme();
|
|
465
|
+
const styles = makeStyles(theme);
|
|
466
|
+
const [text, setText] = useState(value);
|
|
467
|
+
const last = useRef(value);
|
|
468
|
+
useEffect(() => {
|
|
469
|
+
if (value !== last.current) {
|
|
470
|
+
last.current = value;
|
|
471
|
+
setText(value);
|
|
472
|
+
}
|
|
473
|
+
}, [value]);
|
|
474
|
+
const commit = () => {
|
|
475
|
+
if (text !== last.current) {
|
|
476
|
+
last.current = text;
|
|
477
|
+
onCommit(text);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
return /* @__PURE__ */ jsx(TextInput, { value: text, onChangeText: setText, onEndEditing: commit, placeholder: label, placeholderTextColor: theme.edInk3, multiline, style: [styles.input, multiline && styles.inputMulti] });
|
|
481
|
+
}
|
|
482
|
+
function picturesInDoc(doc) {
|
|
483
|
+
var _a, _b;
|
|
484
|
+
const seen = /* @__PURE__ */ new Set();
|
|
485
|
+
for (const page of doc.pages) {
|
|
486
|
+
if (((_a = page.background) == null ? void 0 : _a.kind) === "image" && page.background.src) seen.add(page.background.src);
|
|
487
|
+
for (const l of (_b = page.layers) != null ? _b : []) if (l.kind === "image" && l.src && /^https:/.test(l.src)) seen.add(l.src);
|
|
488
|
+
}
|
|
489
|
+
return [...seen].filter((src) => !/\.svg(\?|$)/i.test(src));
|
|
490
|
+
}
|
|
491
|
+
function AssetsPanel({
|
|
492
|
+
doc,
|
|
493
|
+
width,
|
|
494
|
+
onUpload,
|
|
495
|
+
uploading,
|
|
496
|
+
onPlace,
|
|
497
|
+
replacing
|
|
498
|
+
}) {
|
|
499
|
+
var _a, _b;
|
|
500
|
+
const theme = useCanvasTheme();
|
|
501
|
+
const styles = makeStyles(theme);
|
|
502
|
+
const pictures = picturesInDoc(doc);
|
|
503
|
+
const logos = (_b = (_a = doc.brandKit) == null ? void 0 : _a.logos) != null ? _b : [];
|
|
504
|
+
const col = (width - SPACE.lg * 2 - SPACE.sm * 2) / 3;
|
|
505
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.stack, children: [
|
|
506
|
+
onUpload ? /* @__PURE__ */ jsxs(Pressable, { onPress: onUpload, disabled: uploading, style: styles.wideButton, accessibilityRole: "button", children: [
|
|
507
|
+
uploading ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.edInk }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "upload", size: 20, color: theme.edInk }),
|
|
508
|
+
/* @__PURE__ */ jsx(Text, { style: styles.wideLabel, children: replacing ? "Replace with a photo" : "Upload from device" })
|
|
509
|
+
] }) : null,
|
|
510
|
+
[{
|
|
511
|
+
title: "In this design",
|
|
512
|
+
items: pictures
|
|
513
|
+
}, {
|
|
514
|
+
title: "Logos",
|
|
515
|
+
items: logos
|
|
516
|
+
}].filter((g) => g.items.length).map((g) => /* @__PURE__ */ jsxs(View, { style: styles.section, children: [
|
|
517
|
+
/* @__PURE__ */ jsx(Text, { style: styles.heading, children: g.title }),
|
|
518
|
+
/* @__PURE__ */ jsx(View, { style: styles.assetGrid, children: g.items.map((src) => /* @__PURE__ */ jsx(Pressable, { onPress: () => onPlace(src), style: ({
|
|
519
|
+
pressed
|
|
520
|
+
}) => [styles.asset, {
|
|
521
|
+
width: col,
|
|
522
|
+
height: col
|
|
523
|
+
}, pressed && styles.pressed], accessibilityRole: "button", accessibilityLabel: replacing ? "Use this picture" : "Add this picture", children: /* @__PURE__ */ jsx(Image, { source: {
|
|
524
|
+
uri: src
|
|
525
|
+
}, style: StyleSheet.absoluteFill, contentFit: "cover" }) }, src)) })
|
|
526
|
+
] }, g.title)),
|
|
527
|
+
!onUpload && !pictures.length && !logos.length ? /* @__PURE__ */ jsx(Text, { style: styles.empty, children: "Pictures you add to this design show here." }) : null
|
|
528
|
+
] });
|
|
529
|
+
}
|
|
530
|
+
const makeStyles = themedStyles((theme) => StyleSheet.create({
|
|
531
|
+
stack: {
|
|
532
|
+
gap: SPACE.lg
|
|
533
|
+
},
|
|
534
|
+
section: {
|
|
535
|
+
gap: SPACE.sm
|
|
536
|
+
},
|
|
537
|
+
heading: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
538
|
+
color: theme.edInk2
|
|
539
|
+
}),
|
|
540
|
+
hint: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
541
|
+
color: theme.edInk3
|
|
542
|
+
}),
|
|
543
|
+
empty: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
544
|
+
color: theme.edInk2,
|
|
545
|
+
textAlign: "center",
|
|
546
|
+
paddingVertical: SPACE.xl
|
|
547
|
+
}),
|
|
548
|
+
spinner: {
|
|
549
|
+
paddingVertical: SPACE.xl
|
|
550
|
+
},
|
|
551
|
+
pressed: {
|
|
552
|
+
opacity: 0.7
|
|
553
|
+
},
|
|
554
|
+
search: __spreadValues({
|
|
555
|
+
height: 40,
|
|
556
|
+
borderRadius: RADIUS.pill,
|
|
557
|
+
paddingHorizontal: SPACE.lg,
|
|
558
|
+
backgroundColor: theme.edRaised,
|
|
559
|
+
color: theme.edInk,
|
|
560
|
+
marginBottom: SPACE.md
|
|
561
|
+
}, TYPE.body),
|
|
562
|
+
grid: {
|
|
563
|
+
flexDirection: "row",
|
|
564
|
+
flexWrap: "wrap",
|
|
565
|
+
gap: SPACE.md
|
|
566
|
+
},
|
|
567
|
+
cover: {
|
|
568
|
+
borderRadius: RADIUS.sm,
|
|
569
|
+
backgroundColor: theme.edRaised
|
|
570
|
+
},
|
|
571
|
+
cardTitle: __spreadProps(__spreadValues({}, TYPE.caption), {
|
|
572
|
+
color: theme.edInk2,
|
|
573
|
+
marginTop: 4
|
|
574
|
+
}),
|
|
575
|
+
tileGrid: {
|
|
576
|
+
flexDirection: "row",
|
|
577
|
+
flexWrap: "wrap",
|
|
578
|
+
gap: SPACE.sm
|
|
579
|
+
},
|
|
580
|
+
tile: {
|
|
581
|
+
width: 56,
|
|
582
|
+
height: 56,
|
|
583
|
+
borderRadius: RADIUS.md,
|
|
584
|
+
backgroundColor: theme.edRaised,
|
|
585
|
+
alignItems: "center",
|
|
586
|
+
justifyContent: "center"
|
|
587
|
+
},
|
|
588
|
+
wideButton: {
|
|
589
|
+
flexDirection: "row",
|
|
590
|
+
alignItems: "center",
|
|
591
|
+
justifyContent: "center",
|
|
592
|
+
gap: SPACE.sm,
|
|
593
|
+
height: 46,
|
|
594
|
+
borderRadius: RADIUS.md,
|
|
595
|
+
backgroundColor: theme.edRaised
|
|
596
|
+
},
|
|
597
|
+
wideLabel: __spreadProps(__spreadValues({}, TYPE.label), {
|
|
598
|
+
color: theme.edInk
|
|
599
|
+
}),
|
|
600
|
+
dim: {
|
|
601
|
+
opacity: 0.4
|
|
602
|
+
},
|
|
603
|
+
emoji: {
|
|
604
|
+
fontSize: 28
|
|
605
|
+
},
|
|
606
|
+
qrSwatch: {
|
|
607
|
+
width: 40,
|
|
608
|
+
height: 40,
|
|
609
|
+
borderRadius: RADIUS.sm,
|
|
610
|
+
borderWidth: 2,
|
|
611
|
+
alignItems: "center",
|
|
612
|
+
justifyContent: "center"
|
|
613
|
+
},
|
|
614
|
+
qrDot: {
|
|
615
|
+
width: 16,
|
|
616
|
+
height: 16,
|
|
617
|
+
borderRadius: 3
|
|
618
|
+
},
|
|
619
|
+
textPreset: {
|
|
620
|
+
paddingVertical: SPACE.md,
|
|
621
|
+
paddingHorizontal: SPACE.lg,
|
|
622
|
+
borderRadius: RADIUS.md,
|
|
623
|
+
backgroundColor: theme.edRaised
|
|
624
|
+
},
|
|
625
|
+
swatchRow: {
|
|
626
|
+
flexDirection: "row",
|
|
627
|
+
flexWrap: "wrap",
|
|
628
|
+
gap: SPACE.sm
|
|
629
|
+
},
|
|
630
|
+
swatch: {
|
|
631
|
+
width: 40,
|
|
632
|
+
height: 40,
|
|
633
|
+
borderRadius: 20,
|
|
634
|
+
borderWidth: 1,
|
|
635
|
+
borderColor: theme.edLineHi
|
|
636
|
+
},
|
|
637
|
+
swatchAdd: {
|
|
638
|
+
alignItems: "center",
|
|
639
|
+
justifyContent: "center",
|
|
640
|
+
borderStyle: "dashed",
|
|
641
|
+
backgroundColor: "transparent"
|
|
642
|
+
},
|
|
643
|
+
logo: {
|
|
644
|
+
width: 64,
|
|
645
|
+
height: 64,
|
|
646
|
+
borderRadius: RADIUS.sm,
|
|
647
|
+
borderWidth: 1,
|
|
648
|
+
borderColor: theme.edLine,
|
|
649
|
+
overflow: "hidden",
|
|
650
|
+
backgroundColor: theme.edRaised
|
|
651
|
+
},
|
|
652
|
+
row: {
|
|
653
|
+
flexDirection: "row",
|
|
654
|
+
alignItems: "center",
|
|
655
|
+
gap: SPACE.sm,
|
|
656
|
+
minHeight: 46,
|
|
657
|
+
paddingHorizontal: SPACE.md,
|
|
658
|
+
borderRadius: RADIUS.sm,
|
|
659
|
+
backgroundColor: theme.edRaised
|
|
660
|
+
},
|
|
661
|
+
rowLabel: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
662
|
+
color: theme.edInk,
|
|
663
|
+
flex: 1
|
|
664
|
+
}),
|
|
665
|
+
rowValue: __spreadProps(__spreadValues({}, TYPE.body), {
|
|
666
|
+
color: theme.edInk2
|
|
667
|
+
}),
|
|
668
|
+
backRow: {
|
|
669
|
+
flexDirection: "row",
|
|
670
|
+
alignItems: "center",
|
|
671
|
+
gap: SPACE.xs
|
|
672
|
+
},
|
|
673
|
+
input: __spreadValues({
|
|
674
|
+
minHeight: 42,
|
|
675
|
+
borderRadius: RADIUS.sm,
|
|
676
|
+
paddingHorizontal: SPACE.md,
|
|
677
|
+
backgroundColor: theme.edRaised,
|
|
678
|
+
color: theme.edInk
|
|
679
|
+
}, TYPE.body),
|
|
680
|
+
inputMulti: {
|
|
681
|
+
minHeight: 84,
|
|
682
|
+
paddingTop: SPACE.sm,
|
|
683
|
+
textAlignVertical: "top"
|
|
684
|
+
},
|
|
685
|
+
assetGrid: {
|
|
686
|
+
flexDirection: "row",
|
|
687
|
+
flexWrap: "wrap",
|
|
688
|
+
gap: SPACE.sm
|
|
689
|
+
},
|
|
690
|
+
asset: {
|
|
691
|
+
borderRadius: RADIUS.sm,
|
|
692
|
+
overflow: "hidden",
|
|
693
|
+
backgroundColor: theme.edRaised
|
|
694
|
+
}
|
|
695
|
+
}));export{AssetsPanel,BrandPanel,DOCK_TOOLS,DetailsPanel,ElementsPanel,TemplatesPanel,TextPanel,picturesInDoc};//# sourceMappingURL=ToolPanels.js.map
|