pptx-react-viewer 4.66.0 → 4.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +10 -0
  3. package/dist/{AiChatPanel-JKWJQX4N.mjs → AiChatPanel-E7CJSTW7.mjs} +1 -1
  4. package/dist/AiChatPanel-E7CJSTW7.mjs.br +0 -0
  5. package/dist/AiChatPanel-E7CJSTW7.mjs.gz +0 -0
  6. package/dist/{AiChatPanel-DL7EBR2V.js → AiChatPanel-PLQ3NBTK.js} +19 -19
  7. package/dist/AiChatPanel-PLQ3NBTK.js.br +0 -0
  8. package/dist/AiChatPanel-PLQ3NBTK.js.gz +0 -0
  9. package/dist/ai.js +2 -2
  10. package/dist/ai.js.br +0 -0
  11. package/dist/ai.js.gz +0 -0
  12. package/dist/ai.mjs +1 -1
  13. package/dist/ai.mjs.br +0 -0
  14. package/dist/ai.mjs.gz +0 -0
  15. package/dist/{chunk-ZRU67AVX.mjs → chunk-3LJ5QUU3.mjs} +155 -134
  16. package/dist/chunk-3LJ5QUU3.mjs.br +0 -0
  17. package/dist/chunk-3LJ5QUU3.mjs.gz +0 -0
  18. package/dist/{chunk-YQ67KAQR.js → chunk-F5UOILTY.js} +354 -333
  19. package/dist/chunk-F5UOILTY.js.br +0 -0
  20. package/dist/chunk-F5UOILTY.js.gz +0 -0
  21. package/dist/{chunk-A4K2TM2K.mjs → chunk-FBSPQYRE.mjs} +4 -1
  22. package/dist/chunk-FBSPQYRE.mjs.br +0 -0
  23. package/dist/{chunk-A4K2TM2K.mjs.gz → chunk-FBSPQYRE.mjs.gz} +0 -0
  24. package/dist/{chunk-SLFVXZHA.mjs → chunk-JZE6BORE.mjs} +1 -1
  25. package/dist/chunk-JZE6BORE.mjs.br +0 -0
  26. package/dist/chunk-JZE6BORE.mjs.gz +0 -0
  27. package/dist/{chunk-DORVZDQT.mjs → chunk-LRDW6EH7.mjs} +21 -11
  28. package/dist/chunk-LRDW6EH7.mjs.br +0 -0
  29. package/dist/chunk-LRDW6EH7.mjs.gz +0 -0
  30. package/dist/{chunk-UC57KUGO.js → chunk-LVEFHZ76.js} +1 -1
  31. package/dist/chunk-LVEFHZ76.js.br +0 -0
  32. package/dist/chunk-LVEFHZ76.js.gz +0 -0
  33. package/dist/{chunk-73S5EOD3.js → chunk-P2COO2QO.js} +4 -1
  34. package/dist/chunk-P2COO2QO.js.br +0 -0
  35. package/dist/{chunk-73S5EOD3.js.gz → chunk-P2COO2QO.js.gz} +0 -0
  36. package/dist/{chunk-QLXYEA54.js → chunk-ZLPMXC55.js} +577 -567
  37. package/dist/chunk-ZLPMXC55.js.br +0 -0
  38. package/dist/chunk-ZLPMXC55.js.gz +0 -0
  39. package/dist/i18n/de.cjs +3 -0
  40. package/dist/i18n/de.cjs.br +0 -0
  41. package/dist/i18n/de.cjs.gz +0 -0
  42. package/dist/i18n/de.mjs +3 -0
  43. package/dist/i18n/de.mjs.br +0 -0
  44. package/dist/i18n/de.mjs.gz +0 -0
  45. package/dist/i18n/es.cjs +3 -0
  46. package/dist/i18n/es.cjs.br +0 -0
  47. package/dist/i18n/es.cjs.gz +0 -0
  48. package/dist/i18n/es.mjs +3 -0
  49. package/dist/i18n/es.mjs.br +0 -0
  50. package/dist/i18n/es.mjs.gz +0 -0
  51. package/dist/i18n/fr.cjs +3 -0
  52. package/dist/i18n/fr.cjs.br +0 -0
  53. package/dist/i18n/fr.cjs.gz +0 -0
  54. package/dist/i18n/fr.mjs +3 -0
  55. package/dist/i18n/fr.mjs.br +0 -0
  56. package/dist/i18n/fr.mjs.gz +0 -0
  57. package/dist/i18n/zh-CN.cjs +3 -0
  58. package/dist/i18n/zh-CN.cjs.br +0 -0
  59. package/dist/i18n/zh-CN.cjs.gz +0 -0
  60. package/dist/i18n/zh-CN.mjs +3 -0
  61. package/dist/i18n/zh-CN.mjs.br +0 -0
  62. package/dist/i18n/zh-CN.mjs.gz +0 -0
  63. package/dist/index.d.ts +4 -1
  64. package/dist/index.js +27 -27
  65. package/dist/index.js.br +0 -0
  66. package/dist/index.js.gz +0 -0
  67. package/dist/index.mjs +4 -4
  68. package/dist/index.mjs.br +0 -0
  69. package/dist/index.mjs.gz +0 -0
  70. package/dist/internals.d.ts +9 -2
  71. package/dist/internals.js +81 -81
  72. package/dist/internals.js.br +0 -0
  73. package/dist/internals.js.gz +0 -0
  74. package/dist/internals.mjs +2 -2
  75. package/dist/internals.mjs.br +0 -0
  76. package/dist/internals.mjs.gz +0 -0
  77. package/dist/viewer/index.d.ts +4 -1
  78. package/dist/viewer/index.js +21 -21
  79. package/dist/viewer/index.js.br +0 -0
  80. package/dist/viewer/index.js.gz +0 -0
  81. package/dist/viewer/index.mjs +4 -4
  82. package/dist/viewer/index.mjs.br +0 -0
  83. package/dist/viewer/index.mjs.gz +0 -0
  84. package/package.json +4 -4
  85. package/dist/AiChatPanel-DL7EBR2V.js.br +0 -0
  86. package/dist/AiChatPanel-DL7EBR2V.js.gz +0 -0
  87. package/dist/AiChatPanel-JKWJQX4N.mjs.br +0 -0
  88. package/dist/AiChatPanel-JKWJQX4N.mjs.gz +0 -0
  89. package/dist/chunk-73S5EOD3.js.br +0 -0
  90. package/dist/chunk-A4K2TM2K.mjs.br +0 -0
  91. package/dist/chunk-DORVZDQT.mjs.br +0 -0
  92. package/dist/chunk-DORVZDQT.mjs.gz +0 -0
  93. package/dist/chunk-QLXYEA54.js.br +0 -0
  94. package/dist/chunk-QLXYEA54.js.gz +0 -0
  95. package/dist/chunk-SLFVXZHA.mjs.br +0 -0
  96. package/dist/chunk-SLFVXZHA.mjs.gz +0 -0
  97. package/dist/chunk-UC57KUGO.js.br +0 -0
  98. package/dist/chunk-UC57KUGO.js.gz +0 -0
  99. package/dist/chunk-YQ67KAQR.js.br +0 -0
  100. package/dist/chunk-YQ67KAQR.js.gz +0 -0
  101. package/dist/chunk-ZRU67AVX.mjs.br +0 -0
  102. package/dist/chunk-ZRU67AVX.mjs.gz +0 -0
