pptx-react-viewer 4.65.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.
- package/CHANGELOG.md +85 -0
- package/README.md +10 -0
- package/dist/{AiChatPanel-7U7IJRNY.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-7AFFNYEN.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-G5JGUSBL.mjs → chunk-3LJ5QUU3.mjs} +271 -261
- package/dist/chunk-3LJ5QUU3.mjs.br +0 -0
- package/dist/chunk-3LJ5QUU3.mjs.gz +0 -0
- package/dist/{chunk-VGU5S37T.js → chunk-F5UOILTY.js} +466 -456
- package/dist/chunk-F5UOILTY.js.br +0 -0
- package/dist/chunk-F5UOILTY.js.gz +0 -0
- package/dist/{chunk-5ZW3GP6C.mjs → chunk-FBSPQYRE.mjs} +72 -738
- package/dist/chunk-FBSPQYRE.mjs.br +0 -0
- package/dist/chunk-FBSPQYRE.mjs.gz +0 -0
- package/dist/{chunk-WAIX4VJ2.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-VMX3IDQB.mjs → chunk-LRDW6EH7.mjs} +22 -11
- package/dist/chunk-LRDW6EH7.mjs.br +0 -0
- package/dist/chunk-LRDW6EH7.mjs.gz +0 -0
- package/dist/{chunk-PNDORR6S.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-5DBKW7F3.js → chunk-P2COO2QO.js} +71 -736
- package/dist/chunk-P2COO2QO.js.br +0 -0
- package/dist/chunk-P2COO2QO.js.gz +0 -0
- package/dist/{chunk-LUKGXRHZ.js → chunk-ZLPMXC55.js} +578 -567
- package/dist/chunk-ZLPMXC55.js.br +0 -0
- package/dist/chunk-ZLPMXC55.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-7AFFNYEN.js.br +0 -0
- package/dist/AiChatPanel-7AFFNYEN.js.gz +0 -0
- package/dist/AiChatPanel-7U7IJRNY.mjs.br +0 -0
- package/dist/AiChatPanel-7U7IJRNY.mjs.gz +0 -0
- package/dist/chunk-5DBKW7F3.js.br +0 -0
- package/dist/chunk-5DBKW7F3.js.gz +0 -0
- package/dist/chunk-5ZW3GP6C.mjs.br +0 -0
- package/dist/chunk-5ZW3GP6C.mjs.gz +0 -0
- package/dist/chunk-G5JGUSBL.mjs.br +0 -0
- package/dist/chunk-G5JGUSBL.mjs.gz +0 -0
- package/dist/chunk-LUKGXRHZ.js.br +0 -0
- package/dist/chunk-LUKGXRHZ.js.gz +0 -0
- package/dist/chunk-PNDORR6S.js.br +0 -0
- package/dist/chunk-PNDORR6S.js.gz +0 -0
- package/dist/chunk-VGU5S37T.js.br +0 -0
- package/dist/chunk-VGU5S37T.js.gz +0 -0
- package/dist/chunk-VMX3IDQB.mjs.br +0 -0
- package/dist/chunk-VMX3IDQB.mjs.gz +0 -0
- package/dist/chunk-WAIX4VJ2.mjs.br +0 -0
- package/dist/chunk-WAIX4VJ2.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, 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
|
|
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, selectTrustedEmbeddedFonts, resolveFontWeight, resolveFontItalic, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, 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, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, resolvePalette as resolvePalette$1, 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, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, 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, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, 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, 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,173 +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
|
-
var FONT_FORMAT_ALLOWED = /* @__PURE__ */ new Set([
|
|
10120
|
-
"truetype",
|
|
10121
|
-
"opentype",
|
|
10122
|
-
"woff",
|
|
10123
|
-
"woff2",
|
|
10124
|
-
"svg",
|
|
10125
|
-
"embedded-opentype"
|
|
10126
|
-
]);
|
|
10127
|
-
var FONT_DATA_URL_PATTERN = /^data:font\/[a-z0-9+.-]+(?:;charset=[a-z0-9-]+)?;base64,[A-Za-z0-9+/=]+$/iu;
|
|
10128
|
-
function isFontDataUrlSafe(url) {
|
|
10129
|
-
if (typeof url !== "string" || url.length === 0) {
|
|
10130
|
-
return false;
|
|
10131
|
-
}
|
|
10132
|
-
if (url.startsWith("blob:")) {
|
|
10133
|
-
return true;
|
|
10134
|
-
}
|
|
10135
|
-
return FONT_DATA_URL_PATTERN.test(url);
|
|
10136
|
-
}
|
|
10137
|
-
function useFontInjection({
|
|
10138
|
-
embeddedFonts,
|
|
10139
|
-
slides,
|
|
10140
|
-
googleFonts
|
|
10141
|
-
}) {
|
|
10142
|
-
const googleFontsBase = resolveGoogleFontsCss2Base(googleFonts);
|
|
10143
|
-
useEffect(() => {
|
|
10144
|
-
if (!embeddedFonts.length) {
|
|
10145
|
-
return;
|
|
10146
|
-
}
|
|
10147
|
-
const styleEl = document.createElement("style");
|
|
10148
|
-
styleEl.id = EMBEDDED_FONTS_STYLE_ID;
|
|
10149
|
-
const cssRules = selectTrustedEmbeddedFonts(embeddedFonts).flatMap((font) => {
|
|
10150
|
-
if (typeof font.name !== "string" || font.name.length === 0 || FONT_NAME_UNSAFE_CHARS.test(font.name)) {
|
|
10151
|
-
return [];
|
|
10152
|
-
}
|
|
10153
|
-
if (!isFontDataUrlSafe(font.dataUrl)) {
|
|
10154
|
-
return [];
|
|
10155
|
-
}
|
|
10156
|
-
const fontFormat = font.format ?? "truetype";
|
|
10157
|
-
if (!FONT_FORMAT_ALLOWED.has(fontFormat)) {
|
|
10158
|
-
return [];
|
|
10159
|
-
}
|
|
10160
|
-
const fontWeight = String(resolveFontWeight(font.name, font.bold));
|
|
10161
|
-
const fontStyleCss = resolveFontItalic(font.name, font.italic) ? "italic" : "normal";
|
|
10162
|
-
return [
|
|
10163
|
-
`@font-face {
|
|
10164
|
-
font-family: "${font.name}";
|
|
10165
|
-
src: url("${font.dataUrl}") format("${fontFormat}");
|
|
10166
|
-
font-weight: ${fontWeight};
|
|
10167
|
-
font-style: ${fontStyleCss};
|
|
10168
|
-
font-display: swap;
|
|
10169
|
-
}`
|
|
10170
|
-
];
|
|
10171
|
-
}).join("\n");
|
|
10172
|
-
styleEl.textContent = cssRules;
|
|
10173
|
-
document.head.appendChild(styleEl);
|
|
10174
|
-
return () => {
|
|
10175
|
-
const existing = document.getElementById(EMBEDDED_FONTS_STYLE_ID);
|
|
10176
|
-
if (existing) {
|
|
10177
|
-
document.head.removeChild(existing);
|
|
10178
|
-
}
|
|
10179
|
-
};
|
|
10180
|
-
}, [embeddedFonts]);
|
|
10181
|
-
const referencedFamilies = useMemo(() => collectReferencedFontFamilies(slides), [slides]);
|
|
10182
|
-
useEffect(() => {
|
|
10183
|
-
let cancelled = false;
|
|
10184
|
-
void resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
|
|
10185
|
-
(href) => {
|
|
10186
|
-
if (cancelled) {
|
|
10187
|
-
return null;
|
|
10188
|
-
}
|
|
10189
|
-
syncGoogleWebfontStylesheet(document, GOOGLE_FONTS_LINK_ID, href);
|
|
10190
|
-
return href;
|
|
10191
|
-
}
|
|
10192
|
-
);
|
|
10193
|
-
return () => {
|
|
10194
|
-
cancelled = true;
|
|
10195
|
-
};
|
|
10196
|
-
}, [embeddedFonts, slides, googleFontsBase]);
|
|
10197
|
-
useEffect(() => () => document.getElementById(GOOGLE_FONTS_LINK_ID)?.remove(), []);
|
|
10198
|
-
const [, setOutlineFontsTick] = useState(0);
|
|
10199
|
-
useEffect(() => {
|
|
10200
|
-
let cancelled = false;
|
|
10201
|
-
const referenced = collectReferencedFontFamilies(slides);
|
|
10202
|
-
const candidates = selectGoogleWebfontFamilies(
|
|
10203
|
-
referenced,
|
|
10204
|
-
selectTrustedEmbeddedFonts(embeddedFonts).map((font) => font.name)
|
|
10205
|
-
);
|
|
10206
|
-
if (candidates.length === 0) {
|
|
10207
|
-
return;
|
|
10208
|
-
}
|
|
10209
|
-
void resolveGoogleWebfontHref(slides, embeddedFonts, void 0, googleFontsBase).then(
|
|
10210
|
-
async (href) => {
|
|
10211
|
-
if (cancelled || !href) {
|
|
10212
|
-
return;
|
|
10213
|
-
}
|
|
10214
|
-
const boldItalicVariants = [
|
|
10215
|
-
{ bold: false, italic: false },
|
|
10216
|
-
{ bold: true, italic: false }
|
|
10217
|
-
];
|
|
10218
|
-
let registeredAny = false;
|
|
10219
|
-
for (const family of candidates) {
|
|
10220
|
-
for (const variant of boldItalicVariants) {
|
|
10221
|
-
if (cancelled) {
|
|
10222
|
-
return;
|
|
10223
|
-
}
|
|
10224
|
-
const bytes = await fetchGoogleWebfontOutlineBytes(
|
|
10225
|
-
href,
|
|
10226
|
-
family,
|
|
10227
|
-
variant.bold,
|
|
10228
|
-
variant.italic,
|
|
10229
|
-
fetch
|
|
10230
|
-
);
|
|
10231
|
-
if (bytes && glyphOutlineFontCache.registerFontBytes(family, variant.bold, variant.italic, bytes)) {
|
|
10232
|
-
registeredAny = true;
|
|
10233
|
-
}
|
|
10234
|
-
}
|
|
10235
|
-
}
|
|
10236
|
-
if (registeredAny && !cancelled) {
|
|
10237
|
-
setOutlineFontsTick((tick) => tick + 1);
|
|
10238
|
-
}
|
|
10239
|
-
return void 0;
|
|
10240
|
-
}
|
|
10241
|
-
);
|
|
10242
|
-
return () => {
|
|
10243
|
-
cancelled = true;
|
|
10244
|
-
};
|
|
10245
|
-
}, [embeddedFonts, slides, googleFontsBase]);
|
|
10246
|
-
useEffect(() => {
|
|
10247
|
-
const neededSymbolFonts = SYMBOL_FONT_FAMILIES.filter((f) => referencedFamilies.has(f));
|
|
10248
|
-
if (neededSymbolFonts.length === 0) {
|
|
10249
|
-
return;
|
|
10250
|
-
}
|
|
10251
|
-
const styleEl = document.createElement("style");
|
|
10252
|
-
styleEl.id = SYMBOL_FONTS_STYLE_ID;
|
|
10253
|
-
const rules = neededSymbolFonts.flatMap((font) => {
|
|
10254
|
-
if (typeof font !== "string" || FONT_NAME_UNSAFE_CHARS.test(font)) {
|
|
10255
|
-
return [];
|
|
10256
|
-
}
|
|
10257
|
-
return [
|
|
10258
|
-
`@font-face {
|
|
10259
|
-
font-family: "${font}";
|
|
10260
|
-
src: local("${font}"), local("${font} Regular");
|
|
10261
|
-
font-display: swap;
|
|
10262
|
-
}`
|
|
10263
|
-
];
|
|
10264
|
-
}).join("\n");
|
|
10265
|
-
styleEl.textContent = rules;
|
|
10266
|
-
document.head.appendChild(styleEl);
|
|
10267
|
-
return () => {
|
|
10268
|
-
const existing = document.getElementById(SYMBOL_FONTS_STYLE_ID);
|
|
10269
|
-
if (existing) {
|
|
10270
|
-
document.head.removeChild(existing);
|
|
10271
|
-
}
|
|
10272
|
-
};
|
|
10273
|
-
}, [referencedFamilies]);
|
|
10274
|
-
}
|
|
10275
10223
|
function useContentLifecycle(input) {
|
|
10276
10224
|
const {
|
|
10277
10225
|
content,
|
|
@@ -10338,6 +10286,8 @@ function useContentLifecycle(input) {
|
|
|
10338
10286
|
setModifyVerifier,
|
|
10339
10287
|
setCompatToasts,
|
|
10340
10288
|
setLoading: state.setLoading,
|
|
10289
|
+
setFontProgress: state.setFontProgress,
|
|
10290
|
+
googleFonts,
|
|
10341
10291
|
setError: state.setError,
|
|
10342
10292
|
setIsDirty: state.setIsDirty,
|
|
10343
10293
|
setIsEncrypted: setIsEncryptedDialogOpen,
|
|
@@ -12928,17 +12878,20 @@ function useViewPreferencesSync(input) {
|
|
|
12928
12878
|
function useViewerBuildingBlocksState(input) {
|
|
12929
12879
|
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
12930
12880
|
const { initialSlide, googleFonts, listConversionScope, allowExternalContent, limits } = input;
|
|
12931
|
-
const
|
|
12881
|
+
const hostLockedRef = useRef(false);
|
|
12932
12882
|
const { optionsStore } = core;
|
|
12883
|
+
const fontDownloadLock = hostFontDownloadLock(googleFonts);
|
|
12933
12884
|
useLayoutEffect(() => {
|
|
12934
|
-
|
|
12885
|
+
const anyLock = allowExternalContent !== void 0 || fontDownloadLock !== void 0;
|
|
12886
|
+
if (!anyLock && !hostLockedRef.current) {
|
|
12935
12887
|
return;
|
|
12936
12888
|
}
|
|
12937
|
-
|
|
12889
|
+
hostLockedRef.current = anyLock;
|
|
12890
|
+
const locked = lockExternalContentSetting({}, allowExternalContent);
|
|
12938
12891
|
optionsStore.setConstraints({
|
|
12939
|
-
locked:
|
|
12892
|
+
locked: fontDownloadLock === void 0 ? locked : { ...locked, [FONT_DOWNLOAD_SETTING_ID]: fontDownloadLock }
|
|
12940
12893
|
});
|
|
12941
|
-
}, [optionsStore, allowExternalContent]);
|
|
12894
|
+
}, [optionsStore, allowExternalContent, fontDownloadLock]);
|
|
12942
12895
|
const {
|
|
12943
12896
|
onContentChange,
|
|
12944
12897
|
onDirtyChange,
|
|
@@ -13040,7 +12993,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
13040
12993
|
filePath,
|
|
13041
12994
|
autosaveEnabled,
|
|
13042
12995
|
initialSlide,
|
|
13043
|
-
googleFonts,
|
|
12996
|
+
// Host `googleFonts` first, else Trust Center > "Download fonts", as in `PowerPointViewer`.
|
|
12997
|
+
googleFonts: resolveEffectiveGoogleFonts(googleFonts, viewerOptions),
|
|
13044
12998
|
limits,
|
|
13045
12999
|
// Trust Center > "Allow external content": same gate `PowerPointViewer`
|
|
13046
13000
|
// applies, so the headless building-blocks API loads http(s) images
|
|
@@ -14480,7 +14434,8 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14480
14434
|
const dashArray = getSvgStrokeDasharray(
|
|
14481
14435
|
dashType,
|
|
14482
14436
|
Math.max(strokeWidth, 1),
|
|
14483
|
-
ss?.customDashSegments
|
|
14437
|
+
ss?.customDashSegments,
|
|
14438
|
+
ss?.lineCap
|
|
14484
14439
|
);
|
|
14485
14440
|
const startArrow = ss?.connectorStartArrow;
|
|
14486
14441
|
const endArrow = ss?.connectorEndArrow;
|
|
@@ -14490,7 +14445,7 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14490
14445
|
const endMarkerId = `${markerSeed}-sel-end`;
|
|
14491
14446
|
const compoundOffsets = getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14492
14447
|
const compoundWidths = getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14493
|
-
const strokeCap = svgLineCap(ss?.lineCap);
|
|
14448
|
+
const strokeCap = svgLineCap(ss?.lineCap, dashArray !== void 0);
|
|
14494
14449
|
const textEl = hasTextProperties(el) ? el : void 0;
|
|
14495
14450
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14496
14451
|
const connectorTextSegments = textEl?.textSegments;
|
|
@@ -14503,6 +14458,12 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14503
14458
|
endY: viewHeight
|
|
14504
14459
|
};
|
|
14505
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;
|
|
14506
14467
|
const snapTransform = connectorSnapTransform(
|
|
14507
14468
|
el,
|
|
14508
14469
|
!connectorNeedsPath(shapeEl?.shapeType),
|
|
@@ -14627,7 +14588,7 @@ var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
|
14627
14588
|
"path",
|
|
14628
14589
|
{
|
|
14629
14590
|
"data-pptx-line": "",
|
|
14630
|
-
d:
|
|
14591
|
+
d: paintPathData,
|
|
14631
14592
|
fill: "none",
|
|
14632
14593
|
stroke: strokePaint,
|
|
14633
14594
|
strokeWidth: Math.max(compoundWidths[idx] ?? strokeWidth, 1),
|
|
@@ -14926,7 +14887,17 @@ function renderOutlinePaint(paint) {
|
|
|
14926
14887
|
);
|
|
14927
14888
|
}
|
|
14928
14889
|
if (paint.kind === "rectPath") {
|
|
14929
|
-
return /* @__PURE__ */ jsx(
|
|
14890
|
+
return /* @__PURE__ */ jsx(
|
|
14891
|
+
"pattern",
|
|
14892
|
+
{
|
|
14893
|
+
id: paint.id,
|
|
14894
|
+
patternUnits: "objectBoundingBox",
|
|
14895
|
+
patternContentUnits: "objectBoundingBox",
|
|
14896
|
+
width: 1,
|
|
14897
|
+
height: 1,
|
|
14898
|
+
children: /* @__PURE__ */ jsx("image", { href: paint.href, x: 0, y: 0, width: 1, height: 1, preserveAspectRatio: "none" })
|
|
14899
|
+
}
|
|
14900
|
+
);
|
|
14930
14901
|
}
|
|
14931
14902
|
const stops = paint.stops.map((stop, idx) => /* @__PURE__ */ jsx(
|
|
14932
14903
|
"stop",
|
|
@@ -14951,12 +14922,14 @@ function ShapeEffectOverlay({
|
|
|
14951
14922
|
const fx = getComputedEffectStyle(element);
|
|
14952
14923
|
const overlay = fx.fillOverlay;
|
|
14953
14924
|
const reflection = suppressReflection ? void 0 : fx.reflection;
|
|
14954
|
-
const softEdge =
|
|
14925
|
+
const softEdge = getShapeEffectFilterDefs(element);
|
|
14955
14926
|
const bevelLightingFilter = getBevelLightingSvgFilter(element);
|
|
14956
14927
|
const strokeOutline = buildStrokeOutline(element);
|
|
14957
14928
|
const hollowHit = buildHollowHitOutline(element);
|
|
14958
|
-
const
|
|
14959
|
-
|
|
14929
|
+
const fillLayer = getSilhouetteFillLayer(element);
|
|
14930
|
+
const overlayFill = buildSubpathFillOverlay(element);
|
|
14931
|
+
const subpathFill = overlayFill?.silhouette && (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element)) ? void 0 : overlayFill;
|
|
14932
|
+
if (!overlay && !softEdge && !bevelLightingFilter && !strokeOutline && !hollowHit && !subpathFill && !fillLayer && !reflection) {
|
|
14960
14933
|
return null;
|
|
14961
14934
|
}
|
|
14962
14935
|
const fillOverlayStyle = overlay ? {
|
|
@@ -14968,10 +14941,19 @@ function ShapeEffectOverlay({
|
|
|
14968
14941
|
pointerEvents: "none"
|
|
14969
14942
|
} : void 0;
|
|
14970
14943
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14944
|
+
fillLayer ? /* @__PURE__ */ jsx(
|
|
14945
|
+
"div",
|
|
14946
|
+
{
|
|
14947
|
+
className: "pptx-react-silhouette-fill",
|
|
14948
|
+
"aria-hidden": "true",
|
|
14949
|
+
style: fillLayer.style
|
|
14950
|
+
}
|
|
14951
|
+
) : null,
|
|
14971
14952
|
subpathFill ? /* @__PURE__ */ jsx(
|
|
14972
14953
|
"svg",
|
|
14973
14954
|
{
|
|
14974
14955
|
className: "pptx-react-subpath-fill",
|
|
14956
|
+
"data-pptx-silhouette-fill": subpathFill.silhouette ? "" : void 0,
|
|
14975
14957
|
"aria-hidden": "true",
|
|
14976
14958
|
viewBox: `0 0 ${subpathFill.viewBoxWidth} ${subpathFill.viewBoxHeight}`,
|
|
14977
14959
|
preserveAspectRatio: "none",
|
|
@@ -15067,6 +15049,7 @@ function ShapeEffectOverlay({
|
|
|
15067
15049
|
]
|
|
15068
15050
|
}
|
|
15069
15051
|
) : null,
|
|
15052
|
+
hollowHit?.textCss ? /* @__PURE__ */ jsx("style", { children: hollowHit.textCss }) : null,
|
|
15070
15053
|
hollowHit ? /* @__PURE__ */ jsx(
|
|
15071
15054
|
"svg",
|
|
15072
15055
|
{
|
|
@@ -15087,10 +15070,10 @@ function ShapeEffectOverlay({
|
|
|
15087
15070
|
"path",
|
|
15088
15071
|
{
|
|
15089
15072
|
d: hollowHit.d,
|
|
15090
|
-
fill:
|
|
15091
|
-
stroke:
|
|
15073
|
+
fill: hollowHit.fill,
|
|
15074
|
+
stroke: hollowHit.stroke,
|
|
15092
15075
|
strokeWidth: hollowHit.strokeWidth,
|
|
15093
|
-
style: { pointerEvents:
|
|
15076
|
+
style: { pointerEvents: hollowHit.pointerEvents }
|
|
15094
15077
|
}
|
|
15095
15078
|
)
|
|
15096
15079
|
}
|
|
@@ -15307,7 +15290,7 @@ var ElementRenderer = /* @__PURE__ */ React17.memo(
|
|
|
15307
15290
|
// outline only, so its interior must not swallow clicks meant for what it
|
|
15308
15291
|
// is drawn over. ShapeEffectOverlay paints a transparent
|
|
15309
15292
|
// pointer-events:stroke band that opts the outline back in.
|
|
15310
|
-
|
|
15293
|
+
passesClicksThroughBox(el) ? "pointer-events-none" : "",
|
|
15311
15294
|
isFullscreenMedia ? "pointer-events-auto" : "",
|
|
15312
15295
|
selB,
|
|
15313
15296
|
// Shared class the tooltip's `:hover` rule keys off (see
|
|
@@ -15316,6 +15299,13 @@ var ElementRenderer = /* @__PURE__ */ React17.memo(
|
|
|
15316
15299
|
actionAffordance.showLinkTooltip && LINK_TOOLTIP_HOST_CLASS
|
|
15317
15300
|
),
|
|
15318
15301
|
style: {
|
|
15302
|
+
// The table style's drop shadow (Themed Style 1/2) sits on the clipping frame.
|
|
15303
|
+
...el.type === "table" ? tableFrameCss(el.tableData, {
|
|
15304
|
+
tableStyleMap: tableStyleContext?.tableStyleMap,
|
|
15305
|
+
colorScheme: tableStyleContext?.theme?.colorScheme,
|
|
15306
|
+
fontScheme: tableStyleContext?.theme?.fontScheme,
|
|
15307
|
+
formatScheme: tableStyleContext?.theme?.formatScheme
|
|
15308
|
+
}) : {},
|
|
15319
15309
|
...containerStyle,
|
|
15320
15310
|
...isSelected ? selectionOutlineStyle(selClr) : {}
|
|
15321
15311
|
},
|
|
@@ -17344,23 +17334,20 @@ function getAlignmentProps(align) {
|
|
|
17344
17334
|
return { startOffset: "0%", textAnchor: "start" };
|
|
17345
17335
|
}
|
|
17346
17336
|
}
|
|
17347
|
-
function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
17348
|
-
const
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
decos.push("line-through");
|
|
17355
|
-
}
|
|
17356
|
-
const fill = s.hyperlink ? normalizeHexColor(s.color || element.textStyle?.color, HYPERLINK_COLOR) : normalizeHexColor(s.color || element.textStyle?.color, fallbackColor);
|
|
17337
|
+
function getSegmentTspanProps(segment, element, fallbackColor, fitScale = 1) {
|
|
17338
|
+
const paint = resolveWarpRunPaint(
|
|
17339
|
+
segment,
|
|
17340
|
+
element.textStyle,
|
|
17341
|
+
fallbackColor,
|
|
17342
|
+
DEFAULT_TEXT_FONT_SIZE
|
|
17343
|
+
);
|
|
17357
17344
|
return {
|
|
17358
|
-
fill,
|
|
17359
|
-
fontSize:
|
|
17360
|
-
fontWeight:
|
|
17361
|
-
fontStyle:
|
|
17362
|
-
fontFamily:
|
|
17363
|
-
textDecoration:
|
|
17345
|
+
fill: paint.fill,
|
|
17346
|
+
fontSize: paint.fontSizePx * fitScale,
|
|
17347
|
+
fontWeight: paint.fontWeight ?? "normal",
|
|
17348
|
+
fontStyle: paint.fontStyle ?? "normal",
|
|
17349
|
+
fontFamily: paint.fontFamily,
|
|
17350
|
+
textDecoration: paint.textDecoration
|
|
17364
17351
|
};
|
|
17365
17352
|
}
|
|
17366
17353
|
function resolveSegmentFont(segment, element) {
|
|
@@ -17451,7 +17438,6 @@ function WarpedText({
|
|
|
17451
17438
|
if (paragraphs.length === 0) {
|
|
17452
17439
|
return null;
|
|
17453
17440
|
}
|
|
17454
|
-
const lineCount = paragraphs.length;
|
|
17455
17441
|
const pathIdPrefix = `warp-${element.id}`;
|
|
17456
17442
|
const warpAdj = textEl.textStyle?.textWarpAdj;
|
|
17457
17443
|
const warpAdj2 = textEl.textStyle?.textWarpAdj2;
|
|
@@ -17504,6 +17490,15 @@ function WarpedText({
|
|
|
17504
17490
|
}
|
|
17505
17491
|
);
|
|
17506
17492
|
}
|
|
17493
|
+
const layouts = warpParagraphLayouts(
|
|
17494
|
+
preset,
|
|
17495
|
+
width,
|
|
17496
|
+
height,
|
|
17497
|
+
paragraphs,
|
|
17498
|
+
warpAdj,
|
|
17499
|
+
warpAdj2,
|
|
17500
|
+
textEl.textStyle
|
|
17501
|
+
);
|
|
17507
17502
|
return /* @__PURE__ */ jsxs(
|
|
17508
17503
|
"svg",
|
|
17509
17504
|
{
|
|
@@ -17523,7 +17518,7 @@ function WarpedText({
|
|
|
17523
17518
|
"path",
|
|
17524
17519
|
{
|
|
17525
17520
|
id: `${pathIdPrefix}-${i}`,
|
|
17526
|
-
d:
|
|
17521
|
+
d: layouts[i]?.d,
|
|
17527
17522
|
fill: "none"
|
|
17528
17523
|
},
|
|
17529
17524
|
`${pathIdPrefix}-def-${i}`
|
|
@@ -17545,7 +17540,12 @@ function WarpedText({
|
|
|
17545
17540
|
children: para.segments.map((seg, segIdx) => /* @__PURE__ */ jsx(
|
|
17546
17541
|
"tspan",
|
|
17547
17542
|
{
|
|
17548
|
-
...getSegmentTspanProps(
|
|
17543
|
+
...getSegmentTspanProps(
|
|
17544
|
+
seg,
|
|
17545
|
+
textEl,
|
|
17546
|
+
fallbackColor,
|
|
17547
|
+
layouts[paraIdx]?.fitScale ?? 1
|
|
17548
|
+
),
|
|
17549
17549
|
children: seg.text
|
|
17550
17550
|
},
|
|
17551
17551
|
`${pathIdPrefix}-ts-${paraIdx}-${segIdx}`
|
|
@@ -17559,60 +17559,66 @@ function WarpedText({
|
|
|
17559
17559
|
}
|
|
17560
17560
|
);
|
|
17561
17561
|
}
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17566
|
-
);
|
|
17567
|
-
glyphs["actionButtonForwardOrNext"] = glyphs["actionButtonForwardNext"];
|
|
17568
|
-
glyphs["actionButtonBackOrPrevious"] = glyphs["actionButtonBackPrevious"];
|
|
17569
|
-
return glyphs;
|
|
17570
|
-
}
|
|
17571
|
-
function isActionButtonShape(shapeType) {
|
|
17572
|
-
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
17573
|
-
}
|
|
17574
|
-
function getActionButtonGlyphPath(shapeType) {
|
|
17575
|
-
if (!shapeType) {
|
|
17576
|
-
return void 0;
|
|
17562
|
+
function renderEquationBox(el, interactive) {
|
|
17563
|
+
if (!hasTextProperties(el) || !isEquationOnlyText(el.textSegments)) {
|
|
17564
|
+
return null;
|
|
17577
17565
|
}
|
|
17578
|
-
const
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17566
|
+
const equations = (el.textSegments ?? []).flatMap((segment, index) => {
|
|
17567
|
+
const mathml = segment.equationXml ? convertOmmlToMathMl(segment.equationXml) : "";
|
|
17568
|
+
if (!mathml) {
|
|
17569
|
+
return [];
|
|
17570
|
+
}
|
|
17571
|
+
const math = /* @__PURE__ */ jsx(
|
|
17572
|
+
"span",
|
|
17573
|
+
{
|
|
17574
|
+
style: {
|
|
17575
|
+
display: "inline-block",
|
|
17576
|
+
verticalAlign: "middle",
|
|
17577
|
+
fontFamily: EQUATION_FONT_FAMILY
|
|
17578
|
+
},
|
|
17579
|
+
dangerouslySetInnerHTML: { __html: sanitizeMathMl(mathml) }
|
|
17580
|
+
}
|
|
17581
|
+
);
|
|
17582
|
+
if (!segment.equationNumber) {
|
|
17583
|
+
return [/* @__PURE__ */ jsx(React17.Fragment, { children: math }, `${el.id}-eq-${index}`)];
|
|
17584
|
+
}
|
|
17585
|
+
const label = `(${segment.equationNumber})`;
|
|
17586
|
+
return [
|
|
17587
|
+
/* @__PURE__ */ jsxs(
|
|
17588
|
+
"span",
|
|
17589
|
+
{
|
|
17590
|
+
style: {
|
|
17591
|
+
display: "flex",
|
|
17592
|
+
justifyContent: "space-between",
|
|
17593
|
+
alignItems: "center",
|
|
17594
|
+
width: "100%"
|
|
17595
|
+
},
|
|
17596
|
+
children: [
|
|
17597
|
+
/* @__PURE__ */ jsx("span", { style: { visibility: "hidden", whiteSpace: "nowrap" }, children: label }),
|
|
17598
|
+
/* @__PURE__ */ jsx("span", { style: { flex: 1, textAlign: "center" }, children: math }),
|
|
17599
|
+
/* @__PURE__ */ jsx("span", { style: { whiteSpace: "nowrap", fontFamily: EQUATION_FONT_FAMILY }, children: label })
|
|
17600
|
+
]
|
|
17601
|
+
},
|
|
17602
|
+
`${el.id}-eq-${index}`
|
|
17603
|
+
)
|
|
17604
|
+
];
|
|
17605
|
+
});
|
|
17606
|
+
if (equations.length === 0) {
|
|
17588
17607
|
return null;
|
|
17589
17608
|
}
|
|
17590
|
-
const
|
|
17609
|
+
const style = buildEquationBlockStyle(
|
|
17610
|
+
buildTextBlockStyle(el, {
|
|
17611
|
+
fallbackColor: DEFAULT_TEXT_COLOR,
|
|
17612
|
+
bodyLayout: true,
|
|
17613
|
+
pxLengths: true
|
|
17614
|
+
})
|
|
17615
|
+
);
|
|
17591
17616
|
return /* @__PURE__ */ jsx(
|
|
17592
|
-
"
|
|
17617
|
+
"div",
|
|
17593
17618
|
{
|
|
17594
|
-
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
17598
|
-
style: {
|
|
17599
|
-
position: "absolute",
|
|
17600
|
-
inset: 0,
|
|
17601
|
-
pointerEvents: "none",
|
|
17602
|
-
padding: "20%"
|
|
17603
|
-
},
|
|
17604
|
-
"aria-hidden": "true",
|
|
17605
|
-
children: /* @__PURE__ */ jsx(
|
|
17606
|
-
"path",
|
|
17607
|
-
{
|
|
17608
|
-
d: path,
|
|
17609
|
-
fill: "none",
|
|
17610
|
-
stroke,
|
|
17611
|
-
strokeWidth: 2,
|
|
17612
|
-
strokeLinecap: "round",
|
|
17613
|
-
strokeLinejoin: "round"
|
|
17614
|
-
}
|
|
17615
|
-
)
|
|
17619
|
+
className: cn("relative z-10 w-full h-full", interactive ? "" : "pointer-events-none"),
|
|
17620
|
+
style,
|
|
17621
|
+
children: equations
|
|
17616
17622
|
}
|
|
17617
17623
|
);
|
|
17618
17624
|
}
|
|
@@ -17660,13 +17666,13 @@ function renderTextElementBody(options) {
|
|
|
17660
17666
|
...scene3dStyle?.transformStyle ? { transformStyle: scene3dStyle.transformStyle } : {},
|
|
17661
17667
|
...isLinkedTextBox$1 ? { overflow: "hidden" } : {}
|
|
17662
17668
|
};
|
|
17663
|
-
const shapeType = "shapeType" in el ? el.shapeType : void 0;
|
|
17664
17669
|
const placeholderPrompt = placeholderPromptDescriptor(el, placeholderPromptMode);
|
|
17665
17670
|
const shouldRenderText = isTxtEl || placeholderPrompt !== null;
|
|
17671
|
+
const equationBox = shouldRenderText ? renderEquationBox(el, Boolean(onHyperlinkClick)) : null;
|
|
17666
17672
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17667
17673
|
vecShape,
|
|
17668
|
-
|
|
17669
|
-
shouldRenderText && (useSvgWarp ? /* @__PURE__ */ jsx(
|
|
17674
|
+
equationBox,
|
|
17675
|
+
shouldRenderText && !equationBox && (useSvgWarp ? /* @__PURE__ */ jsx(
|
|
17670
17676
|
"div",
|
|
17671
17677
|
{
|
|
17672
17678
|
className: cn(
|
|
@@ -18095,13 +18101,17 @@ function renderBody(options) {
|
|
|
18095
18101
|
// does. The rule is shared so the five bindings cannot drift on it.
|
|
18096
18102
|
showTransport: mediaTransportVisible({
|
|
18097
18103
|
presenting: isPresentationPassive === true,
|
|
18098
|
-
preview: isStaticSurface === true
|
|
18099
|
-
canvasTransport: true
|
|
18104
|
+
preview: isStaticSurface === true
|
|
18100
18105
|
}),
|
|
18101
18106
|
// ...and never the play badge / placeholder box either: a still is
|
|
18102
18107
|
// slide content, and the transition overlay paints one (issue #147).
|
|
18103
18108
|
preview: isStaticSurface === true,
|
|
18104
|
-
onPlayStateChange: handleMediaPlayStateChange
|
|
18109
|
+
onPlayStateChange: handleMediaPlayStateChange,
|
|
18110
|
+
// PowerPoint's Normal view: a control bar while selected or hovered.
|
|
18111
|
+
...mediaControlBarEnabled({
|
|
18112
|
+
presenting: isPresentationPassive === true,
|
|
18113
|
+
preview: isStaticSurface === true
|
|
18114
|
+
}) ? { controlBar: { selected: isSel === true } } : {}
|
|
18105
18115
|
});
|
|
18106
18116
|
}
|
|
18107
18117
|
if (doInk && isInkElement(el)) {
|