@ggraphic/editor 0.1.0-alpha.2 → 0.1.0-alpha.3
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/LICENSE +661 -373
- package/NOTICE +2 -1
- package/README.md +1 -1
- package/dist/CanvasEditorProvider.js +1 -1
- package/dist/ai/applyOperation.js +1 -1
- package/dist/ai/describeCanvasElements.js +1 -1
- package/dist/ai/illustrationCapability.js +1 -1
- package/dist/blocks/liftedBlock.js +1 -1
- package/dist/brand/bindPick.js +1 -1
- package/dist/brand/brandRegistry.js +1 -1
- package/dist/collab/documentVersion.js +1 -1
- package/dist/collab/pageElementStateKeys.js +1 -1
- package/dist/collab/pagesDoc.js +1 -1
- package/dist/collab/useAwarenessState.js +1 -1
- package/dist/collab/useEmitHostStateChanges.js +1 -1
- package/dist/collab/useSelectionAwareness.js +1 -1
- package/dist/collab/useYjsCanvasBinding.js +1 -1
- package/dist/collab/useYjsPageStateSync.d.ts +1 -15
- package/dist/collab/useYjsPageStateSync.js +76 -6
- package/dist/collab/wrapCallbacksWithPageSync.js +1 -1
- package/dist/collab/ydocKeys.js +1 -1
- package/dist/collab/yjsBinding.js +1 -1
- package/dist/common/Lightbox.js +1 -1
- package/dist/components/AddPageButton.js +1 -1
- package/dist/components/CanvasAnnouncer.js +1 -1
- package/dist/components/CanvasContextMenu/CanvasActionSheet.js +1 -1
- package/dist/components/CanvasContextMenu/CanvasContextMenu.js +1 -1
- package/dist/components/CanvasContextMenu/canvasMenuModel.js +1 -1
- package/dist/components/CanvasEditor/CanvasEditorShell.js +3 -3
- package/dist/components/CanvasEditor/PageWrapper.js +1 -1
- package/dist/components/CanvasEditor/blockInsertContext.js +1 -1
- package/dist/components/CanvasEditor/editorShell.d.ts +8 -2
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +1 -1
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +1 -1
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +1 -1
- package/dist/components/CanvasEditor/hooks/usePageRefs.js +1 -1
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +1 -1
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +1 -1
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +1 -1
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +1 -1
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +1 -1
- package/dist/components/CanvasEditor/layersTab.js +1 -1
- package/dist/components/CanvasEditor/types.d.ts +2 -0
- package/dist/components/CanvasEditorSkeleton.js +2 -2
- package/dist/components/CanvasMetaBar.js +1 -1
- package/dist/components/CanvasRenderLayer.js +1 -1
- package/dist/components/CanvasTextOverlay.js +1 -1
- package/dist/components/ConfigCanvas.js +1 -1
- package/dist/components/CropGhostOverlay.js +1 -1
- package/dist/components/CustomColorSwatch.js +1 -1
- package/dist/components/GenericCanvas.d.ts +11 -0
- package/dist/components/GenericCanvas.js +65 -18
- package/dist/components/GenericCanvasElement.js +5 -3
- package/dist/components/MultiSelectionTransformer.js +1 -1
- package/dist/components/PagePreview.js +1 -1
- package/dist/components/PageThumbnailStrip.js +1 -1
- package/dist/components/PageToolbar.js +1 -1
- package/dist/components/PrintGuides.js +1 -1
- package/dist/components/RemoteSelectionOverlay.js +1 -1
- package/dist/components/RichTextField.js +1 -1
- package/dist/components/SelectionPill.js +1 -1
- package/dist/components/SlideNotesPanel.js +1 -1
- package/dist/components/SlotBudgetStatus.js +1 -1
- package/dist/components/StandaloneCanvas.js +1 -1
- package/dist/components/TextFormatControls.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/ToolbarStateBridge.js +1 -1
- package/dist/components/TopBar/AutoSaveIndicator.js +1 -1
- package/dist/components/TopBar/CropModeControls.js +1 -1
- package/dist/components/TopBar/DownloadSection.js +1 -1
- package/dist/components/TopBar/MobileSelectionControls.js +1 -1
- package/dist/components/TopBar/ShareDropdown.js +1 -1
- package/dist/components/TopBar/barTiles.js +1 -1
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +1 -1
- package/dist/components/TopBar/modules/FloatingBackgroundControls.js +1 -1
- package/dist/components/TopBar/modules/FloatingFontRoleControl.js +1 -1
- package/dist/components/TopBar/modules/FloatingFontSizeControl.js +1 -1
- package/dist/components/TopBar/modules/FloatingHistoryControls.js +1 -1
- package/dist/components/TopBar/modules/FloatingImageLookControl.js +1 -1
- package/dist/components/TopBar/modules/FloatingLayerControls.js +1 -1
- package/dist/components/TopBar/modules/FloatingOpacityControl.js +1 -1
- package/dist/components/TopBar/modules/FloatingPositionControl.js +1 -1
- package/dist/components/TopBar/modules/FloatingTextAlignControl.js +1 -1
- package/dist/components/TransformHud.js +1 -1
- package/dist/components/WholeTextFormatControls.js +1 -1
- package/dist/components/accentMark.js +1 -1
- package/dist/components/canvasItemLock.js +1 -1
- package/dist/components/kindRenderers.js +1 -1
- package/dist/components/markColor.js +1 -1
- package/dist/composer/cardFollowsText.js +1 -1
- package/dist/composer/marks.js +1 -1
- package/dist/composer/steckbriefLayout.js +1 -1
- package/dist/composer/textFit.js +1 -1
- package/dist/configs/buildCanvasText.js +1 -1
- package/dist/configs/buildSharepicText.js +1 -1
- package/dist/configs/configLoader.js +1 -1
- package/dist/configs/factory/actionFactories.d.ts +7 -3
- package/dist/configs/factory/actionFactories.js +28 -12
- package/dist/configs/factory/baseTypes.js +1 -1
- package/dist/configs/factory/carryInstanceState.js +1 -1
- package/dist/configs/factory/createTextElement.js +1 -1
- package/dist/configs/featureInjector.js +1 -1
- package/dist/configs/pageInheritance.d.ts +10 -1
- package/dist/configs/pageInheritance.js +38 -10
- package/dist/configs/placeholders.js +1 -1
- package/dist/configs/shareSection.js +1 -1
- package/dist/configs/types.d.ts +9 -1
- package/dist/configs/unifiedTabs.js +1 -1
- package/dist/embed/EmbeddedEditor.d.ts +2 -2
- package/dist/embed/EmbeddedEditor.js +2 -2
- package/dist/embed/GgraphicEditor.js +1 -1
- package/dist/embed/blankPage.d.ts +6 -0
- package/dist/embed/blankPage.js +7 -0
- package/dist/embed/index.d.ts +1 -0
- package/dist/embed/index.js +2 -1
- package/dist/entries/ai.js +1 -1
- package/dist/entries/brand.js +1 -1
- package/dist/entries/canvas.js +1 -1
- package/dist/entries/collab.js +1 -1
- package/dist/entries/config.d.ts +1 -1
- package/dist/entries/elements.js +1 -1
- package/dist/entries/embed.d.ts +1 -1
- package/dist/entries/embed.js +2 -2
- package/dist/entries/export.js +1 -1
- package/dist/entries/host.d.ts +2 -1
- package/dist/entries/host.js +2 -1
- package/dist/entries/hostReact.js +1 -1
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/illustrations/gophers.js +1 -1
- package/dist/entries/illustrations/humaaans.js +1 -1
- package/dist/entries/illustrations/illlustrations.js +1 -1
- package/dist/entries/illustrations/kawaii.js +1 -1
- package/dist/entries/illustrations/opendoodles.js +1 -1
- package/dist/entries/illustrations/openpeeps.js +1 -1
- package/dist/entries/illustrations/transhumans.js +1 -1
- package/dist/entries/kinds.js +1 -1
- package/dist/entries/page.js +1 -1
- package/dist/entries/shell.d.ts +1 -0
- package/dist/entries/shell.js +1 -1
- package/dist/entries/sidebar.js +1 -1
- package/dist/entries/store.js +1 -1
- package/dist/entries/templates.d.ts +1 -1
- package/dist/entries/templates.js +2 -2
- package/dist/entries/text.js +1 -1
- package/dist/export/pptx/buildPptxModel.js +1 -1
- package/dist/export/pptx/exportPptxDeck.js +1 -1
- package/dist/export/pptx/pptxFonts.js +1 -1
- package/dist/export/pptx/pptxUnits.js +1 -1
- package/dist/export/pptx/types.js +1 -1
- package/dist/export/pptx/writePptx.js +1 -1
- package/dist/export/pptx/writeText.js +1 -1
- package/dist/export/printExport.js +1 -1
- package/dist/export/printPdf.js +1 -1
- package/dist/export/slidesPdf.js +1 -1
- package/dist/formats/index.d.ts +2 -0
- package/dist/formats/index.js +1 -1
- package/dist/groups/pageGroups.js +1 -1
- package/dist/hooks/editorBox.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/stageFit.js +1 -1
- package/dist/hooks/useAiImageGeneration.js +1 -1
- package/dist/hooks/useAnnounce.js +1 -1
- package/dist/hooks/useBoxSnap.js +1 -1
- package/dist/hooks/useCanvasAutoSave.js +1 -1
- package/dist/hooks/useCanvasElementHandlers.js +1 -1
- package/dist/hooks/useCanvasHistorySetup.d.ts +2 -0
- package/dist/hooks/useCanvasHistorySetup.js +3 -2
- package/dist/hooks/useCanvasInteractions.js +1 -1
- package/dist/hooks/useCanvasKeyboardHandlers.js +1 -1
- package/dist/hooks/useCanvasStoreReset.js +1 -1
- package/dist/hooks/useCanvasUndoRedo.d.ts +2 -0
- package/dist/hooks/useCanvasUndoRedo.js +5 -1
- package/dist/hooks/useContextPress.js +1 -1
- package/dist/hooks/useCropSession.js +1 -1
- package/dist/hooks/useDebounce.js +1 -1
- package/dist/hooks/useDeckAutoSave.js +1 -1
- package/dist/hooks/useDeepSelect.js +1 -1
- package/dist/hooks/useElementSnapping.js +1 -1
- package/dist/hooks/useEmojiCatalog.js +1 -1
- package/dist/hooks/useFloatingModuleState.js +1 -1
- package/dist/hooks/useFontGeneration.js +1 -1
- package/dist/hooks/useFontLoader.js +1 -1
- package/dist/hooks/useGeometryReporter.js +1 -1
- package/dist/hooks/useHoverOutline.js +1 -1
- package/dist/hooks/useIconCatalog.js +1 -1
- package/dist/hooks/useIconSearch.js +1 -1
- package/dist/hooks/useIconSetsFor.js +1 -1
- package/dist/hooks/useImageCoverFit.js +1 -1
- package/dist/hooks/useIsCanvasMobile.js +1 -1
- package/dist/hooks/useMarqueeSelection.js +1 -1
- package/dist/hooks/useMobileSheet.js +1 -1
- package/dist/hooks/useMultiPageExport.js +1 -1
- package/dist/hooks/usePageManager.d.ts +2 -1
- package/dist/hooks/usePageManager.js +7 -5
- package/dist/hooks/usePageThumbnails.js +1 -1
- package/dist/hooks/usePaginatedIcons.js +1 -1
- package/dist/hooks/useRovingToolbar.js +1 -1
- package/dist/hooks/useSelectionAnnouncement.js +1 -1
- package/dist/hooks/useSnapScheduler.js +1 -1
- package/dist/hooks/useTrackUnsplashDownload.js +1 -1
- package/dist/hooks/useZoomGestures.js +1 -1
- package/dist/hostServices.js +1 -1
- package/dist/i18n/catalogue.js +1 -1
- package/dist/i18n/de.js +1 -1
- package/dist/i18n/messages.js +1 -1
- package/dist/layouts/CanvasEditorLayout.js +2 -2
- package/dist/layouts/index.js +1 -1
- package/dist/page/actions.js +1 -1
- package/dist/page/config.js +1 -1
- package/dist/page/fitting.js +1 -1
- package/dist/page/hug.js +1 -1
- package/dist/page/instantiate.js +1 -1
- package/dist/page/logoSize.js +1 -1
- package/dist/page/templatePack.js +1 -1
- package/dist/primitives/AssetPrimitive.js +8 -6
- package/dist/primitives/CanvasBackground.js +1 -1
- package/dist/primitives/CanvasIcons.js +1 -1
- package/dist/primitives/CanvasImage.js +1 -1
- package/dist/primitives/CanvasRichText.js +1 -1
- package/dist/primitives/CanvasStage.js +1 -1
- package/dist/primitives/CanvasText.js +1 -1
- package/dist/primitives/ChartPrimitive.js +1 -1
- package/dist/primitives/FramePrimitive.js +1 -1
- package/dist/primitives/IconPrimitive.js +1 -1
- package/dist/primitives/IllustrationPrimitive.js +1 -1
- package/dist/primitives/PillBadge.js +2 -2
- package/dist/primitives/ShapePrimitive.js +1 -1
- package/dist/primitives/SnapGuidelines.js +1 -1
- package/dist/primitives/UserImagePrimitive.js +13 -7
- package/dist/primitives/index.js +1 -1
- package/dist/sidebar/SidebarPanel.js +1 -1
- package/dist/sidebar/SidebarTabBar.js +1 -1
- package/dist/sidebar/SubsectionTabBar.js +1 -1
- package/dist/sidebar/UserUploadsProvider.js +1 -1
- package/dist/sidebar/components/AltTextField.js +1 -1
- package/dist/sidebar/components/SidebarHint.js +1 -1
- package/dist/sidebar/components/SidebarSlider.js +1 -1
- package/dist/sidebar/components/TextFieldPrimitives.js +1 -1
- package/dist/sidebar/coreSidebarParts.js +1 -1
- package/dist/sidebar/sections/AssetGallery.js +1 -1
- package/dist/sidebar/sections/ChartSettingsSection.js +1 -1
- package/dist/sidebar/sections/ChartsSection.js +1 -1
- package/dist/sidebar/sections/CombinedTextSection.js +1 -1
- package/dist/sidebar/sections/DiagrammeSection.js +1 -1
- package/dist/sidebar/sections/FormenSection.js +1 -1
- package/dist/sidebar/sections/FrameSettingsSection.js +1 -1
- package/dist/sidebar/sections/FramesSection.js +1 -1
- package/dist/sidebar/sections/GenericShareSection.js +1 -1
- package/dist/sidebar/sections/IconsSection.js +1 -1
- package/dist/sidebar/sections/IllustrationSettings.js +1 -1
- package/dist/sidebar/sections/IllustrationThumb.js +1 -1
- package/dist/sidebar/sections/ImageAdjustSection.js +1 -1
- package/dist/sidebar/sections/LayersSection.js +1 -1
- package/dist/sidebar/sections/RahmenSection.js +1 -1
- package/dist/sidebar/sections/ShapesSection.js +1 -1
- package/dist/sidebar/sections/StudioGallery.js +1 -1
- package/dist/sidebar/sections/UploadsSection.js +1 -1
- package/dist/sidebar/sections/assets/AssetsSection.js +1 -1
- package/dist/sidebar/sections/assets/BackgroundCatalog.js +1 -1
- package/dist/sidebar/sections/assets/CategoryCard.js +1 -1
- package/dist/sidebar/sections/assets/ElementGrid.js +1 -1
- package/dist/sidebar/sections/assets/ElementThumb.js +1 -1
- package/dist/sidebar/sections/assets/ElementTile.js +1 -1
- package/dist/sidebar/sections/assets/ElementsPanel.js +1 -1
- package/dist/sidebar/sections/assets/EmojiTonePicker.js +1 -1
- package/dist/sidebar/sections/assets/FotosCatalog.js +1 -1
- package/dist/sidebar/sections/assets/IconifyCatalog.js +1 -1
- package/dist/sidebar/sections/assets/RecentCarousel.js +1 -1
- package/dist/sidebar/sections/assets/StickerCatalog.js +1 -1
- package/dist/sidebar/sections/assets/constants.js +1 -1
- package/dist/sidebar/sections/assets/elementSearch.js +1 -1
- package/dist/sidebar/sections/assets/elementTypes.js +1 -1
- package/dist/sidebar/sections/assets/index.js +1 -1
- package/dist/sidebar/sections/assets/useRecentElements.js +1 -1
- package/dist/sidebar/sections/assets/useStockPhotos.js +1 -1
- package/dist/sidebar/sections/effects/EffectCard.js +1 -1
- package/dist/sidebar/sections/effects/GradientSettings.js +1 -1
- package/dist/sidebar/sections/effects/OutlineSettings.js +1 -1
- package/dist/sidebar/sections/effects/ShadowSettings.js +1 -1
- package/dist/sidebar/sections/effects/effectsFor.js +1 -1
- package/dist/sidebar/sections/index.js +1 -1
- package/dist/sidebar/sections/lazyWithPreload.js +1 -1
- package/dist/sidebar/sections/registerBundledIconSets.js +1 -1
- package/dist/sidebar/sections/tools/AiCreateTool.js +1 -1
- package/dist/sidebar/sections/tools/AiEditTool.js +1 -1
- package/dist/sidebar/sections/tools/AltTextTool.js +1 -1
- package/dist/sidebar/sections/tools/ImageInputPicker.js +1 -1
- package/dist/sidebar/sections/tools/QRCodeTool.js +1 -1
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +1 -1
- package/dist/sidebar/sections/tools/ToolPanel.js +1 -1
- package/dist/sidebar/sections/tools/ToolTiles.js +1 -1
- package/dist/sidebar/sections/tools/ToolsSection.js +1 -1
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +1 -1
- package/dist/sidebar/sections/tools/UnsplashTool.js +1 -1
- package/dist/sidebar/sections/tools/index.js +1 -1
- package/dist/sidebar/sections/tools/toolTiles.css +1 -1
- package/dist/sidebar/sections/tools/useToolImagePlacement.js +1 -1
- package/dist/sidebar/sections/usePreloadSections.js +1 -1
- package/dist/sidebar/sections/whenIdle.js +1 -1
- package/dist/sidebar/sidebarStyles.js +1 -1
- package/dist/sidebar/useImagePlacement.js +1 -1
- package/dist/stores/AutoSaveStoreProvider.js +1 -1
- package/dist/stores/CanvasStoreProvider.js +1 -1
- package/dist/stores/createAutoSaveStore.js +1 -1
- package/dist/stores/createCanvasEditorStore.d.ts +11 -0
- package/dist/stores/createCanvasEditorStore.js +47 -1
- package/dist/stores/useAutoSaveStore.js +1 -1
- package/dist/styles/compiled.css +2 -2
- package/dist/styles/editor.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/tailwind.css +1 -1
- package/dist/styles/tokens.css +1 -1
- package/dist/templates/fontWidths.generated.js +1 -1
- package/dist/templates/registry.js +1 -1
- package/dist/templates/templateGeometry.js +1 -1
- package/dist/templates/testKinds.js +1 -1
- package/dist/testing/documentBrandPacks.js +1 -1
- package/dist/testing/fixtureTemplates.js +1 -1
- package/dist/testing/stampKind.js +1 -1
- package/dist/types/editorTypes.js +1 -1
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/editorScope.js +1 -1
- package/dist/ui/icon-button.js +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/masonry-grid.js +1 -1
- package/dist/ui/popover.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/utils/alignment.js +1 -1
- package/dist/utils/axisLock.js +1 -1
- package/dist/utils/backgroundPhotoCrop.js +1 -1
- package/dist/utils/canvasAssets.js +1 -1
- package/dist/utils/canvasClipboard.js +1 -1
- package/dist/utils/canvasCommandRegistry.js +1 -1
- package/dist/utils/canvasCommands.js +1 -1
- package/dist/utils/canvasFontFamilies.js +1 -1
- package/dist/utils/canvasIcons.js +1 -1
- package/dist/utils/canvasLayerManager.d.ts +4 -0
- package/dist/utils/canvasLayerManager.js +12 -7
- package/dist/utils/captureStage.js +1 -1
- package/dist/utils/chartTypes.js +1 -1
- package/dist/utils/chartUtils.js +1 -1
- package/dist/utils/circleBadgeUtils.js +1 -1
- package/dist/utils/cn.js +1 -1
- package/dist/utils/collectAltTextPages.js +1 -1
- package/dist/utils/colorLuminance.js +1 -1
- package/dist/utils/coverFit.js +1 -1
- package/dist/utils/cropAspect.js +1 -1
- package/dist/utils/cropGhost.js +1 -1
- package/dist/utils/cropSession.js +1 -1
- package/dist/utils/cropTarget.js +1 -1
- package/dist/utils/deepSelect.js +1 -1
- package/dist/utils/downloadError.js +1 -1
- package/dist/utils/duplicateElement.js +1 -1
- package/dist/utils/editorFocus.js +1 -1
- package/dist/utils/elementKinds.js +1 -1
- package/dist/utils/emoji/emojiCatalog.js +1 -1
- package/dist/utils/ensureFontsReady.d.ts +8 -2
- package/dist/utils/ensureFontsReady.js +20 -10
- package/dist/utils/expandImage.js +1 -1
- package/dist/utils/externalIcons.js +1 -1
- package/dist/utils/filterCache.js +1 -1
- package/dist/utils/filterUtils.js +1 -1
- package/dist/utils/fontAliases.js +1 -1
- package/dist/utils/fontGeneration.js +1 -1
- package/dist/utils/fontMarkSupport.js +1 -1
- package/dist/utils/fontSpecs.js +1 -1
- package/dist/utils/gradientFill.js +1 -1
- package/dist/utils/gradientHitArea.js +1 -1
- package/dist/utils/grain.js +1 -1
- package/dist/utils/grainSpec.js +1 -1
- package/dist/utils/groupSnap.js +1 -1
- package/dist/utils/handDrawn.js +1 -1
- package/dist/utils/historyStamp.js +1 -1
- package/dist/utils/hostStorageKeys.js +1 -1
- package/dist/utils/iconInstances.js +1 -1
- package/dist/utils/illustrations/gophers.js +1 -1
- package/dist/utils/illustrations/humaaans.js +1 -1
- package/dist/utils/illustrations/illlustrations.js +1 -1
- package/dist/utils/illustrations/kawaii.js +1 -1
- package/dist/utils/illustrations/opendoodles.js +1 -1
- package/dist/utils/illustrations/openpeeps.js +1 -1
- package/dist/utils/illustrations/prefetchAnalytics.js +1 -1
- package/dist/utils/illustrations/registry.js +1 -1
- package/dist/utils/illustrations/svgCache.js +1 -1
- package/dist/utils/illustrations/transhumans.js +1 -1
- package/dist/utils/illustrations/types.js +1 -1
- package/dist/utils/imageElementComparison.js +1 -1
- package/dist/utils/imageFilters.js +1 -1
- package/dist/utils/imageLook.js +1 -1
- package/dist/utils/keyboardCrop.js +1 -1
- package/dist/utils/keyboardOwnership.js +1 -1
- package/dist/utils/layerLabels.js +1 -1
- package/dist/utils/layerLock.js +1 -1
- package/dist/utils/layerSelection.js +1 -1
- package/dist/utils/mediaDrop.js +1 -1
- package/dist/utils/mediaPlacement.js +1 -1
- package/dist/utils/motifSizes.js +1 -1
- package/dist/utils/multiSelect.js +1 -1
- package/dist/utils/notch.js +1 -1
- package/dist/utils/orientElement.js +1 -1
- package/dist/utils/orientation.js +1 -1
- package/dist/utils/pageCounter.js +1 -1
- package/dist/utils/pendingImages.d.ts +17 -4
- package/dist/utils/pendingImages.js +18 -14
- package/dist/utils/photoCredit.js +1 -1
- package/dist/utils/photoPlaceholder.js +1 -1
- package/dist/utils/pillBadgeUtils.js +1 -1
- package/dist/utils/plainTextLayout.js +1 -1
- package/dist/utils/rebaseHistoryState.d.ts +71 -0
- package/dist/utils/rebaseHistoryState.js +208 -0
- package/dist/utils/removeElement.js +1 -1
- package/dist/utils/renderedBoxes.js +1 -1
- package/dist/utils/resolveElementValue.js +1 -1
- package/dist/utils/scrollBehavior.js +1 -1
- package/dist/utils/searchTranslations.js +1 -1
- package/dist/utils/selectionCapabilities.js +1 -1
- package/dist/utils/shade.js +1 -1
- package/dist/utils/shapeTransform.js +1 -1
- package/dist/utils/smartCrop.js +1 -1
- package/dist/utils/snapping.js +1 -1
- package/dist/utils/stateTypeAssertions.js +1 -1
- package/dist/utils/straighten.js +1 -1
- package/dist/utils/surfaceGlow.js +1 -1
- package/dist/utils/templateElementInstance.js +1 -1
- package/dist/utils/templateRotation.js +1 -1
- package/dist/utils/textAlign.js +1 -1
- package/dist/utils/textEditorOpeners.js +1 -1
- package/dist/utils/textRouting.js +1 -1
- package/dist/utils/transformHudLabel.js +1 -1
- package/dist/utils/unsplashLinks.js +1 -1
- package/dist/utils/userImageCrop.js +1 -1
- package/dist/utils/viewport.js +1 -1
- package/dist/utils/zipPageImages.js +1 -1
- package/package.json +4 -4
- package/skills/ggraphic-embed/SKILL.md +13 -13
package/dist/export/printPdf.js
CHANGED
package/dist/export/slidesPdf.js
CHANGED
package/dist/formats/index.d.ts
CHANGED
|
@@ -31,7 +31,9 @@ export interface CanvasPrintSpec {
|
|
|
31
31
|
export type PrintImprintPlacement = 'every-page' | 'first-page' | 'last-page';
|
|
32
32
|
export interface CanvasFormat {
|
|
33
33
|
id: string;
|
|
34
|
+
/** The name in the format's original language; show `formatLabel(format)`, which follows the catalogue. */
|
|
34
35
|
label: string;
|
|
36
|
+
/** The size line in the original language; show `formatDescription(format)`. */
|
|
35
37
|
description: string;
|
|
36
38
|
group: CanvasFormatGroup;
|
|
37
39
|
category: CanvasFormatCategory;
|
package/dist/formats/index.js
CHANGED
package/dist/hooks/editorBox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
3
|
import { createContext, useCallback, useContext, useMemo, useState, useSyncExternalStore, } from 'react';
|
|
4
4
|
const EditorBoxContext = createContext(null);
|
|
5
5
|
/**
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
export { useElementSnapping } from './useElementSnapping.js';
|
|
3
3
|
export { useCanvasUndoRedo } from './useCanvasUndoRedo.js';
|
|
4
4
|
export { useCanvasInteractions } from './useCanvasInteractions.js';
|
package/dist/hooks/stageFit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { createContext, useContext, useEffect, useState } from 'react';
|
|
3
3
|
const StageFitContext = createContext(null);
|
|
4
4
|
/** Set by the editor shell; the pages inside fit their stage to it. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
3
|
const noop = () => { };
|
|
4
4
|
/** Ohne Editor-Wurzel (Einzeltests, Standalone-Canvas) sagt `announce` nichts an. */
|
package/dist/hooks/useBoxSnap.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useCallback } from 'react';
|
|
3
3
|
import { useAutoSaveStore, useAutoSaveStoreApi } from '../stores/useAutoSaveStore.js';
|
|
4
4
|
import { useCanvasEditorServices } from '../CanvasEditorProvider.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { resolveValue } from '../utils/canvasValueResolver.js';
|
|
4
4
|
import { isTemplateElementRotatable, templatePositionUpdates, withTemplateRotation, } from '../utils/templateRotation.js';
|
|
@@ -16,6 +16,8 @@ export interface UseCanvasHistorySetupResult<T extends Record<string, unknown>>
|
|
|
16
16
|
checkpoint: () => void;
|
|
17
17
|
/** Writes pending saves, so the history's newest entry is the newest edit. */
|
|
18
18
|
flushPendingSaves: () => void;
|
|
19
|
+
/** Replaces a string value in every history entry, without a step of its own. */
|
|
20
|
+
replaceInHistory: (from: string, to: string) => void;
|
|
19
21
|
undo: () => void;
|
|
20
22
|
redo: () => void;
|
|
21
23
|
canUndo: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* useCanvasHistorySetup - Extended undo/redo setup with refs pattern
|
|
4
4
|
* Wraps useCanvasUndoRedo and adds:
|
|
@@ -27,7 +27,7 @@ export function useCanvasHistorySetup(collectState, handleRestore, debounceMs =
|
|
|
27
27
|
collectStateRef.current = collectState;
|
|
28
28
|
const readState = useCallback(() => collectStateRef.current(), []);
|
|
29
29
|
// Every save snapshots the committed state; the argument is ignored.
|
|
30
|
-
const { saveToHistory: saveCommitted, debouncedSaveToHistory: saveDebounced, saveNow, commitPendingSave, flushPendingSaves, undo, redo, canUndo, canRedo, } = useCanvasUndoRedo(debounceMs, handleRestore, shortcutsEnabled, readState);
|
|
30
|
+
const { saveToHistory: saveCommitted, debouncedSaveToHistory: saveDebounced, saveNow, commitPendingSave, flushPendingSaves, replaceInHistory, undo, redo, canUndo, canRedo, } = useCanvasUndoRedo(debounceMs, handleRestore, shortcutsEnabled, readState);
|
|
31
31
|
// While a batch runs, saves only mark it dirty, and the one entry is taken
|
|
32
32
|
// from the committed state after the batch.
|
|
33
33
|
// A depth counter, so a nested batch does not end the outer one.
|
|
@@ -105,6 +105,7 @@ export function useCanvasHistorySetup(collectState, handleRestore, debounceMs =
|
|
|
105
105
|
runHistoryBatch,
|
|
106
106
|
checkpoint,
|
|
107
107
|
flushPendingSaves,
|
|
108
|
+
replaceInHistory,
|
|
108
109
|
undo,
|
|
109
110
|
redo,
|
|
110
111
|
canUndo,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
import { commandForKey } from '../utils/canvasCommandRegistry.js';
|
|
4
4
|
import { isPageFocusTarget, returnFocusToPage } from '../utils/editorFocus.js';
|
|
@@ -11,6 +11,8 @@ interface UseCanvasUndoRedoReturn<TComponentState extends Record<string, unknown
|
|
|
11
11
|
commitPendingSave: () => void;
|
|
12
12
|
/** Writes pending (immediate and debounced) saves, as Undo does before it steps back. */
|
|
13
13
|
flushPendingSaves: () => void;
|
|
14
|
+
/** Replaces a string value in every history entry (the store's `replaceInHistory`). */
|
|
15
|
+
replaceInHistory: (from: string, to: string) => void;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Hook for canvas undo/redo functionality
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useEffect, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
4
|
import { useStore } from 'zustand';
|
|
@@ -199,6 +199,9 @@ export function useCanvasUndoRedo(debounceMs = 250, onRestore, shortcutsEnabled
|
|
|
199
199
|
pendingComponentStateRef.current = undefined;
|
|
200
200
|
}, debounceMs);
|
|
201
201
|
}, [debounceMs]);
|
|
202
|
+
const replaceInHistory = useCallback((from, to) => {
|
|
203
|
+
getStore().replaceInHistory(from, to);
|
|
204
|
+
}, []);
|
|
202
205
|
return {
|
|
203
206
|
undo,
|
|
204
207
|
redo,
|
|
@@ -209,5 +212,6 @@ export function useCanvasUndoRedo(debounceMs = 250, onRestore, shortcutsEnabled
|
|
|
209
212
|
saveNow,
|
|
210
213
|
commitPendingSave,
|
|
211
214
|
flushPendingSaves,
|
|
215
|
+
replaceInHistory,
|
|
212
216
|
};
|
|
213
217
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { useCanvasStore } from '../stores/CanvasStoreProvider.js';
|
|
4
4
|
import { restoreCropSnapshot, takeCropSnapshot } from '../utils/cropSession.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { loadEmojiCatalog } from '../utils/emoji/emojiCatalog.js';
|
|
4
4
|
/** The full emoji catalogue, loaded once someone browses or searches emoji. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { loadIconSetCatalog, getIconSetCatalogSync, loadAllIcons, DEFAULT_ICON_SET, } from '../utils/canvasIcons.js';
|
|
4
4
|
export const ICON_CATALOG_QUERY_KEY = ['canvas', 'icons', 'catalog'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { iconSetsLoaded, loadIconSetsFor } from '../utils/canvasIcons.js';
|
|
4
4
|
import { registerStoredExternalIcons } from '../utils/externalIcons.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { useCanvasStore } from '../stores/CanvasStoreProvider.js';
|
|
4
4
|
import { canStartMarquee, itemsInRect, SELECTION_COLOR, syncOutlines, } from '../utils/multiSelect.js';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type DocumentRefusal } from '@ggraphic/schema';
|
|
15
15
|
import * as Y from 'yjs';
|
|
16
|
+
import { type PageInheritance } from '../configs/pageInheritance.js';
|
|
16
17
|
import { type TemplateId } from '../templates/registry.js';
|
|
17
18
|
import { type YjsPagesApi } from '../collab/useYjsPages.js';
|
|
18
19
|
import type { HeterogeneousPage, FullCanvasConfig } from '../configs/types.js';
|
|
@@ -84,7 +85,7 @@ export interface UsePageManagerReturn<TId extends string = TemplateId> {
|
|
|
84
85
|
currentPageIndex: number;
|
|
85
86
|
setCurrentPageIndex: (index: number) => void;
|
|
86
87
|
currentPage: HeterogeneousPage<TId> | undefined;
|
|
87
|
-
addPage: (configId: TId,
|
|
88
|
+
addPage: (configId: TId, inherit?: boolean | PageInheritance, stateOverrides?: Record<string, unknown>) => Promise<void>;
|
|
88
89
|
duplicateCurrentPage: () => void;
|
|
89
90
|
duplicatePage: (id: string) => void;
|
|
90
91
|
movePage: (id: string, direction: 'up' | 'down') => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* usePageManager - Hook for multi-page canvas management
|
|
4
4
|
*
|
|
@@ -237,9 +237,10 @@ export function usePageManager({ initialConfigId, formatId, initialProps, maxPag
|
|
|
237
237
|
/**
|
|
238
238
|
* Add a new page with a specific template
|
|
239
239
|
* @param configId - The template type for the new page
|
|
240
|
-
* @param
|
|
240
|
+
* @param inherit - What the new page takes from the current one: `true` its
|
|
241
|
+
* background and brand, `false` nothing, or each part on its own.
|
|
241
242
|
*/
|
|
242
|
-
const addPage = useCallback(async (configId,
|
|
243
|
+
const addPage = useCallback(async (configId, inherit = true, stateOverrides) => {
|
|
243
244
|
if (!canAddMore || !yjsPages)
|
|
244
245
|
return;
|
|
245
246
|
const config = await getConfigForPage(configId);
|
|
@@ -248,8 +249,9 @@ export function usePageManager({ initialConfigId, formatId, initialProps, maxPag
|
|
|
248
249
|
// while the config chunk loaded.
|
|
249
250
|
const liveViews = readPages(ydoc);
|
|
250
251
|
const sourcePage = liveViews.find((p) => p.id === currentPageId) ?? liveViews[liveViews.length - 1];
|
|
251
|
-
const
|
|
252
|
-
|
|
252
|
+
const parts = typeof inherit === 'boolean' ? { brand: inherit, background: inherit } : inherit;
|
|
253
|
+
const inherited = sourcePage
|
|
254
|
+
? extractInheritablePageState(sourcePage.state, configId, parts)
|
|
253
255
|
: {};
|
|
254
256
|
const newPageState = config.createInitialState({
|
|
255
257
|
...(config.multiPage?.defaultNewPageState || {}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
const DEFAULT_ITEM_SELECTOR = 'button:not(:disabled)';
|
|
4
4
|
/** Knöpfe plus die Eingaben einer Leiste (Regler, Zahlenfeld, Auswahl). */
|
package/dist/hostServices.js
CHANGED
package/dist/i18n/catalogue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* The message catalogue without React: the register and `messages()`. Data modules (formats,
|
|
4
4
|
* factories, chart and placeholder texts) read texts from here, so the entries built from them load
|
package/dist/i18n/de.js
CHANGED
package/dist/i18n/messages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
3
|
import { useEditorBoxRef } from '../hooks/editorBox.js';
|
|
4
4
|
import { useIsCanvasMobile } from '../hooks/useIsCanvasMobile.js';
|
|
5
5
|
import { useMessages } from '../i18n/messages.js';
|
|
@@ -45,7 +45,7 @@ export function CanvasEditorLayout({ children, actions, sidebar, tabBar, mobileS
|
|
|
45
45
|
return;
|
|
46
46
|
returnFocusToPage(e.currentTarget, () => !button.isConnected);
|
|
47
47
|
}, []);
|
|
48
|
-
return (_jsxs("div", { ref: measureBox, "data-canvas-mobile": isMobile ? '' : undefined, onClickCapture: handleClickCapture, className: "canvas-editor-layout relative flex flex-col h-[var(--editor-height)] min-h-[500px] bg-[var(--editor-bg)]", children: [toolbar, hasSidebar && (_jsx("div", { className: "canvas-sidebar absolute left-0 top-[var(--editor-topbar-height)] bottom-0 z-[120] max-canvas-mobile:static max-canvas-mobile:contents", style: SIDEBAR_FONT_SIZES, children: tabBar })), hasPanel && (_jsx("div", { className: "max-canvas-mobile:contents", style: SIDEBAR_FONT_SIZES, children: sidebar })), _jsxs("div", { "data-sheet-open": mobileSheetOpen || undefined, onPointerDown: onCanvasBackdropPointerDown
|
|
48
|
+
return (_jsxs("div", { ref: measureBox, "data-canvas-mobile": isMobile ? '' : undefined, onClickCapture: handleClickCapture, className: "canvas-editor-layout relative flex flex-col h-[var(--editor-height,100dvh)] min-h-[500px] bg-[var(--editor-bg)]", children: [toolbar, hasSidebar && (_jsx("div", { className: "canvas-sidebar absolute left-0 top-[var(--editor-topbar-height)] bottom-0 z-[120] max-canvas-mobile:static max-canvas-mobile:contents", style: SIDEBAR_FONT_SIZES, children: tabBar })), hasPanel && (_jsx("div", { className: "max-canvas-mobile:contents", style: SIDEBAR_FONT_SIZES, children: sidebar })), _jsxs("div", { "data-sheet-open": mobileSheetOpen || undefined, onPointerDown: onCanvasBackdropPointerDown
|
|
49
49
|
? (e) => {
|
|
50
50
|
const target = e.target;
|
|
51
51
|
if (target === e.currentTarget ||
|
package/dist/layouts/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
export { CanvasEditorLayout, SIDEBAR_FONT_SIZES } from './CanvasEditorLayout.js';
|
package/dist/page/actions.js
CHANGED
package/dist/page/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* The one page config for templates as data: a colour ground and the editor's free elements, with
|
|
4
4
|
* the Text, Elements, Uploads and Tools tabs. Templates differ only in what a fresh page starts
|
package/dist/page/fitting.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* Text sizes fitted to the brand's fonts, up to the prototype's size (`maxFontSize`). The fit
|
|
4
4
|
* itself is the gate adapter's (`TEMPLATE_GATE_ADAPTER.fitText`, the width tables the gate
|
package/dist/page/hug.js
CHANGED
package/dist/page/instantiate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/** Places a template on a page: the one door from template data to page state. */
|
|
3
3
|
import { instantiateTemplatePage, } from '@ggraphic/core';
|
|
4
4
|
import { activeBrand } from '../brand/brandRegistry.js';
|
package/dist/page/logoSize.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
2
|
/**
|
|
3
3
|
* Templates as data: template files (the `@ggraphic/schema` format) become editor templates.
|
|
4
4
|
* Every template is a free page (`createPageConfig`) seeded with its file, so a host registers its
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
3
|
import { useState, useEffect, useRef, useCallback, memo } from 'react';
|
|
4
4
|
import { Image, Group, Rect, Transformer } from 'react-konva';
|
|
5
5
|
import { activeBrand } from '../brand/brandRegistry.js';
|
|
@@ -8,7 +8,7 @@ import { useGeometryReporter } from '../hooks/useGeometryReporter.js';
|
|
|
8
8
|
import { useSnapScheduler } from '../hooks/useSnapScheduler.js';
|
|
9
9
|
import { isGroupDrag } from '../utils/multiSelect.js';
|
|
10
10
|
import { ELEMENT_TRANSFORMER, signedScale } from '../utils/orientation.js';
|
|
11
|
-
import { useTrackPendingImage } from '../utils/pendingImages.js';
|
|
11
|
+
import { useImageRetry, useTrackPendingImage } from '../utils/pendingImages.js';
|
|
12
12
|
import { applyPixelHitArea } from '../utils/pixelHitArea.js';
|
|
13
13
|
import { boxFrame, createBoxFrame, frameBounds, snapByBounds } from '../utils/snapping.js';
|
|
14
14
|
import { ASSET_TARGET_SIZE, isStickerLikeInstance, resolveAssetInstanceSrc, } from '../utils/canvasAssets.js';
|
|
@@ -25,6 +25,8 @@ function AssetPrimitiveInner({ asset, isSelected, onSelect, onDragEnd, onTransfo
|
|
|
25
25
|
const src = resolveAssetInstanceSrc(asset);
|
|
26
26
|
const stickerLike = isStickerLikeInstance(asset);
|
|
27
27
|
const [settled, setSettled] = useState(null);
|
|
28
|
+
// A retry (`retryFailedImages`) loads the same source again.
|
|
29
|
+
const retry = useImageRetry(asset.id);
|
|
28
30
|
useEffect(() => {
|
|
29
31
|
if (!src)
|
|
30
32
|
return;
|
|
@@ -34,17 +36,17 @@ function AssetPrimitiveInner({ asset, isSelected, onSelect, onDragEnd, onTransfo
|
|
|
34
36
|
img.onload = () => {
|
|
35
37
|
setImage(img);
|
|
36
38
|
setImageSize({ width: img.naturalWidth, height: img.naturalHeight });
|
|
37
|
-
setSettled({ src, ok: true });
|
|
39
|
+
setSettled({ src, retry, ok: true });
|
|
38
40
|
};
|
|
39
|
-
img.onerror = () => setSettled({ src, ok: false });
|
|
41
|
+
img.onerror = () => setSettled({ src, retry, ok: false });
|
|
40
42
|
return () => {
|
|
41
43
|
img.onload = null;
|
|
42
44
|
img.onerror = null;
|
|
43
45
|
};
|
|
44
|
-
}, [src]);
|
|
46
|
+
}, [src, retry]);
|
|
45
47
|
// Logos and stickers are assets too: the chat preview must not capture
|
|
46
48
|
// before they have arrived (#4834).
|
|
47
|
-
useTrackPendingImage(asset.id, src ?? '', settled?.src !== src ? 'loading' : settled.ok ? 'loaded' : 'failed');
|
|
49
|
+
useTrackPendingImage(asset.id, src ?? '', settled?.src !== src || settled.retry !== retry ? 'loading' : settled.ok ? 'loaded' : 'failed');
|
|
48
50
|
// Attach transformer when selected
|
|
49
51
|
useEffect(() => {
|
|
50
52
|
if (isSelected && transformerRef.current && groupRef.current) {
|