pptx-react-viewer 4.66.0 → 4.68.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.
- package/CHANGELOG.md +38 -0
- package/README.md +10 -0
- package/dist/{AiChatPanel-JKWJQX4N.mjs → AiChatPanel-E7CJSTW7.mjs} +1 -1
- package/dist/AiChatPanel-E7CJSTW7.mjs.br +0 -0
- package/dist/AiChatPanel-E7CJSTW7.mjs.gz +0 -0
- package/dist/{AiChatPanel-DL7EBR2V.js → AiChatPanel-PLQ3NBTK.js} +19 -19
- package/dist/AiChatPanel-PLQ3NBTK.js.br +0 -0
- package/dist/AiChatPanel-PLQ3NBTK.js.gz +0 -0
- package/dist/ai.js +2 -2
- package/dist/ai.js.br +0 -0
- package/dist/ai.js.gz +0 -0
- package/dist/ai.mjs +1 -1
- package/dist/ai.mjs.br +0 -0
- package/dist/ai.mjs.gz +0 -0
- package/dist/{chunk-DORVZDQT.mjs → chunk-BJLJJUP3.mjs} +25 -11
- package/dist/chunk-BJLJJUP3.mjs.br +0 -0
- package/dist/chunk-BJLJJUP3.mjs.gz +0 -0
- package/dist/{chunk-A4K2TM2K.mjs → chunk-FBSPQYRE.mjs} +4 -1
- package/dist/chunk-FBSPQYRE.mjs.br +0 -0
- package/dist/{chunk-A4K2TM2K.mjs.gz → chunk-FBSPQYRE.mjs.gz} +0 -0
- package/dist/{chunk-ZRU67AVX.mjs → chunk-GG4I3L2W.mjs} +165 -135
- package/dist/chunk-GG4I3L2W.mjs.br +0 -0
- package/dist/chunk-GG4I3L2W.mjs.gz +0 -0
- package/dist/{chunk-SLFVXZHA.mjs → chunk-JZE6BORE.mjs} +1 -1
- package/dist/chunk-JZE6BORE.mjs.br +0 -0
- package/dist/chunk-JZE6BORE.mjs.gz +0 -0
- package/dist/{chunk-UC57KUGO.js → chunk-LVEFHZ76.js} +1 -1
- package/dist/chunk-LVEFHZ76.js.br +0 -0
- package/dist/chunk-LVEFHZ76.js.gz +0 -0
- package/dist/{chunk-YQ67KAQR.js → chunk-NRTPKXZX.js} +364 -334
- package/dist/chunk-NRTPKXZX.js.br +0 -0
- package/dist/chunk-NRTPKXZX.js.gz +0 -0
- package/dist/{chunk-73S5EOD3.js → chunk-P2COO2QO.js} +4 -1
- package/dist/chunk-P2COO2QO.js.br +0 -0
- package/dist/{chunk-73S5EOD3.js.gz → chunk-P2COO2QO.js.gz} +0 -0
- package/dist/{chunk-QLXYEA54.js → chunk-Q5QEVT54.js} +581 -567
- package/dist/chunk-Q5QEVT54.js.br +0 -0
- package/dist/chunk-Q5QEVT54.js.gz +0 -0
- package/dist/i18n/de.cjs +3 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +3 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +3 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +3 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +3 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +3 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +3 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +3 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +27 -27
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +9 -2
- package/dist/internals.js +81 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +2 -2
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +4 -1
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +4 -4
- package/dist/AiChatPanel-DL7EBR2V.js.br +0 -0
- package/dist/AiChatPanel-DL7EBR2V.js.gz +0 -0
- package/dist/AiChatPanel-JKWJQX4N.mjs.br +0 -0
- package/dist/AiChatPanel-JKWJQX4N.mjs.gz +0 -0
- package/dist/chunk-73S5EOD3.js.br +0 -0
- package/dist/chunk-A4K2TM2K.mjs.br +0 -0
- package/dist/chunk-DORVZDQT.mjs.br +0 -0
- package/dist/chunk-DORVZDQT.mjs.gz +0 -0
- package/dist/chunk-QLXYEA54.js.br +0 -0
- package/dist/chunk-QLXYEA54.js.gz +0 -0
- package/dist/chunk-SLFVXZHA.mjs.br +0 -0
- package/dist/chunk-SLFVXZHA.mjs.gz +0 -0
- package/dist/chunk-UC57KUGO.js.br +0 -0
- package/dist/chunk-UC57KUGO.js.gz +0 -0
- package/dist/chunk-YQ67KAQR.js.br +0 -0
- package/dist/chunk-YQ67KAQR.js.gz +0 -0
- package/dist/chunk-ZRU67AVX.mjs.br +0 -0
- 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-
|
|
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, prepareDeckWebfonts, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, 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;
|
|
@@ -4442,13 +4542,35 @@ function useLoadContent({
|
|
|
4442
4542
|
);
|
|
4443
4543
|
}
|
|
4444
4544
|
const previousHandler = handlerRef.current;
|
|
4545
|
+
let webfonts;
|
|
4546
|
+
const startWebfonts = (deckSlides, deckEmbeddedFonts) => {
|
|
4547
|
+
if (typeof document === "undefined" || cancelled || token !== renderTokenRef.current) {
|
|
4548
|
+
return;
|
|
4549
|
+
}
|
|
4550
|
+
webfonts = prepareDeckWebfonts({
|
|
4551
|
+
document,
|
|
4552
|
+
linkId: GOOGLE_FONTS_LINK_ID,
|
|
4553
|
+
slides: partitionTemplateElements(deckSlides).slides,
|
|
4554
|
+
embeddedFonts: deckEmbeddedFonts,
|
|
4555
|
+
googleFontsBase: resolveGoogleFontsCss2Base(googleFontsRef.current),
|
|
4556
|
+
onProgress: (progress) => {
|
|
4557
|
+
if (!cancelled && token === renderTokenRef.current) {
|
|
4558
|
+
setFontProgress?.(progress);
|
|
4559
|
+
}
|
|
4560
|
+
}
|
|
4561
|
+
});
|
|
4562
|
+
};
|
|
4445
4563
|
const parsed = await handler.load(buffer, {
|
|
4446
4564
|
allowExternalImages,
|
|
4447
|
-
limits: limitsRef.current
|
|
4565
|
+
limits: limitsRef.current,
|
|
4566
|
+
onSlidesParsed: (deck) => startWebfonts([...deck.slides], [...deck.embeddedFonts])
|
|
4448
4567
|
});
|
|
4449
4568
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4450
4569
|
return;
|
|
4451
4570
|
}
|
|
4571
|
+
if (!webfonts) {
|
|
4572
|
+
startWebfonts(parsed.slides, parsed.embeddedFonts ?? []);
|
|
4573
|
+
}
|
|
4452
4574
|
const mediaElements = [];
|
|
4453
4575
|
for (const slide of parsed.slides) {
|
|
4454
4576
|
collectMediaElements(slide.elements, mediaElements);
|
|
@@ -4499,6 +4621,8 @@ function useLoadContent({
|
|
|
4499
4621
|
nextSlides,
|
|
4500
4622
|
(path) => handler.getImageData(path)
|
|
4501
4623
|
);
|
|
4624
|
+
const partition = partitionTemplateElements(nextSlides);
|
|
4625
|
+
await webfonts;
|
|
4502
4626
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4503
4627
|
return;
|
|
4504
4628
|
}
|
|
@@ -4514,7 +4638,6 @@ function useLoadContent({
|
|
|
4514
4638
|
}
|
|
4515
4639
|
resources.commit();
|
|
4516
4640
|
handlerRef.current = handler;
|
|
4517
|
-
const partition = partitionTemplateElements(nextSlides);
|
|
4518
4641
|
setSlides(partition.slides);
|
|
4519
4642
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4520
4643
|
setCanvasSize({
|
|
@@ -4595,6 +4718,7 @@ function useLoadContent({
|
|
|
4595
4718
|
} finally {
|
|
4596
4719
|
resources.releaseIfUncommitted();
|
|
4597
4720
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4721
|
+
setFontProgress?.(null);
|
|
4598
4722
|
setLoading(false);
|
|
4599
4723
|
}
|
|
4600
4724
|
}
|
|
@@ -10105,125 +10229,6 @@ function useIOHandlers(input) {
|
|
|
10105
10229
|
});
|
|
10106
10230
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
10107
10231
|
}
|
|
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
10232
|
function useContentLifecycle(input) {
|
|
10228
10233
|
const {
|
|
10229
10234
|
content,
|
|
@@ -10290,6 +10295,8 @@ function useContentLifecycle(input) {
|
|
|
10290
10295
|
setModifyVerifier,
|
|
10291
10296
|
setCompatToasts,
|
|
10292
10297
|
setLoading: state.setLoading,
|
|
10298
|
+
setFontProgress: state.setFontProgress,
|
|
10299
|
+
googleFonts,
|
|
10293
10300
|
setError: state.setError,
|
|
10294
10301
|
setIsDirty: state.setIsDirty,
|
|
10295
10302
|
setIsEncrypted: setIsEncryptedDialogOpen,
|
|
@@ -12880,17 +12887,20 @@ function useViewPreferencesSync(input) {
|
|
|
12880
12887
|
function useViewerBuildingBlocksState(input) {
|
|
12881
12888
|
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
12882
12889
|
const { initialSlide, googleFonts, listConversionScope, allowExternalContent, limits } = input;
|
|
12883
|
-
const
|
|
12890
|
+
const hostLockedRef = useRef(false);
|
|
12884
12891
|
const { optionsStore } = core;
|
|
12892
|
+
const fontDownloadLock = hostFontDownloadLock(googleFonts);
|
|
12885
12893
|
useLayoutEffect(() => {
|
|
12886
|
-
|
|
12894
|
+
const anyLock = allowExternalContent !== void 0 || fontDownloadLock !== void 0;
|
|
12895
|
+
if (!anyLock && !hostLockedRef.current) {
|
|
12887
12896
|
return;
|
|
12888
12897
|
}
|
|
12889
|
-
|
|
12898
|
+
hostLockedRef.current = anyLock;
|
|
12899
|
+
const locked = lockExternalContentSetting({}, allowExternalContent);
|
|
12890
12900
|
optionsStore.setConstraints({
|
|
12891
|
-
locked:
|
|
12901
|
+
locked: fontDownloadLock === void 0 ? locked : { ...locked, [FONT_DOWNLOAD_SETTING_ID]: fontDownloadLock }
|
|
12892
12902
|
});
|
|
12893
|
-
}, [optionsStore, allowExternalContent]);
|
|
12903
|
+
}, [optionsStore, allowExternalContent, fontDownloadLock]);
|
|
12894
12904
|
const {
|
|
12895
12905
|
onContentChange,
|
|
12896
12906
|
onDirtyChange,
|
|
@@ -12992,7 +13002,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
12992
13002
|
filePath,
|
|
12993
13003
|
autosaveEnabled,
|
|
12994
13004
|
initialSlide,
|
|
12995
|
-
googleFonts,
|
|
13005
|
+
// Host `googleFonts` first, else Trust Center > "Download fonts", as in `PowerPointViewer`.
|
|
13006
|
+
googleFonts: resolveEffectiveGoogleFonts(googleFonts, viewerOptions),
|
|
12996
13007
|
limits,
|
|
12997
13008
|
// Trust Center > "Allow external content": same gate `PowerPointViewer`
|
|
12998
13009
|
// applies, so the headless building-blocks API loads http(s) images
|
|
@@ -14456,6 +14467,12 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14456
14467
|
endY: viewHeight
|
|
14457
14468
|
};
|
|
14458
14469
|
const hitTargetWidth = Math.max(strokeWidth * 3, 14);
|
|
14470
|
+
const paintPathData = connectorSquareCapPath(
|
|
14471
|
+
pathGeometry.pathData,
|
|
14472
|
+
ss,
|
|
14473
|
+
strokeWidth,
|
|
14474
|
+
compoundOffsets.length > 1 || !!startArrow && startArrow !== "none" || !!endArrow && endArrow !== "none"
|
|
14475
|
+
) ?? pathGeometry.pathData;
|
|
14459
14476
|
const snapTransform = connectorSnapTransform(
|
|
14460
14477
|
el,
|
|
14461
14478
|
!connectorNeedsPath(shapeEl?.shapeType),
|
|
@@ -14580,7 +14597,7 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14580
14597
|
"path",
|
|
14581
14598
|
{
|
|
14582
14599
|
"data-pptx-line": "",
|
|
14583
|
-
d:
|
|
14600
|
+
d: paintPathData,
|
|
14584
14601
|
fill: "none",
|
|
14585
14602
|
stroke: strokePaint,
|
|
14586
14603
|
strokeWidth: Math.max(compoundWidths[idx] ?? strokeWidth, 1),
|
|
@@ -17326,7 +17343,7 @@ function getAlignmentProps(align) {
|
|
|
17326
17343
|
return { startOffset: "0%", textAnchor: "start" };
|
|
17327
17344
|
}
|
|
17328
17345
|
}
|
|
17329
|
-
function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
17346
|
+
function getSegmentTspanProps(segment, element, fallbackColor, fitScale = 1) {
|
|
17330
17347
|
const paint = resolveWarpRunPaint(
|
|
17331
17348
|
segment,
|
|
17332
17349
|
element.textStyle,
|
|
@@ -17335,7 +17352,7 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17335
17352
|
);
|
|
17336
17353
|
return {
|
|
17337
17354
|
fill: paint.fill,
|
|
17338
|
-
fontSize: paint.fontSizePx,
|
|
17355
|
+
fontSize: paint.fontSizePx * fitScale,
|
|
17339
17356
|
fontWeight: paint.fontWeight ?? "normal",
|
|
17340
17357
|
fontStyle: paint.fontStyle ?? "normal",
|
|
17341
17358
|
fontFamily: paint.fontFamily,
|
|
@@ -17430,7 +17447,6 @@ function WarpedText({
|
|
|
17430
17447
|
if (paragraphs.length === 0) {
|
|
17431
17448
|
return null;
|
|
17432
17449
|
}
|
|
17433
|
-
const lineCount = paragraphs.length;
|
|
17434
17450
|
const pathIdPrefix = `warp-${element.id}`;
|
|
17435
17451
|
const warpAdj = textEl.textStyle?.textWarpAdj;
|
|
17436
17452
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
@@ -17483,6 +17499,15 @@ function WarpedText({
|
|
|
17483
17499
|
}
|
|
17484
17500
|
);
|
|
17485
17501
|
}
|
|
17502
|
+
const layouts = warpParagraphLayouts(
|
|
17503
|
+
preset,
|
|
17504
|
+
width,
|
|
17505
|
+
height,
|
|
17506
|
+
paragraphs,
|
|
17507
|
+
warpAdj,
|
|
17508
|
+
warpAdj2,
|
|
17509
|
+
textEl.textStyle
|
|
17510
|
+
);
|
|
17486
17511
|
return /* @__PURE__ */ jsxs(
|
|
17487
17512
|
"svg",
|
|
17488
17513
|
{
|
|
@@ -17502,7 +17527,7 @@ function WarpedText({
|
|
|
17502
17527
|
"path",
|
|
17503
17528
|
{
|
|
17504
17529
|
id: `${pathIdPrefix}-${i}`,
|
|
17505
|
-
d:
|
|
17530
|
+
d: layouts[i]?.d,
|
|
17506
17531
|
fill: "none"
|
|
17507
17532
|
},
|
|
17508
17533
|
`${pathIdPrefix}-def-${i}`
|
|
@@ -17524,7 +17549,12 @@ function WarpedText({
|
|
|
17524
17549
|
children: para.segments.map((seg, segIdx) => /* @__PURE__ */ jsx(
|
|
17525
17550
|
"tspan",
|
|
17526
17551
|
{
|
|
17527
|
-
...getSegmentTspanProps(
|
|
17552
|
+
...getSegmentTspanProps(
|
|
17553
|
+
seg,
|
|
17554
|
+
textEl,
|
|
17555
|
+
fallbackColor,
|
|
17556
|
+
layouts[paraIdx]?.fitScale ?? 1
|
|
17557
|
+
),
|
|
17528
17558
|
children: seg.text
|
|
17529
17559
|
},
|
|
17530
17560
|
`${pathIdPrefix}-ts-${paraIdx}-${segIdx}`
|
|
Binary file
|
|
Binary file
|
|
@@ -10,7 +10,7 @@ var aiAssistants = createAiAssistantRegistry({
|
|
|
10
10
|
var AiChatPanel = /* @__PURE__ */ lazy(async () => {
|
|
11
11
|
const [{ useChat }, { default: Panel }] = await Promise.all([
|
|
12
12
|
import('@ai-sdk/react'),
|
|
13
|
-
import('./AiChatPanel-
|
|
13
|
+
import('./AiChatPanel-E7CJSTW7.mjs')
|
|
14
14
|
]);
|
|
15
15
|
function BoundAiChatPanel(props) {
|
|
16
16
|
return /* @__PURE__ */ jsx(Panel, { ...props, useChat });
|
|
Binary file
|
|
Binary file
|
|
@@ -12,7 +12,7 @@ var aiAssistants = host.createAiAssistantRegistry({
|
|
|
12
12
|
var AiChatPanel = /* @__PURE__ */ react.lazy(async () => {
|
|
13
13
|
const [{ useChat }, { default: Panel }] = await Promise.all([
|
|
14
14
|
import('@ai-sdk/react'),
|
|
15
|
-
import('./AiChatPanel-
|
|
15
|
+
import('./AiChatPanel-PLQ3NBTK.js')
|
|
16
16
|
]);
|
|
17
17
|
function BoundAiChatPanel(props) {
|
|
18
18
|
return /* @__PURE__ */ jsxRuntime.jsx(Panel, { ...props, useChat });
|
|
Binary file
|
|
Binary file
|