@adminide-stack/yantra-mobile 12.0.160-alpha.1 → 12.0.160-alpha.2
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/assets/channels/lucy.jpg +0 -0
- package/lib/components/GatewayConnector/GatewayConnector.js +3 -2
- package/lib/components/GatewayConnector/GatewayConnector.js.map +1 -1
- package/lib/components/GatewayToolbarButtonMobile.js +4 -2
- package/lib/components/GatewayToolbarButtonMobile.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderMoreMenu.js +2 -1
- package/lib/components/NavigationHeader/HeaderMoreMenu.js.map +1 -1
- package/lib/components/NavigationHeader/NavigationHeader.js +13 -11
- package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
- package/lib/features/attachments/ComposerAttachMenu.js +15 -6
- package/lib/features/attachments/ComposerAttachMenu.js.map +1 -1
- package/lib/features/canvas/AudioEditorExperience.js +44 -1
- package/lib/features/canvas/AudioEditorExperience.js.map +1 -1
- package/lib/features/canvas/CanvasAppsPanel.js +240 -0
- package/lib/features/canvas/CanvasAppsPanel.js.map +1 -0
- package/lib/features/canvas/CanvasBoardsGrid.js +264 -803
- package/lib/features/canvas/CanvasBoardsGrid.js.map +1 -1
- package/lib/features/canvas/CanvasEditToolsPanel.js +320 -66
- package/lib/features/canvas/CanvasEditToolsPanel.js.map +1 -1
- package/lib/features/canvas/CanvasExperience.js +366 -235
- package/lib/features/canvas/CanvasExperience.js.map +1 -1
- package/lib/features/canvas/CanvasGeneratePanel.js +437 -117
- package/lib/features/canvas/CanvasGeneratePanel.js.map +1 -1
- package/lib/features/canvas/CanvasLibrarySheet.js +218 -18
- package/lib/features/canvas/CanvasLibrarySheet.js.map +1 -1
- package/lib/features/canvas/CanvasLooksPanel.js +2 -2
- package/lib/features/canvas/CanvasLooksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasTasksPanel.js +52 -12
- package/lib/features/canvas/CanvasTasksPanel.js.map +1 -1
- package/lib/features/canvas/CanvasTemplatesPanel.js +2 -2
- package/lib/features/canvas/CanvasTemplatesPanel.js.map +1 -1
- package/lib/features/canvas/CanvasToolDock.js +146 -37
- package/lib/features/canvas/CanvasToolDock.js.map +1 -1
- package/lib/features/canvas/DesignCategoryGallery.js +264 -7
- package/lib/features/canvas/DesignCategoryGallery.js.map +1 -1
- package/lib/features/canvas/NativeCanvasViewer.js +54 -7
- package/lib/features/canvas/NativeCanvasViewer.js.map +1 -1
- package/lib/features/canvas/SetStudioExperience.js +7 -5
- package/lib/features/canvas/SetStudioExperience.js.map +1 -1
- package/lib/features/canvas/VideoEditorExperience.js +9 -5
- package/lib/features/canvas/VideoEditorExperience.js.map +1 -1
- package/lib/features/canvas/VideoGeneratorExperience.js +295 -96
- package/lib/features/canvas/VideoGeneratorExperience.js.map +1 -1
- package/lib/features/canvas/appsCatalog.js +554 -0
- package/lib/features/canvas/appsCatalog.js.map +1 -0
- package/lib/features/canvas/boardActions.js +547 -0
- package/lib/features/canvas/boardActions.js.map +1 -0
- package/lib/features/canvas/boardHistory.js +264 -0
- package/lib/features/canvas/boardHistory.js.map +1 -0
- package/lib/features/canvas/canvasAgentChat.js +3 -2
- package/lib/features/canvas/canvasAgentChat.js.map +1 -1
- package/lib/features/canvas/canvasArtifacts.js +115 -0
- package/lib/features/canvas/canvasArtifacts.js.map +1 -0
- package/lib/features/canvas/canvasCore.js +5 -2
- package/lib/features/canvas/canvasCore.js.map +1 -1
- package/lib/features/canvas/canvasEditHistory.js +42 -0
- package/lib/features/canvas/canvasEditHistory.js.map +1 -0
- package/lib/features/canvas/canvasEditOps.js +27 -21
- package/lib/features/canvas/canvasEditOps.js.map +1 -1
- package/lib/features/canvas/canvasTasks.js +5 -4
- package/lib/features/canvas/canvasTasks.js.map +1 -1
- package/lib/features/canvas/canvasUi.js +9 -4
- package/lib/features/canvas/canvasUi.js.map +1 -1
- package/lib/features/canvas/catalogSearchIndex.js +271 -0
- package/lib/features/canvas/catalogSearchIndex.js.map +1 -0
- package/lib/features/canvas/characters/CharacterBuilder.js +331 -0
- package/lib/features/canvas/characters/CharacterBuilder.js.map +1 -0
- package/lib/features/canvas/characters/CharacterPicker.js +207 -0
- package/lib/features/canvas/characters/CharacterPicker.js.map +1 -0
- package/lib/features/canvas/characters/CharacterStudio.js +106 -0
- package/lib/features/canvas/characters/CharacterStudio.js.map +1 -0
- package/lib/features/canvas/characters/PhotoDumpTool.js +157 -0
- package/lib/features/canvas/characters/PhotoDumpTool.js.map +1 -0
- package/lib/features/canvas/characters/PhotoSlot.js +104 -0
- package/lib/features/canvas/characters/PhotoSlot.js.map +1 -0
- package/lib/features/canvas/characters/RunFooter.js +126 -0
- package/lib/features/canvas/characters/RunFooter.js.map +1 -0
- package/lib/features/canvas/characters/StoryFramesTool.js +245 -0
- package/lib/features/canvas/characters/StoryFramesTool.js.map +1 -0
- package/lib/features/canvas/characters/SubjectPicker.js +198 -0
- package/lib/features/canvas/characters/SubjectPicker.js.map +1 -0
- package/lib/features/canvas/characters/characterActions.js +364 -0
- package/lib/features/canvas/characters/characterActions.js.map +1 -0
- package/lib/features/canvas/characters/characterRuns.js +256 -0
- package/lib/features/canvas/characters/characterRuns.js.map +1 -0
- package/lib/features/canvas/characters/characterStore.js +137 -0
- package/lib/features/canvas/characters/characterStore.js.map +1 -0
- package/lib/features/canvas/characters/characterTools.js +33 -0
- package/lib/features/canvas/characters/characterTools.js.map +1 -0
- package/lib/features/canvas/characters/characterVocabulary.js +1138 -0
- package/lib/features/canvas/characters/characterVocabulary.js.map +1 -0
- package/lib/features/canvas/characters/charactersRpc.js +70 -0
- package/lib/features/canvas/characters/charactersRpc.js.map +1 -0
- package/lib/features/canvas/characters/photoDumpPacks.js +252 -0
- package/lib/features/canvas/characters/photoDumpPacks.js.map +1 -0
- package/lib/features/canvas/characters/placement.js +114 -0
- package/lib/features/canvas/characters/placement.js.map +1 -0
- package/lib/features/canvas/characters/storyboard.js +188 -0
- package/lib/features/canvas/characters/storyboard.js.map +1 -0
- package/lib/features/canvas/createTiles.js +16 -98
- package/lib/features/canvas/createTiles.js.map +1 -1
- package/lib/features/canvas/creditsOffer.js +21 -0
- package/lib/features/canvas/creditsOffer.js.map +1 -0
- package/lib/features/canvas/deepLinks.js.map +1 -1
- package/lib/features/canvas/designCatalog.js +6 -13
- package/lib/features/canvas/designCatalog.js.map +1 -1
- package/lib/features/canvas/editTools.js +122 -10
- package/lib/features/canvas/editTools.js.map +1 -1
- package/lib/features/canvas/editorControls.js +1 -1
- package/lib/features/canvas/elements/ElementForm.js +389 -0
- package/lib/features/canvas/elements/ElementForm.js.map +1 -0
- package/lib/features/canvas/elements/ElementMentionMenu.js +125 -0
- package/lib/features/canvas/elements/ElementMentionMenu.js.map +1 -0
- package/lib/features/canvas/elements/ElementThumb.js +23 -0
- package/lib/features/canvas/elements/ElementThumb.js.map +1 -0
- package/lib/features/canvas/elements/ElementsButton.js +55 -0
- package/lib/features/canvas/elements/ElementsButton.js.map +1 -0
- package/lib/features/canvas/elements/ElementsSheet.js +392 -0
- package/lib/features/canvas/elements/ElementsSheet.js.map +1 -0
- package/lib/features/canvas/elements/MentionedElements.js +159 -0
- package/lib/features/canvas/elements/MentionedElements.js.map +1 -0
- package/lib/features/canvas/elements/elementCopy.js +37 -0
- package/lib/features/canvas/elements/elementCopy.js.map +1 -0
- package/lib/features/canvas/elements/elementImages.js +66 -0
- package/lib/features/canvas/elements/elementImages.js.map +1 -0
- package/lib/features/canvas/elements/elementsStore.js +164 -0
- package/lib/features/canvas/elements/elementsStore.js.map +1 -0
- package/lib/features/canvas/elements/shotMentions.js +94 -0
- package/lib/features/canvas/elements/shotMentions.js.map +1 -0
- package/lib/features/canvas/elements/unicodeWords.js +13 -0
- package/lib/features/canvas/elements/unicodeWords.js.map +1 -0
- package/lib/features/canvas/elements/useElementMentions.js +94 -0
- package/lib/features/canvas/elements/useElementMentions.js.map +1 -0
- package/lib/features/canvas/elements/useGeneratorElements.js +83 -0
- package/lib/features/canvas/elements/useGeneratorElements.js.map +1 -0
- package/lib/features/canvas/elements/useSavedElements.js +170 -0
- package/lib/features/canvas/elements/useSavedElements.js.map +1 -0
- package/lib/features/canvas/enhance/AnimateControls.js +249 -0
- package/lib/features/canvas/enhance/AnimateControls.js.map +1 -0
- package/lib/features/canvas/enhance/ClipAudioControls.js +184 -0
- package/lib/features/canvas/enhance/ClipAudioControls.js.map +1 -0
- package/lib/features/canvas/enhance/ImageAiControls.js +293 -0
- package/lib/features/canvas/enhance/ImageAiControls.js.map +1 -0
- package/lib/features/canvas/enhance/MediaSlot.js +220 -0
- package/lib/features/canvas/enhance/MediaSlot.js.map +1 -0
- package/lib/features/canvas/enhance/PixelToolControls.js +236 -0
- package/lib/features/canvas/enhance/PixelToolControls.js.map +1 -0
- package/lib/features/canvas/enhance/RemixControls.js +166 -0
- package/lib/features/canvas/enhance/RemixControls.js.map +1 -0
- package/lib/features/canvas/enhance/enhanceUi.js +182 -0
- package/lib/features/canvas/enhance/enhanceUi.js.map +1 -0
- package/lib/features/canvas/enhance/useEnhanceRunner.js +218 -0
- package/lib/features/canvas/enhance/useEnhanceRunner.js.map +1 -0
- package/lib/features/canvas/enhanceCatalog.js +110 -0
- package/lib/features/canvas/enhanceCatalog.js.map +1 -0
- package/lib/features/canvas/enhanceOps.js +630 -0
- package/lib/features/canvas/enhanceOps.js.map +1 -0
- package/lib/features/canvas/enhanceRpc.js +404 -0
- package/lib/features/canvas/enhanceRpc.js.map +1 -0
- package/lib/features/canvas/generationModels.js +82 -11
- package/lib/features/canvas/generationModels.js.map +1 -1
- package/lib/features/canvas/generationTasks.js +46 -17
- package/lib/features/canvas/generationTasks.js.map +1 -1
- package/lib/features/canvas/generator/GeneratorModelMenu.js +118 -0
- package/lib/features/canvas/generator/GeneratorModelMenu.js.map +1 -0
- package/lib/features/canvas/generator/audio/AudioLaneSettings.js +127 -0
- package/lib/features/canvas/generator/audio/AudioLaneSettings.js.map +1 -0
- package/lib/features/canvas/generator/audio/audioLane.js +163 -0
- package/lib/features/canvas/generator/audio/audioLane.js.map +1 -0
- package/lib/features/canvas/generator/audio/audioVoices.js +108 -0
- package/lib/features/canvas/generator/audio/audioVoices.js.map +1 -0
- package/lib/features/canvas/generator/audio/clipAudio.js +149 -0
- package/lib/features/canvas/generator/audio/clipAudio.js.map +1 -0
- package/lib/features/canvas/generator/audio/dub.js +109 -0
- package/lib/features/canvas/generator/audio/dub.js.map +1 -0
- package/lib/features/canvas/generator/audio/soundtrack.js +70 -0
- package/lib/features/canvas/generator/audio/soundtrack.js.map +1 -0
- package/lib/features/canvas/generator/audio/useAudioVoices.js +38 -0
- package/lib/features/canvas/generator/audio/useAudioVoices.js.map +1 -0
- package/lib/features/canvas/generator/audio/useSamplePlayer.js +72 -0
- package/lib/features/canvas/generator/audio/useSamplePlayer.js.map +1 -0
- package/lib/features/canvas/generator/audio/useSampleUploads.js +11 -0
- package/lib/features/canvas/generator/audio/useSampleUploads.js.map +1 -0
- package/lib/features/canvas/generator/batchImages.js +198 -0
- package/lib/features/canvas/generator/batchImages.js.map +1 -0
- package/lib/features/canvas/generator/batchLayout.js +36 -0
- package/lib/features/canvas/generator/batchLayout.js.map +1 -0
- package/lib/features/canvas/generator/brandKitGeneration.js +47 -0
- package/lib/features/canvas/generator/brandKitGeneration.js.map +1 -0
- package/lib/features/canvas/generator/cameraVocabulary.js +90 -0
- package/lib/features/canvas/generator/cameraVocabulary.js.map +1 -1
- package/lib/features/canvas/generator/cinematicVocabulary.js +58 -0
- package/lib/features/canvas/generator/cinematicVocabulary.js.map +1 -1
- package/lib/features/canvas/generator/elementMentions.js +402 -0
- package/lib/features/canvas/generator/elementMentions.js.map +1 -0
- package/lib/features/canvas/generator/reuse/BatchCountPill.js +136 -0
- package/lib/features/canvas/generator/reuse/BatchCountPill.js.map +1 -0
- package/lib/features/canvas/generator/reuse/busyRuns.js +17 -0
- package/lib/features/canvas/generator/reuse/busyRuns.js.map +1 -0
- package/lib/features/canvas/generator/reuse/generationRecord.js +368 -0
- package/lib/features/canvas/generator/reuse/generationRecord.js.map +1 -0
- package/lib/features/canvas/generator/reuse/generationReuse.js +77 -0
- package/lib/features/canvas/generator/reuse/generationReuse.js.map +1 -0
- package/lib/features/canvas/generator/reuse/laneInputs.js +75 -0
- package/lib/features/canvas/generator/reuse/laneInputs.js.map +1 -0
- package/lib/features/canvas/generator/reuse/modelFavourites.js +87 -0
- package/lib/features/canvas/generator/reuse/modelFavourites.js.map +1 -0
- package/lib/features/canvas/generator/reuse/recreate.js +121 -0
- package/lib/features/canvas/generator/reuse/recreate.js.map +1 -0
- package/lib/features/canvas/generator/reuse/retryJob.js +142 -0
- package/lib/features/canvas/generator/reuse/retryJob.js.map +1 -0
- package/lib/features/canvas/generator/reuse/reusePlan.js +203 -0
- package/lib/features/canvas/generator/reuse/reusePlan.js.map +1 -0
- package/lib/features/canvas/generator/reuse/runBoard.js +117 -0
- package/lib/features/canvas/generator/reuse/runBoard.js.map +1 -0
- package/lib/features/canvas/generator/useShotSpec.js +4 -3
- package/lib/features/canvas/generator/useShotSpec.js.map +1 -1
- package/lib/features/canvas/generator/video/VideoExtrasControls.js +276 -0
- package/lib/features/canvas/generator/video/VideoExtrasControls.js.map +1 -0
- package/lib/features/canvas/generator/video/cameraMotions.js +66 -0
- package/lib/features/canvas/generator/video/cameraMotions.js.map +1 -0
- package/lib/features/canvas/generator/video/clipTile.js +20 -0
- package/lib/features/canvas/generator/video/clipTile.js.map +1 -0
- package/lib/features/canvas/generator/video/mediaSeconds.js +31 -0
- package/lib/features/canvas/generator/video/mediaSeconds.js.map +1 -0
- package/lib/features/canvas/generator/video/referenceMedia.js +156 -0
- package/lib/features/canvas/generator/video/referenceMedia.js.map +1 -0
- package/lib/features/canvas/generator/video/useVideoGenExtras.js +179 -0
- package/lib/features/canvas/generator/video/useVideoGenExtras.js.map +1 -0
- package/lib/features/canvas/generator/video/videoExtras.js +34 -0
- package/lib/features/canvas/generator/video/videoExtras.js.map +1 -0
- package/lib/features/canvas/generator/video/videoModelCaps.js +96 -0
- package/lib/features/canvas/generator/video/videoModelCaps.js.map +1 -0
- package/lib/features/canvas/home/BoardHistorySheet.js +266 -0
- package/lib/features/canvas/home/BoardHistorySheet.js.map +1 -0
- package/lib/features/canvas/home/BoardMenuSheet.js +157 -0
- package/lib/features/canvas/home/BoardMenuSheet.js.map +1 -0
- package/lib/features/canvas/home/BoardTile.js +224 -0
- package/lib/features/canvas/home/BoardTile.js.map +1 -0
- package/lib/features/canvas/home/HeroComposer.js +72 -6
- package/lib/features/canvas/home/HeroComposer.js.map +1 -1
- package/lib/features/canvas/home/SlidesPrompt.js +79 -0
- package/lib/features/canvas/home/SlidesPrompt.js.map +1 -0
- package/lib/features/canvas/home/TemplatesGallery.js +2 -19
- package/lib/features/canvas/home/TemplatesGallery.js.map +1 -1
- package/lib/features/canvas/home/TrashView.js +299 -0
- package/lib/features/canvas/home/TrashView.js.map +1 -0
- package/lib/features/canvas/home/heroShots.js +4 -2
- package/lib/features/canvas/home/heroShots.js.map +1 -1
- package/lib/features/canvas/home/templatesGallerySources.js +13 -58
- package/lib/features/canvas/home/templatesGallerySources.js.map +1 -1
- package/lib/features/canvas/home/useYourWork.js +218 -0
- package/lib/features/canvas/home/useYourWork.js.map +1 -0
- package/lib/features/canvas/homeWork.js +54 -119
- package/lib/features/canvas/homeWork.js.map +1 -1
- package/lib/features/canvas/influencer/influencerPipeline.js +9 -8
- package/lib/features/canvas/influencer/influencerPipeline.js.map +1 -1
- package/lib/features/canvas/lazyEditors.js +3 -2
- package/lib/features/canvas/lazyEditors.js.map +1 -1
- package/lib/features/canvas/lookReading.js +38 -0
- package/lib/features/canvas/lookReading.js.map +1 -0
- package/lib/features/canvas/matchLook.js +81 -0
- package/lib/features/canvas/matchLook.js.map +1 -0
- package/lib/features/canvas/mediaUrls.js +22 -1
- package/lib/features/canvas/mediaUrls.js.map +1 -1
- package/lib/features/canvas/pngPixels.js +224 -0
- package/lib/features/canvas/pngPixels.js.map +1 -0
- package/lib/features/canvas/rankedCatalogSearch.js +1 -1
- package/lib/features/canvas/serverTasks.js +12 -5
- package/lib/features/canvas/serverTasks.js.map +1 -1
- package/lib/features/canvas/studioCatalog.js +1 -1
- package/lib/features/canvas/surfaceIndex.js +287 -11
- package/lib/features/canvas/surfaceIndex.js.map +1 -1
- package/lib/features/canvas/templateSearch.js +90 -11
- package/lib/features/canvas/templateSearch.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/agentLoop.js +6 -5
- package/lib/features/canvas/videoEditor/agent/agentLoop.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/brainClient.js +13 -2
- package/lib/features/canvas/videoEditor/agent/brainClient.js.map +1 -1
- package/lib/features/canvas/videoEditor/agent/cutTools.js +150 -4
- package/lib/features/canvas/videoEditor/agent/cutTools.js.map +1 -1
- package/lib/features/canvas/videoEditor/exportTask.js +5 -2
- package/lib/features/canvas/videoEditor/exportTask.js.map +1 -1
- package/lib/features/canvas/videoEditor/formWidgets.js +1 -1
- package/lib/features/canvas/videoEditor/mediaActions.js +18 -3
- package/lib/features/canvas/videoEditor/mediaActions.js.map +1 -1
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js +25 -2
- package/lib/features/canvas/videoEditor/produce/ProduceVideoSheet.js.map +1 -1
- package/lib/features/canvas/videoEditor/produce/produceScenes.js +15 -7
- package/lib/features/canvas/videoEditor/produce/produceScenes.js.map +1 -1
- package/lib/features/canvas/videoEditor/remoteMediaClient.js +3 -3
- package/lib/features/canvas/videoEditor/remoteMediaClient.js.map +1 -1
- package/lib/features/channels/ChannelIcon.js +62 -0
- package/lib/features/channels/ChannelIcon.js.map +1 -0
- package/lib/features/channels/ConnectAppsSheet.js +721 -0
- package/lib/features/channels/ConnectAppsSheet.js.map +1 -0
- package/lib/features/channels/HomeImessage.js +48 -0
- package/lib/features/channels/HomeImessage.js.map +1 -0
- package/lib/features/channels/channelLinks.js +90 -0
- package/lib/features/channels/channelLinks.js.map +1 -0
- package/lib/features/channels/useChannelsApi.js +299 -0
- package/lib/features/channels/useChannelsApi.js.map +1 -0
- package/lib/features/chat/AskUserCard.js +327 -21
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/ChatModelSheet.js +414 -0
- package/lib/features/chat/ChatModelSheet.js.map +1 -0
- package/lib/features/chat/TemplatesChatCards.js +32 -1
- package/lib/features/chat/TemplatesChatCards.js.map +1 -1
- package/lib/features/chat/askUser.js +130 -17
- package/lib/features/chat/askUser.js.map +1 -1
- package/lib/features/chat/chatModelCredentials.js +76 -0
- package/lib/features/chat/chatModelCredentials.js.map +1 -0
- package/lib/features/chat/chatModelPick.js +67 -0
- package/lib/features/chat/chatModelPick.js.map +1 -0
- package/lib/features/chat/credentialTemplates.js +43 -0
- package/lib/features/chat/credentialTemplates.js.map +1 -0
- package/lib/features/design/DesignEditorExperience.js +208 -22
- package/lib/features/design/DesignEditorExperience.js.map +1 -1
- package/lib/features/design/DesignExperience.js +23 -6
- package/lib/features/design/DesignExperience.js.map +1 -1
- package/lib/features/design/doc/aiDesign.js +6 -16
- package/lib/features/design/doc/aiDesign.js.map +1 -1
- package/lib/features/design/doc/arrange.js +72 -0
- package/lib/features/design/doc/arrange.js.map +1 -0
- package/lib/features/design/doc/artifacts.js +40 -10
- package/lib/features/design/doc/artifacts.js.map +1 -1
- package/lib/features/design/doc/bleedRunout.js +201 -0
- package/lib/features/design/doc/bleedRunout.js.map +1 -0
- package/lib/features/design/doc/briefForms.js +218 -0
- package/lib/features/design/doc/briefForms.js.map +1 -0
- package/lib/features/design/doc/chart.js +11 -1
- package/lib/features/design/doc/chart.js.map +1 -1
- package/lib/features/design/doc/deletedWork.js +13 -0
- package/lib/features/design/doc/deletedWork.js.map +1 -0
- package/lib/features/design/doc/demoVideo.js +91 -0
- package/lib/features/design/doc/demoVideo.js.map +1 -0
- package/lib/features/design/doc/docOps.js +15 -0
- package/lib/features/design/doc/docOps.js.map +1 -1
- package/lib/features/design/doc/layoutGuides.js +159 -0
- package/lib/features/design/doc/layoutGuides.js.map +1 -0
- package/lib/features/design/doc/pageTemplates.js +286 -0
- package/lib/features/design/doc/pageTemplates.js.map +1 -0
- package/lib/features/design/doc/resize.js +8 -3
- package/lib/features/design/doc/resize.js.map +1 -1
- package/lib/features/design/doc/sizes.js +18 -5
- package/lib/features/design/doc/sizes.js.map +1 -1
- package/lib/features/design/doc/textRuns.js +67 -0
- package/lib/features/design/doc/textRuns.js.map +1 -0
- package/lib/features/design/doc/types.js +8 -1
- package/lib/features/design/doc/types.js.map +1 -1
- package/lib/features/design/editor/AiPanel.js +71 -74
- package/lib/features/design/editor/AiPanel.js.map +1 -1
- package/lib/features/design/editor/AllPagesPanel.js +64 -0
- package/lib/features/design/editor/AllPagesPanel.js.map +1 -0
- package/lib/features/design/editor/CarouselWizard.js +139 -0
- package/lib/features/design/editor/CarouselWizard.js.map +1 -0
- package/lib/features/design/editor/DesignCanvas.js +205 -14
- package/lib/features/design/editor/DesignCanvas.js.map +1 -1
- package/lib/features/design/editor/ExportSheet.js +24 -8
- package/lib/features/design/editor/ExportSheet.js.map +1 -1
- package/lib/features/design/editor/FlyerBriefForm.js +221 -0
- package/lib/features/design/editor/FlyerBriefForm.js.map +1 -0
- package/lib/features/design/editor/GuidesPanel.js +152 -0
- package/lib/features/design/editor/GuidesPanel.js.map +1 -0
- package/lib/features/design/editor/LayerTools.js +24 -1
- package/lib/features/design/editor/LayerTools.js.map +1 -1
- package/lib/features/design/editor/LayersPanel.js +156 -0
- package/lib/features/design/editor/LayersPanel.js.map +1 -0
- package/lib/features/design/editor/ToolPanels.js +34 -1
- package/lib/features/design/editor/ToolPanels.js.map +1 -1
- package/lib/features/design/editor/WordStyleRow.js +66 -0
- package/lib/features/design/editor/WordStyleRow.js.map +1 -0
- package/lib/features/design/editor/useDesignSave.js +36 -2
- package/lib/features/design/editor/useDesignSave.js.map +1 -1
- package/lib/features/design/export/exportDesign.js +79 -19
- package/lib/features/design/export/exportDesign.js.map +1 -1
- package/lib/features/design/export/fetchBytes.js +26 -0
- package/lib/features/design/export/fetchBytes.js.map +1 -0
- package/lib/features/design/export/pdf.js +16 -1
- package/lib/features/design/export/pdf.js.map +1 -1
- package/lib/features/design/export/pptx.js +621 -0
- package/lib/features/design/export/pptx.js.map +1 -0
- package/lib/features/design/export/pptxChart.js +106 -0
- package/lib/features/design/export/pptxChart.js.map +1 -0
- package/lib/features/design/export/pptxGeometry.js +219 -0
- package/lib/features/design/export/pptxGeometry.js.map +1 -0
- package/lib/features/design/export/printFile.js +19 -0
- package/lib/features/design/export/printFile.js.map +1 -0
- package/lib/features/design/export/zip.js +91 -0
- package/lib/features/design/export/zip.js.map +1 -0
- package/lib/features/design/render/PageCapture.js +95 -23
- package/lib/features/design/render/PageCapture.js.map +1 -1
- package/lib/features/design/render/TextMeasure.js +1 -1
- package/lib/features/design/render/layers.js +1 -1
- package/lib/features/design/surface/BoardScreen.js +139 -102
- package/lib/features/design/surface/BoardScreen.js.map +1 -1
- package/lib/features/design/surface/BrandSheet.js +407 -0
- package/lib/features/design/surface/BrandSheet.js.map +1 -0
- package/lib/features/design/surface/ChatWorkView.js +154 -0
- package/lib/features/design/surface/ChatWorkView.js.map +1 -0
- package/lib/features/design/surface/CreationScreen.js +36 -2
- package/lib/features/design/surface/CreationScreen.js.map +1 -1
- package/lib/features/design/surface/DesignAgentChatPane.js +7 -1
- package/lib/features/design/surface/DesignAgentChatPane.js.map +1 -1
- package/lib/features/design/surface/DesignHome.js +505 -0
- package/lib/features/design/surface/DesignHome.js.map +1 -0
- package/lib/features/design/surface/DesignSurfaceExperience.js +182 -9
- package/lib/features/design/surface/DesignSurfaceExperience.js.map +1 -1
- package/lib/features/design/surface/TasksSheet.js +141 -0
- package/lib/features/design/surface/TasksSheet.js.map +1 -0
- package/lib/features/design/surface/TemplatesGallery.js +67 -17
- package/lib/features/design/surface/TemplatesGallery.js.map +1 -1
- package/lib/features/design/surface/WorkTiles.js +207 -0
- package/lib/features/design/surface/WorkTiles.js.map +1 -0
- package/lib/features/design/surface/agentTurn.js +4 -4
- package/lib/features/design/surface/agentTurn.js.map +1 -1
- package/lib/features/design/surface/brandKit.js +204 -0
- package/lib/features/design/surface/brandKit.js.map +1 -0
- package/lib/features/design/surface/designBoard.js +269 -58
- package/lib/features/design/surface/designBoard.js.map +1 -1
- package/lib/features/design/surface/designChannel.js +30 -6
- package/lib/features/design/surface/designChannel.js.map +1 -1
- package/lib/features/design/surface/designConnector.js +11 -3
- package/lib/features/design/surface/designConnector.js.map +1 -1
- package/lib/features/design/surface/designErrors.js +92 -0
- package/lib/features/design/surface/designErrors.js.map +1 -0
- package/lib/features/design/surface/designLinks.js +64 -1
- package/lib/features/design/surface/designLinks.js.map +1 -1
- package/lib/features/design/surface/designRun.js +7 -3
- package/lib/features/design/surface/designRun.js.map +1 -1
- package/lib/features/design/surface/designTheme.js +54 -93
- package/lib/features/design/surface/designTheme.js.map +1 -1
- package/lib/features/design/surface/execStream.js +2 -2
- package/lib/features/design/surface/execStream.js.map +1 -1
- package/lib/features/design/surface/freshLinks.js +69 -0
- package/lib/features/design/surface/freshLinks.js.map +1 -0
- package/lib/features/design/surface/graphicChat.js +37 -0
- package/lib/features/design/surface/graphicChat.js.map +1 -0
- package/lib/features/design/surface/templateKinds.js +61 -0
- package/lib/features/design/surface/templateKinds.js.map +1 -0
- package/lib/features/design/surface/useBrandKitInUse.js +90 -0
- package/lib/features/design/surface/useBrandKitInUse.js.map +1 -0
- package/lib/features/design/surface/useDesignSurface.js +202 -43
- package/lib/features/design/surface/useDesignSurface.js.map +1 -1
- package/lib/features/design/surface/workList.js +184 -0
- package/lib/features/design/surface/workList.js.map +1 -0
- package/lib/features/devices/bodyComposition.js.map +1 -1
- package/lib/features/docs/DocsEditorExperience.js +18 -3
- package/lib/features/docs/DocsEditorExperience.js.map +1 -1
- package/lib/features/docs/docArtifacts.js +11 -23
- package/lib/features/docs/docArtifacts.js.map +1 -1
- package/lib/features/docs/docExport.js +1 -13
- package/lib/features/docs/docExport.js.map +1 -1
- package/lib/features/docs/docShare.js +28 -1
- package/lib/features/docs/docShare.js.map +1 -1
- package/lib/features/docs/docxFile.js +221 -0
- package/lib/features/docs/docxFile.js.map +1 -0
- package/lib/features/home/sky/HomeSky.js +526 -0
- package/lib/features/home/sky/HomeSky.js.map +1 -0
- package/lib/features/home/sky/homeSkyBar.js +16 -0
- package/lib/features/home/sky/homeSkyBar.js.map +1 -0
- package/lib/features/home/sky/skyScene.js +273 -0
- package/lib/features/home/sky/skyScene.js.map +1 -0
- package/lib/features/home/sky/useSkyScene.js +32 -0
- package/lib/features/home/sky/useSkyScene.js.map +1 -0
- package/lib/features/home/weather.js +8 -3
- package/lib/features/home/weather.js.map +1 -1
- package/lib/features/links/openInApp.js +8 -1
- package/lib/features/links/openInApp.js.map +1 -1
- package/lib/features/webbuilder/codezenHandoff.js +7 -1
- package/lib/features/webbuilder/codezenHandoff.js.map +1 -1
- package/lib/hooks/useChatStream.js +3 -2
- package/lib/hooks/useChatStream.js.map +1 -1
- package/lib/screens/DesignNative/index.js +13 -3
- package/lib/screens/DesignNative/index.js.map +1 -1
- package/lib/screens/Devices/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +150 -28
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/HomeHero.js +7 -4
- package/lib/screens/Home/components/HomeHero.js.map +1 -1
- package/lib/screens/Home/components/HomeSuggestions.js +5 -3
- package/lib/screens/Home/components/HomeSuggestions.js.map +1 -1
- package/package.json +2 -2
- package/lib/features/design/surface/DesignBoards.js +0 -441
- package/lib/features/design/surface/DesignBoards.js.map +0 -1
- package/lib/features/design/surface/WetPaint.js +0 -140
- package/lib/features/design/surface/WetPaint.js.map +0 -1
- package/lib/features/design/surface/metaball.js +0 -48
- package/lib/features/design/surface/metaball.js.map +0 -1
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import {chartInk}from'../doc/chart.js';import {SHAPES}from'../doc/shapes.js';import {chartPartXml,chartWorkbook,visibleChartData}from'./pptxChart.js';import {isUnitRect,custGeomXml}from'./pptxGeometry.js';import {makeZip,utf8Text,utf8Bytes}from'./zip.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 PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
21
|
+
const EMU_PER_PX = 9525;
|
|
22
|
+
const XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
23
|
+
const NS = 'xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"';
|
|
24
|
+
const REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
25
|
+
const CT = "application/vnd.openxmlformats-officedocument";
|
|
26
|
+
const esc = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g, "");
|
|
27
|
+
const NAMED = {
|
|
28
|
+
white: "FFFFFF",
|
|
29
|
+
black: "000000",
|
|
30
|
+
red: "FF0000",
|
|
31
|
+
green: "008000",
|
|
32
|
+
blue: "0000FF",
|
|
33
|
+
gray: "808080",
|
|
34
|
+
grey: "808080"
|
|
35
|
+
};
|
|
36
|
+
function parseColor(color) {
|
|
37
|
+
if (typeof color !== "string") return null;
|
|
38
|
+
const c = color.trim().toLowerCase();
|
|
39
|
+
if (!c || c === "none" || c === "transparent") return null;
|
|
40
|
+
if (NAMED[c]) return {
|
|
41
|
+
hex: NAMED[c],
|
|
42
|
+
alpha: 1
|
|
43
|
+
};
|
|
44
|
+
let m = /^#([0-9a-f]{3,8})$/.exec(c);
|
|
45
|
+
if (m) {
|
|
46
|
+
let h = m[1];
|
|
47
|
+
if (h.length === 3 || h.length === 4) h = [...h].map((x) => x + x).join("");
|
|
48
|
+
if (h.length !== 6 && h.length !== 8) return null;
|
|
49
|
+
const alpha = h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1;
|
|
50
|
+
return alpha <= 0 ? null : {
|
|
51
|
+
hex: h.slice(0, 6).toUpperCase(),
|
|
52
|
+
alpha
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
m = /^rgba?\(([^)]+)\)$/.exec(c);
|
|
56
|
+
if (m) {
|
|
57
|
+
const parts = m[1].split(/[\s,/]+/).filter(Boolean);
|
|
58
|
+
if (parts.length < 3) return null;
|
|
59
|
+
const ch = (v) => Math.max(0, Math.min(255, v.endsWith("%") ? parseFloat(v) * 255 / 100 : parseFloat(v)));
|
|
60
|
+
const alpha = parts[3] == null ? 1 : parts[3].endsWith("%") ? parseFloat(parts[3]) / 100 : parseFloat(parts[3]);
|
|
61
|
+
if (!(alpha > 0)) return null;
|
|
62
|
+
const hx = (v) => Math.round(v).toString(16).padStart(2, "0");
|
|
63
|
+
return {
|
|
64
|
+
hex: (hx(ch(parts[0])) + hx(ch(parts[1])) + hx(ch(parts[2]))).toUpperCase(),
|
|
65
|
+
alpha: Math.min(1, alpha)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
function fillXml(color, opacity = 1) {
|
|
71
|
+
const c = parseColor(color);
|
|
72
|
+
if (!c) return "<a:noFill/>";
|
|
73
|
+
const a = Math.max(0, Math.min(1, opacity * c.alpha));
|
|
74
|
+
return `<a:solidFill><a:srgbClr val="${c.hex}">${a < 1 ? `<a:alpha val="${Math.round(a * 1e5)}"/>` : ""}</a:srgbClr></a:solidFill>`;
|
|
75
|
+
}
|
|
76
|
+
function gradientXml(from, to, cssAngle, opacity = 1) {
|
|
77
|
+
const a = parseColor(from);
|
|
78
|
+
const b = parseColor(to);
|
|
79
|
+
if (!a && !b) return "<a:noFill/>";
|
|
80
|
+
const stop = (pos, c, other) => {
|
|
81
|
+
var _a;
|
|
82
|
+
const alpha = ((_a = c == null ? void 0 : c.alpha) != null ? _a : 0) * opacity;
|
|
83
|
+
return `<a:gs pos="${pos}"><a:srgbClr val="${(c != null ? c : other).hex}">${alpha < 1 ? `<a:alpha val="${Math.round(alpha * 1e5)}"/>` : ""}</a:srgbClr></a:gs>`;
|
|
84
|
+
};
|
|
85
|
+
const ang = ((cssAngle - 90) % 360 + 360) % 360 * 6e4;
|
|
86
|
+
return `<a:gradFill rotWithShape="1"><a:gsLst>${stop(0, a, b)}${stop(1e5, b, a)}</a:gsLst><a:lin ang="${Math.round(ang)}" scaled="0"/></a:gradFill>`;
|
|
87
|
+
}
|
|
88
|
+
const MARKUP_RE = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\?[\s\S]*?\?>|<!DOCTYPE(?:[^[>]|\[[\s\S]*?\])*>|<([A-Za-z_][\w:.-]*)((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)(\s*\/?>)/gi;
|
|
89
|
+
const ATTR_RE = /\s+([^\s=/>]+)\s*=\s*("[^"]*"|'[^']*')/g;
|
|
90
|
+
function repairSvgMarkup(svg) {
|
|
91
|
+
let changed = false;
|
|
92
|
+
const out = svg.replace(MARKUP_RE, (whole, name, attrs, end) => {
|
|
93
|
+
if (!name) return whole;
|
|
94
|
+
const list = [...(attrs != null ? attrs : "").matchAll(ATTR_RE)];
|
|
95
|
+
const last = new Map(list.map((a, i) => [a[1], i]));
|
|
96
|
+
if (last.size === list.length) return whole;
|
|
97
|
+
changed = true;
|
|
98
|
+
return `<${name}${list.filter((a, i) => last.get(a[1]) === i).map((a) => a[0]).join("")}${end}`;
|
|
99
|
+
});
|
|
100
|
+
return changed ? out : null;
|
|
101
|
+
}
|
|
102
|
+
const MEDIA_TYPES = {
|
|
103
|
+
png: "image/png",
|
|
104
|
+
jpeg: "image/jpeg",
|
|
105
|
+
gif: "image/gif",
|
|
106
|
+
svg: "image/svg+xml",
|
|
107
|
+
webp: "image/webp",
|
|
108
|
+
bmp: "image/bmp",
|
|
109
|
+
tiff: "image/tiff"
|
|
110
|
+
};
|
|
111
|
+
function sniff(b) {
|
|
112
|
+
if (b[0] === 137 && b[1] === 80 && b[2] === 78) return "png";
|
|
113
|
+
if (b[0] === 255 && b[1] === 216) return "jpeg";
|
|
114
|
+
if (b[0] === 71 && b[1] === 73 && b[2] === 70) return "gif";
|
|
115
|
+
if (b[0] === 82 && b[1] === 73 && b[2] === 70 && b[3] === 70 && b[8] === 87) return "webp";
|
|
116
|
+
if (b[0] === 66 && b[1] === 77) return "bmp";
|
|
117
|
+
if (b[0] === 73 && b[1] === 73 || b[0] === 77 && b[1] === 77) return "tiff";
|
|
118
|
+
const head = String.fromCharCode(...b.slice(0, 1024));
|
|
119
|
+
return /<svg[\s>]/i.test(head) ? "svg" : null;
|
|
120
|
+
}
|
|
121
|
+
function relsXml(list) {
|
|
122
|
+
return `${XML}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">` + list.map((r) => `<Relationship Id="${r.id}" Type="${r.type.includes("://") ? r.type : `${REL}/${r.type}`}" Target="${r.target}"/>`).join("") + `</Relationships>`;
|
|
123
|
+
}
|
|
124
|
+
const ALGN = {
|
|
125
|
+
left: "l",
|
|
126
|
+
center: "ctr",
|
|
127
|
+
right: "r"
|
|
128
|
+
};
|
|
129
|
+
function layerFamily(l, doc) {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
const t = l;
|
|
132
|
+
return t.fontFamily || ((_b = doc.fontPair) == null ? void 0 : _b[(_a = t.fontToken) != null ? _a : "body"]) || "Inter";
|
|
133
|
+
}
|
|
134
|
+
async function buildPptx(doc, deps, pageIndexes) {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
136
|
+
const W = doc.pageWidth;
|
|
137
|
+
const H = doc.pageHeight;
|
|
138
|
+
const emu = (px) => Math.round(px * EMU_PER_PX);
|
|
139
|
+
const clampEmu = (px) => Math.max(914400, Math.min(51206400, emu(px)));
|
|
140
|
+
const keep = pageIndexes ? new Set(pageIndexes) : null;
|
|
141
|
+
const pages = doc.pages.filter((_, i) => !keep || keep.has(i));
|
|
142
|
+
const files = {};
|
|
143
|
+
const put = (path, data) => {
|
|
144
|
+
files[path] = typeof data === "string" ? utf8Bytes(data) : data;
|
|
145
|
+
};
|
|
146
|
+
const defaults = /* @__PURE__ */ new Map([["rels", "application/vnd.openxmlformats-package.relationships+xml"], ["xml", "application/xml"]]);
|
|
147
|
+
const overrides = /* @__PURE__ */ new Map();
|
|
148
|
+
const report = {
|
|
149
|
+
slides: 0,
|
|
150
|
+
pictures: 0,
|
|
151
|
+
shapes: 0,
|
|
152
|
+
texts: 0,
|
|
153
|
+
charts: 0,
|
|
154
|
+
fontsByNameOnly: [],
|
|
155
|
+
notes: []
|
|
156
|
+
};
|
|
157
|
+
const note = (s) => {
|
|
158
|
+
if (!report.notes.includes(s)) report.notes.push(s);
|
|
159
|
+
};
|
|
160
|
+
const named = (fam) => {
|
|
161
|
+
if (!report.fontsByNameOnly.includes(fam)) report.fontsByNameOnly.push(fam);
|
|
162
|
+
};
|
|
163
|
+
const typefaceOf = (family, weight, italic) => {
|
|
164
|
+
named(family);
|
|
165
|
+
return {
|
|
166
|
+
typeface: family,
|
|
167
|
+
bold: weight >= 600,
|
|
168
|
+
italic
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
const isSvgSrc = (src) => /\.svg(\?|#|$)/i.test(src) || src.startsWith("data:image/svg");
|
|
172
|
+
const vectorSize = /* @__PURE__ */ new Map();
|
|
173
|
+
const growVector = (src, w, h) => {
|
|
174
|
+
var _a2, _b2;
|
|
175
|
+
if (!isSvgSrc(src)) return;
|
|
176
|
+
const was = vectorSize.get(src);
|
|
177
|
+
vectorSize.set(src, {
|
|
178
|
+
w: Math.max(w, (_a2 = was == null ? void 0 : was.w) != null ? _a2 : 0),
|
|
179
|
+
h: Math.max(h, (_b2 = was == null ? void 0 : was.h) != null ? _b2 : 0)
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
for (const page of pages) {
|
|
183
|
+
for (const l of (_a = page.layers) != null ? _a : []) if (l.kind === "image" && l.src) growVector(l.src, l.w * W, l.h * H);
|
|
184
|
+
if (((_b = page.background) == null ? void 0 : _b.kind) === "image" && page.background.src) growVector(page.background.src, W, H);
|
|
185
|
+
if (!((_c = page.layers) != null ? _c : []).length && page.src) growVector(page.src, W, H);
|
|
186
|
+
}
|
|
187
|
+
let mediaN = 0;
|
|
188
|
+
const media = /* @__PURE__ */ new Map();
|
|
189
|
+
const mediaFor = (src, wPx, hPx) => {
|
|
190
|
+
const key = src;
|
|
191
|
+
let job = media.get(key);
|
|
192
|
+
if (!job) {
|
|
193
|
+
const n = ++mediaN;
|
|
194
|
+
job = (async () => {
|
|
195
|
+
var _a2;
|
|
196
|
+
let bytes2;
|
|
197
|
+
try {
|
|
198
|
+
bytes2 = await deps.fetchBytes(src);
|
|
199
|
+
} catch (e) {
|
|
200
|
+
note("Some pictures could not be fetched and were left out.");
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
const kind = sniff(bytes2);
|
|
204
|
+
if (!kind) {
|
|
205
|
+
note("Some pictures are in a format PowerPoint cannot show and were left out.");
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (kind !== "svg") {
|
|
209
|
+
const ext = kind === "jpeg" ? "jpeg" : kind;
|
|
210
|
+
put(`ppt/media/image${n}.${ext}`, bytes2);
|
|
211
|
+
defaults.set(ext, MEDIA_TYPES[kind]);
|
|
212
|
+
return {
|
|
213
|
+
main: `image${n}.${ext}`
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
if (!deps.rasterizeSvg) {
|
|
217
|
+
note("Vector pictures were left out.");
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
const fixed = repairSvgMarkup(utf8Text(bytes2));
|
|
221
|
+
if (fixed) bytes2 = utf8Bytes(fixed);
|
|
222
|
+
const size = (_a2 = vectorSize.get(src)) != null ? _a2 : {
|
|
223
|
+
w: wPx,
|
|
224
|
+
h: hPx
|
|
225
|
+
};
|
|
226
|
+
const long = Math.max(size.w, size.h, 1);
|
|
227
|
+
const scale = Math.min(long <= 300 ? 2 : 1, 1600 / long);
|
|
228
|
+
let png;
|
|
229
|
+
try {
|
|
230
|
+
png = await deps.rasterizeSvg(bytes2, Math.max(1, Math.round(size.w * scale)), Math.max(1, Math.round(size.h * scale)));
|
|
231
|
+
} catch (e) {
|
|
232
|
+
note("Some vector pictures could not be drawn and were left out.");
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
put(`ppt/media/image${n}.png`, png);
|
|
236
|
+
put(`ppt/media/image${n}.svg`, bytes2);
|
|
237
|
+
defaults.set("png", MEDIA_TYPES.png);
|
|
238
|
+
defaults.set("svg", MEDIA_TYPES.svg);
|
|
239
|
+
return {
|
|
240
|
+
main: `image${n}.png`,
|
|
241
|
+
svg: `image${n}.svg`
|
|
242
|
+
};
|
|
243
|
+
})();
|
|
244
|
+
media.set(key, job);
|
|
245
|
+
}
|
|
246
|
+
return job;
|
|
247
|
+
};
|
|
248
|
+
const blipFor = (m, rels, inner = "") => {
|
|
249
|
+
const rid = `rId${rels.length + 1}`;
|
|
250
|
+
rels.push({
|
|
251
|
+
id: rid,
|
|
252
|
+
type: "image",
|
|
253
|
+
target: `../media/${m.main}`
|
|
254
|
+
});
|
|
255
|
+
let ext = "";
|
|
256
|
+
if (m.svg) {
|
|
257
|
+
const sid = `rId${rels.length + 1}`;
|
|
258
|
+
rels.push({
|
|
259
|
+
id: sid,
|
|
260
|
+
type: "image",
|
|
261
|
+
target: `../media/${m.svg}`
|
|
262
|
+
});
|
|
263
|
+
ext = `<a:extLst><a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}"><asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" r:embed="${sid}"/></a:ext></a:extLst>`;
|
|
264
|
+
}
|
|
265
|
+
return `<a:blip r:embed="${rid}">${inner}${ext}</a:blip>`;
|
|
266
|
+
};
|
|
267
|
+
const xfrm = (l) => {
|
|
268
|
+
const rot = l.rotation ? ` rot="${Math.round((l.rotation % 360 + 360) % 360 * 6e4)}"` : "";
|
|
269
|
+
const flip = `${l.flipX ? ' flipH="1"' : ""}${l.flipY ? ' flipV="1"' : ""}`;
|
|
270
|
+
return `<a:xfrm${rot}${flip}><a:off x="${emu(l.x * W)}" y="${emu(l.y * H)}"/><a:ext cx="${Math.max(1, emu(l.w * W))}" cy="${Math.max(1, emu(l.h * H))}"/></a:xfrm>`;
|
|
271
|
+
};
|
|
272
|
+
const shadowXml = (sh) => {
|
|
273
|
+
var _a2;
|
|
274
|
+
const c = parseColor(sh == null ? void 0 : sh.color);
|
|
275
|
+
if (!sh || !c) return "";
|
|
276
|
+
return `<a:effectLst><a:outerShdw blurRad="${emu(sh.blurFrac * W)}" dist="${emu(sh.distFrac * W)}" dir="${Math.round((((_a2 = sh.angle) != null ? _a2 : 45) % 360 + 360) % 360 * 6e4)}" algn="ctr" rotWithShape="0"><a:srgbClr val="${c.hex}"><a:alpha val="${Math.round(Math.max(0, Math.min(1, sh.alpha * c.alpha)) * 1e5)}"/></a:srgbClr></a:outerShdw></a:effectLst>`;
|
|
277
|
+
};
|
|
278
|
+
const textBoxXml = (l, id, mode) => {
|
|
279
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
280
|
+
const family = layerFamily(l, doc);
|
|
281
|
+
const opacity = (_a2 = l.opacity) != null ? _a2 : 1;
|
|
282
|
+
const runProps = (r) => {
|
|
283
|
+
var _a3, _b3, _c3, _d3, _e3, _f3, _g3, _h3, _i, _j;
|
|
284
|
+
const size = ((_a3 = r.fontSizeFrac) != null ? _a3 : l.fontSizeFrac) * W;
|
|
285
|
+
const face = typefaceOf((_b3 = r.fontFamily) != null ? _b3 : family, (_d3 = (_c3 = r.fontWeight) != null ? _c3 : l.fontWeight) != null ? _d3 : 400, !!((_e3 = r.italic) != null ? _e3 : l.italic));
|
|
286
|
+
const tracking = (_f3 = r.letterSpacingFrac) != null ? _f3 : l.letterSpacingFrac;
|
|
287
|
+
const attrs = `lang="en-US" sz="${Math.max(100, Math.round(size * 75))}" b="${face.bold ? 1 : 0}" i="${face.italic ? 1 : 0}"${((_g3 = r.underline) != null ? _g3 : l.underline) ? ' u="sng"' : ""}${((_h3 = r.strike) != null ? _h3 : l.strike) ? ' strike="sngStrike"' : ""}${l.uppercase ? ' cap="all"' : ""}${tracking ? ` spc="${Math.round(tracking * W * 75)}"` : ""} dirty="0"`;
|
|
288
|
+
const outline = mode === "back" && l.outline ? `<a:ln w="${Math.max(1, emu(l.outline.widthEm * size))}" cap="rnd">${fillXml(l.outline.color)}<a:round/></a:ln>` : "";
|
|
289
|
+
const fill2 = fillXml(mode === "back" ? (_i = l.outline) == null ? void 0 : _i.color : (_j = r.color) != null ? _j : l.color, opacity);
|
|
290
|
+
const shadow = mode === "front" ? "" : shadowXml(l.shadow);
|
|
291
|
+
const typeface = `<a:latin typeface="${esc(face.typeface)}"/><a:cs typeface="${esc(face.typeface)}"/>`;
|
|
292
|
+
return `<a:rPr ${attrs}>${outline}${fill2}${shadow}${typeface}</a:rPr>`;
|
|
293
|
+
};
|
|
294
|
+
const list = (_b2 = l.listStyle) != null ? _b2 : "none";
|
|
295
|
+
const basePx = l.fontSizeFrac * W;
|
|
296
|
+
const hang = basePx * ((_c2 = l.listIndentEm) != null ? _c2 : 1.2);
|
|
297
|
+
const indent = list === "none" ? "" : ` marL="${emu(hang)}" indent="${-emu(hang)}"`;
|
|
298
|
+
const bullet = list === "bullet" ? '<a:buFontTx/><a:buChar char="\u2022"/>' : list === "number" ? '<a:buFontTx/><a:buAutoNum type="arabicPeriod"/>' : "<a:buNone/>";
|
|
299
|
+
const content = String((_d2 = l.content) != null ? _d2 : "");
|
|
300
|
+
const runs = (_e2 = l.runs) != null ? _e2 : [];
|
|
301
|
+
let offset = 0;
|
|
302
|
+
const paras = content.split("\n").map((line) => {
|
|
303
|
+
var _a3, _b3, _c3, _d3, _e3, _f3, _g3;
|
|
304
|
+
const start = offset;
|
|
305
|
+
const stop = start + line.length;
|
|
306
|
+
offset = stop + 1;
|
|
307
|
+
const pieces = [];
|
|
308
|
+
for (let a = start; a < stop; ) {
|
|
309
|
+
const run = runs.find((r) => a >= r.start && a < r.end);
|
|
310
|
+
const next = run ? Math.min(run.end, stop) : Math.min(stop, ...runs.filter((r) => r.start > a).map((r) => r.start));
|
|
311
|
+
pieces.push({
|
|
312
|
+
a,
|
|
313
|
+
b: next,
|
|
314
|
+
style: run != null ? run : {}
|
|
315
|
+
});
|
|
316
|
+
a = next;
|
|
317
|
+
}
|
|
318
|
+
const first = (_c3 = (_b3 = (_a3 = pieces[0]) == null ? void 0 : _a3.style) != null ? _b3 : runs.find((r) => start >= r.start && start < r.end)) != null ? _c3 : {};
|
|
319
|
+
const lineHeight = (_e3 = (_d3 = first.lineHeight) != null ? _d3 : l.lineHeight) != null ? _e3 : 1.2;
|
|
320
|
+
const linePx = ((_f3 = first.fontSizeFrac) != null ? _f3 : l.fontSizeFrac) * W;
|
|
321
|
+
const pPr = `<a:pPr algn="${l.justify ? "just" : (_g3 = ALGN[l.align]) != null ? _g3 : "l"}"${indent}><a:lnSpc><a:spcPts val="${Math.max(100, Math.round(lineHeight * linePx * 75))}"/></a:lnSpc>${bullet}</a:pPr>`;
|
|
322
|
+
const body = pieces.map((p) => `<a:r>${runProps(p.style)}<a:t>${esc(content.slice(p.a, p.b))}</a:t></a:r>`).join("");
|
|
323
|
+
return `<a:p>${pPr}${body}<a:endParaRPr lang="en-US" sz="${Math.max(100, Math.round(linePx * 75))}" dirty="0"/></a:p>`;
|
|
324
|
+
}).join("");
|
|
325
|
+
const name = mode === "back" ? `Text outline ${id}` : `Text ${id}`;
|
|
326
|
+
const bg = mode !== "front" && ((_f2 = l.effect) == null ? void 0 : _f2.kind) === "background" && !l.curve ? l.effect : null;
|
|
327
|
+
const spread = bg ? bg.spreadEm * basePx : 0;
|
|
328
|
+
const box = bg ? __spreadProps(__spreadValues({}, l), {
|
|
329
|
+
x: l.x - spread / W,
|
|
330
|
+
y: l.y - spread / H,
|
|
331
|
+
w: l.w + 2 * spread / W,
|
|
332
|
+
h: l.h + 2 * spread / H
|
|
333
|
+
}) : l;
|
|
334
|
+
let geom = '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>';
|
|
335
|
+
if (bg && bg.roundness > 0) {
|
|
336
|
+
const lineBox = basePx * ((_g2 = l.lineHeight) != null ? _g2 : 1.2) + 2 * spread;
|
|
337
|
+
const radius = bg.roundness * lineBox / 2;
|
|
338
|
+
const adj = Math.round(Math.min(0.5, radius / Math.max(1, Math.min(box.w * W, box.h * H))) * 1e5);
|
|
339
|
+
geom = `<a:prstGeom prst="roundRect"><a:avLst><a:gd name="adj" fmla="val ${adj}"/></a:avLst></a:prstGeom>`;
|
|
340
|
+
}
|
|
341
|
+
const fill = bg ? fillXml(bg.color, bg.opacity * ((_h2 = l.opacity) != null ? _h2 : 1)) : "<a:noFill/>";
|
|
342
|
+
const inset = emu(spread);
|
|
343
|
+
return `<p:sp><p:nvSpPr><p:cNvPr id="${id}" name="${name}"/><p:cNvSpPr txBox="1"/><p:nvPr/></p:nvSpPr><p:spPr>${xfrm(box)}${geom}${fill}</p:spPr><p:txBody><a:bodyPr wrap="square" lIns="${inset}" tIns="${inset}" rIns="${inset}" bIns="${inset}" rtlCol="0" anchor="t"><a:normAutofit/></a:bodyPr><a:lstStyle/>${paras}</p:txBody></p:sp>`;
|
|
344
|
+
};
|
|
345
|
+
const textXml = (l, take) => {
|
|
346
|
+
if (l.effect && (l.effect.kind !== "background" || l.curve)) note("Text effects (neon, echo, hollow, splice...) are drawn as plain text.");
|
|
347
|
+
if (l.curve) note("Curved text is drawn straight.");
|
|
348
|
+
if (!l.outline || !parseColor(l.outline.color) || !(l.outline.widthEm > 0)) return textBoxXml(l, take(), "plain");
|
|
349
|
+
const gid = take();
|
|
350
|
+
const box = `<a:off x="${emu(l.x * W)}" y="${emu(l.y * H)}"/><a:ext cx="${Math.max(1, emu(l.w * W))}" cy="${Math.max(1, emu(l.h * H))}"/>`;
|
|
351
|
+
const child = `<a:chOff x="${emu(l.x * W)}" y="${emu(l.y * H)}"/><a:chExt cx="${Math.max(1, emu(l.w * W))}" cy="${Math.max(1, emu(l.h * H))}"/>`;
|
|
352
|
+
return `<p:grpSp><p:nvGrpSpPr><p:cNvPr id="${gid}" name="Outlined text ${gid}"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm>${box}${child}</a:xfrm></p:grpSpPr>${textBoxXml(l, take(), "back")}${textBoxXml(l, take(), "front")}</p:grpSp>`;
|
|
353
|
+
};
|
|
354
|
+
const shapeXml = (l, id) => {
|
|
355
|
+
var _a2, _b2, _c2, _d2;
|
|
356
|
+
const kind = String((_a2 = l.shape) != null ? _a2 : "rect");
|
|
357
|
+
let geom;
|
|
358
|
+
if (kind === "rect" && l.radiusFrac) {
|
|
359
|
+
const adj = Math.round(Math.min(0.5, l.radiusFrac) * 1e5);
|
|
360
|
+
geom = `<a:prstGeom prst="roundRect"><a:avLst><a:gd name="adj" fmla="val ${adj}"/></a:avLst></a:prstGeom>`;
|
|
361
|
+
} else if (kind === "rect") geom = '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>';
|
|
362
|
+
else if (kind === "ellipse") geom = '<a:prstGeom prst="ellipse"><a:avLst/></a:prstGeom>';
|
|
363
|
+
else {
|
|
364
|
+
const spec = SHAPES[kind];
|
|
365
|
+
geom = spec ? custGeomXml(spec.d) : '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>';
|
|
366
|
+
if (!spec) note("Unknown shapes became rectangles.");
|
|
367
|
+
}
|
|
368
|
+
const opacity = (_b2 = l.opacity) != null ? _b2 : 1;
|
|
369
|
+
const fill = l.fillTo ? gradientXml(l.fill, l.fillTo, (_c2 = l.fillAngle) != null ? _c2 : 180, opacity) : fillXml(l.fill, opacity);
|
|
370
|
+
const line = parseColor(l.stroke) ? `<a:ln w="${Math.max(1, emu(((_d2 = l.strokeWidthFrac) != null ? _d2 : 2e-3) * W))}">${fillXml(l.stroke, opacity)}</a:ln>` : "<a:ln><a:noFill/></a:ln>";
|
|
371
|
+
return `<p:sp><p:nvSpPr><p:cNvPr id="${id}" name="Shape ${id}"/><p:cNvSpPr/><p:nvPr/></p:nvSpPr><p:spPr>${xfrm(l)}${geom}${fill}${line}</p:spPr><p:txBody><a:bodyPr rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:endParaRPr lang="en-US" dirty="0"/></a:p></p:txBody></p:sp>`;
|
|
372
|
+
};
|
|
373
|
+
const pictureXml = async (l, id, rels) => {
|
|
374
|
+
var _a2, _b2, _c2;
|
|
375
|
+
if (!l.src) {
|
|
376
|
+
note("Empty picture slots were left out.");
|
|
377
|
+
return "";
|
|
378
|
+
}
|
|
379
|
+
const m = await mediaFor(l.src, l.w * W, l.h * H);
|
|
380
|
+
if (!m) return "";
|
|
381
|
+
const opacity = (_a2 = l.opacity) != null ? _a2 : 1;
|
|
382
|
+
const adj = l.adjust;
|
|
383
|
+
let effects = opacity < 1 ? `<a:alphaModFix amt="${Math.round(opacity * 1e5)}"/>` : "";
|
|
384
|
+
if (adj) {
|
|
385
|
+
if (adj.saturation === 0) effects += "<a:grayscl/>";
|
|
386
|
+
const bright = Math.round((((_b2 = adj.brightness) != null ? _b2 : 1) - 1) * 1e5);
|
|
387
|
+
const contrast = Math.round((((_c2 = adj.contrast) != null ? _c2 : 1) - 1) * 1e5);
|
|
388
|
+
if (bright || contrast) effects += `<a:lum bright="${Math.max(-1e5, Math.min(1e5, bright))}" contrast="${Math.max(-1e5, Math.min(1e5, contrast))}"/>`;
|
|
389
|
+
if (adj.filter || adj.blurFrac || adj.saturation != null && adj.saturation !== 0 && adj.saturation !== 1) note("Picture filters, blur and saturation are left off.");
|
|
390
|
+
}
|
|
391
|
+
const c = l.crop;
|
|
392
|
+
const src = c ? `<a:srcRect l="${Math.round(c.x * 1e5)}" t="${Math.round(c.y * 1e5)}" r="${Math.round((1 - c.x - c.w) * 1e5)}" b="${Math.round((1 - c.y - c.h) * 1e5)}"/>` : "";
|
|
393
|
+
const geom = isUnitRect(l.clipPath) ? '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>' : custGeomXml(l.clipPath);
|
|
394
|
+
return `<p:pic><p:nvPicPr><p:cNvPr id="${id}" name="Picture ${id}"/><p:cNvPicPr><a:picLocks noChangeAspect="1"/></p:cNvPicPr><p:nvPr/></p:nvPicPr><p:blipFill>${blipFor(m, rels, effects)}${src}<a:stretch><a:fillRect/></a:stretch></p:blipFill><p:spPr>${xfrm(l)}${geom}${shadowXml(l.shadow)}</p:spPr></p:pic>`;
|
|
395
|
+
};
|
|
396
|
+
let chartN = 0;
|
|
397
|
+
const chartXml = (l, id, rels, background) => {
|
|
398
|
+
var _a2, _b2;
|
|
399
|
+
const n = ++chartN;
|
|
400
|
+
const rid = `rId${rels.length + 1}`;
|
|
401
|
+
rels.push({
|
|
402
|
+
id: rid,
|
|
403
|
+
type: "chart",
|
|
404
|
+
target: `../charts/chart${n}.xml`
|
|
405
|
+
});
|
|
406
|
+
const ink = (_b2 = l.ink) != null ? _b2 : chartInk(background, (_a2 = doc.palette) == null ? void 0 : _a2.background);
|
|
407
|
+
const labelPt = Math.max(6, Math.min(40, W * 85e-4 * 0.75));
|
|
408
|
+
put(`ppt/charts/chart${n}.xml`, chartPartXml(l, ink, labelPt, "rId1"));
|
|
409
|
+
overrides.set(`/ppt/charts/chart${n}.xml`, `${CT}.drawingml.chart+xml`);
|
|
410
|
+
put(`ppt/embeddings/Microsoft_Excel_Worksheet${n}.xlsx`, chartWorkbook(visibleChartData(l)));
|
|
411
|
+
defaults.set("xlsx", `${CT}.spreadsheetml.sheet`);
|
|
412
|
+
put(`ppt/charts/_rels/chart${n}.xml.rels`, relsXml([{
|
|
413
|
+
id: "rId1",
|
|
414
|
+
type: "package",
|
|
415
|
+
target: `../embeddings/Microsoft_Excel_Worksheet${n}.xlsx`
|
|
416
|
+
}]));
|
|
417
|
+
return `<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="${id}" name="Chart ${id}"/><p:cNvGraphicFramePr/><p:nvPr/></p:nvGraphicFramePr><p:xfrm><a:off x="${emu(l.x * W)}" y="${emu(l.y * H)}"/><a:ext cx="${Math.max(1, emu(l.w * W))}" cy="${Math.max(1, emu(l.h * H))}"/></p:xfrm><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart"><c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${rid}"/></a:graphicData></a:graphic></p:graphicFrame>`;
|
|
418
|
+
};
|
|
419
|
+
const backgroundXml = async (bg, rels) => {
|
|
420
|
+
var _a2;
|
|
421
|
+
if (!bg) return "";
|
|
422
|
+
let fill = "";
|
|
423
|
+
if (bg.kind === "color" && parseColor(bg.color)) fill = fillXml(bg.color);
|
|
424
|
+
else if (bg.kind === "gradient") fill = gradientXml(bg.from, bg.to, (_a2 = bg.angle) != null ? _a2 : 180);
|
|
425
|
+
else if (bg.kind === "image" && bg.src) {
|
|
426
|
+
const m = await mediaFor(bg.src, W, H);
|
|
427
|
+
if (m) fill = `<a:blipFill dpi="0" rotWithShape="1">${blipFor(m, rels)}<a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill>`;
|
|
428
|
+
}
|
|
429
|
+
return fill ? `<p:bg><p:bgPr>${fill}<a:effectLst/></p:bgPr></p:bg>` : "";
|
|
430
|
+
};
|
|
431
|
+
await Promise.all(pages.flatMap((page) => {
|
|
432
|
+
var _a2, _b2;
|
|
433
|
+
const jobs = [];
|
|
434
|
+
const layers = (_a2 = page.layers) != null ? _a2 : [];
|
|
435
|
+
for (const l of layers) if (l.kind === "image" && l.src) jobs.push(mediaFor(l.src, l.w * W, l.h * H));
|
|
436
|
+
if (((_b2 = page.background) == null ? void 0 : _b2.kind) === "image" && page.background.src) jobs.push(mediaFor(page.background.src, W, H));
|
|
437
|
+
if (!layers.length && page.src) jobs.push(mediaFor(page.src, W, H));
|
|
438
|
+
return jobs;
|
|
439
|
+
}));
|
|
440
|
+
const emptyTree = `<p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr>`;
|
|
441
|
+
const notesSlides = [];
|
|
442
|
+
let slideN = 0;
|
|
443
|
+
for (const page of pages) {
|
|
444
|
+
const rels = [{
|
|
445
|
+
id: "rId1",
|
|
446
|
+
type: "slideLayout",
|
|
447
|
+
target: "../slideLayouts/slideLayout1.xml"
|
|
448
|
+
}];
|
|
449
|
+
const parts = [];
|
|
450
|
+
let id = 2;
|
|
451
|
+
const take = () => id++;
|
|
452
|
+
const layers = (_d = page.layers) != null ? _d : [];
|
|
453
|
+
if (!layers.length && page.src) {
|
|
454
|
+
const flat = await pictureXml({
|
|
455
|
+
x: 0,
|
|
456
|
+
y: 0,
|
|
457
|
+
w: 1,
|
|
458
|
+
h: 1,
|
|
459
|
+
src: page.src
|
|
460
|
+
}, take(), rels);
|
|
461
|
+
if (flat) report.pictures++;
|
|
462
|
+
parts.push(flat);
|
|
463
|
+
} else if (!layers.length) {
|
|
464
|
+
note("Pages that are not drawn yet were left out.");
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
for (const l of layers) {
|
|
468
|
+
if (l.kind === "text") {
|
|
469
|
+
parts.push(textXml(l, take));
|
|
470
|
+
report.texts++;
|
|
471
|
+
} else if (l.kind === "shape") {
|
|
472
|
+
parts.push(shapeXml(l, take()));
|
|
473
|
+
report.shapes++;
|
|
474
|
+
} else if (l.kind === "image") {
|
|
475
|
+
const x = await pictureXml(l, take(), rels);
|
|
476
|
+
if (x) report.pictures++;
|
|
477
|
+
parts.push(x);
|
|
478
|
+
} else if (l.kind === "chart") {
|
|
479
|
+
parts.push(chartXml(l, take(), rels, page.background));
|
|
480
|
+
report.charts++;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
const bg = await backgroundXml(page.background, rels);
|
|
484
|
+
const n = ++slideN;
|
|
485
|
+
if ((_e = page.notes) == null ? void 0 : _e.trim()) {
|
|
486
|
+
rels.push({
|
|
487
|
+
id: `rId${rels.length + 1}`,
|
|
488
|
+
type: "notesSlide",
|
|
489
|
+
target: `../notesSlides/notesSlide${n}.xml`
|
|
490
|
+
});
|
|
491
|
+
put(`ppt/notesSlides/notesSlide${n}.xml`, notesSlideXml(page.notes));
|
|
492
|
+
put(`ppt/notesSlides/_rels/notesSlide${n}.xml.rels`, relsXml([{
|
|
493
|
+
id: "rId1",
|
|
494
|
+
type: "notesMaster",
|
|
495
|
+
target: "../notesMasters/notesMaster1.xml"
|
|
496
|
+
}, {
|
|
497
|
+
id: "rId2",
|
|
498
|
+
type: "slide",
|
|
499
|
+
target: `../slides/slide${n}.xml`
|
|
500
|
+
}]));
|
|
501
|
+
overrides.set(`/ppt/notesSlides/notesSlide${n}.xml`, `${CT}.presentationml.notesSlide+xml`);
|
|
502
|
+
notesSlides.push(n);
|
|
503
|
+
}
|
|
504
|
+
put(`ppt/slides/slide${n}.xml`, `${XML}<p:sld ${NS}><p:cSld>${bg}<p:spTree>${emptyTree}${parts.join("")}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>`);
|
|
505
|
+
overrides.set(`/ppt/slides/slide${n}.xml`, `${CT}.presentationml.slide+xml`);
|
|
506
|
+
put(`ppt/slides/_rels/slide${n}.xml.rels`, relsXml(rels));
|
|
507
|
+
report.slides++;
|
|
508
|
+
}
|
|
509
|
+
if (!slideN) throw new Error("No pages to export");
|
|
510
|
+
const presRels = [{
|
|
511
|
+
id: "rId1",
|
|
512
|
+
type: "slideMaster",
|
|
513
|
+
target: "slideMasters/slideMaster1.xml"
|
|
514
|
+
}];
|
|
515
|
+
for (let i = 1; i <= slideN; i++) presRels.push({
|
|
516
|
+
id: `rId${i + 1}`,
|
|
517
|
+
type: "slide",
|
|
518
|
+
target: `slides/slide${i}.xml`
|
|
519
|
+
});
|
|
520
|
+
presRels.push({
|
|
521
|
+
id: `rId${presRels.length + 1}`,
|
|
522
|
+
type: "theme",
|
|
523
|
+
target: "theme/theme1.xml"
|
|
524
|
+
});
|
|
525
|
+
const notesMasterRel = notesSlides.length ? `rId${presRels.length + 1}` : "";
|
|
526
|
+
if (notesMasterRel) presRels.push({
|
|
527
|
+
id: notesMasterRel,
|
|
528
|
+
type: "notesMaster",
|
|
529
|
+
target: "notesMasters/notesMaster1.xml"
|
|
530
|
+
});
|
|
531
|
+
const cx = clampEmu(W);
|
|
532
|
+
const cy = clampEmu(H);
|
|
533
|
+
const sldIds = Array.from({
|
|
534
|
+
length: slideN
|
|
535
|
+
}, (_, i) => `<p:sldId id="${256 + i}" r:id="rId${i + 2}"/>`).join("");
|
|
536
|
+
put("ppt/presentation.xml", `${XML}<p:presentation ${NS}><p:sldMasterIdLst><p:sldMasterId id="2147483648" r:id="rId1"/></p:sldMasterIdLst>` + (notesMasterRel ? `<p:notesMasterIdLst><p:notesMasterId r:id="${notesMasterRel}"/></p:notesMasterIdLst>` : "") + `<p:sldIdLst>${sldIds}</p:sldIdLst><p:sldSz cx="${cx}" cy="${cy}"/><p:notesSz cx="6858000" cy="9144000"/></p:presentation>`);
|
|
537
|
+
overrides.set("/ppt/presentation.xml", `${CT}.presentationml.presentation.main+xml`);
|
|
538
|
+
put("ppt/_rels/presentation.xml.rels", relsXml(presRels));
|
|
539
|
+
put("_rels/.rels", relsXml([{
|
|
540
|
+
id: "rId1",
|
|
541
|
+
type: "officeDocument",
|
|
542
|
+
target: "ppt/presentation.xml"
|
|
543
|
+
}, {
|
|
544
|
+
id: "rId2",
|
|
545
|
+
type: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
|
|
546
|
+
target: "docProps/core.xml"
|
|
547
|
+
}]));
|
|
548
|
+
put("ppt/slideMasters/slideMaster1.xml", `${XML}<p:sldMaster ${NS}><p:cSld><p:spTree>${emptyTree}</p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/></p:sldLayoutIdLst></p:sldMaster>`);
|
|
549
|
+
overrides.set("/ppt/slideMasters/slideMaster1.xml", `${CT}.presentationml.slideMaster+xml`);
|
|
550
|
+
put("ppt/slideMasters/_rels/slideMaster1.xml.rels", relsXml([{
|
|
551
|
+
id: "rId1",
|
|
552
|
+
type: "slideLayout",
|
|
553
|
+
target: "../slideLayouts/slideLayout1.xml"
|
|
554
|
+
}, {
|
|
555
|
+
id: "rId2",
|
|
556
|
+
type: "theme",
|
|
557
|
+
target: "../theme/theme1.xml"
|
|
558
|
+
}]));
|
|
559
|
+
put("ppt/slideLayouts/slideLayout1.xml", `${XML}<p:sldLayout ${NS} type="blank" preserve="1"><p:cSld name="Blank"><p:spTree>${emptyTree}</p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`);
|
|
560
|
+
overrides.set("/ppt/slideLayouts/slideLayout1.xml", `${CT}.presentationml.slideLayout+xml`);
|
|
561
|
+
put("ppt/slideLayouts/_rels/slideLayout1.xml.rels", relsXml([{
|
|
562
|
+
id: "rId1",
|
|
563
|
+
type: "slideMaster",
|
|
564
|
+
target: "../slideMasters/slideMaster1.xml"
|
|
565
|
+
}]));
|
|
566
|
+
const theme = themeXml(doc, pages);
|
|
567
|
+
put("ppt/theme/theme1.xml", theme);
|
|
568
|
+
overrides.set("/ppt/theme/theme1.xml", `${CT}.theme+xml`);
|
|
569
|
+
if (notesMasterRel) {
|
|
570
|
+
put("ppt/notesMasters/notesMaster1.xml", `${XML}<p:notesMaster ${NS}><p:cSld><p:spTree>${emptyTree}</p:spTree></p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/></p:notesMaster>`);
|
|
571
|
+
overrides.set("/ppt/notesMasters/notesMaster1.xml", `${CT}.presentationml.notesMaster+xml`);
|
|
572
|
+
put("ppt/notesMasters/_rels/notesMaster1.xml.rels", relsXml([{
|
|
573
|
+
id: "rId1",
|
|
574
|
+
type: "theme",
|
|
575
|
+
target: "../theme/theme2.xml"
|
|
576
|
+
}]));
|
|
577
|
+
put("ppt/theme/theme2.xml", theme);
|
|
578
|
+
overrides.set("/ppt/theme/theme2.xml", `${CT}.theme+xml`);
|
|
579
|
+
}
|
|
580
|
+
const title = ((_f = doc.title) == null ? void 0 : _f.trim()) || ((_h = (_g = doc.brief) == null ? void 0 : _g.topic) == null ? void 0 : _h.trim()) || "Presentation";
|
|
581
|
+
put("docProps/core.xml", `${XML}<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:title>${esc(title)}</dc:title><dc:creator>Yantra</dc:creator></cp:coreProperties>`);
|
|
582
|
+
overrides.set("/docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml");
|
|
583
|
+
put("[Content_Types].xml", `${XML}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">` + [...defaults].map(([e, t]) => `<Default Extension="${e}" ContentType="${t}"/>`).join("") + [...overrides].map(([p, t]) => `<Override PartName="${p}" ContentType="${t}"/>`).join("") + `</Types>`);
|
|
584
|
+
const bytes = makeZip(Object.entries(files).map(([name, data]) => ({
|
|
585
|
+
name,
|
|
586
|
+
data
|
|
587
|
+
})));
|
|
588
|
+
return {
|
|
589
|
+
bytes,
|
|
590
|
+
report
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
function notesSlideXml(notes) {
|
|
594
|
+
const paras = notes.split("\n").map((line) => `<a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t>${esc(line)}</a:t></a:r></a:p>`).join("");
|
|
595
|
+
return `${XML}<p:notes ${NS}><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Notes Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="4400550"/><a:ext cx="5486400" cy="3600450"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/>${paras}</p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>`;
|
|
596
|
+
}
|
|
597
|
+
function themeXml(doc, pages) {
|
|
598
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
599
|
+
const counts = /* @__PURE__ */ new Map();
|
|
600
|
+
for (const p of pages) for (const l of (_a = p.layers) != null ? _a : []) if (l.kind === "text") {
|
|
601
|
+
const fam = layerFamily(l, doc);
|
|
602
|
+
counts.set(fam, ((_b = counts.get(fam)) != null ? _b : 0) + ((_d = (_c = l.content) == null ? void 0 : _c.length) != null ? _d : 0));
|
|
603
|
+
}
|
|
604
|
+
const main = (_h = (_g = (_e = [...counts].sort((a, b) => b[1] - a[1])[0]) == null ? void 0 : _e[0]) != null ? _g : (_f = doc.fontPair) == null ? void 0 : _f.body) != null ? _h : "Calibri";
|
|
605
|
+
const accents = [];
|
|
606
|
+
const take = (c) => {
|
|
607
|
+
const p = parseColor(c);
|
|
608
|
+
if (p && !accents.includes(p.hex) && accents.length < 6) accents.push(p.hex);
|
|
609
|
+
};
|
|
610
|
+
take((_i = doc.palette) == null ? void 0 : _i.primary);
|
|
611
|
+
for (const p of pages) for (const l of (_j = p.layers) != null ? _j : []) {
|
|
612
|
+
if (l.kind === "chart") (_k = l.colors) == null ? void 0 : _k.forEach(take);
|
|
613
|
+
else if (l.kind === "shape") take(l.fill);
|
|
614
|
+
}
|
|
615
|
+
for (const c of ["4472C4", "ED7D31", "A5A5A5", "FFC000", "5B9BD5", "70AD47"]) take(`#${c}`);
|
|
616
|
+
const dk = (_n = (_m = parseColor((_l = doc.palette) == null ? void 0 : _l.text)) == null ? void 0 : _m.hex) != null ? _n : "1F2937";
|
|
617
|
+
const lt = (_q = (_p = parseColor((_o = doc.palette) == null ? void 0 : _o.background)) == null ? void 0 : _p.hex) != null ? _q : "FFFFFF";
|
|
618
|
+
const font = `<a:latin typeface="${esc(main)}"/><a:ea typeface=""/><a:cs typeface=""/>`;
|
|
619
|
+
const phFill = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
|
|
620
|
+
return `${XML}<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Design"><a:themeElements><a:clrScheme name="Design"><a:dk1><a:srgbClr val="000000"/></a:dk1><a:lt1><a:srgbClr val="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="${dk}"/></a:dk2><a:lt2><a:srgbClr val="${lt}"/></a:lt2>` + accents.map((c, i) => `<a:accent${i + 1}><a:srgbClr val="${c}"/></a:accent${i + 1}>`).join("") + `<a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Design"><a:majorFont>${font}</a:majorFont><a:minorFont>${font}</a:minorFont></a:fontScheme><a:fmtScheme name="Design"><a:fillStyleLst>${phFill}${phFill}${phFill}</a:fillStyleLst><a:lnStyleLst><a:ln w="6350">${phFill}</a:ln><a:ln w="12700">${phFill}</a:ln><a:ln w="19050">${phFill}</a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst>${phFill}${phFill}${phFill}</a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>`;
|
|
621
|
+
}export{PPTX_MIME,buildPptx,esc,parseColor,repairSvgMarkup};//# sourceMappingURL=pptx.js.map
|