pptx-react-viewer 2.16.6 → 2.16.7
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 +2 -0
- package/dist/{AiChatPanel-NQFSMKIJ.mjs → AiChatPanel-2YYL6AKX.mjs} +3 -9
- package/dist/AiChatPanel-2YYL6AKX.mjs.br +0 -0
- package/dist/AiChatPanel-2YYL6AKX.mjs.gz +0 -0
- package/dist/{AiChatPanel-T6UN6LME.js → AiChatPanel-XSXMU2Q5.js} +23 -29
- package/dist/AiChatPanel-XSXMU2Q5.js.br +0 -0
- package/dist/AiChatPanel-XSXMU2Q5.js.gz +0 -0
- package/dist/{Model3DScene-SIST7CIH.js → Model3DScene-36UJZLCO.js} +2 -2
- package/dist/Model3DScene-36UJZLCO.js.br +0 -0
- package/dist/Model3DScene-36UJZLCO.js.gz +0 -0
- package/dist/{Model3DScene-4D4GSRIB.mjs → Model3DScene-NVFP3JBJ.mjs} +1 -1
- package/dist/Model3DScene-NVFP3JBJ.mjs.br +0 -0
- package/dist/Model3DScene-NVFP3JBJ.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-ZT7L27U4.mjs → SurfaceChart3DScene-BMFEDBLF.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-ZT7L27U4.mjs.br → SurfaceChart3DScene-BMFEDBLF.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-BMFEDBLF.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GRM24VBC.js → SurfaceChart3DScene-W6I255VU.js} +2 -2
- package/dist/SurfaceChart3DScene-W6I255VU.js.br +0 -0
- package/dist/SurfaceChart3DScene-W6I255VU.js.gz +0 -0
- package/dist/{chunk-DYGKE2LY.js → chunk-77TMRPDU.js} +2128 -1541
- package/dist/chunk-77TMRPDU.js.br +0 -0
- package/dist/chunk-77TMRPDU.js.gz +0 -0
- package/dist/{chunk-PUBYHZYJ.mjs → chunk-D5TAZ5NL.mjs} +1132 -6
- package/dist/chunk-D5TAZ5NL.mjs.br +0 -0
- package/dist/chunk-D5TAZ5NL.mjs.gz +0 -0
- package/dist/{chunk-YZHBUMVU.mjs → chunk-J56KVWI5.mjs} +1114 -527
- package/dist/chunk-J56KVWI5.mjs.br +0 -0
- package/dist/chunk-J56KVWI5.mjs.gz +0 -0
- package/dist/{chunk-6F76GHPE.mjs → chunk-J5V7UCD2.mjs} +15 -1410
- package/dist/chunk-J5V7UCD2.mjs.br +0 -0
- package/dist/chunk-J5V7UCD2.mjs.gz +0 -0
- package/dist/{chunk-YDYAOW6D.js → chunk-JSJZWA43.js} +9 -3
- package/dist/chunk-JSJZWA43.js.br +0 -0
- package/dist/chunk-JSJZWA43.js.gz +0 -0
- package/dist/{chunk-NI5GSVZU.mjs → chunk-KVNZGR3L.mjs} +6 -91
- package/dist/chunk-KVNZGR3L.mjs.br +0 -0
- package/dist/chunk-KVNZGR3L.mjs.gz +0 -0
- package/dist/{chunk-H36QL5T5.js → chunk-NFJLF7TX.js} +258 -1683
- package/dist/chunk-NFJLF7TX.js.br +0 -0
- package/dist/chunk-NFJLF7TX.js.gz +0 -0
- package/dist/{chunk-VDQD3ZOU.mjs → chunk-QNKJUUKD.mjs} +7 -2
- package/dist/chunk-QNKJUUKD.mjs.br +0 -0
- package/dist/chunk-QNKJUUKD.mjs.gz +0 -0
- package/dist/{chunk-GUDJDY4J.js → chunk-S7HPAJRX.js} +342 -427
- package/dist/chunk-S7HPAJRX.js.br +0 -0
- package/dist/chunk-S7HPAJRX.js.gz +0 -0
- package/dist/{chunk-RZYOOWZN.js → chunk-USAJMMF2.js} +1165 -13
- package/dist/chunk-USAJMMF2.js.br +0 -0
- package/dist/chunk-USAJMMF2.js.gz +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +39 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +27 -7
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-DpzU8NZ_.d.ts → useViewerBuildingBlocks-Xddn6SFj.d.ts} +13 -1
- package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +1 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-NQFSMKIJ.mjs.br +0 -0
- package/dist/AiChatPanel-NQFSMKIJ.mjs.gz +0 -0
- package/dist/AiChatPanel-T6UN6LME.js.br +0 -0
- package/dist/AiChatPanel-T6UN6LME.js.gz +0 -0
- package/dist/Model3DScene-4D4GSRIB.mjs.br +0 -0
- package/dist/Model3DScene-4D4GSRIB.mjs.gz +0 -0
- package/dist/Model3DScene-SIST7CIH.js.br +0 -0
- package/dist/Model3DScene-SIST7CIH.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GRM24VBC.js.br +0 -0
- package/dist/SurfaceChart3DScene-GRM24VBC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ZT7L27U4.mjs.gz +0 -0
- package/dist/chunk-6F76GHPE.mjs.br +0 -0
- package/dist/chunk-6F76GHPE.mjs.gz +0 -0
- package/dist/chunk-DYGKE2LY.js.br +0 -0
- package/dist/chunk-DYGKE2LY.js.gz +0 -0
- package/dist/chunk-GUDJDY4J.js.br +0 -0
- package/dist/chunk-GUDJDY4J.js.gz +0 -0
- package/dist/chunk-H36QL5T5.js.br +0 -0
- package/dist/chunk-H36QL5T5.js.gz +0 -0
- package/dist/chunk-NI5GSVZU.mjs.br +0 -0
- package/dist/chunk-NI5GSVZU.mjs.gz +0 -0
- package/dist/chunk-PUBYHZYJ.mjs.br +0 -0
- package/dist/chunk-PUBYHZYJ.mjs.gz +0 -0
- package/dist/chunk-RZYOOWZN.js.br +0 -0
- package/dist/chunk-RZYOOWZN.js.gz +0 -0
- package/dist/chunk-VDQD3ZOU.mjs.br +0 -0
- package/dist/chunk-VDQD3ZOU.mjs.gz +0 -0
- package/dist/chunk-YDYAOW6D.js.br +0 -0
- package/dist/chunk-YDYAOW6D.js.gz +0 -0
- package/dist/chunk-YZHBUMVU.mjs.br +0 -0
- package/dist/chunk-YZHBUMVU.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-DpzU8NZ_.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computeFocusTargets, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, toRenderableParts } from './chunk-
|
|
2
|
-
import { useReducedMotion, useViewerState, useViewerOptions, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useLayoutSwitching, useYjsDocumentSync, useCollaborationLivePatch, useFollowMode, useBroadcastFollower, scopeLayoutOptionsToActiveSlide, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, useCollaborativeState, useVirtualizedSlides, useSwipeNavigation, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, downloadBlob } from './chunk-
|
|
3
|
-
import { MIN_ELEMENT_SIZE, DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, DEFAULT_FILL_COLOR, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getCropShapeClipPath,
|
|
1
|
+
import { computeFocusTargets, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, toRenderableParts } from './chunk-QNKJUUKD.mjs';
|
|
2
|
+
import { useReducedMotion, useViewerState, useViewerOptions, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useLayoutSwitching, useYjsDocumentSync, useCollaborationLivePatch, useFollowMode, useBroadcastFollower, scopeLayoutOptionsToActiveSlide, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, useCollaborativeState, useVirtualizedSlides, useSwipeNavigation, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, downloadBlob } from './chunk-KVNZGR3L.mjs';
|
|
3
|
+
import { MIN_ELEMENT_SIZE, DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, DEFAULT_FILL_COLOR, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getCropShapeClipPath, isImageTiled, getImageTilingStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, buildTextBody3DSceneStyle, SLIDE_NAV_THUMBNAIL_WIDTH, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, TOOLBAR_SECTIONS, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, HYPERLINK_COLOR, GRID_SIZE, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, THEME_COLOR_SWATCHES, STROKE_DASH_OPTIONS } from './chunk-J5V7UCD2.mjs';
|
|
4
4
|
import { LOCALE_CATALOG, translationsEn } from './chunk-5IUEPQTK.mjs';
|
|
5
|
-
import { hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getElementTransform, isEditableTextElement, isElementRendered, isElementActionable, getAriaRole, getAriaLabel, getAriaRoleDescription, getImageEffectsOpacity, getImageEffectsFilter, getElementTransformWithoutRotation, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, getElementLabel, SWITCHABLE_LAYOUT_TYPES, DEFAULT_VIEWER_OPTIONS, compileEquationTemplateMathMl, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, viewerOptionsToPreferences, applyPreferenceToOptions, listAutosaveSnapshots, deleteAutosaveSnapshot, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, getComputedEffectStyle, getSoftEdgeSvgFilter, buildStrokeOutline, buildHollowHitOutline, strokeOutlineViewBox, getGroupChildParentFill, revealedSmartArtNodeCount, buildSmartArtA11y, buildSummaryZoomView, getImageColorWashStyle, isImageLikeElement, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, applyChartBuildReveal, formatAxisValue, hasPressureVariation, getInkReplayStyles, INK_REPLAY_KEYFRAMES, resolveInkColor, resolveInkWidth, resolveInkOpacity, pressuresToWidths, getContentPartReplayStyles, resolveOleType, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, RULER_THICKNESS, RULER_FONT_SIZE, buildPreviewElements, deriveSlideFieldContext, SLIDE_TRANSITION_OPTIONS, hiddenSlideCue, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, themeToCssVars, applyMotionPathPreset, DEFAULT_INSERT_CHART_KIND, hasCopyableFormat, templateSchemeFromTheme, createBackstagePresentation, printPropertiesFrameSlides, printPropertiesSlidesPerPage, VIEWER_OPTIONS_TABS, DEFAULT_QUICK_ACCESS_COMMAND_IDS, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS,
|
|
5
|
+
import { hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getElementTransform, isEditableTextElement, isElementRendered, isElementActionable, getAriaRole, getAriaLabel, getAriaRoleDescription, getImageEffectsOpacity, getImageEffectsFilter, getElementTransformWithoutRotation, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, getElementLabel, SWITCHABLE_LAYOUT_TYPES, DEFAULT_VIEWER_OPTIONS, compileEquationTemplateMathMl, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, viewerOptionsToPreferences, applyPreferenceToOptions, listAutosaveSnapshots, deleteAutosaveSnapshot, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, getComputedEffectStyle, getSoftEdgeSvgFilter, buildStrokeOutline, buildHollowHitOutline, strokeOutlineViewBox, getGroupChildParentFill, revealedSmartArtNodeCount, buildSmartArtA11y, buildSummaryZoomView, getImageColorWashStyle, isImageLikeElement, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, applyChartBuildReveal, formatAxisValue, hasPressureVariation, getInkReplayStyles, INK_REPLAY_KEYFRAMES, resolveInkColor, resolveInkWidth, resolveInkOpacity, pressuresToWidths, getContentPartReplayStyles, resolveOleType, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, RULER_THICKNESS, RULER_FONT_SIZE, buildPreviewElements, deriveSlideFieldContext, SLIDE_TRANSITION_OPTIONS, hiddenSlideCue, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, themeToCssVars, applyMotionPathPreset, DEFAULT_INSERT_CHART_KIND, hasCopyableFormat, templateSchemeFromTheme, createBackstagePresentation, printPropertiesFrameSlides, printPropertiesSlidesPerPage, VIEWER_OPTIONS_TABS, DEFAULT_QUICK_ACCESS_COMMAND_IDS, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, DEFAULT_PALETTE2, resolvePalette, computeDrawingViewBox, projectDrawingShapes, styleShadowFilter, resolveDrawingShapeNodeId, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, findChartPartTarget, dragValueForPart, withChartPointValue, dragAnchorViewY, withChartTitle, computeSmartArtLayout, buildSmartArt3DModel, extractPathPoints, generatePressureCircles, isBrowserOpenableMime, formatBytes, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, getWarpPath, getSlideBackgroundStyle, filterCommands, resolveTitleBarStatusKey, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, buildFieldSubstitutionContext, shouldConfirmExternalHyperlink, safeOpenUrl, isPpactionUrl, parsePpactionUrl, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, buildContextMenuEntries, themeColorSchemesEqual, EXPANDED_MAX_HEIGHT, STATUS_BAR_CLASSES, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, activateModalFocus, buildCollaborationShareUrl, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, OUTLINE_LEVEL_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_ROW_ATTR, OUTLINE_VIEW_ATTR, mobileElapsedSince, nextPresentedSlide, presenterPrevDisabled, presenterNextDisabled, formatMobileElapsed, mobileSlideCounter, presenterPaneAdvancesOnClick, presenterTimerProgress, PRESENTER_CONSOLE_CLASSES, formatElapsed, centeredSvgTextLines, buildTree, treeWidth, treeDepth, fitFontSize, computeInlineEditorRect, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, groupIntoParagraphs, substituteFieldText, extraQuickAccessCommands, TAB_ROW_ACTION_CLASSES, listBackstageRecentFiles, BACKSTAGE_NAV, INSERT_CHART_TYPES, CHARACTER_SPACING_OPTIONS, DEFAULT_MOTION_PATH_PRESET_ID, SLIDE_VIRTUALIZATION_THRESHOLD, PRESENTATION_STAGE_ATTRIBUTE, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, annotationOverlayZIndex, presentationInkPath, motionPathFor, setMotionPath, getShapeAdjustmentHandleDescriptor, PRESENTER_NAVIGATOR_LABEL_KEYS, PEN_COLORS, HIGHLIGHTER_COLORS, isBlackboardActive, PRESET_THEMES, normalizeSegments, createPlainNotesSegments, segmentsToEditorHtml, DEBOUNCE_MS, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX, isUrlSafe, escapeHtml2, sanitizeMathMl, computeHandoutLayout, getPrintableArea, generateNoteLineCount, computeAllNotesPages, getNotesPrintableArea, QUICK_ACCESS_COMMAND_CATALOG, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, PRESENTER_CONSOLE_CONTROLS, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, styleShadow, styleStroke, nodeOpacity, truncate, paletteColour, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, backstageCardsFor, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, ENTRANCE_PRESET_VALUES, EMPHASIS_PRESET_VALUES, EXIT_PRESET_VALUES, MOTION_PATH_FAMILIES, motionPathFamilyLabelKey, motionPathPresetsByFamily, motionPathPresetLabelKey, getConnectionSites, generateTicks, rulerDragToGuidePosition, getCommentMarkerPosition, motionPathToSvgD, motionPathEndPixel, isEditableMotionPath, setMotionPathEnd, themeColorLabel, buildThemeColorGrid, THEME_COLOR_SCHEME_KEYS, COMMON_FONTS, buildSmartArtPresetData, handleReadingViewKey, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, SLIDE_TEMPLATES, mergeSlideTransition, buildSlideTemplateContent, buildTableDataGrid, appendTableElementRow, removeLastTableElementRow, appendTableElementColumn, removeLastTableElementColumn, removeTableElementColumn, removeTableElementRow, setTableElementCellText, TABLE_STYLE_PRESETS, chartDataChangeType, setChartCategoryLabel, setChartCellValue, addChartCategory, removeChartCategory, addChartSeries, removeChartSeries, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, getOleObjectTypeLabel, sanitizeGradientStops, pptxActionToElementAction, withFrameSlides, withSlidesPerPage, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, TRANSITION_VALID_DIRECTIONS, TRANSITION_ORIENTATION_TYPES, clampTransitionNumber, flattenTagCollections, formatCommentTimestamp, clearMotionPath, DIRECTIONAL_PRESETS, motionPathPresetIdForPath, computeMergeCellRight, computeMergeCellDown, computeSplitCell, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, addSmartArtNodeAsChild, removeSmartArtNode, clampCropValue, DUOTONE_PRESETS, ARTISTIC_EFFECTS, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, toSlideIndex, elementActionToPptxAction, canCommitActionType, TRANSITION_DIR_ARROWS, buildDirectionGrid, updateTagInCollections, deleteTagFromCollections, addTagToCollections, animationEffectLabel, LBL, SEL, FILL_MODE_OPTIONS, SECTION_HEADING, NUM, switchSmartArtLayout, addSmartArtNode, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode, SHAPE_QUICK_STYLES, quickStyleSwatchCss, getPatternSvg, TEXT_WARP_PRESETS, warpPreviewPath, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, GRADIENT_TYPE_OPTIONS, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, openNativeEyeDropper, toggleText3dExtrusion, BEVEL_PRESETS } from './chunk-D5TAZ5NL.mjs';
|
|
6
6
|
import React14, { createContext, useMemo, useState, useCallback, lazy, forwardRef, useEffect, useRef, Suspense, useLayoutEffect, useContext, Fragment as Fragment$1, useDeferredValue } from 'react';
|
|
7
7
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
@@ -2563,7 +2563,7 @@ function FailedToLoad() {
|
|
|
2563
2563
|
var LazyModel3DScene = React14.lazy(
|
|
2564
2564
|
async () => {
|
|
2565
2565
|
try {
|
|
2566
|
-
return await import('./Model3DScene-
|
|
2566
|
+
return await import('./Model3DScene-NVFP3JBJ.mjs');
|
|
2567
2567
|
} catch {
|
|
2568
2568
|
return { default: FailedToLoad };
|
|
2569
2569
|
}
|
|
@@ -2827,6 +2827,77 @@ function OleRenderer({ element: el }) {
|
|
|
2827
2827
|
);
|
|
2828
2828
|
}
|
|
2829
2829
|
var SmartArt3DContext = createContext(false);
|
|
2830
|
+
var DEFAULT_PALETTE = DEFAULT_PALETTE2;
|
|
2831
|
+
function colour(index, palette = DEFAULT_PALETTE) {
|
|
2832
|
+
return paletteColour(index, palette);
|
|
2833
|
+
}
|
|
2834
|
+
function nodeOpacity2(index, total, style) {
|
|
2835
|
+
return nodeOpacity(index, total, style ?? "flat");
|
|
2836
|
+
}
|
|
2837
|
+
function styleShadow2(style) {
|
|
2838
|
+
return styleShadow(style ?? "flat");
|
|
2839
|
+
}
|
|
2840
|
+
function styleStroke2(style) {
|
|
2841
|
+
return styleStroke(style ?? "flat");
|
|
2842
|
+
}
|
|
2843
|
+
function truncate2(text, max) {
|
|
2844
|
+
return truncate(text, max);
|
|
2845
|
+
}
|
|
2846
|
+
function resolvePalette2(el) {
|
|
2847
|
+
return el.type === "smartArt" ? resolvePalette(el.smartArtData) : DEFAULT_PALETTE;
|
|
2848
|
+
}
|
|
2849
|
+
function resolveStyle(el) {
|
|
2850
|
+
if (el.type !== "smartArt" || !el.smartArtData) {
|
|
2851
|
+
return "flat";
|
|
2852
|
+
}
|
|
2853
|
+
return el.smartArtData.style ?? "flat";
|
|
2854
|
+
}
|
|
2855
|
+
function resolveSmartArtDataPalette(data) {
|
|
2856
|
+
return resolvePalette(data);
|
|
2857
|
+
}
|
|
2858
|
+
function layoutToCategory(layout) {
|
|
2859
|
+
if (!layout) {
|
|
2860
|
+
return "list";
|
|
2861
|
+
}
|
|
2862
|
+
const map = {
|
|
2863
|
+
basicBlockList: "list",
|
|
2864
|
+
alternatingHexagons: "list",
|
|
2865
|
+
basicChevronProcess: "process",
|
|
2866
|
+
basicCycle: "cycle",
|
|
2867
|
+
basicPie: "cycle",
|
|
2868
|
+
basicRadial: "radial",
|
|
2869
|
+
basicVenn: "venn",
|
|
2870
|
+
continuousBlockProcess: "process",
|
|
2871
|
+
convergingRadial: "radial",
|
|
2872
|
+
hierarchy: "hierarchy",
|
|
2873
|
+
horizontalBulletList: "list",
|
|
2874
|
+
linearVenn: "venn",
|
|
2875
|
+
segmentedProcess: "process",
|
|
2876
|
+
stackedList: "list",
|
|
2877
|
+
tableList: "list",
|
|
2878
|
+
trapezoidList: "list",
|
|
2879
|
+
upwardArrow: "process",
|
|
2880
|
+
basicFunnel: "funnel",
|
|
2881
|
+
basicTarget: "radial",
|
|
2882
|
+
interlockingGears: "radial",
|
|
2883
|
+
basicTimeline: "process",
|
|
2884
|
+
basicMatrix: "matrix",
|
|
2885
|
+
basicPyramid: "pyramid",
|
|
2886
|
+
invertedPyramid: "pyramid",
|
|
2887
|
+
bendingProcess: "process",
|
|
2888
|
+
stepDownProcess: "stepdown",
|
|
2889
|
+
alternatingFlow: "alternatingflow",
|
|
2890
|
+
descendingProcess: "descending",
|
|
2891
|
+
pictureAccentList: "pictureaccent",
|
|
2892
|
+
verticalBlockList: "verticalblock",
|
|
2893
|
+
groupedList: "grouped",
|
|
2894
|
+
pyramidList: "pyramidlist",
|
|
2895
|
+
horizontalPictureList: "horizontalpicture",
|
|
2896
|
+
accentProcess: "accentprocess",
|
|
2897
|
+
verticalChevronList: "verticalchevron"
|
|
2898
|
+
};
|
|
2899
|
+
return map[layout] ?? "list";
|
|
2900
|
+
}
|
|
2830
2901
|
var LINE_HEIGHT_RATIO = 1.2;
|
|
2831
2902
|
var DEFAULT_FONT_SIZE = 12;
|
|
2832
2903
|
function SmartArtInlineNodeEditor({
|
|
@@ -3096,44 +3167,979 @@ function SmartArtEditableLayer({
|
|
|
3096
3167
|
}
|
|
3097
3168
|
);
|
|
3098
3169
|
}
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3170
|
+
var LABEL_WIDTH_FRACTION = 0.82;
|
|
3171
|
+
function smartArtNodeGroupProps(nodeId, shadow, label) {
|
|
3172
|
+
const props = {
|
|
3173
|
+
"data-smartart-node-id": nodeId,
|
|
3174
|
+
style: { filter: shadow, pointerEvents: "auto" }
|
|
3175
|
+
};
|
|
3176
|
+
if (label) {
|
|
3177
|
+
props.role = "img";
|
|
3178
|
+
props["aria-label"] = label;
|
|
3103
3179
|
}
|
|
3104
|
-
|
|
3180
|
+
return props;
|
|
3181
|
+
}
|
|
3182
|
+
function gearPath(cx, cy, outerR, innerR, teeth) {
|
|
3183
|
+
const segments = [];
|
|
3184
|
+
const step = Math.PI * 2 / (teeth * 2);
|
|
3185
|
+
for (let i = 0; i < teeth * 2; i++) {
|
|
3186
|
+
const angle = i * step - Math.PI / 2;
|
|
3187
|
+
const r = i % 2 === 0 ? outerR : innerR;
|
|
3188
|
+
const x = cx + r * Math.cos(angle);
|
|
3189
|
+
const y = cy + r * Math.sin(angle);
|
|
3190
|
+
segments.push(i === 0 ? `M${x},${y}` : `L${x},${y}`);
|
|
3191
|
+
}
|
|
3192
|
+
segments.push("Z");
|
|
3193
|
+
return segments.join(" ");
|
|
3194
|
+
}
|
|
3195
|
+
function SmartArtGradient({ gradient }) {
|
|
3196
|
+
const stops = gradient.stops.map((stop, i) => /* @__PURE__ */ jsx(
|
|
3105
3197
|
"stop",
|
|
3106
3198
|
{
|
|
3107
|
-
offset:
|
|
3108
|
-
stopColor:
|
|
3109
|
-
...
|
|
3199
|
+
offset: stop.offset,
|
|
3200
|
+
stopColor: stop.color,
|
|
3201
|
+
...stop.opacity !== void 0 ? { stopOpacity: stop.opacity } : {}
|
|
3110
3202
|
},
|
|
3111
|
-
`${id}-s${i}`
|
|
3203
|
+
`${gradient.id}-s${i}`
|
|
3112
3204
|
));
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3205
|
+
return gradient.kind === "radial" ? /* @__PURE__ */ jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsx(
|
|
3206
|
+
"linearGradient",
|
|
3207
|
+
{
|
|
3208
|
+
id: gradient.id,
|
|
3209
|
+
x1: gradient.x1,
|
|
3210
|
+
y1: gradient.y1,
|
|
3211
|
+
x2: gradient.x2,
|
|
3212
|
+
y2: gradient.y2,
|
|
3213
|
+
children: stops
|
|
3214
|
+
}
|
|
3215
|
+
);
|
|
3216
|
+
}
|
|
3217
|
+
function SmartArtNodeText({
|
|
3218
|
+
text,
|
|
3219
|
+
lines: positionedLines,
|
|
3220
|
+
x,
|
|
3221
|
+
y,
|
|
3222
|
+
fill,
|
|
3223
|
+
fontSize,
|
|
3224
|
+
fontWeight,
|
|
3225
|
+
fontStyle,
|
|
3226
|
+
className,
|
|
3227
|
+
anchor = "middle",
|
|
3228
|
+
maxWidth
|
|
3229
|
+
}) {
|
|
3230
|
+
if (positionedLines) {
|
|
3231
|
+
return /* @__PURE__ */ jsx(
|
|
3232
|
+
"text",
|
|
3233
|
+
{
|
|
3234
|
+
x,
|
|
3235
|
+
textAnchor: "middle",
|
|
3236
|
+
dominantBaseline: "central",
|
|
3237
|
+
fill,
|
|
3238
|
+
fontSize,
|
|
3239
|
+
fontWeight,
|
|
3240
|
+
fontStyle,
|
|
3241
|
+
className,
|
|
3242
|
+
children: positionedLines.map((line, i) => /* @__PURE__ */ jsx("tspan", { x, y: line.y, children: line.text }, i))
|
|
3243
|
+
}
|
|
3244
|
+
);
|
|
3245
|
+
}
|
|
3246
|
+
const source = text ?? "";
|
|
3247
|
+
const lines = maxWidth !== void 0 ? centeredSvgTextLines(source, fontSize, { maxWidth: maxWidth * LABEL_WIDTH_FRACTION }).map(
|
|
3248
|
+
(line) => line.text
|
|
3249
|
+
) : source.split("\n").filter((l) => l.length > 0);
|
|
3250
|
+
const lineHeight = fontSize * 1.2;
|
|
3251
|
+
let startY;
|
|
3252
|
+
let dominantBaseline;
|
|
3253
|
+
if (anchor === "bottom") {
|
|
3254
|
+
startY = lines.length > 0 ? y - (lines.length - 1) * lineHeight : y;
|
|
3255
|
+
dominantBaseline = "auto";
|
|
3256
|
+
} else if (anchor === "top") {
|
|
3257
|
+
startY = y;
|
|
3258
|
+
dominantBaseline = "hanging";
|
|
3259
|
+
} else {
|
|
3260
|
+
const totalHeight = lines.length * lineHeight;
|
|
3261
|
+
startY = lines.length > 0 ? y - totalHeight / 2 + lineHeight / 2 : y;
|
|
3262
|
+
dominantBaseline = "central";
|
|
3263
|
+
}
|
|
3264
|
+
return /* @__PURE__ */ jsx(
|
|
3265
|
+
"text",
|
|
3266
|
+
{
|
|
3267
|
+
x,
|
|
3268
|
+
textAnchor: "middle",
|
|
3269
|
+
dominantBaseline,
|
|
3270
|
+
fill,
|
|
3271
|
+
fontSize,
|
|
3272
|
+
fontWeight,
|
|
3273
|
+
fontStyle,
|
|
3274
|
+
className,
|
|
3275
|
+
children: lines.map((line, i) => /* @__PURE__ */ jsx("tspan", { x, y: startY + i * lineHeight, children: line }, i))
|
|
3276
|
+
}
|
|
3277
|
+
);
|
|
3278
|
+
}
|
|
3279
|
+
function wrapChrome(chrome, content, className, a11y) {
|
|
3280
|
+
const wrapperStyle = {};
|
|
3281
|
+
if (chrome?.backgroundColor) {
|
|
3282
|
+
wrapperStyle.backgroundColor = chrome.backgroundColor;
|
|
3283
|
+
}
|
|
3284
|
+
if (chrome?.outlineColor) {
|
|
3285
|
+
wrapperStyle.border = `${chrome.outlineWidth ?? 1}px solid ${chrome.outlineColor}`;
|
|
3286
|
+
}
|
|
3287
|
+
return /* @__PURE__ */ jsx(
|
|
3288
|
+
"div",
|
|
3289
|
+
{
|
|
3290
|
+
className: `w-full h-full ${className}`,
|
|
3291
|
+
style: wrapperStyle,
|
|
3292
|
+
role: a11y?.role,
|
|
3293
|
+
"aria-label": a11y?.label,
|
|
3294
|
+
children: content
|
|
3295
|
+
}
|
|
3296
|
+
);
|
|
3297
|
+
}
|
|
3298
|
+
function renderStepDownProcess(element, nodes, palette, style) {
|
|
3299
|
+
const w = element.width;
|
|
3300
|
+
const h = element.height;
|
|
3301
|
+
const pad = 8;
|
|
3302
|
+
const usableW = w - pad * 2;
|
|
3303
|
+
const usableH = h - pad * 2;
|
|
3304
|
+
const stepW = usableW / nodes.length;
|
|
3305
|
+
const stepH = usableH / nodes.length;
|
|
3306
|
+
const boxW = stepW * 0.85;
|
|
3307
|
+
const boxH = stepH * 0.6;
|
|
3308
|
+
const shadow = styleShadow2(style);
|
|
3309
|
+
const sw = styleStroke2(style);
|
|
3310
|
+
return /* @__PURE__ */ jsx(
|
|
3311
|
+
"svg",
|
|
3312
|
+
{
|
|
3313
|
+
className: "w-full h-full pointer-events-none",
|
|
3314
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3315
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3316
|
+
style: { filter: shadow },
|
|
3317
|
+
children: nodes.map((node, i) => {
|
|
3318
|
+
const x = pad + i * stepW;
|
|
3319
|
+
const y = pad + i * stepH;
|
|
3320
|
+
const fontSize = Math.max(7, Math.min(10, boxW * 0.1));
|
|
3321
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3322
|
+
i < nodes.length - 1 && /* @__PURE__ */ jsx(
|
|
3323
|
+
"line",
|
|
3324
|
+
{
|
|
3325
|
+
x1: x + boxW,
|
|
3326
|
+
y1: y + boxH / 2,
|
|
3327
|
+
x2: x + stepW,
|
|
3328
|
+
y2: y + stepH + boxH / 2,
|
|
3329
|
+
stroke: "#94a3b8",
|
|
3330
|
+
strokeWidth: 1.5,
|
|
3331
|
+
opacity: 0.5
|
|
3332
|
+
}
|
|
3333
|
+
),
|
|
3334
|
+
/* @__PURE__ */ jsx(
|
|
3335
|
+
"rect",
|
|
3336
|
+
{
|
|
3337
|
+
x,
|
|
3338
|
+
y,
|
|
3339
|
+
width: boxW,
|
|
3340
|
+
height: boxH,
|
|
3341
|
+
rx: 5,
|
|
3342
|
+
fill: colour(i, palette),
|
|
3343
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3344
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3345
|
+
strokeWidth: sw
|
|
3346
|
+
}
|
|
3347
|
+
),
|
|
3348
|
+
/* @__PURE__ */ jsx(
|
|
3349
|
+
SmartArtNodeText,
|
|
3350
|
+
{
|
|
3351
|
+
x: x + boxW / 2,
|
|
3352
|
+
y: y + boxH / 2,
|
|
3353
|
+
text: truncate2(node.text, 20),
|
|
3354
|
+
fill: "white",
|
|
3355
|
+
fontSize,
|
|
3356
|
+
className: "pointer-events-none"
|
|
3357
|
+
}
|
|
3358
|
+
)
|
|
3359
|
+
] }, `${element.id}-stepdown-${node.id}-${i}`);
|
|
3360
|
+
})
|
|
3361
|
+
}
|
|
3362
|
+
);
|
|
3363
|
+
}
|
|
3364
|
+
function renderAlternatingFlow(element, nodes, palette, style) {
|
|
3365
|
+
const w = element.width;
|
|
3366
|
+
const h = element.height;
|
|
3367
|
+
const pad = 8;
|
|
3368
|
+
const usableH = h - pad * 2;
|
|
3369
|
+
const rowH = usableH / nodes.length;
|
|
3370
|
+
const halfW = (w - pad * 2) / 2;
|
|
3371
|
+
const boxW = halfW * 0.8;
|
|
3372
|
+
const boxH = Math.min(rowH * 0.7, 40);
|
|
3373
|
+
const centerX = w / 2;
|
|
3374
|
+
const shadow = styleShadow2(style);
|
|
3375
|
+
const sw = styleStroke2(style);
|
|
3376
|
+
return /* @__PURE__ */ jsxs(
|
|
3377
|
+
"svg",
|
|
3378
|
+
{
|
|
3379
|
+
className: "w-full h-full pointer-events-none",
|
|
3380
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3381
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3382
|
+
style: { filter: shadow },
|
|
3383
|
+
children: [
|
|
3384
|
+
/* @__PURE__ */ jsx(
|
|
3385
|
+
"line",
|
|
3386
|
+
{
|
|
3387
|
+
x1: centerX,
|
|
3388
|
+
y1: pad,
|
|
3389
|
+
x2: centerX,
|
|
3390
|
+
y2: h - pad,
|
|
3391
|
+
stroke: "#94a3b8",
|
|
3392
|
+
strokeWidth: 2,
|
|
3393
|
+
opacity: 0.3
|
|
3394
|
+
}
|
|
3395
|
+
),
|
|
3396
|
+
nodes.map((node, i) => {
|
|
3397
|
+
const isLeft = i % 2 === 0;
|
|
3398
|
+
const y = pad + i * rowH + (rowH - boxH) / 2;
|
|
3399
|
+
const x = isLeft ? centerX - boxW - 12 : centerX + 12;
|
|
3400
|
+
const fontSize = Math.max(7, Math.min(10, boxW * 0.1));
|
|
3401
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3402
|
+
/* @__PURE__ */ jsx(
|
|
3403
|
+
"line",
|
|
3404
|
+
{
|
|
3405
|
+
x1: isLeft ? x + boxW : x,
|
|
3406
|
+
y1: y + boxH / 2,
|
|
3407
|
+
x2: centerX,
|
|
3408
|
+
y2: y + boxH / 2,
|
|
3409
|
+
stroke: colour(i, palette),
|
|
3410
|
+
strokeWidth: 1.5,
|
|
3411
|
+
opacity: 0.5
|
|
3412
|
+
}
|
|
3413
|
+
),
|
|
3414
|
+
/* @__PURE__ */ jsx("circle", { cx: centerX, cy: y + boxH / 2, r: 3, fill: colour(i, palette), opacity: 0.8 }),
|
|
3415
|
+
/* @__PURE__ */ jsx(
|
|
3416
|
+
"rect",
|
|
3417
|
+
{
|
|
3418
|
+
x,
|
|
3419
|
+
y,
|
|
3420
|
+
width: boxW,
|
|
3421
|
+
height: boxH,
|
|
3422
|
+
rx: 5,
|
|
3423
|
+
fill: colour(i, palette),
|
|
3424
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3425
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3426
|
+
strokeWidth: sw
|
|
3427
|
+
}
|
|
3428
|
+
),
|
|
3429
|
+
/* @__PURE__ */ jsx(
|
|
3430
|
+
SmartArtNodeText,
|
|
3431
|
+
{
|
|
3432
|
+
x: x + boxW / 2,
|
|
3433
|
+
y: y + boxH / 2,
|
|
3434
|
+
text: truncate2(node.text, 20),
|
|
3435
|
+
fill: "white",
|
|
3436
|
+
fontSize,
|
|
3437
|
+
className: "pointer-events-none"
|
|
3438
|
+
}
|
|
3439
|
+
)
|
|
3440
|
+
] }, `${element.id}-altflow-${node.id}-${i}`);
|
|
3441
|
+
})
|
|
3442
|
+
]
|
|
3443
|
+
}
|
|
3444
|
+
);
|
|
3445
|
+
}
|
|
3446
|
+
function renderDescendingProcess(element, nodes, palette, style) {
|
|
3447
|
+
const w = element.width;
|
|
3448
|
+
const h = element.height;
|
|
3449
|
+
const pad = 8;
|
|
3450
|
+
const gap = 4;
|
|
3451
|
+
const usableH = h - pad * 2;
|
|
3452
|
+
const maxW = w - pad * 2;
|
|
3453
|
+
const itemH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3454
|
+
const shadow = styleShadow2(style);
|
|
3455
|
+
const sw = styleStroke2(style);
|
|
3456
|
+
return /* @__PURE__ */ jsx(
|
|
3457
|
+
"svg",
|
|
3458
|
+
{
|
|
3459
|
+
className: "w-full h-full pointer-events-none",
|
|
3460
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3461
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3462
|
+
style: { filter: shadow },
|
|
3463
|
+
children: nodes.map((node, i) => {
|
|
3464
|
+
const widthFraction = 1 - i / Math.max(nodes.length, 1) * 0.5;
|
|
3465
|
+
const bw = maxW * widthFraction;
|
|
3466
|
+
const x = (w - bw) / 2;
|
|
3467
|
+
const y = pad + i * (itemH + gap);
|
|
3468
|
+
const fontSize = Math.max(7, Math.min(11, itemH * 0.4));
|
|
3469
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3470
|
+
i < nodes.length - 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3471
|
+
/* @__PURE__ */ jsx(
|
|
3472
|
+
"line",
|
|
3473
|
+
{
|
|
3474
|
+
x1: w / 2,
|
|
3475
|
+
y1: y + itemH,
|
|
3476
|
+
x2: w / 2,
|
|
3477
|
+
y2: y + itemH + gap,
|
|
3478
|
+
stroke: "#94a3b8",
|
|
3479
|
+
strokeWidth: 1.5,
|
|
3480
|
+
opacity: 0.5
|
|
3481
|
+
}
|
|
3482
|
+
),
|
|
3483
|
+
/* @__PURE__ */ jsx(
|
|
3484
|
+
"polygon",
|
|
3485
|
+
{
|
|
3486
|
+
points: `${w / 2 - 3},${y + itemH + gap - 4} ${w / 2},${y + itemH + gap} ${w / 2 + 3},${y + itemH + gap - 4}`,
|
|
3487
|
+
fill: "#94a3b8",
|
|
3488
|
+
opacity: 0.5
|
|
3489
|
+
}
|
|
3490
|
+
)
|
|
3491
|
+
] }),
|
|
3492
|
+
/* @__PURE__ */ jsx(
|
|
3493
|
+
"rect",
|
|
3494
|
+
{
|
|
3495
|
+
x,
|
|
3496
|
+
y,
|
|
3497
|
+
width: bw,
|
|
3498
|
+
height: itemH,
|
|
3499
|
+
rx: 5,
|
|
3500
|
+
fill: colour(i, palette),
|
|
3501
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3502
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3503
|
+
strokeWidth: sw
|
|
3504
|
+
}
|
|
3505
|
+
),
|
|
3506
|
+
/* @__PURE__ */ jsx(
|
|
3507
|
+
SmartArtNodeText,
|
|
3508
|
+
{
|
|
3509
|
+
x: w / 2,
|
|
3510
|
+
y: y + itemH / 2,
|
|
3511
|
+
text: truncate2(node.text, 30),
|
|
3512
|
+
fill: "white",
|
|
3513
|
+
fontSize,
|
|
3514
|
+
className: "pointer-events-none"
|
|
3515
|
+
}
|
|
3516
|
+
)
|
|
3517
|
+
] }, `${element.id}-desc-${node.id}-${i}`);
|
|
3518
|
+
})
|
|
3519
|
+
}
|
|
3520
|
+
);
|
|
3521
|
+
}
|
|
3522
|
+
function renderPictureAccentList(element, nodes, palette, style) {
|
|
3523
|
+
const w = element.width;
|
|
3524
|
+
const h = element.height;
|
|
3525
|
+
const pad = 8;
|
|
3526
|
+
const gap = 6;
|
|
3527
|
+
const usableH = h - pad * 2;
|
|
3528
|
+
const usableW = w - pad * 2;
|
|
3529
|
+
const itemH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3530
|
+
const circleR = Math.min(itemH * 0.38, 18);
|
|
3531
|
+
const textX = pad + circleR * 2 + 12;
|
|
3532
|
+
const textW = usableW - circleR * 2 - 16;
|
|
3533
|
+
const shadow = styleShadow2(style);
|
|
3534
|
+
const sw = styleStroke2(style);
|
|
3535
|
+
return /* @__PURE__ */ jsx(
|
|
3536
|
+
"svg",
|
|
3537
|
+
{
|
|
3538
|
+
className: "w-full h-full pointer-events-none",
|
|
3539
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3540
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3541
|
+
style: { filter: shadow },
|
|
3542
|
+
children: nodes.map((node, i) => {
|
|
3543
|
+
const y = pad + i * (itemH + gap);
|
|
3544
|
+
const cy = y + itemH / 2;
|
|
3545
|
+
const col = colour(i, palette);
|
|
3546
|
+
const fontSize = Math.max(7, Math.min(11, itemH * 0.35));
|
|
3547
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3548
|
+
/* @__PURE__ */ jsx(
|
|
3549
|
+
"circle",
|
|
3550
|
+
{
|
|
3551
|
+
cx: pad + circleR,
|
|
3552
|
+
cy,
|
|
3553
|
+
r: circleR,
|
|
3554
|
+
fill: col,
|
|
3555
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
3556
|
+
}
|
|
3557
|
+
),
|
|
3558
|
+
/* @__PURE__ */ jsx(
|
|
3559
|
+
"text",
|
|
3560
|
+
{
|
|
3561
|
+
x: pad + circleR,
|
|
3562
|
+
y: cy,
|
|
3563
|
+
textAnchor: "middle",
|
|
3564
|
+
dominantBaseline: "central",
|
|
3565
|
+
fill: "white",
|
|
3566
|
+
fontSize: Math.max(7, circleR * 0.7),
|
|
3567
|
+
fontWeight: "bold",
|
|
3568
|
+
className: "pointer-events-none",
|
|
3569
|
+
children: i + 1
|
|
3570
|
+
}
|
|
3571
|
+
),
|
|
3572
|
+
/* @__PURE__ */ jsx(
|
|
3573
|
+
"rect",
|
|
3574
|
+
{
|
|
3575
|
+
x: textX,
|
|
3576
|
+
y: y + 2,
|
|
3577
|
+
width: textW,
|
|
3578
|
+
height: itemH - 4,
|
|
3579
|
+
rx: 4,
|
|
3580
|
+
fill: col,
|
|
3581
|
+
opacity: 0.12,
|
|
3582
|
+
stroke: col,
|
|
3583
|
+
strokeWidth: sw > 0 ? sw : 1,
|
|
3584
|
+
strokeOpacity: 0.3
|
|
3585
|
+
}
|
|
3586
|
+
),
|
|
3587
|
+
/* @__PURE__ */ jsx(
|
|
3588
|
+
"text",
|
|
3589
|
+
{
|
|
3590
|
+
x: textX + 8,
|
|
3591
|
+
y: cy,
|
|
3592
|
+
textAnchor: "start",
|
|
3593
|
+
dominantBaseline: "central",
|
|
3594
|
+
fill: col,
|
|
3595
|
+
fontSize,
|
|
3596
|
+
className: "pointer-events-none",
|
|
3597
|
+
children: truncate2(node.text, 40)
|
|
3598
|
+
}
|
|
3599
|
+
)
|
|
3600
|
+
] }, `${element.id}-picacc-${node.id}-${i}`);
|
|
3601
|
+
})
|
|
3602
|
+
}
|
|
3603
|
+
);
|
|
3604
|
+
}
|
|
3605
|
+
function renderVerticalBlockList(element, nodes, palette, style) {
|
|
3606
|
+
const w = element.width;
|
|
3607
|
+
const h = element.height;
|
|
3608
|
+
const pad = 8;
|
|
3609
|
+
const gap = 4;
|
|
3610
|
+
const usableH = h - pad * 2;
|
|
3611
|
+
const usableW = w - pad * 2;
|
|
3612
|
+
const itemH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3613
|
+
const headerW = usableW * 0.22;
|
|
3614
|
+
const bodyW = usableW - headerW - 4;
|
|
3615
|
+
const shadow = styleShadow2(style);
|
|
3616
|
+
const sw = styleStroke2(style);
|
|
3617
|
+
return /* @__PURE__ */ jsx(
|
|
3618
|
+
"svg",
|
|
3619
|
+
{
|
|
3620
|
+
className: "w-full h-full pointer-events-none",
|
|
3621
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3622
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3623
|
+
style: { filter: shadow },
|
|
3624
|
+
children: nodes.map((node, i) => {
|
|
3625
|
+
const y = pad + i * (itemH + gap);
|
|
3626
|
+
const col = colour(i, palette);
|
|
3627
|
+
const fontSize = Math.max(7, Math.min(11, itemH * 0.35));
|
|
3628
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3629
|
+
/* @__PURE__ */ jsx(
|
|
3630
|
+
"rect",
|
|
3631
|
+
{
|
|
3632
|
+
x: pad,
|
|
3633
|
+
y,
|
|
3634
|
+
width: headerW,
|
|
3635
|
+
height: itemH,
|
|
3636
|
+
rx: 3,
|
|
3637
|
+
fill: col,
|
|
3638
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3639
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3640
|
+
strokeWidth: sw
|
|
3641
|
+
}
|
|
3642
|
+
),
|
|
3643
|
+
/* @__PURE__ */ jsx(
|
|
3644
|
+
"text",
|
|
3645
|
+
{
|
|
3646
|
+
x: pad + headerW / 2,
|
|
3647
|
+
y: y + itemH / 2,
|
|
3648
|
+
textAnchor: "middle",
|
|
3649
|
+
dominantBaseline: "central",
|
|
3650
|
+
fill: "white",
|
|
3651
|
+
fontSize: Math.max(8, itemH * 0.4),
|
|
3652
|
+
fontWeight: "bold",
|
|
3653
|
+
className: "pointer-events-none",
|
|
3654
|
+
children: i + 1
|
|
3655
|
+
}
|
|
3656
|
+
),
|
|
3657
|
+
/* @__PURE__ */ jsx(
|
|
3658
|
+
"rect",
|
|
3659
|
+
{
|
|
3660
|
+
x: pad + headerW + 4,
|
|
3661
|
+
y,
|
|
3662
|
+
width: bodyW,
|
|
3663
|
+
height: itemH,
|
|
3664
|
+
rx: 3,
|
|
3665
|
+
fill: col,
|
|
3666
|
+
opacity: 0.1,
|
|
3667
|
+
stroke: col,
|
|
3668
|
+
strokeWidth: 1,
|
|
3669
|
+
strokeOpacity: 0.3
|
|
3670
|
+
}
|
|
3671
|
+
),
|
|
3672
|
+
/* @__PURE__ */ jsx(
|
|
3673
|
+
"text",
|
|
3674
|
+
{
|
|
3675
|
+
x: pad + headerW + 12,
|
|
3676
|
+
y: y + itemH / 2,
|
|
3677
|
+
textAnchor: "start",
|
|
3678
|
+
dominantBaseline: "central",
|
|
3679
|
+
fill: col,
|
|
3680
|
+
fontSize,
|
|
3681
|
+
className: "pointer-events-none",
|
|
3682
|
+
children: truncate2(node.text, 40)
|
|
3683
|
+
}
|
|
3684
|
+
)
|
|
3685
|
+
] }, `${element.id}-vblk-${node.id}-${i}`);
|
|
3686
|
+
})
|
|
3687
|
+
}
|
|
3688
|
+
);
|
|
3689
|
+
}
|
|
3690
|
+
function renderGroupedList(element, nodes, palette, style) {
|
|
3691
|
+
const w = element.width;
|
|
3692
|
+
const h = element.height;
|
|
3693
|
+
const pad = 8;
|
|
3694
|
+
const gap = 8;
|
|
3695
|
+
const shadow = styleShadow2(style);
|
|
3696
|
+
const sw = styleStroke2(style);
|
|
3697
|
+
const groupSize = nodes.length <= 4 ? 2 : 3;
|
|
3698
|
+
const groups = [];
|
|
3699
|
+
for (let i = 0; i < nodes.length; i += groupSize) {
|
|
3700
|
+
groups.push(nodes.slice(i, i + groupSize));
|
|
3701
|
+
}
|
|
3702
|
+
const usableW = w - pad * 2;
|
|
3703
|
+
const groupW = (usableW - gap * (groups.length - 1)) / groups.length;
|
|
3704
|
+
const usableH = h - pad * 2;
|
|
3705
|
+
const headerH = usableH * 0.18;
|
|
3706
|
+
return /* @__PURE__ */ jsx(
|
|
3707
|
+
"svg",
|
|
3708
|
+
{
|
|
3709
|
+
className: "w-full h-full pointer-events-none",
|
|
3710
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3711
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3712
|
+
style: { filter: shadow },
|
|
3713
|
+
children: groups.map((group, gi) => {
|
|
3714
|
+
const gx = pad + gi * (groupW + gap);
|
|
3715
|
+
const col = colour(gi, palette);
|
|
3716
|
+
const subItemGap = 3;
|
|
3717
|
+
const subItemH = (usableH - headerH - 4 - subItemGap * (group.length - 1)) / group.length;
|
|
3718
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3719
|
+
/* @__PURE__ */ jsx(
|
|
3720
|
+
"rect",
|
|
3721
|
+
{
|
|
3722
|
+
x: gx,
|
|
3723
|
+
y: pad,
|
|
3724
|
+
width: groupW,
|
|
3725
|
+
height: headerH,
|
|
3726
|
+
rx: 4,
|
|
3727
|
+
fill: col,
|
|
3728
|
+
opacity: nodeOpacity2(gi, groups.length, style),
|
|
3729
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3730
|
+
strokeWidth: sw
|
|
3731
|
+
}
|
|
3732
|
+
),
|
|
3733
|
+
/* @__PURE__ */ jsx(
|
|
3734
|
+
"text",
|
|
3735
|
+
{
|
|
3736
|
+
x: gx + groupW / 2,
|
|
3737
|
+
y: pad + headerH / 2,
|
|
3738
|
+
textAnchor: "middle",
|
|
3739
|
+
dominantBaseline: "central",
|
|
3740
|
+
fill: "white",
|
|
3741
|
+
fontSize: Math.max(7, Math.min(10, groupW * 0.08)),
|
|
3742
|
+
fontWeight: "bold",
|
|
3743
|
+
className: "pointer-events-none",
|
|
3744
|
+
children: `Group ${gi + 1}`
|
|
3745
|
+
}
|
|
3746
|
+
),
|
|
3747
|
+
group.map((node, si) => {
|
|
3748
|
+
const sy = pad + headerH + 4 + si * (subItemH + subItemGap);
|
|
3749
|
+
const fontSize = Math.max(7, Math.min(10, subItemH * 0.35));
|
|
3750
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3751
|
+
/* @__PURE__ */ jsx(
|
|
3752
|
+
"rect",
|
|
3753
|
+
{
|
|
3754
|
+
x: gx + 4,
|
|
3755
|
+
y: sy,
|
|
3756
|
+
width: groupW - 8,
|
|
3757
|
+
height: subItemH,
|
|
3758
|
+
rx: 3,
|
|
3759
|
+
fill: col,
|
|
3760
|
+
opacity: 0.15,
|
|
3761
|
+
stroke: col,
|
|
3762
|
+
strokeWidth: 1,
|
|
3763
|
+
strokeOpacity: 0.3
|
|
3764
|
+
}
|
|
3765
|
+
),
|
|
3766
|
+
/* @__PURE__ */ jsx(
|
|
3767
|
+
SmartArtNodeText,
|
|
3768
|
+
{
|
|
3769
|
+
x: gx + groupW / 2,
|
|
3770
|
+
y: sy + subItemH / 2,
|
|
3771
|
+
text: truncate2(node.text, 20),
|
|
3772
|
+
fill: col,
|
|
3773
|
+
fontSize,
|
|
3774
|
+
className: "pointer-events-none"
|
|
3775
|
+
}
|
|
3776
|
+
)
|
|
3777
|
+
] }, `${element.id}-grp-${gi}-item-${node.id}-${si}`);
|
|
3778
|
+
})
|
|
3779
|
+
] }, `${element.id}-grp-${gi}`);
|
|
3780
|
+
})
|
|
3781
|
+
}
|
|
3782
|
+
);
|
|
3783
|
+
}
|
|
3784
|
+
function renderPyramidList(element, nodes, palette, style) {
|
|
3785
|
+
const w = element.width;
|
|
3786
|
+
const h = element.height;
|
|
3787
|
+
const pad = 8;
|
|
3788
|
+
const gap = 4;
|
|
3789
|
+
const usableH = h - pad * 2;
|
|
3790
|
+
const pyramidW = w * 0.35;
|
|
3791
|
+
const labelStartX = pyramidW + pad + 16;
|
|
3792
|
+
const labelW = w - labelStartX - pad;
|
|
3793
|
+
const bandH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3794
|
+
const shadow = styleShadow2(style);
|
|
3795
|
+
return /* @__PURE__ */ jsx(
|
|
3796
|
+
"svg",
|
|
3797
|
+
{
|
|
3798
|
+
className: "w-full h-full pointer-events-none",
|
|
3799
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3800
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3801
|
+
style: { filter: shadow },
|
|
3802
|
+
children: nodes.map((node, i) => {
|
|
3803
|
+
const y = pad + i * (bandH + gap);
|
|
3804
|
+
const col = colour(i, palette);
|
|
3805
|
+
const topFrac = 0.3 + i / Math.max(nodes.length - 1, 1) * 0.7;
|
|
3806
|
+
const segW = pyramidW * topFrac;
|
|
3807
|
+
const segX = pad + (pyramidW - segW) / 2;
|
|
3808
|
+
const fontSize = Math.max(7, Math.min(11, bandH * 0.35));
|
|
3809
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3810
|
+
/* @__PURE__ */ jsx(
|
|
3811
|
+
"rect",
|
|
3812
|
+
{
|
|
3813
|
+
x: segX,
|
|
3814
|
+
y,
|
|
3815
|
+
width: segW,
|
|
3816
|
+
height: bandH,
|
|
3817
|
+
rx: 2,
|
|
3818
|
+
fill: col,
|
|
3819
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
3820
|
+
}
|
|
3821
|
+
),
|
|
3822
|
+
/* @__PURE__ */ jsx(
|
|
3823
|
+
"line",
|
|
3824
|
+
{
|
|
3825
|
+
x1: segX + segW,
|
|
3826
|
+
y1: y + bandH / 2,
|
|
3827
|
+
x2: labelStartX - 4,
|
|
3828
|
+
y2: y + bandH / 2,
|
|
3829
|
+
stroke: col,
|
|
3830
|
+
strokeWidth: 1,
|
|
3831
|
+
opacity: 0.5,
|
|
3832
|
+
strokeDasharray: "3,2"
|
|
3833
|
+
}
|
|
3834
|
+
),
|
|
3835
|
+
/* @__PURE__ */ jsx(
|
|
3836
|
+
"rect",
|
|
3837
|
+
{
|
|
3838
|
+
x: labelStartX,
|
|
3839
|
+
y: y + 2,
|
|
3840
|
+
width: labelW,
|
|
3841
|
+
height: bandH - 4,
|
|
3842
|
+
rx: 3,
|
|
3843
|
+
fill: col,
|
|
3844
|
+
opacity: 0.1,
|
|
3845
|
+
stroke: col,
|
|
3846
|
+
strokeWidth: 1,
|
|
3847
|
+
strokeOpacity: 0.25
|
|
3848
|
+
}
|
|
3849
|
+
),
|
|
3850
|
+
/* @__PURE__ */ jsx(
|
|
3851
|
+
"text",
|
|
3852
|
+
{
|
|
3853
|
+
x: labelStartX + 8,
|
|
3854
|
+
y: y + bandH / 2,
|
|
3855
|
+
textAnchor: "start",
|
|
3856
|
+
dominantBaseline: "central",
|
|
3857
|
+
fill: col,
|
|
3858
|
+
fontSize,
|
|
3859
|
+
className: "pointer-events-none",
|
|
3860
|
+
children: truncate2(node.text, 30)
|
|
3861
|
+
}
|
|
3862
|
+
)
|
|
3863
|
+
] }, `${element.id}-pyrlist-${node.id}-${i}`);
|
|
3864
|
+
})
|
|
3865
|
+
}
|
|
3866
|
+
);
|
|
3867
|
+
}
|
|
3868
|
+
function renderHorizontalPictureList(element, nodes, palette, style) {
|
|
3869
|
+
const w = element.width;
|
|
3870
|
+
const h = element.height;
|
|
3871
|
+
const pad = 8;
|
|
3872
|
+
const gap = 8;
|
|
3873
|
+
const usableW = w - pad * 2;
|
|
3874
|
+
const colW = (usableW - gap * (nodes.length - 1)) / nodes.length;
|
|
3875
|
+
const usableH = h - pad * 2;
|
|
3876
|
+
const circleR = Math.min(colW * 0.38, usableH * 0.28);
|
|
3877
|
+
const shadow = styleShadow2(style);
|
|
3878
|
+
const sw = styleStroke2(style);
|
|
3879
|
+
return /* @__PURE__ */ jsx(
|
|
3880
|
+
"svg",
|
|
3881
|
+
{
|
|
3882
|
+
className: "w-full h-full pointer-events-none",
|
|
3883
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3884
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3885
|
+
style: { filter: shadow },
|
|
3886
|
+
children: nodes.map((node, i) => {
|
|
3887
|
+
const cx = pad + i * (colW + gap) + colW / 2;
|
|
3888
|
+
const cy = pad + circleR + 4;
|
|
3889
|
+
const col = colour(i, palette);
|
|
3890
|
+
const labelY = cy + circleR + 10;
|
|
3891
|
+
const fontSize = Math.max(7, Math.min(10, colW * 0.1));
|
|
3892
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3893
|
+
/* @__PURE__ */ jsx(
|
|
3894
|
+
"circle",
|
|
3895
|
+
{
|
|
3896
|
+
cx,
|
|
3897
|
+
cy,
|
|
3898
|
+
r: circleR,
|
|
3899
|
+
fill: col,
|
|
3900
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3901
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3902
|
+
strokeWidth: sw
|
|
3903
|
+
}
|
|
3904
|
+
),
|
|
3905
|
+
/* @__PURE__ */ jsx(
|
|
3906
|
+
"text",
|
|
3907
|
+
{
|
|
3908
|
+
x: cx,
|
|
3909
|
+
y: cy,
|
|
3910
|
+
textAnchor: "middle",
|
|
3911
|
+
dominantBaseline: "central",
|
|
3912
|
+
fill: "white",
|
|
3913
|
+
fontSize: Math.max(8, circleR * 0.5),
|
|
3914
|
+
fontWeight: "bold",
|
|
3915
|
+
className: "pointer-events-none",
|
|
3916
|
+
children: i + 1
|
|
3917
|
+
}
|
|
3918
|
+
),
|
|
3919
|
+
/* @__PURE__ */ jsx(
|
|
3920
|
+
"text",
|
|
3921
|
+
{
|
|
3922
|
+
x: cx,
|
|
3923
|
+
y: labelY,
|
|
3924
|
+
textAnchor: "middle",
|
|
3925
|
+
dominantBaseline: "hanging",
|
|
3926
|
+
fill: col,
|
|
3927
|
+
fontSize,
|
|
3928
|
+
className: "pointer-events-none",
|
|
3929
|
+
children: truncate2(node.text, 15)
|
|
3930
|
+
}
|
|
3931
|
+
)
|
|
3932
|
+
] }, `${element.id}-hpic-${node.id}-${i}`);
|
|
3933
|
+
})
|
|
3934
|
+
}
|
|
3935
|
+
);
|
|
3936
|
+
}
|
|
3937
|
+
function renderAccentProcess(element, nodes, palette, style) {
|
|
3938
|
+
const w = element.width;
|
|
3939
|
+
const h = element.height;
|
|
3940
|
+
const pad = 8;
|
|
3941
|
+
const arrowGap = 16;
|
|
3942
|
+
const usableW = w - pad * 2;
|
|
3943
|
+
const nodeW = (usableW - arrowGap * (nodes.length - 1)) / nodes.length;
|
|
3944
|
+
const nodeH = h * 0.45;
|
|
3945
|
+
const yMid = h / 2;
|
|
3946
|
+
const circleR = Math.min(nodeW, nodeH) * 0.55;
|
|
3947
|
+
const shadow = styleShadow2(style);
|
|
3948
|
+
const sw = styleStroke2(style);
|
|
3949
|
+
return /* @__PURE__ */ jsx(
|
|
3950
|
+
"svg",
|
|
3951
|
+
{
|
|
3952
|
+
className: "w-full h-full pointer-events-none",
|
|
3953
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
3954
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3955
|
+
style: { filter: shadow },
|
|
3956
|
+
children: nodes.map((node, i) => {
|
|
3957
|
+
const x = pad + i * (nodeW + arrowGap);
|
|
3958
|
+
const cx = x + nodeW / 2;
|
|
3959
|
+
const col = colour(i, palette);
|
|
3960
|
+
const fontSize = Math.max(7, Math.min(11, nodeW * 0.1));
|
|
3961
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
3962
|
+
/* @__PURE__ */ jsx("circle", { cx, cy: yMid, r: circleR, fill: col, opacity: 0.15 }),
|
|
3963
|
+
/* @__PURE__ */ jsx(
|
|
3964
|
+
"rect",
|
|
3965
|
+
{
|
|
3966
|
+
x,
|
|
3967
|
+
y: yMid - nodeH / 2,
|
|
3968
|
+
width: nodeW,
|
|
3969
|
+
height: nodeH,
|
|
3970
|
+
rx: 5,
|
|
3971
|
+
fill: col,
|
|
3972
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3973
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3974
|
+
strokeWidth: sw
|
|
3975
|
+
}
|
|
3976
|
+
),
|
|
3977
|
+
/* @__PURE__ */ jsx(
|
|
3978
|
+
SmartArtNodeText,
|
|
3979
|
+
{
|
|
3980
|
+
x: cx,
|
|
3981
|
+
y: yMid,
|
|
3982
|
+
text: truncate2(node.text, 20),
|
|
3983
|
+
fill: "white",
|
|
3984
|
+
fontSize,
|
|
3985
|
+
className: "pointer-events-none"
|
|
3986
|
+
}
|
|
3987
|
+
),
|
|
3988
|
+
i < nodes.length - 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3989
|
+
/* @__PURE__ */ jsx(
|
|
3990
|
+
"line",
|
|
3991
|
+
{
|
|
3992
|
+
x1: x + nodeW + 2,
|
|
3993
|
+
y1: yMid,
|
|
3994
|
+
x2: x + nodeW + arrowGap - 2,
|
|
3995
|
+
y2: yMid,
|
|
3996
|
+
stroke: "#94a3b8",
|
|
3997
|
+
strokeWidth: 1.5,
|
|
3998
|
+
opacity: 0.5
|
|
3999
|
+
}
|
|
4000
|
+
),
|
|
4001
|
+
/* @__PURE__ */ jsx(
|
|
4002
|
+
"polygon",
|
|
4003
|
+
{
|
|
4004
|
+
points: `${x + nodeW + arrowGap - 6},${yMid - 3} ${x + nodeW + arrowGap - 2},${yMid} ${x + nodeW + arrowGap - 6},${yMid + 3}`,
|
|
4005
|
+
fill: "#94a3b8",
|
|
4006
|
+
opacity: 0.5
|
|
4007
|
+
}
|
|
4008
|
+
)
|
|
4009
|
+
] })
|
|
4010
|
+
] }, `${element.id}-accproc-${node.id}-${i}`);
|
|
4011
|
+
})
|
|
4012
|
+
}
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
function renderVerticalChevronList(element, nodes, palette, style) {
|
|
4016
|
+
const w = element.width;
|
|
4017
|
+
const h = element.height;
|
|
4018
|
+
const pad = 8;
|
|
4019
|
+
const gap = 2;
|
|
4020
|
+
const usableW = w - pad * 2;
|
|
4021
|
+
const usableH = h - pad * 2;
|
|
4022
|
+
const itemH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
4023
|
+
const chevDepth = Math.min(12, itemH * 0.3);
|
|
4024
|
+
const shadow = styleShadow2(style);
|
|
4025
|
+
const sw = styleStroke2(style);
|
|
4026
|
+
return /* @__PURE__ */ jsx(
|
|
4027
|
+
"svg",
|
|
4028
|
+
{
|
|
4029
|
+
className: "w-full h-full pointer-events-none",
|
|
4030
|
+
viewBox: `0 0 ${w} ${h}`,
|
|
4031
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
4032
|
+
style: { filter: shadow },
|
|
4033
|
+
children: nodes.map((node, i) => {
|
|
4034
|
+
const x = pad;
|
|
4035
|
+
const y = pad + i * (itemH + gap);
|
|
4036
|
+
const col = colour(i, palette);
|
|
4037
|
+
const fontSize = Math.max(7, Math.min(11, itemH * 0.4));
|
|
4038
|
+
const isFirst = i === 0;
|
|
4039
|
+
const isLast = i === nodes.length - 1;
|
|
4040
|
+
const points = isFirst ? [
|
|
4041
|
+
`${x},${y}`,
|
|
4042
|
+
`${x + usableW},${y}`,
|
|
4043
|
+
`${x + usableW},${y + itemH - chevDepth}`,
|
|
4044
|
+
`${x + usableW / 2},${y + itemH}`,
|
|
4045
|
+
`${x},${y + itemH - chevDepth}`
|
|
4046
|
+
].join(" ") : isLast ? [
|
|
4047
|
+
`${x},${y + chevDepth}`,
|
|
4048
|
+
`${x + usableW / 2},${y}`,
|
|
4049
|
+
`${x + usableW},${y + chevDepth}`,
|
|
4050
|
+
`${x + usableW},${y + itemH}`,
|
|
4051
|
+
`${x},${y + itemH}`
|
|
4052
|
+
].join(" ") : [
|
|
4053
|
+
`${x},${y + chevDepth}`,
|
|
4054
|
+
`${x + usableW / 2},${y}`,
|
|
4055
|
+
`${x + usableW},${y + chevDepth}`,
|
|
4056
|
+
`${x + usableW},${y + itemH - chevDepth}`,
|
|
4057
|
+
`${x + usableW / 2},${y + itemH}`,
|
|
4058
|
+
`${x},${y + itemH - chevDepth}`
|
|
4059
|
+
].join(" ");
|
|
4060
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
4061
|
+
/* @__PURE__ */ jsx(
|
|
4062
|
+
"polygon",
|
|
4063
|
+
{
|
|
4064
|
+
points,
|
|
4065
|
+
fill: col,
|
|
4066
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
4067
|
+
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
4068
|
+
strokeWidth: sw
|
|
4069
|
+
}
|
|
4070
|
+
),
|
|
4071
|
+
/* @__PURE__ */ jsx(
|
|
4072
|
+
SmartArtNodeText,
|
|
4073
|
+
{
|
|
4074
|
+
x: x + usableW / 2,
|
|
4075
|
+
y: y + itemH / 2,
|
|
4076
|
+
text: truncate2(node.text, 30),
|
|
4077
|
+
fill: "white",
|
|
4078
|
+
fontSize,
|
|
4079
|
+
className: "pointer-events-none"
|
|
4080
|
+
}
|
|
4081
|
+
)
|
|
4082
|
+
] }, `${element.id}-vchev-${node.id}-${i}`);
|
|
4083
|
+
})
|
|
4084
|
+
}
|
|
4085
|
+
);
|
|
4086
|
+
}
|
|
4087
|
+
function shapeBody(shape) {
|
|
4088
|
+
switch (shape.kind) {
|
|
4089
|
+
case "image":
|
|
4090
|
+
return /* @__PURE__ */ jsx(
|
|
4091
|
+
"image",
|
|
4092
|
+
{
|
|
4093
|
+
x: shape.x,
|
|
4094
|
+
y: shape.y,
|
|
4095
|
+
width: shape.width,
|
|
4096
|
+
height: shape.height,
|
|
4097
|
+
href: shape.imageUrl,
|
|
4098
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
4099
|
+
transform: shape.transform
|
|
4100
|
+
}
|
|
4101
|
+
);
|
|
4102
|
+
case "ellipse":
|
|
4103
|
+
return /* @__PURE__ */ jsx(
|
|
4104
|
+
"ellipse",
|
|
4105
|
+
{
|
|
4106
|
+
cx: shape.cx,
|
|
4107
|
+
cy: shape.cy,
|
|
4108
|
+
rx: shape.width / 2,
|
|
4109
|
+
ry: shape.height / 2,
|
|
4110
|
+
fill: shape.fill,
|
|
4111
|
+
stroke: shape.stroke,
|
|
4112
|
+
strokeWidth: shape.strokeWidth,
|
|
4113
|
+
transform: shape.transform
|
|
4114
|
+
}
|
|
4115
|
+
);
|
|
4116
|
+
case "polygon":
|
|
4117
|
+
return /* @__PURE__ */ jsx(
|
|
4118
|
+
"polygon",
|
|
4119
|
+
{
|
|
4120
|
+
points: shape.points,
|
|
4121
|
+
fill: shape.fill,
|
|
4122
|
+
stroke: shape.stroke,
|
|
4123
|
+
strokeWidth: shape.strokeWidth,
|
|
4124
|
+
transform: shape.transform
|
|
4125
|
+
}
|
|
4126
|
+
);
|
|
4127
|
+
default:
|
|
4128
|
+
return /* @__PURE__ */ jsx(
|
|
4129
|
+
"rect",
|
|
4130
|
+
{
|
|
4131
|
+
x: shape.x,
|
|
4132
|
+
y: shape.y,
|
|
4133
|
+
width: shape.width,
|
|
4134
|
+
height: shape.height,
|
|
4135
|
+
rx: shape.rx,
|
|
4136
|
+
fill: shape.fill,
|
|
4137
|
+
stroke: shape.stroke,
|
|
4138
|
+
strokeWidth: shape.strokeWidth,
|
|
4139
|
+
transform: shape.transform
|
|
4140
|
+
}
|
|
4141
|
+
);
|
|
3118
4142
|
}
|
|
3119
|
-
const rad = (shape.fillGradientAngle ?? 0) * Math.PI / 180;
|
|
3120
|
-
const dx = Math.cos(rad) / 2;
|
|
3121
|
-
const dy = Math.sin(rad) / 2;
|
|
3122
|
-
return {
|
|
3123
|
-
ref: `url(#${id})`,
|
|
3124
|
-
def: /* @__PURE__ */ jsx(
|
|
3125
|
-
"linearGradient",
|
|
3126
|
-
{
|
|
3127
|
-
id,
|
|
3128
|
-
x1: `${(0.5 - dx) * 100}%`,
|
|
3129
|
-
y1: `${(0.5 - dy) * 100}%`,
|
|
3130
|
-
x2: `${(0.5 + dx) * 100}%`,
|
|
3131
|
-
y2: `${(0.5 + dy) * 100}%`,
|
|
3132
|
-
children: stopEls
|
|
3133
|
-
},
|
|
3134
|
-
id
|
|
3135
|
-
)
|
|
3136
|
-
};
|
|
3137
4143
|
}
|
|
3138
4144
|
function DrawingShapeRenderer({
|
|
3139
4145
|
elementId,
|
|
@@ -3143,112 +4149,36 @@ function DrawingShapeRenderer({
|
|
|
3143
4149
|
nodes,
|
|
3144
4150
|
nodeLabels
|
|
3145
4151
|
}) {
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
let maxY = -Infinity;
|
|
3150
|
-
for (const s of shapes) {
|
|
3151
|
-
if (s.x < minX) {
|
|
3152
|
-
minX = s.x;
|
|
3153
|
-
}
|
|
3154
|
-
if (s.y < minY) {
|
|
3155
|
-
minY = s.y;
|
|
3156
|
-
}
|
|
3157
|
-
if (s.x + s.width > maxX) {
|
|
3158
|
-
maxX = s.x + s.width;
|
|
3159
|
-
}
|
|
3160
|
-
if (s.y + s.height > maxY) {
|
|
3161
|
-
maxY = s.y + s.height;
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
const drawingW = maxX - minX || 1;
|
|
3165
|
-
const drawingH = maxY - minY || 1;
|
|
3166
|
-
const shadow = styleShadow(style);
|
|
3167
|
-
const sw = styleStroke(style);
|
|
4152
|
+
const viewBox = computeDrawingViewBox(shapes);
|
|
4153
|
+
const rendered = projectDrawingShapes(elementId, shapes, viewBox, palette, style);
|
|
4154
|
+
const shadow = styleShadowFilter(style);
|
|
3168
4155
|
return /* @__PURE__ */ jsx(
|
|
3169
4156
|
"svg",
|
|
3170
4157
|
{
|
|
3171
|
-
viewBox: `0 0 ${
|
|
4158
|
+
viewBox: `0 0 ${viewBox.width} ${viewBox.height}`,
|
|
3172
4159
|
className: "w-full h-full pointer-events-none",
|
|
3173
4160
|
preserveAspectRatio: "xMidYMid meet",
|
|
3174
4161
|
"data-testid": "smartart-drawing-shapes",
|
|
3175
|
-
children:
|
|
3176
|
-
const
|
|
3177
|
-
const fill = shape.fillNone ? "none" : gradient?.ref ?? shape.fillPatternForegroundColor ?? shape.fillColor ?? colour(i, palette);
|
|
3178
|
-
const relX = shape.x - minX;
|
|
3179
|
-
const relY = shape.y - minY;
|
|
3180
|
-
const rx = shape.shapeType === "roundRect" ? Math.min(shape.width, shape.height) * 0.1 : 0;
|
|
3181
|
-
const isEllipse = shape.shapeType === "ellipse";
|
|
3182
|
-
const isChevron = shape.shapeType === "chevron" || shape.shapeType === "homePlate";
|
|
3183
|
-
const rotation = shape.rotation ? `rotate(${shape.rotation} ${relX + shape.width / 2} ${relY + shape.height / 2})` : void 0;
|
|
3184
|
-
const strokeCol = shape.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none");
|
|
3185
|
-
const strokeW = shape.strokeWidth ?? sw;
|
|
3186
|
-
const fontSize = shape.fontSize ?? fitFontSize(shape.text ?? "", shape.width * 0.85, shape.height, 14);
|
|
3187
|
-
const nodeId = nodes ? resolveDrawingShapeNodeId(shape, i, shapes, nodes) : void 0;
|
|
4162
|
+
children: rendered.map((shape, i) => {
|
|
4163
|
+
const nodeId = nodes ? resolveDrawingShapeNodeId(shapes[i], i, shapes, nodes) : void 0;
|
|
3188
4164
|
const nodeLabel = nodeId ? nodeLabels?.get(nodeId) : void 0;
|
|
3189
4165
|
const groupProps = nodeId ? smartArtNodeGroupProps(nodeId, shadow, nodeLabel) : { style: { filter: shadow } };
|
|
3190
4166
|
return /* @__PURE__ */ jsxs("g", { ...groupProps, children: [
|
|
3191
4167
|
nodeLabel ? /* @__PURE__ */ jsx("title", { children: nodeLabel }) : null,
|
|
3192
|
-
gradient ? /* @__PURE__ */ jsx("defs", { children: gradient.
|
|
3193
|
-
shape
|
|
3194
|
-
|
|
3195
|
-
{
|
|
3196
|
-
x: relX,
|
|
3197
|
-
y: relY,
|
|
3198
|
-
width: shape.width,
|
|
3199
|
-
height: shape.height,
|
|
3200
|
-
href: shape.fillImageUrl,
|
|
3201
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
3202
|
-
transform: rotation
|
|
3203
|
-
}
|
|
3204
|
-
) : isEllipse ? /* @__PURE__ */ jsx(
|
|
3205
|
-
"ellipse",
|
|
3206
|
-
{
|
|
3207
|
-
cx: relX + shape.width / 2,
|
|
3208
|
-
cy: relY + shape.height / 2,
|
|
3209
|
-
rx: shape.width / 2,
|
|
3210
|
-
ry: shape.height / 2,
|
|
3211
|
-
fill,
|
|
3212
|
-
stroke: strokeCol,
|
|
3213
|
-
strokeWidth: strokeW,
|
|
3214
|
-
transform: rotation
|
|
3215
|
-
}
|
|
3216
|
-
) : isChevron ? /* @__PURE__ */ jsx(
|
|
3217
|
-
"polygon",
|
|
3218
|
-
{
|
|
3219
|
-
points: chevronPoints(relX, relY, shape.width, shape.height),
|
|
3220
|
-
fill,
|
|
3221
|
-
stroke: strokeCol,
|
|
3222
|
-
strokeWidth: strokeW,
|
|
3223
|
-
transform: rotation
|
|
3224
|
-
}
|
|
3225
|
-
) : /* @__PURE__ */ jsx(
|
|
3226
|
-
"rect",
|
|
3227
|
-
{
|
|
3228
|
-
x: relX,
|
|
3229
|
-
y: relY,
|
|
3230
|
-
width: shape.width,
|
|
3231
|
-
height: shape.height,
|
|
3232
|
-
rx,
|
|
3233
|
-
fill,
|
|
3234
|
-
stroke: strokeCol,
|
|
3235
|
-
strokeWidth: strokeW,
|
|
3236
|
-
transform: rotation
|
|
3237
|
-
}
|
|
3238
|
-
),
|
|
3239
|
-
shape.text ? /* @__PURE__ */ jsx(
|
|
4168
|
+
shape.gradient ? /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(SmartArtGradient, { gradient: shape.gradient }) }) : null,
|
|
4169
|
+
shapeBody(shape),
|
|
4170
|
+
shape.textLines.length > 0 ? /* @__PURE__ */ jsx(
|
|
3240
4171
|
SmartArtNodeText,
|
|
3241
4172
|
{
|
|
3242
|
-
x:
|
|
3243
|
-
y:
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
fontSize,
|
|
4173
|
+
x: shape.textX,
|
|
4174
|
+
y: shape.textY,
|
|
4175
|
+
lines: shape.textLines,
|
|
4176
|
+
fill: shape.fontColor,
|
|
4177
|
+
fontSize: shape.fontSize,
|
|
3248
4178
|
className: "pointer-events-none"
|
|
3249
4179
|
}
|
|
3250
4180
|
) : null
|
|
3251
|
-
] },
|
|
4181
|
+
] }, shape.key);
|
|
3252
4182
|
})
|
|
3253
4183
|
}
|
|
3254
4184
|
);
|
|
@@ -3280,8 +4210,8 @@ function ListRenderer({
|
|
|
3280
4210
|
const itemH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3281
4211
|
const itemW = w - pad * 2;
|
|
3282
4212
|
const rx = Math.min(6, itemH * 0.15);
|
|
3283
|
-
const shadow =
|
|
3284
|
-
const sw =
|
|
4213
|
+
const shadow = styleShadow2(style);
|
|
4214
|
+
const sw = styleStroke2(style);
|
|
3285
4215
|
return /* @__PURE__ */ jsx(
|
|
3286
4216
|
"svg",
|
|
3287
4217
|
{
|
|
@@ -3309,7 +4239,7 @@ function ListRenderer({
|
|
|
3309
4239
|
height: itemH,
|
|
3310
4240
|
rx,
|
|
3311
4241
|
fill: ns.fill,
|
|
3312
|
-
opacity:
|
|
4242
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3313
4243
|
stroke: ns.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none"),
|
|
3314
4244
|
strokeWidth: sw
|
|
3315
4245
|
}
|
|
@@ -3319,7 +4249,7 @@ function ListRenderer({
|
|
|
3319
4249
|
{
|
|
3320
4250
|
x: pad + itemW / 2,
|
|
3321
4251
|
y: y + itemH / 2,
|
|
3322
|
-
text:
|
|
4252
|
+
text: truncate2(node.text, 40),
|
|
3323
4253
|
fill: ns.fontColor,
|
|
3324
4254
|
fontWeight: ns.fontWeight,
|
|
3325
4255
|
fontStyle: ns.fontStyle,
|
|
@@ -3351,8 +4281,8 @@ function ProcessRenderer({
|
|
|
3351
4281
|
const itemW = (usableW - gap * (nodes.length - 1)) / nodes.length;
|
|
3352
4282
|
const itemH = Math.min(h - pad * 2, h * 0.6);
|
|
3353
4283
|
const yMid = h / 2;
|
|
3354
|
-
const shadow =
|
|
3355
|
-
const sw =
|
|
4284
|
+
const shadow = styleShadow2(style);
|
|
4285
|
+
const sw = styleStroke2(style);
|
|
3356
4286
|
return /* @__PURE__ */ jsx(
|
|
3357
4287
|
"svg",
|
|
3358
4288
|
{
|
|
@@ -3380,7 +4310,7 @@ function ProcessRenderer({
|
|
|
3380
4310
|
{
|
|
3381
4311
|
points,
|
|
3382
4312
|
fill: ns.fill,
|
|
3383
|
-
opacity:
|
|
4313
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3384
4314
|
stroke: ns.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none"),
|
|
3385
4315
|
strokeWidth: sw
|
|
3386
4316
|
}
|
|
@@ -3390,7 +4320,7 @@ function ProcessRenderer({
|
|
|
3390
4320
|
{
|
|
3391
4321
|
x: x + itemW / 2,
|
|
3392
4322
|
y: yMid,
|
|
3393
|
-
text:
|
|
4323
|
+
text: truncate2(node.text, 25),
|
|
3394
4324
|
fill: ns.fontColor,
|
|
3395
4325
|
fontWeight: ns.fontWeight,
|
|
3396
4326
|
fontStyle: ns.fontStyle,
|
|
@@ -3420,8 +4350,8 @@ function CycleRenderer({
|
|
|
3420
4350
|
const cy = h / 2;
|
|
3421
4351
|
const radius = size * 0.35;
|
|
3422
4352
|
const nodeR = Math.max(size * 0.06, Math.min(size * 0.12, 200 / nodes.length));
|
|
3423
|
-
const shadow =
|
|
3424
|
-
const sw =
|
|
4353
|
+
const shadow = styleShadow2(style);
|
|
4354
|
+
const sw = styleStroke2(style);
|
|
3425
4355
|
return /* @__PURE__ */ jsxs(
|
|
3426
4356
|
"svg",
|
|
3427
4357
|
{
|
|
@@ -3476,7 +4406,7 @@ function CycleRenderer({
|
|
|
3476
4406
|
cy: ny,
|
|
3477
4407
|
r: nodeR,
|
|
3478
4408
|
fill: ns.fill,
|
|
3479
|
-
opacity:
|
|
4409
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3480
4410
|
stroke: ns.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none"),
|
|
3481
4411
|
strokeWidth: sw
|
|
3482
4412
|
}
|
|
@@ -3486,7 +4416,7 @@ function CycleRenderer({
|
|
|
3486
4416
|
{
|
|
3487
4417
|
x: nx,
|
|
3488
4418
|
y: ny,
|
|
3489
|
-
text:
|
|
4419
|
+
text: truncate2(node.text, 20),
|
|
3490
4420
|
fill: ns.fontColor,
|
|
3491
4421
|
fontWeight: ns.fontWeight,
|
|
3492
4422
|
fontStyle: ns.fontStyle,
|
|
@@ -3521,8 +4451,8 @@ function MatrixRenderer({
|
|
|
3521
4451
|
const cellW = (usableW - gap * (cols - 1)) / cols;
|
|
3522
4452
|
const cellH = (usableH - gap * (rows - 1)) / rows;
|
|
3523
4453
|
const rx = Math.min(6, Math.min(cellW, cellH) * 0.1);
|
|
3524
|
-
const shadow =
|
|
3525
|
-
const sw =
|
|
4454
|
+
const shadow = styleShadow2(style);
|
|
4455
|
+
const sw = styleStroke2(style);
|
|
3526
4456
|
return /* @__PURE__ */ jsx(
|
|
3527
4457
|
"svg",
|
|
3528
4458
|
{
|
|
@@ -3553,7 +4483,7 @@ function MatrixRenderer({
|
|
|
3553
4483
|
height: cellH,
|
|
3554
4484
|
rx,
|
|
3555
4485
|
fill: ns.fill,
|
|
3556
|
-
opacity:
|
|
4486
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3557
4487
|
stroke: ns.strokeColor ?? (sw > 0 ? "rgba(255,255,255,0.3)" : "none"),
|
|
3558
4488
|
strokeWidth: sw
|
|
3559
4489
|
}
|
|
@@ -3563,7 +4493,7 @@ function MatrixRenderer({
|
|
|
3563
4493
|
{
|
|
3564
4494
|
x: x + cellW / 2,
|
|
3565
4495
|
y: y + cellH / 2,
|
|
3566
|
-
text:
|
|
4496
|
+
text: truncate2(node.text, 30),
|
|
3567
4497
|
fill: ns.fontColor,
|
|
3568
4498
|
fontWeight: ns.fontWeight ?? 500,
|
|
3569
4499
|
fontStyle: ns.fontStyle,
|
|
@@ -3592,8 +4522,8 @@ function PyramidRenderer({
|
|
|
3592
4522
|
const usableH = h - pad * 2;
|
|
3593
4523
|
const bandH = (usableH - gap * (nodes.length - 1)) / nodes.length;
|
|
3594
4524
|
const maxW = w - pad * 2;
|
|
3595
|
-
const shadow =
|
|
3596
|
-
const sw =
|
|
4525
|
+
const shadow = styleShadow2(style);
|
|
4526
|
+
const sw = styleStroke2(style);
|
|
3597
4527
|
return /* @__PURE__ */ jsx(
|
|
3598
4528
|
"svg",
|
|
3599
4529
|
{
|
|
@@ -3628,7 +4558,7 @@ function PyramidRenderer({
|
|
|
3628
4558
|
{
|
|
3629
4559
|
points,
|
|
3630
4560
|
fill: colour(i, palette),
|
|
3631
|
-
opacity:
|
|
4561
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
3632
4562
|
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3633
4563
|
strokeWidth: sw
|
|
3634
4564
|
}
|
|
@@ -3638,7 +4568,7 @@ function PyramidRenderer({
|
|
|
3638
4568
|
{
|
|
3639
4569
|
x: w / 2,
|
|
3640
4570
|
y: y + bandH / 2,
|
|
3641
|
-
text:
|
|
4571
|
+
text: truncate2(node.text, 30),
|
|
3642
4572
|
fill: "white",
|
|
3643
4573
|
fontSize,
|
|
3644
4574
|
className: "pointer-events-none"
|
|
@@ -3660,7 +4590,7 @@ function VennRenderer({
|
|
|
3660
4590
|
}) {
|
|
3661
4591
|
const w = element.width;
|
|
3662
4592
|
const h = element.height;
|
|
3663
|
-
const shadow =
|
|
4593
|
+
const shadow = styleShadow2(style);
|
|
3664
4594
|
if (nodes.length <= 4) {
|
|
3665
4595
|
const cx = w / 2;
|
|
3666
4596
|
const cy2 = h / 2;
|
|
@@ -3689,7 +4619,7 @@ function VennRenderer({
|
|
|
3689
4619
|
{
|
|
3690
4620
|
x: nx,
|
|
3691
4621
|
y: ny,
|
|
3692
|
-
text:
|
|
4622
|
+
text: truncate2(node.text, 20),
|
|
3693
4623
|
fill: "white",
|
|
3694
4624
|
fontSize,
|
|
3695
4625
|
fontWeight: "bold",
|
|
@@ -3730,7 +4660,7 @@ function VennRenderer({
|
|
|
3730
4660
|
{
|
|
3731
4661
|
x: nx,
|
|
3732
4662
|
y: cy,
|
|
3733
|
-
text:
|
|
4663
|
+
text: truncate2(node.text, 20),
|
|
3734
4664
|
fill: "white",
|
|
3735
4665
|
fontSize,
|
|
3736
4666
|
fontWeight: "bold",
|
|
@@ -3756,7 +4686,7 @@ function FunnelRenderer({
|
|
|
3756
4686
|
const pad = 8;
|
|
3757
4687
|
const usableW = w - pad * 2;
|
|
3758
4688
|
const stageH = (h - pad * 2) / nodes.length;
|
|
3759
|
-
const shadow =
|
|
4689
|
+
const shadow = styleShadow2(style);
|
|
3760
4690
|
return /* @__PURE__ */ jsx(
|
|
3761
4691
|
"svg",
|
|
3762
4692
|
{
|
|
@@ -3789,7 +4719,7 @@ function FunnelRenderer({
|
|
|
3789
4719
|
{
|
|
3790
4720
|
points,
|
|
3791
4721
|
fill: colour(i, palette),
|
|
3792
|
-
opacity:
|
|
4722
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
3793
4723
|
}
|
|
3794
4724
|
),
|
|
3795
4725
|
/* @__PURE__ */ jsx(
|
|
@@ -3797,7 +4727,7 @@ function FunnelRenderer({
|
|
|
3797
4727
|
{
|
|
3798
4728
|
x: w / 2,
|
|
3799
4729
|
y: y + stageH / 2,
|
|
3800
|
-
text:
|
|
4730
|
+
text: truncate2(node.text, 30),
|
|
3801
4731
|
fill: "white",
|
|
3802
4732
|
fontSize,
|
|
3803
4733
|
className: "pointer-events-none"
|
|
@@ -3824,7 +4754,7 @@ function TargetRenderer({
|
|
|
3824
4754
|
const maxR = Math.min(cx - 8, cy - 8);
|
|
3825
4755
|
const fontSize = Math.max(7, Math.min(10, maxR / (nodes.length + 1)));
|
|
3826
4756
|
const labelX = cx + maxR + 8;
|
|
3827
|
-
const shadow =
|
|
4757
|
+
const shadow = styleShadow2(style);
|
|
3828
4758
|
return /* @__PURE__ */ jsx(
|
|
3829
4759
|
"svg",
|
|
3830
4760
|
{
|
|
@@ -3846,7 +4776,7 @@ function TargetRenderer({
|
|
|
3846
4776
|
cy,
|
|
3847
4777
|
r: Math.max(r, 4),
|
|
3848
4778
|
fill: colour(i, palette),
|
|
3849
|
-
opacity:
|
|
4779
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
3850
4780
|
}
|
|
3851
4781
|
),
|
|
3852
4782
|
/* @__PURE__ */ jsx(
|
|
@@ -3871,7 +4801,7 @@ function TargetRenderer({
|
|
|
3871
4801
|
fill: colour(i, palette),
|
|
3872
4802
|
fontSize,
|
|
3873
4803
|
className: "pointer-events-none",
|
|
3874
|
-
children:
|
|
4804
|
+
children: truncate2(node.text, 30)
|
|
3875
4805
|
}
|
|
3876
4806
|
)
|
|
3877
4807
|
]
|
|
@@ -3901,8 +4831,8 @@ function HierarchyRenderer({
|
|
|
3901
4831
|
const boxW = Math.min(cellW * 0.8, 140);
|
|
3902
4832
|
const boxH = Math.min(cellH * 0.4, 36);
|
|
3903
4833
|
const rx = Math.min(6, boxH * 0.15);
|
|
3904
|
-
const shadow =
|
|
3905
|
-
const sw =
|
|
4834
|
+
const shadow = styleShadow2(style);
|
|
4835
|
+
const sw = styleStroke2(style);
|
|
3906
4836
|
const elements = [];
|
|
3907
4837
|
let colourIdx = 0;
|
|
3908
4838
|
function renderTreeNode(t, xOffset, level) {
|
|
@@ -3952,7 +4882,7 @@ function HierarchyRenderer({
|
|
|
3952
4882
|
height: boxH,
|
|
3953
4883
|
rx,
|
|
3954
4884
|
fill: colour(ci, palette),
|
|
3955
|
-
opacity:
|
|
4885
|
+
opacity: nodeOpacity2(ci, nodes.length, style),
|
|
3956
4886
|
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
3957
4887
|
strokeWidth: sw
|
|
3958
4888
|
}
|
|
@@ -3962,7 +4892,7 @@ function HierarchyRenderer({
|
|
|
3962
4892
|
{
|
|
3963
4893
|
x: nodeCx,
|
|
3964
4894
|
y: nodeCy,
|
|
3965
|
-
text:
|
|
4895
|
+
text: truncate2(t.node.text, 40),
|
|
3966
4896
|
fill: "white",
|
|
3967
4897
|
fontSize,
|
|
3968
4898
|
className: "pointer-events-none"
|
|
@@ -4011,7 +4941,7 @@ function GearRenderer({
|
|
|
4011
4941
|
const gearR = Math.min(spacing * 0.4, h * 0.35);
|
|
4012
4942
|
const innerR = gearR * 0.7;
|
|
4013
4943
|
const teethCount = 8;
|
|
4014
|
-
const shadow =
|
|
4944
|
+
const shadow = styleShadow2(style);
|
|
4015
4945
|
return /* @__PURE__ */ jsxs(
|
|
4016
4946
|
"svg",
|
|
4017
4947
|
{
|
|
@@ -4034,7 +4964,7 @@ function GearRenderer({
|
|
|
4034
4964
|
{
|
|
4035
4965
|
d: gearPath(gx, gy, gearR, innerR, teethCount),
|
|
4036
4966
|
fill: colour(i, palette),
|
|
4037
|
-
opacity:
|
|
4967
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
4038
4968
|
}
|
|
4039
4969
|
),
|
|
4040
4970
|
/* @__PURE__ */ jsx("circle", { cx: gx, cy: gy, r: innerR * 0.5, fill: "white", opacity: 0.25 }),
|
|
@@ -4043,7 +4973,7 @@ function GearRenderer({
|
|
|
4043
4973
|
{
|
|
4044
4974
|
x: gx,
|
|
4045
4975
|
y: gy,
|
|
4046
|
-
text:
|
|
4976
|
+
text: truncate2(node.text, 20),
|
|
4047
4977
|
fill: "white",
|
|
4048
4978
|
fontSize,
|
|
4049
4979
|
fontWeight: "bold",
|
|
@@ -4066,7 +4996,7 @@ function GearRenderer({
|
|
|
4066
4996
|
cy: ly,
|
|
4067
4997
|
r: 3,
|
|
4068
4998
|
fill: colour(gearCount + i, palette),
|
|
4069
|
-
opacity:
|
|
4999
|
+
opacity: nodeOpacity2(gearCount + i, nodes.length, style)
|
|
4070
5000
|
}
|
|
4071
5001
|
),
|
|
4072
5002
|
/* @__PURE__ */ jsx(
|
|
@@ -4079,7 +5009,7 @@ function GearRenderer({
|
|
|
4079
5009
|
fill: colour(gearCount + i, palette),
|
|
4080
5010
|
fontSize: 10,
|
|
4081
5011
|
className: "pointer-events-none",
|
|
4082
|
-
children:
|
|
5012
|
+
children: truncate2(node.text, 30)
|
|
4083
5013
|
}
|
|
4084
5014
|
)
|
|
4085
5015
|
] }, `${element.id}-gear-extra-${node.id}-${i}`);
|
|
@@ -4103,7 +5033,7 @@ function TimelineRenderer({
|
|
|
4103
5033
|
const lineLen = lineEndX - lineStartX;
|
|
4104
5034
|
const dotR = Math.max(4, Math.min(8, lineLen / (nodes.length * 4)));
|
|
4105
5035
|
const labelOffset = Math.min(h * 0.28, 40);
|
|
4106
|
-
const shadow =
|
|
5036
|
+
const shadow = styleShadow2(style);
|
|
4107
5037
|
return /* @__PURE__ */ jsxs(
|
|
4108
5038
|
"svg",
|
|
4109
5039
|
{
|
|
@@ -4150,13 +5080,13 @@ function TimelineRenderer({
|
|
|
4150
5080
|
cy: lineY,
|
|
4151
5081
|
r: dotR,
|
|
4152
5082
|
fill: colour(i, palette),
|
|
4153
|
-
opacity:
|
|
5083
|
+
opacity: nodeOpacity2(i, nodes.length, style)
|
|
4154
5084
|
}
|
|
4155
5085
|
),
|
|
4156
5086
|
/* @__PURE__ */ jsx(
|
|
4157
5087
|
SmartArtNodeText,
|
|
4158
5088
|
{
|
|
4159
|
-
text:
|
|
5089
|
+
text: truncate2(node.text, 20) ?? "",
|
|
4160
5090
|
x,
|
|
4161
5091
|
y: textY,
|
|
4162
5092
|
fill: colour(i, palette),
|
|
@@ -4192,8 +5122,8 @@ function BendingProcessRenderer({
|
|
|
4192
5122
|
const boxH = Math.min(cellH * 0.6, 32);
|
|
4193
5123
|
const rx = Math.min(5, boxH * 0.15);
|
|
4194
5124
|
const arrowSize = 6;
|
|
4195
|
-
const shadow =
|
|
4196
|
-
const sw =
|
|
5125
|
+
const shadow = styleShadow2(style);
|
|
5126
|
+
const sw = styleStroke2(style);
|
|
4197
5127
|
return /* @__PURE__ */ jsx(
|
|
4198
5128
|
"svg",
|
|
4199
5129
|
{
|
|
@@ -4279,7 +5209,7 @@ function BendingProcessRenderer({
|
|
|
4279
5209
|
height: boxH,
|
|
4280
5210
|
rx,
|
|
4281
5211
|
fill: colour(i, palette),
|
|
4282
|
-
opacity:
|
|
5212
|
+
opacity: nodeOpacity2(i, nodes.length, style),
|
|
4283
5213
|
stroke: sw > 0 ? "rgba(255,255,255,0.3)" : "none",
|
|
4284
5214
|
strokeWidth: sw
|
|
4285
5215
|
}
|
|
@@ -4289,7 +5219,7 @@ function BendingProcessRenderer({
|
|
|
4289
5219
|
{
|
|
4290
5220
|
x: nodeCx,
|
|
4291
5221
|
y: nodeCy,
|
|
4292
|
-
text:
|
|
5222
|
+
text: truncate2(node.text, 20),
|
|
4293
5223
|
fill: "white",
|
|
4294
5224
|
fontSize,
|
|
4295
5225
|
className: "pointer-events-none"
|
|
@@ -4339,7 +5269,7 @@ function SmartArtRendererImpl({
|
|
|
4339
5269
|
}
|
|
4340
5270
|
);
|
|
4341
5271
|
}
|
|
4342
|
-
const palette =
|
|
5272
|
+
const palette = resolvePalette2(element);
|
|
4343
5273
|
const style = resolveStyle(element);
|
|
4344
5274
|
const a11y = buildSmartArtA11y(smartArtData);
|
|
4345
5275
|
const nodeLabels = new Map(a11y.nodes.map((n) => [n.id, n.label]));
|
|
@@ -4602,7 +5532,7 @@ function SmartArt3DRenderer({
|
|
|
4602
5532
|
if (nodes.length === 0) {
|
|
4603
5533
|
return null;
|
|
4604
5534
|
}
|
|
4605
|
-
const palette =
|
|
5535
|
+
const palette = resolvePalette2(element);
|
|
4606
5536
|
const style = resolveStyle(element);
|
|
4607
5537
|
const layoutResult = computeSmartArtLayout(
|
|
4608
5538
|
nodes,
|
|
@@ -6679,7 +7609,7 @@ function AccountPage() {
|
|
|
6679
7609
|
return void 0;
|
|
6680
7610
|
});
|
|
6681
7611
|
};
|
|
6682
|
-
const version = "2.16.
|
|
7612
|
+
const version = "2.16.6" ;
|
|
6683
7613
|
return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
|
|
6684
7614
|
/* @__PURE__ */ jsxs("section", { className: cardClass, children: [
|
|
6685
7615
|
/* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
@@ -15851,7 +16781,7 @@ function useOutlineView(input) {
|
|
|
15851
16781
|
}, [rows]);
|
|
15852
16782
|
return { rows, containerRef, run, onRowKeyDown };
|
|
15853
16783
|
}
|
|
15854
|
-
var
|
|
16784
|
+
var INDENT_PX2 = 22;
|
|
15855
16785
|
function OutlineViewOverlay({
|
|
15856
16786
|
slides,
|
|
15857
16787
|
canvasSize,
|
|
@@ -15897,7 +16827,7 @@ function OutlineViewOverlay({
|
|
|
15897
16827
|
"div",
|
|
15898
16828
|
{
|
|
15899
16829
|
className: "flex items-center gap-2 py-0.5",
|
|
15900
|
-
style: { paddingLeft: row.level *
|
|
16830
|
+
style: { paddingLeft: row.level * INDENT_PX2 },
|
|
15901
16831
|
children: [
|
|
15902
16832
|
/* @__PURE__ */ jsx("span", { className: "w-6 shrink-0 text-right text-[10px] tabular-nums text-white/40", children: row.kind === "title" ? row.slideIndex + 1 : "" }),
|
|
15903
16833
|
/* @__PURE__ */ jsx(
|
|
@@ -16129,349 +17059,6 @@ function ReadingViewOverlay({
|
|
|
16129
17059
|
}
|
|
16130
17060
|
);
|
|
16131
17061
|
}
|
|
16132
|
-
|
|
16133
|
-
// src/viewer/components/notes/notes-utils.ts
|
|
16134
|
-
var DEBOUNCE_MS = 600;
|
|
16135
|
-
var EXPANDED_MAX_HEIGHT = 200;
|
|
16136
|
-
var PX_TO_PT = 0.75;
|
|
16137
|
-
var MAX_INDENT_LEVEL = 4;
|
|
16138
|
-
var INDENT_PX2 = 24;
|
|
16139
|
-
function escapeHtml(value) {
|
|
16140
|
-
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
16141
|
-
}
|
|
16142
|
-
function createPlainNotesSegments(text) {
|
|
16143
|
-
const lines = text.split("\n");
|
|
16144
|
-
const segments = [];
|
|
16145
|
-
lines.forEach((line, index) => {
|
|
16146
|
-
segments.push({ text: line, style: {} });
|
|
16147
|
-
if (index < lines.length - 1) {
|
|
16148
|
-
segments.push({ text: "", style: {}, isParagraphBreak: true });
|
|
16149
|
-
}
|
|
16150
|
-
});
|
|
16151
|
-
if (segments.length === 0) {
|
|
16152
|
-
segments.push({ text: "", style: {} });
|
|
16153
|
-
}
|
|
16154
|
-
return segments;
|
|
16155
|
-
}
|
|
16156
|
-
function segmentsToPlainText(segments) {
|
|
16157
|
-
return segments.map((segment) => segment.isParagraphBreak ? "\n" : segment.text).join("");
|
|
16158
|
-
}
|
|
16159
|
-
function normalizeSegments(segments) {
|
|
16160
|
-
const cleaned = segments.filter((segment) => segment.isParagraphBreak || segment.text.length > 0);
|
|
16161
|
-
while (cleaned.length > 0 && cleaned[cleaned.length - 1].isParagraphBreak) {
|
|
16162
|
-
cleaned.pop();
|
|
16163
|
-
}
|
|
16164
|
-
return cleaned.length > 0 ? cleaned : [{ text: "", style: {} }];
|
|
16165
|
-
}
|
|
16166
|
-
function parsePt(value) {
|
|
16167
|
-
if (!value) {
|
|
16168
|
-
return void 0;
|
|
16169
|
-
}
|
|
16170
|
-
const numeric = Number.parseFloat(value);
|
|
16171
|
-
if (Number.isNaN(numeric) || !Number.isFinite(numeric)) {
|
|
16172
|
-
return void 0;
|
|
16173
|
-
}
|
|
16174
|
-
if (value.endsWith("px")) {
|
|
16175
|
-
return numeric * PX_TO_PT;
|
|
16176
|
-
}
|
|
16177
|
-
return numeric;
|
|
16178
|
-
}
|
|
16179
|
-
function buildParagraph(segments) {
|
|
16180
|
-
const first = segments[0];
|
|
16181
|
-
let bulletType = "none";
|
|
16182
|
-
let indentLevel = 0;
|
|
16183
|
-
if (first?.bulletInfo) {
|
|
16184
|
-
if (first.bulletInfo.char) {
|
|
16185
|
-
bulletType = "bullet";
|
|
16186
|
-
} else if (first.bulletInfo.autoNumType) {
|
|
16187
|
-
bulletType = "numbered";
|
|
16188
|
-
}
|
|
16189
|
-
}
|
|
16190
|
-
if (first?.style.paragraphMarginLeft) {
|
|
16191
|
-
indentLevel = Math.min(
|
|
16192
|
-
MAX_INDENT_LEVEL,
|
|
16193
|
-
Math.max(0, Math.round(first.style.paragraphMarginLeft / INDENT_PX2))
|
|
16194
|
-
);
|
|
16195
|
-
}
|
|
16196
|
-
return {
|
|
16197
|
-
segments: segments.length > 0 ? segments : [{ text: "", style: {} }],
|
|
16198
|
-
bulletType,
|
|
16199
|
-
indentLevel
|
|
16200
|
-
};
|
|
16201
|
-
}
|
|
16202
|
-
function segmentsToParagraphs(segments) {
|
|
16203
|
-
const normalized = normalizeSegments(segments);
|
|
16204
|
-
const paragraphs = [];
|
|
16205
|
-
let current = [];
|
|
16206
|
-
for (const seg of normalized) {
|
|
16207
|
-
if (seg.isParagraphBreak) {
|
|
16208
|
-
paragraphs.push(buildParagraph(current));
|
|
16209
|
-
current = [];
|
|
16210
|
-
} else {
|
|
16211
|
-
current.push(seg);
|
|
16212
|
-
}
|
|
16213
|
-
}
|
|
16214
|
-
if (current.length > 0) {
|
|
16215
|
-
paragraphs.push(buildParagraph(current));
|
|
16216
|
-
}
|
|
16217
|
-
if (paragraphs.length === 0) {
|
|
16218
|
-
paragraphs.push({
|
|
16219
|
-
segments: [{ text: "", style: {} }],
|
|
16220
|
-
bulletType: "none",
|
|
16221
|
-
indentLevel: 0
|
|
16222
|
-
});
|
|
16223
|
-
}
|
|
16224
|
-
return paragraphs;
|
|
16225
|
-
}
|
|
16226
|
-
function paragraphsToSegments(paragraphs) {
|
|
16227
|
-
const result = [];
|
|
16228
|
-
let numberedCounter = 0;
|
|
16229
|
-
paragraphs.forEach((para, pIdx) => {
|
|
16230
|
-
if (para.bulletType === "numbered") {
|
|
16231
|
-
numberedCounter++;
|
|
16232
|
-
} else {
|
|
16233
|
-
numberedCounter = 0;
|
|
16234
|
-
}
|
|
16235
|
-
para.segments.forEach((seg, sIdx) => {
|
|
16236
|
-
const updated = { ...seg, style: { ...seg.style } };
|
|
16237
|
-
if (para.indentLevel > 0) {
|
|
16238
|
-
updated.style.paragraphMarginLeft = para.indentLevel * INDENT_PX2;
|
|
16239
|
-
} else {
|
|
16240
|
-
delete updated.style.paragraphMarginLeft;
|
|
16241
|
-
}
|
|
16242
|
-
if (sIdx === 0) {
|
|
16243
|
-
if (para.bulletType === "bullet") {
|
|
16244
|
-
updated.bulletInfo = { char: "\u2022" };
|
|
16245
|
-
} else if (para.bulletType === "numbered") {
|
|
16246
|
-
updated.bulletInfo = {
|
|
16247
|
-
autoNumType: "arabicPeriod",
|
|
16248
|
-
paragraphIndex: numberedCounter - 1
|
|
16249
|
-
};
|
|
16250
|
-
} else {
|
|
16251
|
-
delete updated.bulletInfo;
|
|
16252
|
-
}
|
|
16253
|
-
}
|
|
16254
|
-
result.push(updated);
|
|
16255
|
-
});
|
|
16256
|
-
if (pIdx < paragraphs.length - 1) {
|
|
16257
|
-
result.push({ text: "", style: {}, isParagraphBreak: true });
|
|
16258
|
-
}
|
|
16259
|
-
});
|
|
16260
|
-
return result;
|
|
16261
|
-
}
|
|
16262
|
-
function getCurrentParagraphIndex(editorEl, segments) {
|
|
16263
|
-
const sel = window.getSelection();
|
|
16264
|
-
if (!sel || sel.rangeCount === 0) {
|
|
16265
|
-
return 0;
|
|
16266
|
-
}
|
|
16267
|
-
const range = sel.getRangeAt(0);
|
|
16268
|
-
let charOffset = 0;
|
|
16269
|
-
const walker = document.createTreeWalker(editorEl, NodeFilter.SHOW_TEXT);
|
|
16270
|
-
let node = walker.nextNode();
|
|
16271
|
-
while (node) {
|
|
16272
|
-
if (range.startContainer === node) {
|
|
16273
|
-
charOffset += range.startOffset;
|
|
16274
|
-
break;
|
|
16275
|
-
}
|
|
16276
|
-
charOffset += (node.textContent ?? "").length;
|
|
16277
|
-
node = walker.nextNode();
|
|
16278
|
-
}
|
|
16279
|
-
let paraIdx = 0;
|
|
16280
|
-
let pos = 0;
|
|
16281
|
-
for (const seg of segments) {
|
|
16282
|
-
if (seg.isParagraphBreak) {
|
|
16283
|
-
paraIdx++;
|
|
16284
|
-
pos++;
|
|
16285
|
-
continue;
|
|
16286
|
-
}
|
|
16287
|
-
const segLen = seg.text.length;
|
|
16288
|
-
if (pos + segLen > charOffset) {
|
|
16289
|
-
return paraIdx;
|
|
16290
|
-
}
|
|
16291
|
-
pos += segLen;
|
|
16292
|
-
}
|
|
16293
|
-
return paraIdx;
|
|
16294
|
-
}
|
|
16295
|
-
var CSS_VALUE_SAFE = /^[a-zA-Z0-9 _,.\-+#'%/]{1,100}$/u;
|
|
16296
|
-
function isCssValueSafe(value) {
|
|
16297
|
-
if (value === void 0 || value === null) {
|
|
16298
|
-
return false;
|
|
16299
|
-
}
|
|
16300
|
-
const str = String(value);
|
|
16301
|
-
return str.length > 0 && CSS_VALUE_SAFE.test(str);
|
|
16302
|
-
}
|
|
16303
|
-
function deriveStyleFromElement(element, inheritedStyle) {
|
|
16304
|
-
const style = { ...inheritedStyle };
|
|
16305
|
-
const tagName = element.tagName.toLowerCase();
|
|
16306
|
-
if (tagName === "b" || tagName === "strong") {
|
|
16307
|
-
style.bold = true;
|
|
16308
|
-
}
|
|
16309
|
-
if (tagName === "i" || tagName === "em") {
|
|
16310
|
-
style.italic = true;
|
|
16311
|
-
}
|
|
16312
|
-
if (tagName === "u") {
|
|
16313
|
-
style.underline = true;
|
|
16314
|
-
}
|
|
16315
|
-
if (tagName === "s" || tagName === "strike") {
|
|
16316
|
-
style.strikethrough = true;
|
|
16317
|
-
}
|
|
16318
|
-
if (tagName === "a") {
|
|
16319
|
-
const href = element.getAttribute("href");
|
|
16320
|
-
if (href) {
|
|
16321
|
-
style.hyperlink = href;
|
|
16322
|
-
}
|
|
16323
|
-
style.underline = true;
|
|
16324
|
-
style.color = "#4a9eff";
|
|
16325
|
-
}
|
|
16326
|
-
const inlineStyle = element.style;
|
|
16327
|
-
if (inlineStyle.fontWeight === "bold" || Number(inlineStyle.fontWeight) >= 600) {
|
|
16328
|
-
style.bold = true;
|
|
16329
|
-
}
|
|
16330
|
-
if (inlineStyle.fontStyle === "italic") {
|
|
16331
|
-
style.italic = true;
|
|
16332
|
-
}
|
|
16333
|
-
if (inlineStyle.textDecoration.includes("underline") || inlineStyle.textDecorationLine.includes("underline")) {
|
|
16334
|
-
style.underline = true;
|
|
16335
|
-
}
|
|
16336
|
-
if (inlineStyle.textDecoration.includes("line-through") || inlineStyle.textDecorationLine.includes("line-through")) {
|
|
16337
|
-
style.strikethrough = true;
|
|
16338
|
-
}
|
|
16339
|
-
if (inlineStyle.color) {
|
|
16340
|
-
style.color = inlineStyle.color;
|
|
16341
|
-
}
|
|
16342
|
-
const fontSizePt = parsePt(inlineStyle.fontSize);
|
|
16343
|
-
if (fontSizePt !== void 0) {
|
|
16344
|
-
style.fontSize = fontSizePt;
|
|
16345
|
-
}
|
|
16346
|
-
if (inlineStyle.fontFamily) {
|
|
16347
|
-
style.fontFamily = inlineStyle.fontFamily;
|
|
16348
|
-
}
|
|
16349
|
-
return style;
|
|
16350
|
-
}
|
|
16351
|
-
function parseSegmentsFromRichEditor(root) {
|
|
16352
|
-
const segments = [];
|
|
16353
|
-
const walk = (node, inheritedStyle) => {
|
|
16354
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
16355
|
-
const value = node.textContent ?? "";
|
|
16356
|
-
if (value.length > 0) {
|
|
16357
|
-
segments.push({ text: value, style: { ...inheritedStyle } });
|
|
16358
|
-
}
|
|
16359
|
-
return;
|
|
16360
|
-
}
|
|
16361
|
-
if (!(node instanceof HTMLElement)) {
|
|
16362
|
-
return;
|
|
16363
|
-
}
|
|
16364
|
-
if (node.tagName.toLowerCase() === "br") {
|
|
16365
|
-
segments.push({ text: "", style: {}, isParagraphBreak: true });
|
|
16366
|
-
return;
|
|
16367
|
-
}
|
|
16368
|
-
const nextStyle = deriveStyleFromElement(node, inheritedStyle);
|
|
16369
|
-
const tag = node.tagName.toLowerCase();
|
|
16370
|
-
const isBlock = ["div", "p", "li"].includes(tag);
|
|
16371
|
-
let bulletInfo;
|
|
16372
|
-
let paraIndent = 0;
|
|
16373
|
-
if (isBlock && node.dataset.bulletType) {
|
|
16374
|
-
const bt = node.dataset.bulletType;
|
|
16375
|
-
if (bt === "bullet") {
|
|
16376
|
-
bulletInfo = { char: "\u2022" };
|
|
16377
|
-
} else if (bt === "numbered") {
|
|
16378
|
-
bulletInfo = { autoNumType: "arabicPeriod" };
|
|
16379
|
-
}
|
|
16380
|
-
}
|
|
16381
|
-
if (isBlock && node.dataset.indentLevel) {
|
|
16382
|
-
paraIndent = Number.parseInt(node.dataset.indentLevel, 10) || 0;
|
|
16383
|
-
}
|
|
16384
|
-
const segStartIdx = segments.length;
|
|
16385
|
-
node.childNodes.forEach((child) => walk(child, nextStyle));
|
|
16386
|
-
if (isBlock && (bulletInfo || paraIndent > 0)) {
|
|
16387
|
-
for (let i = segStartIdx; i < segments.length; i++) {
|
|
16388
|
-
if (!segments[i].isParagraphBreak) {
|
|
16389
|
-
if (bulletInfo) {
|
|
16390
|
-
segments[i].bulletInfo = bulletInfo;
|
|
16391
|
-
}
|
|
16392
|
-
if (paraIndent > 0) {
|
|
16393
|
-
segments[i].style = {
|
|
16394
|
-
...segments[i].style,
|
|
16395
|
-
paragraphMarginLeft: paraIndent * INDENT_PX2
|
|
16396
|
-
};
|
|
16397
|
-
}
|
|
16398
|
-
break;
|
|
16399
|
-
}
|
|
16400
|
-
}
|
|
16401
|
-
}
|
|
16402
|
-
if (isBlock) {
|
|
16403
|
-
segments.push({ text: "", style: {}, isParagraphBreak: true });
|
|
16404
|
-
}
|
|
16405
|
-
};
|
|
16406
|
-
root.childNodes.forEach((child) => walk(child, {}));
|
|
16407
|
-
return normalizeSegments(segments);
|
|
16408
|
-
}
|
|
16409
|
-
function segmentsToEditorHtml(segments) {
|
|
16410
|
-
const paragraphs = segmentsToParagraphs(segments);
|
|
16411
|
-
let numberedCounter = 0;
|
|
16412
|
-
return paragraphs.map((para) => {
|
|
16413
|
-
if (para.bulletType === "numbered") {
|
|
16414
|
-
numberedCounter++;
|
|
16415
|
-
} else {
|
|
16416
|
-
numberedCounter = 0;
|
|
16417
|
-
}
|
|
16418
|
-
const runsHtml = para.segments.map((segment) => {
|
|
16419
|
-
if (segment.isParagraphBreak) {
|
|
16420
|
-
return "";
|
|
16421
|
-
}
|
|
16422
|
-
const inlineStyles = [];
|
|
16423
|
-
if (segment.style.bold) {
|
|
16424
|
-
inlineStyles.push("font-weight:700");
|
|
16425
|
-
}
|
|
16426
|
-
if (segment.style.italic) {
|
|
16427
|
-
inlineStyles.push("font-style:italic");
|
|
16428
|
-
}
|
|
16429
|
-
if (segment.style.underline) {
|
|
16430
|
-
inlineStyles.push("text-decoration:underline");
|
|
16431
|
-
}
|
|
16432
|
-
if (segment.style.strikethrough) {
|
|
16433
|
-
inlineStyles.push("text-decoration:line-through");
|
|
16434
|
-
}
|
|
16435
|
-
if (segment.style.color && isCssValueSafe(segment.style.color)) {
|
|
16436
|
-
inlineStyles.push(`color:${segment.style.color}`);
|
|
16437
|
-
}
|
|
16438
|
-
if (segment.style.fontSize && Number.isFinite(Number(segment.style.fontSize))) {
|
|
16439
|
-
inlineStyles.push(`font-size:${Number(segment.style.fontSize)}pt`);
|
|
16440
|
-
}
|
|
16441
|
-
if (segment.style.fontFamily && isCssValueSafe(segment.style.fontFamily)) {
|
|
16442
|
-
inlineStyles.push(`font-family:${segment.style.fontFamily}`);
|
|
16443
|
-
}
|
|
16444
|
-
const text = escapeHtml(segment.text);
|
|
16445
|
-
if (segment.style.hyperlink && isUrlSafe(segment.style.hyperlink)) {
|
|
16446
|
-
const href = escapeHtml(segment.style.hyperlink);
|
|
16447
|
-
return `<a href="${href}" style="color:#4a9eff;text-decoration:underline;cursor:pointer" data-hyperlink="${href}">${text}</a>`;
|
|
16448
|
-
}
|
|
16449
|
-
const styleAttr = inlineStyles.length > 0 ? ` style="${inlineStyles.join(";")}"` : "";
|
|
16450
|
-
return `<span${styleAttr}>${text}</span>`;
|
|
16451
|
-
}).join("");
|
|
16452
|
-
const attrs = [];
|
|
16453
|
-
if (para.bulletType !== "none") {
|
|
16454
|
-
attrs.push(`data-bullet-type="${para.bulletType}"`);
|
|
16455
|
-
}
|
|
16456
|
-
if (para.indentLevel > 0) {
|
|
16457
|
-
attrs.push(`data-indent-level="${para.indentLevel}"`);
|
|
16458
|
-
}
|
|
16459
|
-
const indent = para.indentLevel * INDENT_PX2;
|
|
16460
|
-
const divStyles = [];
|
|
16461
|
-
if (indent > 0) {
|
|
16462
|
-
divStyles.push(`padding-left:${indent}px`);
|
|
16463
|
-
}
|
|
16464
|
-
let prefix = "";
|
|
16465
|
-
if (para.bulletType === "bullet") {
|
|
16466
|
-
prefix = `<span style="margin-right:6px;color:#9ca3af" contenteditable="false">\u2022</span>`;
|
|
16467
|
-
} else if (para.bulletType === "numbered") {
|
|
16468
|
-
prefix = `<span style="margin-right:6px;color:#9ca3af" contenteditable="false">${numberedCounter}.</span>`;
|
|
16469
|
-
}
|
|
16470
|
-
const styleStr = divStyles.length > 0 ? ` style="${divStyles.join(";")}"` : "";
|
|
16471
|
-
const attrStr = attrs.length > 0 ? ` ${attrs.join(" ")}` : "";
|
|
16472
|
-
return `<div${attrStr}${styleStr}>${prefix}${runsHtml || "<br />"}</div>`;
|
|
16473
|
-
}).join("");
|
|
16474
|
-
}
|
|
16475
17062
|
function renderRichNotesSegments(segments) {
|
|
16476
17063
|
const paragraphs = segmentsToParagraphs(segments);
|
|
16477
17064
|
const nodes = [];
|
|
@@ -16484,7 +17071,7 @@ function renderRichNotesSegments(segments) {
|
|
|
16484
17071
|
}
|
|
16485
17072
|
const divStyle = {};
|
|
16486
17073
|
if (para.indentLevel > 0) {
|
|
16487
|
-
divStyle.paddingLeft = para.indentLevel *
|
|
17074
|
+
divStyle.paddingLeft = para.indentLevel * INDENT_PX;
|
|
16488
17075
|
}
|
|
16489
17076
|
const children = [];
|
|
16490
17077
|
if (para.bulletType === "bullet") {
|
|
@@ -16588,10 +17175,10 @@ function NotesPrintDialog({
|
|
|
16588
17175
|
const paras = segmentsToParagraphs(segs);
|
|
16589
17176
|
doc.write(`<div class="slide-page">`);
|
|
16590
17177
|
doc.write(
|
|
16591
|
-
`<div class="slide-header">${
|
|
17178
|
+
`<div class="slide-header">${escapeHtml2(t("pptx.notes.slideN", { n: slide.slideNumber }))}</div>`
|
|
16592
17179
|
);
|
|
16593
17180
|
doc.write(
|
|
16594
|
-
`<div class="slide-thumb">${
|
|
17181
|
+
`<div class="slide-thumb">${escapeHtml2(t("pptx.notes.slideN", { n: slide.slideNumber }))}</div>`
|
|
16595
17182
|
);
|
|
16596
17183
|
doc.write(`<div class="notes-text">`);
|
|
16597
17184
|
let numCounter = 0;
|
|
@@ -16608,9 +17195,9 @@ function NotesPrintDialog({
|
|
|
16608
17195
|
} else if (para.bulletType === "numbered") {
|
|
16609
17196
|
prefix = `${numCounter}. `;
|
|
16610
17197
|
}
|
|
16611
|
-
const text = para.segments.filter((s) => !s.isParagraphBreak).map((s) =>
|
|
17198
|
+
const text = para.segments.filter((s) => !s.isParagraphBreak).map((s) => escapeHtml2(s.text)).join("");
|
|
16612
17199
|
doc.write(
|
|
16613
|
-
`<div class="para" style="padding-left:${indent}px">${
|
|
17200
|
+
`<div class="para" style="padding-left:${indent}px">${escapeHtml2(prefix)}${text}</div>`
|
|
16614
17201
|
);
|
|
16615
17202
|
}
|
|
16616
17203
|
doc.write(`</div></div>`);
|
|
@@ -35411,7 +35998,7 @@ ${url}`)) {
|
|
|
35411
35998
|
var AiChatPanel = lazy(async () => {
|
|
35412
35999
|
const [{ useChat }, { default: Panel }] = await Promise.all([
|
|
35413
36000
|
import('@ai-sdk/react'),
|
|
35414
|
-
import('./AiChatPanel-
|
|
36001
|
+
import('./AiChatPanel-2YYL6AKX.mjs')
|
|
35415
36002
|
]);
|
|
35416
36003
|
function BoundAiChatPanel(props) {
|
|
35417
36004
|
return /* @__PURE__ */ jsx(Panel, { ...props, useChat });
|