@@ -1,5 +1,5 @@
1
- import { cloneTemplateElementsBySlideId, cloneSlide, cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, useTranslation, partitionTemplateElements, isTemplateElementId, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, comparePresentation, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, stopAllPersistentAudio, buildSaveSlides, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, getImageEffectsOpacity, getImageEffectsFilter, getImageRenderStyle, cn, isEditableTextElement, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, getElementLabel, normalizeHexColor, makeCloneId, DEFAULT_TEXT_FONT_SIZE, buildPdfFromTiledImageData, GRID_SIZE, copyFormatFromElement, hasCopyableFormat, isImageTiled, getDuotoneColors, DEFAULT_STROKE_COLOR, DEFAULT_FILL_COLOR, buildCssGradientFromShapeStyle, getCropShapeClipPath, getElementTransform, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, rendersCustomVectorPath, rendersWedgeCalloutVector, getImageSurfaceMaskStyle, getTextWarpStyle, getTextCompensationTransform, getTextCompensationOrigin, renderTextSegments, buildReactChartViewModel, renderChartElement, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, buildTextBody3DSceneStyle, rerouteConnectorsForMovedElements, applyReroutedConnectors, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, buildNotesPdf, canvasToJpegData, applyFormatToElement, isPpactionUrl, parsePpactionUrl, getImageTilingStyle, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getAriaRoleDescription as getAriaRoleDescription$1, getAriaLabel as getAriaLabel$1, getAriaRole, DEFAULT_FONT_FAMILY, ACTION_BUTTON_PRESETS, isUrlSafe, substituteFieldText } from './chunk-A4K2TM2K.mjs';
2
- import { defineThreeViewElement, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createCollaborationSessionController, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, createEditorHistoryController, historyTheme, crossedHistoryTheme, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, resolveMediaBookmarkTimesMs, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, resolveShowBackward, resolveShowForward, beginZoomExcursion, buildZoomTransitionOverride, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, INITIAL_FIND_REPLACE_SESSION, findReplaceSessionActions, visibleTemplateElements, createCollaborationLivePatcher, reportInlineTextDraft, initialInspectorOpen, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, seedRecentColors, resolveAuthoredCustomShowId, GlyphOutlineFontCache, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, resolveInitialSlideIndex, pptxLoadErrorMessage, resolveAutosaveIntervalMs, createAutosaveController, saveAutosaveSnapshot, updateMasterViewElement, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canMergeShapes, canInteractWithElement, prepareHtml2CanvasClone, html2canvasCaptureScope, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, DEFAULT_VIEWER_OPTIONS, resolveImageResolutionScale, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, createAutosaveRecoveryController, discardAutosaveRecovery, probeAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, canEditElementPoints, resolveGoogleFontsCss2Base, createEmbeddedFontsSheet, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, selectTrustedEmbeddedFonts, fetchGoogleWebfontOutlineBytes, dispatchEditorKey, isFeatureEnabled, parentSelection, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, gateViewerEdits, prepareElementForInsertion, slideSpaceElement, resolveReportedViewerMode, autosaveStatusKind, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, isKeyboardOpen, scopeLayoutOptionsToSlide, collaborationHistoryReady, bindCollaborationHistory, INITIAL_READ_ONLY_SESSION, readOnlySessionActions, applyReadOnlySessionEvent, readOnlyBannerVisible, readOnlyLocked, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, resolveCollaborationConfig, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, getResizeHandleHitAreaStyle, resolveElementInteractivity, getBackgroundAnimationState, getShapeEffectLayerPlacement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getShapeEffectAnimationLayerStyle, tableFrameCss, inlineElementPointerEvents, passesClicksThroughBox, LINK_TOOLTIP_HOST_CLASS, resolvePalette as resolvePalette$1, mediaControlBarEnabled, mediaTransportVisible, oleActionsVisible, getGroupChildParentFill, deviceStrokeStageStyle, morphOverlayElementSlots, buildMorphOutlineRules, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, setPendingCaretPoint, resolveGroupDoubleClickTarget, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, promptNameDialog, generateCustomShowId, confirmDeleteDialog, contextMenuInspectorAnchor, savedPresentationFileName, deliverSavedPresentation, exportDeckJson, mapCustomizedEditorKey, isEditorTextInputTarget, groupElements, generateElementId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, planMergeShapes, applyMergeShapesPlan, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, createBlankSlide, insertSlidePaste, applySlidePasteTemplates, makeSlideId, insertedLayoutCompletion, buildSlideTemplateSlide, templateSchemeFromTheme, queueThemeWrite, needsOwnedSession, openOwnedCollaboration, resolveViewportFitOptions, editorViewportFitFor, calculateViewportFit, observeViewportClientSize, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, openUrlInNewTab, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, slideSpaceMembers, remapTextToSegments, getInlineEditorSelectionResult, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, createGestureController, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx as computeGridSpacingPx$1, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, writeBackReport, createSyncGate, observeExternalCollaborationReadiness, resolveHistoryDepth, lockExternalContentSetting, resolveAllowExternalContent, createBackstagePresentation, buildFieldSubstitutionContext, buildSlidesPaneFieldContext, buildSlidesPaneTableStyleContext, slidesPaneRehearsalTimings, openSlidesPaneLayoutGallery, getImageColorWashStyle, attachRotateHandlePlacement, getSelectionControlArtworkStyle, getSelectionOutlineColor, paintedStrokeWidth, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getAnimationOpacity, abuttingEdgeBleedStyle, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getShapeEffectFilterDefs, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, getSilhouetteFillLayer, buildSubpathFillOverlay, strokeOutlineViewBox, buildSummaryZoomView, readEditableText, placeCaretAt, takePendingCaretPoint, getPendingSelectionRestore, restoreSegmentSelection, mapInlineTextFormatKey, mapInlineEditorChord, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, chartFormatTargetFromEvent, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, getTextCompensationStyle, placeholderPromptDescriptor, getAriaRoleDescription, getAriaLabel, elementIdSelector, TOOLBAR_TABS, resolveGroupPressTarget, scrollInspectorSectionIntoView, computeScrollDelta, buildOutlinePrintJobDocument, printJobRasterFallback, applyThemeByPath, withHistoryTheme, withHistoryMasterThemes, writeThemeParts, loadedThemeName, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, withCellStyle, getCellText, setCellText, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, createSnapshotTextPositions, resolvePresentationAction, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, svgLineCap, connectorSnapTransform, connectorNeedsPath, connectorStrandScreenWidth, connectorWrapperTransform, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, modelDataToBlobUrl, resolveZoomNavigationTarget, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, canDrillDown, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, measureSvgViewportRect, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, isEquationOnlyText, convertOmmlToMathMl, EQUATION_FONT_FAMILY, sanitizeMathMl, buildEquationBlockStyle, buildTextBlockStyle, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, resolveFontItalic, resolveFontWeight, isWedgeCalloutPresetShape, getAriaRole as getAriaRole$1, isElementActionable, buildSmartArtPresetData, classifyMediaType, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, planPrintJob, openPrintWindow, buildVectorPrintJobDocument, openPendingPrintWindow, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, publishLiveGeometry, rasterizeElementTiledToCanvas, clampGifDimensions, rasterResultToPngDataUrl, openExternalHyperlinkConfirmed, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, findSmartArtNodeText, commitSmartArtNodeFill, commitSmartArtNodeText, groupIntoParagraphs as groupIntoParagraphs$1, createGlyphOutlineLookup, resolveWarpRunPaint, finishPrintWindow, buildRasterPrintJobDocument, applyMotionPathPreset, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, computeSmartArtElementLayout, flattenNodes, computeInlineEditorRect, smartArtNodeAtPoint, SMARTART_DEFAULT_PALETTE, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, refreshSmartArtPictureImage, centeredSvgTextLines, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, bringForward, sendBackward, bringToFront, sendToBack } from 'ooxml-ui/pptx';
1
+ import { cloneTemplateElementsBySlideId, cloneSlide, cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, useTranslation, partitionTemplateElements, isTemplateElementId, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, comparePresentation, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, stopAllPersistentAudio, buildSaveSlides, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, getImageEffectsOpacity, getImageEffectsFilter, getImageRenderStyle, cn, isEditableTextElement, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, getElementLabel, normalizeHexColor, makeCloneId, DEFAULT_TEXT_FONT_SIZE, buildPdfFromTiledImageData, GRID_SIZE, copyFormatFromElement, hasCopyableFormat, isImageTiled, getDuotoneColors, DEFAULT_STROKE_COLOR, DEFAULT_FILL_COLOR, buildCssGradientFromShapeStyle, getCropShapeClipPath, getElementTransform, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, rendersCustomVectorPath, rendersWedgeCalloutVector, getImageSurfaceMaskStyle, getTextWarpStyle, getTextCompensationTransform, getTextCompensationOrigin, renderTextSegments, buildReactChartViewModel, renderChartElement, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, buildTextBody3DSceneStyle, rerouteConnectorsForMovedElements, applyReroutedConnectors, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, buildNotesPdf, canvasToJpegData, applyFormatToElement, isPpactionUrl, parsePpactionUrl, getImageTilingStyle, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getAriaRoleDescription as getAriaRoleDescription$1, getAriaLabel as getAriaLabel$1, getAriaRole, DEFAULT_FONT_FAMILY, ACTION_BUTTON_PRESETS, isUrlSafe, substituteFieldText } from './chunk-FBSPQYRE.mjs';
2
+ import { defineThreeViewElement, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createCollaborationSessionController, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, createEditorHistoryController, historyTheme, crossedHistoryTheme, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, resolveMediaBookmarkTimesMs, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, resolveShowBackward, resolveShowForward, beginZoomExcursion, buildZoomTransitionOverride, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, INITIAL_FIND_REPLACE_SESSION, findReplaceSessionActions, visibleTemplateElements, createCollaborationLivePatcher, reportInlineTextDraft, initialInspectorOpen, resolveGoogleFontsCss2Base, createEmbeddedFontsSheet, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, loadDeckWebfontOutlines, GlyphOutlineFontCache, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, prepareDeckWebfonts, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, resolveInitialSlideIndex, pptxLoadErrorMessage, resolveAutosaveIntervalMs, createAutosaveController, saveAutosaveSnapshot, updateMasterViewElement, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canMergeShapes, canInteractWithElement, prepareHtml2CanvasClone, html2canvasCaptureScope, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, DEFAULT_VIEWER_OPTIONS, resolveImageResolutionScale, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, createAutosaveRecoveryController, discardAutosaveRecovery, probeAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, canEditElementPoints, dispatchEditorKey, isFeatureEnabled, parentSelection, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, gateViewerEdits, prepareElementForInsertion, slideSpaceElement, resolveReportedViewerMode, autosaveStatusKind, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, isKeyboardOpen, scopeLayoutOptionsToSlide, collaborationHistoryReady, bindCollaborationHistory, INITIAL_READ_ONLY_SESSION, readOnlySessionActions, applyReadOnlySessionEvent, readOnlyBannerVisible, readOnlyLocked, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, resolveCollaborationConfig, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, getResizeHandleHitAreaStyle, resolveElementInteractivity, getBackgroundAnimationState, getShapeEffectLayerPlacement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getShapeEffectAnimationLayerStyle, tableFrameCss, inlineElementPointerEvents, passesClicksThroughBox, LINK_TOOLTIP_HOST_CLASS, resolvePalette as resolvePalette$1, mediaControlBarEnabled, mediaTransportVisible, oleActionsVisible, getGroupChildParentFill, deviceStrokeStageStyle, morphOverlayElementSlots, buildMorphOutlineRules, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, setPendingCaretPoint, resolveGroupDoubleClickTarget, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, promptNameDialog, generateCustomShowId, confirmDeleteDialog, contextMenuInspectorAnchor, savedPresentationFileName, deliverSavedPresentation, exportDeckJson, mapCustomizedEditorKey, isEditorTextInputTarget, groupElements, generateElementId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, planMergeShapes, applyMergeShapesPlan, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, createBlankSlide, insertSlidePaste, applySlidePasteTemplates, makeSlideId, insertedLayoutCompletion, buildSlideTemplateSlide, templateSchemeFromTheme, queueThemeWrite, needsOwnedSession, openOwnedCollaboration, resolveViewportFitOptions, editorViewportFitFor, calculateViewportFit, observeViewportClientSize, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, openUrlInNewTab, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, slideSpaceMembers, remapTextToSegments, getInlineEditorSelectionResult, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, createGestureController, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx as computeGridSpacingPx$1, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, writeBackReport, createSyncGate, observeExternalCollaborationReadiness, resolveHistoryDepth, hostFontDownloadLock, lockExternalContentSetting, FONT_DOWNLOAD_SETTING_ID, resolveAllowExternalContent, resolveEffectiveGoogleFonts, createBackstagePresentation, buildFieldSubstitutionContext, buildSlidesPaneFieldContext, buildSlidesPaneTableStyleContext, slidesPaneRehearsalTimings, openSlidesPaneLayoutGallery, getImageColorWashStyle, attachRotateHandlePlacement, getSelectionControlArtworkStyle, getSelectionOutlineColor, paintedStrokeWidth, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getAnimationOpacity, abuttingEdgeBleedStyle, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getShapeEffectFilterDefs, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, getSilhouetteFillLayer, buildSubpathFillOverlay, strokeOutlineViewBox, buildSummaryZoomView, readEditableText, placeCaretAt, takePendingCaretPoint, getPendingSelectionRestore, restoreSegmentSelection, mapInlineTextFormatKey, mapInlineEditorChord, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, chartFormatTargetFromEvent, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, getTextCompensationStyle, placeholderPromptDescriptor, getAriaRoleDescription, getAriaLabel, elementIdSelector, TOOLBAR_TABS, resolveGroupPressTarget, scrollInspectorSectionIntoView, computeScrollDelta, buildOutlinePrintJobDocument, printJobRasterFallback, applyThemeByPath, withHistoryTheme, withHistoryMasterThemes, writeThemeParts, loadedThemeName, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, withCellStyle, getCellText, setCellText, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, createSnapshotTextPositions, resolvePresentationAction, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, svgLineCap, connectorSquareCapPath, connectorSnapTransform, connectorNeedsPath, connectorStrandScreenWidth, connectorWrapperTransform, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, modelDataToBlobUrl, resolveZoomNavigationTarget, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, canDrillDown, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, measureSvgViewportRect, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, isEquationOnlyText, convertOmmlToMathMl, EQUATION_FONT_FAMILY, sanitizeMathMl, buildEquationBlockStyle, buildTextBlockStyle, hasGlyphEnvelope, buildGlyphEnvelopeBlock, warpParagraphLayouts, resolveFontItalic, resolveFontWeight, isWedgeCalloutPresetShape, getAriaRole as getAriaRole$1, isElementActionable, buildSmartArtPresetData, classifyMediaType, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, planPrintJob, openPrintWindow, buildVectorPrintJobDocument, openPendingPrintWindow, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, publishLiveGeometry, rasterizeElementTiledToCanvas, clampGifDimensions, rasterResultToPngDataUrl, openExternalHyperlinkConfirmed, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, findSmartArtNodeText, commitSmartArtNodeFill, commitSmartArtNodeText, groupIntoParagraphs as groupIntoParagraphs$1, createGlyphOutlineLookup, resolveWarpRunPaint, finishPrintWindow, buildRasterPrintJobDocument, applyMotionPathPreset, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, computeSmartArtElementLayout, flattenNodes, computeInlineEditorRect, smartArtNodeAtPoint, SMARTART_DEFAULT_PALETTE, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, refreshSmartArtPictureImage, centeredSvgTextLines, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, bringForward, sendBackward, bringToFront, sendToBack } from 'ooxml-ui/pptx';
3
3
  export { DUOTONE_PRESETS, MOBILE_BREAKPOINT, SLIDE_TRANSITION_KEYFRAMES, TABLET_BREAKPOINT, clearAudienceContent, computeVirtualRange, downloadBlob, getSlideTransitionAnimations, loadAudienceContent, storeAudienceContent } from 'ooxml-ui/pptx';
4
4
  import React17, { useRef, useState, useCallback, useEffect, useSyncExternalStore, useMemo, useContext, useLayoutEffect, createContext, useImperativeHandle, Suspense } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -4017,6 +4017,7 @@ function useViewerCoreState(_input) {
4017
4017
  useEffect(() => () => livePatcher.dispose(), [livePatcher]);
4018
4018
  const [mode, setMode] = useState("edit");
4019
4019
  const [loading, setLoading] = useState(true);
4020
+ const [fontProgress, setFontProgress] = useState(null);
4020
4021
  const [error, setError] = useState(null);
4021
4022
  const { slides, setSlides, slidesRef } = useSlideState();
4022
4023
  const [templateElementsBySlideId, setTemplateElementsBySlideId] = useState({});
@@ -4119,6 +4120,8 @@ function useViewerCoreState(_input) {
4119
4120
  setMode,
4120
4121
  loading,
4121
4122
  setLoading,
4123
+ fontProgress,
4124
+ setFontProgress,
4122
4125
  error,
4123
4126
  setError,
4124
4127
  slides,
@@ -4358,6 +4361,98 @@ function useViewerState(input) {
4358
4361
  var glyphOutlineFontCache = /* @__PURE__ */ new GlyphOutlineFontCache();
4359
4362
  var getGlyphOutline = /* @__PURE__ */ createGlyphOutlineLookup(glyphOutlineFontCache);
4360
4363
 
4364
+ // src/viewer/hooks/useFontInjection.ts
4365
+ var EMBEDDED_FONTS_STYLE_ID = "pptx-embedded-fonts";
4366
+ var GOOGLE_FONTS_LINK_ID = "pptx-google-fonts";
4367
+ var SYMBOL_FONTS_STYLE_ID = "pptx-symbol-font-fallback";
4368
+ var SYMBOL_FONT_FAMILIES = [
4369
+ "Wingdings",
4370
+ "Wingdings 2",
4371
+ "Wingdings 3",
4372
+ "Symbol",
4373
+ "Webdings"
4374
+ ];
4375
+ var FONT_NAME_UNSAFE_CHARS = /["\\\n\r;}<>]/u;
4376
+ function useFontInjection({
4377
+ embeddedFonts,
4378
+ slides,
4379
+ googleFonts
4380
+ }) {
4381
+ const googleFontsBase = resolveGoogleFontsCss2Base(googleFonts);
4382
+ useEffect(() => {
4383
+ if (!embeddedFonts.length) {
4384
+ return;
4385
+ }
4386
+ const sheet = createEmbeddedFontsSheet(document, EMBEDDED_FONTS_STYLE_ID);
4387
+ sheet.set(embeddedFonts);
4388
+ return () => sheet.dispose();
4389
+ }, [embeddedFonts]);
4390
+ const referencedFamilies = useMemo(() => collectReferencedFontFamilies(slides), [slides]);
4391
+ useEffect(() => {
4392
+ let cancelled = false;
4393
+ void resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
4394
+ (href) => {
4395
+ if (cancelled) {
4396
+ return null;
4397
+ }
4398
+ syncGoogleWebfontStylesheet(document, GOOGLE_FONTS_LINK_ID, href);
4399
+ return href;
4400
+ }
4401
+ );
4402
+ return () => {
4403
+ cancelled = true;
4404
+ };
4405
+ }, [embeddedFonts, slides, googleFontsBase]);
4406
+ useEffect(() => () => document.getElementById(GOOGLE_FONTS_LINK_ID)?.remove(), []);
4407
+ const [, setOutlineFontsTick] = useState(0);
4408
+ useEffect(() => {
4409
+ let cancelled = false;
4410
+ void loadDeckWebfontOutlines({
4411
+ slides,
4412
+ embeddedFonts,
4413
+ googleFontsBase,
4414
+ cache: glyphOutlineFontCache,
4415
+ isCancelled: () => cancelled
4416
+ }).then((registered) => {
4417
+ if (registered && !cancelled) {
4418
+ setOutlineFontsTick((tick) => tick + 1);
4419
+ }
4420
+ return void 0;
4421
+ });
4422
+ return () => {
4423
+ cancelled = true;
4424
+ };
4425
+ }, [embeddedFonts, slides, googleFontsBase]);
4426
+ useEffect(() => {
4427
+ const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
4428
+ if (neededSymbolFonts.length === 0) {
4429
+ return;
4430
+ }
4431
+ const styleEl = document.createElement("style");
4432
+ styleEl.id = SYMBOL_FONTS_STYLE_ID;
4433
+ const rules = neededSymbolFonts.flatMap((font) => {
4434
+ if (typeof font !== "string" || FONT_NAME_UNSAFE_CHARS.test(font)) {
4435
+ return [];
4436
+ }
4437
+ return [
4438
+ `@font-face {
4439
+ font-family: "${font}";
4440
+ src: local("${font}"), local("${font} Regular");
4441
+ font-display: swap;
4442
+ }`
4443
+ ];
4444
+ }).join("\n");
4445
+ styleEl.textContent = rules;
4446
+ document.head.appendChild(styleEl);
4447
+ return () => {
4448
+ const existing = document.getElementById(SYMBOL_FONTS_STYLE_ID);
4449
+ if (existing) {
4450
+ document.head.removeChild(existing);
4451
+ }
4452
+ };
4453
+ }, [referencedFamilies]);
4454
+ }
4455
+
4361
4456
  // src/viewer/hooks/useLoadContent.ts
4362
4457
  function useLoadContent({
4363
4458
  content,
@@ -4401,6 +4496,8 @@ function useLoadContent({
4401
4496
  setModifyVerifier,
4402
4497
  setCompatToasts,
4403
4498
  setLoading,
4499
+ setFontProgress,
4500
+ googleFonts,
4404
4501
  setError,
4405
4502
  setIsDirty,
4406
4503
  setIsEncrypted,
@@ -4414,6 +4511,8 @@ function useLoadContent({
4414
4511
  initialSlideRef.current = initialSlide;
4415
4512
  const limitsRef = useRef(limits);
4416
4513
  limitsRef.current = limits;
4514
+ const googleFontsRef = useRef(googleFonts);
4515
+ googleFontsRef.current = googleFonts;
4417
4516
  const { t } = useTranslation();
4418
4517
  const translateRef = useRef(t);
4419
4518
  translateRef.current = t;
@@ -4432,6 +4531,7 @@ function useLoadContent({
4432
4531
  (async () => {
4433
4532
  try {
4434
4533
  setLoading(true);
4534
+ setFontProgress?.(null);
4435
4535
  setError(null);
4436
4536
  const buffer = content instanceof Uint8Array ? content.buffer.slice(content.byteOffset, content.byteOffset + content.byteLength) : content;
4437
4537
  originalBufferRef.current = buffer instanceof ArrayBuffer ? buffer : null;
@@ -4499,6 +4599,21 @@ function useLoadContent({
4499
4599
  nextSlides,
4500
4600
  (path) => handler.getImageData(path)
4501
4601
  );
4602
+ const partition = partitionTemplateElements(nextSlides);
4603
+ if (typeof document !== "undefined") {
4604
+ await prepareDeckWebfonts({
4605
+ document,
4606
+ linkId: GOOGLE_FONTS_LINK_ID,
4607
+ slides: partition.slides,
4608
+ embeddedFonts: parsed.embeddedFonts ?? [],
4609
+ googleFontsBase: resolveGoogleFontsCss2Base(googleFontsRef.current),
4610
+ onProgress: (progress) => {
4611
+ if (!cancelled && token === renderTokenRef.current) {
4612
+ setFontProgress?.(progress);
4613
+ }
4614
+ }
4615
+ });
4616
+ }
4502
4617
  if (cancelled || token !== renderTokenRef.current) {
4503
4618
  return;
4504
4619
  }
@@ -4514,7 +4629,6 @@ function useLoadContent({
4514
4629
  }
4515
4630
  resources.commit();
4516
4631
  handlerRef.current = handler;
4517
- const partition = partitionTemplateElements(nextSlides);
4518
4632
  setSlides(partition.slides);
4519
4633
  setTemplateElementsBySlideId(partition.templateElementsBySlideId);
4520
4634
  setCanvasSize({
@@ -4595,6 +4709,7 @@ function useLoadContent({
4595
4709
  } finally {
4596
4710
  resources.releaseIfUncommitted();
4597
4711
  if (!cancelled && token === renderTokenRef.current) {
4712
+ setFontProgress?.(null);
4598
4713
  setLoading(false);
4599
4714
  }
4600
4715
  }
@@ -10105,125 +10220,6 @@ function useIOHandlers(input) {
10105
10220
  });
10106
10221
  return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
10107
10222
  }
10108
- var EMBEDDED_FONTS_STYLE_ID = "pptx-embedded-fonts";
10109
- var GOOGLE_FONTS_LINK_ID = "pptx-google-fonts";
10110
- var SYMBOL_FONTS_STYLE_ID = "pptx-symbol-font-fallback";
10111
- var SYMBOL_FONT_FAMILIES = [
10112
- "Wingdings",
10113
- "Wingdings 2",
10114
- "Wingdings 3",
10115
- "Symbol",
10116
- "Webdings"
10117
- ];
10118
- var FONT_NAME_UNSAFE_CHARS = /["\\\n\r;}<>]/u;
10119
- function useFontInjection({
10120
- embeddedFonts,
10121
- slides,
10122
- googleFonts
10123
- }) {
10124
- const googleFontsBase = resolveGoogleFontsCss2Base(googleFonts);
10125
- useEffect(() => {
10126
- if (!embeddedFonts.length) {
10127
- return;
10128
- }
10129
- const sheet = createEmbeddedFontsSheet(document, EMBEDDED_FONTS_STYLE_ID);
10130
- sheet.set(embeddedFonts);
10131
- return () => sheet.dispose();
10132
- }, [embeddedFonts]);
10133
- const referencedFamilies = useMemo(() => collectReferencedFontFamilies(slides), [slides]);
10134
- useEffect(() => {
10135
- let cancelled = false;
10136
- void resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
10137
- (href) => {
10138
- if (cancelled) {
10139
- return null;
10140
- }
10141
- syncGoogleWebfontStylesheet(document, GOOGLE_FONTS_LINK_ID, href);
10142
- return href;
10143
- }
10144
- );
10145
- return () => {
10146
- cancelled = true;
10147
- };
10148
- }, [embeddedFonts, slides, googleFontsBase]);
10149
- useEffect(() => () => document.getElementById(GOOGLE_FONTS_LINK_ID)?.remove(), []);
10150
- const [, setOutlineFontsTick] = useState(0);
10151
- useEffect(() => {
10152
- let cancelled = false;
10153
- const referenced = collectReferencedFontFamilies(slides);
10154
- const candidates = selectGoogleWebfontFamilies(
10155
- referenced,
10156
- selectTrustedEmbeddedFonts(embeddedFonts).map((font) => font.name)
10157
- );
10158
- if (candidates.length === 0) {
10159
- return;
10160
- }
10161
- void resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
10162
- async (href) => {
10163
- if (cancelled || !href) {
10164
- return;
10165
- }
10166
- const boldItalicVariants = [
10167
- { bold: false, italic: false },
10168
- { bold: true, italic: false }
10169
- ];
10170
- let registeredAny = false;
10171
- for (const family of candidates) {
10172
- for (const variant of boldItalicVariants) {
10173
- if (cancelled) {
10174
- return;
10175
- }
10176
- const bytes = await fetchGoogleWebfontOutlineBytes(
10177
- href,
10178
- family,
10179
- variant.bold,
10180
- variant.italic,
10181
- fetch
10182
- );
10183
- if (bytes && glyphOutlineFontCache.registerFontBytes(family, variant.bold, variant.italic, bytes)) {
10184
- registeredAny = true;
10185
- }
10186
- }
10187
- }
10188
- if (registeredAny && !cancelled) {
10189
- setOutlineFontsTick((tick) => tick + 1);
10190
- }
10191
- return void 0;
10192
- }
10193
- );
10194
- return () => {
10195
- cancelled = true;
10196
- };
10197
- }, [embeddedFonts, slides, googleFontsBase]);
10198
- useEffect(() => {
10199
- const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
10200
- if (neededSymbolFonts.length === 0) {
10201
- return;
10202
- }
10203
- const styleEl = document.createElement("style");
10204
- styleEl.id = SYMBOL_FONTS_STYLE_ID;
10205
- const rules = neededSymbolFonts.flatMap((font) => {
10206
- if (typeof font !== "string" || FONT_NAME_UNSAFE_CHARS.test(font)) {
10207
- return [];
10208
- }
10209
- return [
10210
- `@font-face {
10211
- font-family: "${font}";
10212
- src: local("${font}"), local("${font} Regular");
10213
- font-display: swap;
10214
- }`
10215
- ];
10216
- }).join("\n");
10217
- styleEl.textContent = rules;
10218
- document.head.appendChild(styleEl);
10219
- return () => {
10220
- const existing = document.getElementById(SYMBOL_FONTS_STYLE_ID);
10221
- if (existing) {
10222
- document.head.removeChild(existing);
10223
- }
10224
- };
10225
- }, [referencedFamilies]);
10226
- }
10227
10223
  function useContentLifecycle(input) {
10228
10224
  const {
10229
10225
  content,
@@ -10290,6 +10286,8 @@ function useContentLifecycle(input) {
10290
10286
  setModifyVerifier,
10291
10287
  setCompatToasts,
10292
10288
  setLoading: state.setLoading,
10289
+ setFontProgress: state.setFontProgress,
10290
+ googleFonts,
10293
10291
  setError: state.setError,
10294
10292
  setIsDirty: state.setIsDirty,
10295
10293
  setIsEncrypted: setIsEncryptedDialogOpen,
@@ -12880,17 +12878,20 @@ function useViewPreferencesSync(input) {
12880
12878
  function useViewerBuildingBlocksState(input) {
12881
12879
  const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
12882
12880
  const { initialSlide, googleFonts, listConversionScope, allowExternalContent, limits } = input;
12883
- const externalContentLockedRef = useRef(false);
12881
+ const hostLockedRef = useRef(false);
12884
12882
  const { optionsStore } = core;
12883
+ const fontDownloadLock = hostFontDownloadLock(googleFonts);
12885
12884
  useLayoutEffect(() => {
12886
- if (allowExternalContent === void 0 && !externalContentLockedRef.current) {
12885
+ const anyLock = allowExternalContent !== void 0 || fontDownloadLock !== void 0;
12886
+ if (!anyLock && !hostLockedRef.current) {
12887
12887
  return;
12888
12888
  }
12889
- externalContentLockedRef.current = allowExternalContent !== void 0;
12889
+ hostLockedRef.current = anyLock;
12890
+ const locked = lockExternalContentSetting({}, allowExternalContent);
12890
12891
  optionsStore.setConstraints({
12891
- locked: lockExternalContentSetting({}, allowExternalContent)
12892
+ locked: fontDownloadLock === void 0 ? locked : { ...locked, [FONT_DOWNLOAD_SETTING_ID]: fontDownloadLock }
12892
12893
  });
12893
- }, [optionsStore, allowExternalContent]);
12894
+ }, [optionsStore, allowExternalContent, fontDownloadLock]);
12894
12895
  const {
12895
12896
  onContentChange,
12896
12897
  onDirtyChange,
@@ -12992,7 +12993,8 @@ function useViewerBuildingBlocksState(input) {
12992
12993
  filePath,
12993
12994
  autosaveEnabled,
12994
12995
  initialSlide,
12995
- googleFonts,
12996
+ // Host `googleFonts` first, else Trust Center > "Download fonts", as in `PowerPointViewer`.
12997
+ googleFonts: resolveEffectiveGoogleFonts(googleFonts, viewerOptions),
12996
12998
  limits,
12997
12999
  // Trust Center > "Allow external content": same gate `PowerPointViewer`
12998
13000
  // applies, so the headless building-blocks API loads http(s) images
@@ -14456,6 +14458,12 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
14456
14458
  endY: viewHeight
14457
14459
  };
14458
14460
  const hitTargetWidth = Math.max(strokeWidth * 3, 14);
14461
+ const paintPathData = connectorSquareCapPath(
14462
+ pathGeometry.pathData,
14463
+ ss,
14464
+ strokeWidth,
14465
+ compoundOffsets.length > 1 || !!startArrow && startArrow !== "none" || !!endArrow && endArrow !== "none"
14466
+ ) ?? pathGeometry.pathData;
14459
14467
  const snapTransform = connectorSnapTransform(
14460
14468
  el,
14461
14469
  !connectorNeedsPath(shapeEl?.shapeType),
@@ -14580,7 +14588,7 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
14580
14588
  "path",
14581
14589
  {
14582
14590
  "data-pptx-line": "",
14583
- d: pathGeometry.pathData,
14591
+ d: paintPathData,
14584
14592
  fill: "none",
14585
14593
  stroke: strokePaint,
14586
14594
  strokeWidth: Math.max(compoundWidths[idx] ?? strokeWidth, 1),
@@ -17326,7 +17334,7 @@ function getAlignmentProps(align) {
17326
17334
  return { startOffset: "0%", textAnchor: "start" };
17327
17335
  }
17328
17336
  }
17329
- function getSegmentTspanProps(segment, element, fallbackColor) {
17337
+ function getSegmentTspanProps(segment, element, fallbackColor, fitScale = 1) {
17330
17338
  const paint = resolveWarpRunPaint(
17331
17339
  segment,
17332
17340
  element.textStyle,
@@ -17335,7 +17343,7 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
17335
17343
  );
17336
17344
  return {
17337
17345
  fill: paint.fill,
17338
- fontSize: paint.fontSizePx,
17346
+ fontSize: paint.fontSizePx * fitScale,
17339
17347
  fontWeight: paint.fontWeight ?? "normal",
17340
17348
  fontStyle: paint.fontStyle ?? "normal",
17341
17349
  fontFamily: paint.fontFamily,
@@ -17430,7 +17438,6 @@ function WarpedText({
17430
17438
  if (paragraphs.length === 0) {
17431
17439
  return null;
17432
17440
  }
17433
- const lineCount = paragraphs.length;
17434
17441
  const pathIdPrefix = `warp-${element.id}`;
17435
17442
  const warpAdj = textEl.textStyle?.textWarpAdj;
17436
17443
  const warpAdj2 = textEl.textStyle?.textWarpAdj2;
@@ -17483,6 +17490,15 @@ function WarpedText({
17483
17490
  }
17484
17491
  );
17485
17492
  }
17493
+ const layouts = warpParagraphLayouts(
17494
+ preset,
17495
+ width,
17496
+ height,
17497
+ paragraphs,
17498
+ warpAdj,
17499
+ warpAdj2,
17500
+ textEl.textStyle
17501
+ );
17486
17502
  return /* @__PURE__ */ jsxs(
17487
17503
  "svg",
17488
17504
  {
@@ -17502,7 +17518,7 @@ function WarpedText({
17502
17518
  "path",
17503
17519
  {
17504
17520
  id: `${pathIdPrefix}-${i}`,
17505
- d: getWarpPath(preset, width, height, i, lineCount, warpAdj, warpAdj2),
17521
+ d: layouts[i]?.d,
17506
17522
  fill: "none"
17507
17523
  },
17508
17524
  `${pathIdPrefix}-def-${i}`
@@ -17524,7 +17540,12 @@ function WarpedText({
17524
17540
  children: para.segments.map((seg, segIdx) => /* @__PURE__ */ jsx(
17525
17541
  "tspan",
17526
17542
  {
17527
- ...getSegmentTspanProps(seg, textEl, fallbackColor),
17543
+ ...getSegmentTspanProps(
17544
+ seg,
17545
+ textEl,
17546
+ fallbackColor,
17547
+ layouts[paraIdx]?.fitScale ?? 1
17548
+ ),
17528
17549
  children: seg.text
17529
17550
  },
17530
17551
  `${pathIdPrefix}-ts-${paraIdx}-${segIdx}`
Binary file
Binary file