@ggraphic/editor 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/NOTICE +2 -0
- package/README.md +8 -2
- package/THIRD_PARTY_NOTICES +7 -0
- package/dist/CanvasEditorProvider.d.ts +214 -0
- package/dist/CanvasEditorProvider.js +10 -0
- package/dist/ai/applyOperation.d.ts +75 -0
- package/dist/ai/applyOperation.js +354 -0
- package/dist/ai/describeCanvasElements.d.ts +17 -0
- package/dist/ai/describeCanvasElements.js +148 -0
- package/dist/ai/illustrationCapability.d.ts +6 -0
- package/dist/ai/illustrationCapability.js +20 -0
- package/dist/ai/types.d.ts +91 -0
- package/dist/ai/types.js +1 -0
- package/dist/blocks/liftedBlock.d.ts +61 -0
- package/dist/blocks/liftedBlock.js +117 -0
- package/dist/brand/bindPick.d.ts +18 -0
- package/dist/brand/bindPick.js +28 -0
- package/dist/brand/bindableFields.d.ts +9 -0
- package/dist/brand/bindableFields.js +61 -0
- package/dist/brand/brandRegistry.d.ts +18 -0
- package/dist/brand/brandRegistry.js +41 -0
- package/dist/brand/composerBrand.d.ts +146 -0
- package/dist/brand/composerBrand.js +6 -0
- package/dist/collab/documentVersion.d.ts +36 -0
- package/dist/collab/documentVersion.js +139 -0
- package/dist/collab/pageElementStateKeys.d.ts +33 -0
- package/dist/collab/pageElementStateKeys.js +148 -0
- package/dist/collab/pagesDoc.d.ts +152 -0
- package/dist/collab/pagesDoc.js +434 -0
- package/dist/collab/useAwarenessState.d.ts +12 -0
- package/dist/collab/useAwarenessState.js +47 -0
- package/dist/collab/useEmitHostStateChanges.d.ts +18 -0
- package/dist/collab/useEmitHostStateChanges.js +40 -0
- package/dist/collab/useSelectionAwareness.d.ts +22 -0
- package/dist/collab/useSelectionAwareness.js +60 -0
- package/dist/collab/useYjsCanvasBinding.d.ts +7 -0
- package/dist/collab/useYjsCanvasBinding.js +21 -0
- package/dist/collab/useYjsPageStateSync.d.ts +20 -0
- package/dist/collab/useYjsPageStateSync.js +49 -0
- package/dist/collab/useYjsPages.d.ts +73 -0
- package/dist/collab/useYjsPages.js +396 -0
- package/dist/collab/wrapCallbacksWithPageSync.d.ts +3 -0
- package/dist/collab/wrapCallbacksWithPageSync.js +62 -0
- package/dist/collab/ydocKeys.d.ts +50 -0
- package/dist/collab/ydocKeys.js +50 -0
- package/dist/collab/yjsBinding.d.ts +27 -0
- package/dist/collab/yjsBinding.js +105 -0
- package/dist/common/Lightbox.d.ts +8 -0
- package/dist/common/Lightbox.js +8 -0
- package/dist/common/imageSourceTypes.d.ts +1 -0
- package/dist/common/imageSourceTypes.js +1 -0
- package/dist/components/AddPageButton.d.ts +13 -0
- package/dist/components/AddPageButton.js +13 -0
- package/dist/components/CanvasAnnouncer.d.ts +8 -0
- package/dist/components/CanvasAnnouncer.js +10 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.d.ts +12 -0
- package/dist/components/CanvasContextMenu/CanvasActionSheet.js +145 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.d.ts +33 -0
- package/dist/components/CanvasContextMenu/CanvasContextMenu.js +107 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.d.ts +68 -0
- package/dist/components/CanvasContextMenu/canvasMenuModel.js +203 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.d.ts +32 -0
- package/dist/components/CanvasEditor/CanvasEditorShell.js +1138 -0
- package/dist/components/CanvasEditor/PageWrapper.d.ts +7 -0
- package/dist/components/CanvasEditor/PageWrapper.js +103 -0
- package/dist/components/CanvasEditor/autoSwitchTab.d.ts +11 -0
- package/dist/components/CanvasEditor/autoSwitchTab.js +15 -0
- package/dist/components/CanvasEditor/blockInsertContext.d.ts +22 -0
- package/dist/components/CanvasEditor/blockInsertContext.js +5 -0
- package/dist/components/CanvasEditor/editorShell.d.ts +99 -0
- package/dist/components/CanvasEditor/editorShell.js +20 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.d.ts +32 -0
- package/dist/components/CanvasEditor/hooks/useCanvasContextMenu.js +140 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.d.ts +13 -0
- package/dist/components/CanvasEditor/hooks/useLoadedConfigs.js +29 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.d.ts +14 -0
- package/dist/components/CanvasEditor/hooks/useMobileSheetFit.js +56 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.d.ts +18 -0
- package/dist/components/CanvasEditor/hooks/usePageRefs.js +36 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.d.ts +25 -0
- package/dist/components/CanvasEditor/hooks/usePageUndoRedoShortcuts.js +49 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/usePrintImpressumGate.js +70 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.d.ts +17 -0
- package/dist/components/CanvasEditor/hooks/useScrollToAddedPage.js +31 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.d.ts +75 -0
- package/dist/components/CanvasEditor/hooks/useToolbarHandlers.js +69 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.d.ts +6 -0
- package/dist/components/CanvasEditor/hooks/useWorkAreaDeselect.js +56 -0
- package/dist/components/CanvasEditor/layersTab.d.ts +13 -0
- package/dist/components/CanvasEditor/layersTab.js +27 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.d.ts +8 -0
- package/dist/components/CanvasEditor/mobileSelectionArea.js +27 -0
- package/dist/components/CanvasEditor/types.d.ts +202 -0
- package/dist/components/CanvasEditor/types.js +1 -0
- package/dist/components/CanvasEditorSkeleton.d.ts +16 -0
- package/dist/components/CanvasEditorSkeleton.js +24 -0
- package/dist/components/CanvasMetaBar.d.ts +16 -0
- package/dist/components/CanvasMetaBar.js +33 -0
- package/dist/components/CanvasRenderLayer.d.ts +37 -0
- package/dist/components/CanvasRenderLayer.js +54 -0
- package/dist/components/CanvasTextOverlay.d.ts +126 -0
- package/dist/components/CanvasTextOverlay.js +525 -0
- package/dist/components/ConfigCanvas.d.ts +35 -0
- package/dist/components/ConfigCanvas.js +30 -0
- package/dist/components/CropGhostOverlay.d.ts +13 -0
- package/dist/components/CropGhostOverlay.js +56 -0
- package/dist/components/CustomColorSwatch.d.ts +35 -0
- package/dist/components/CustomColorSwatch.js +80 -0
- package/dist/components/DownloadNotice.d.ts +7 -0
- package/dist/components/DownloadNotice.js +7 -0
- package/dist/components/GenericCanvas.d.ts +309 -0
- package/dist/components/GenericCanvas.js +780 -0
- package/dist/components/GenericCanvasElement.d.ts +34 -0
- package/dist/components/GenericCanvasElement.js +267 -0
- package/dist/components/MobileSelectionPill.d.ts +40 -0
- package/dist/components/MobileSelectionPill.js +85 -0
- package/dist/components/MultiSelectionTransformer.d.ts +39 -0
- package/dist/components/MultiSelectionTransformer.js +107 -0
- package/dist/components/PagePreview.d.ts +14 -0
- package/dist/components/PagePreview.js +63 -0
- package/dist/components/PageThumbnailStrip.d.ts +25 -0
- package/dist/components/PageThumbnailStrip.js +46 -0
- package/dist/components/PageToolbar.d.ts +12 -0
- package/dist/components/PageToolbar.js +20 -0
- package/dist/components/PrintGuides.d.ts +13 -0
- package/dist/components/PrintGuides.js +28 -0
- package/dist/components/RemoteSelectionOverlay.d.ts +15 -0
- package/dist/components/RemoteSelectionOverlay.js +29 -0
- package/dist/components/RichTextField.d.ts +34 -0
- package/dist/components/RichTextField.js +212 -0
- package/dist/components/SelectionPill.d.ts +56 -0
- package/dist/components/SelectionPill.js +123 -0
- package/dist/components/SlideNotesPanel.d.ts +13 -0
- package/dist/components/SlideNotesPanel.js +28 -0
- package/dist/components/SlotBudgetStatus.d.ts +12 -0
- package/dist/components/SlotBudgetStatus.js +64 -0
- package/dist/components/StandaloneCanvas.d.ts +33 -0
- package/dist/components/StandaloneCanvas.js +61 -0
- package/dist/components/TextFormatButtons.d.ts +61 -0
- package/dist/components/TextFormatButtons.js +123 -0
- package/dist/components/TextFormatControls.d.ts +26 -0
- package/dist/components/TextFormatControls.js +73 -0
- package/dist/components/Toolbar.d.ts +40 -0
- package/dist/components/Toolbar.js +26 -0
- package/dist/components/ToolbarStateBridge.d.ts +72 -0
- package/dist/components/ToolbarStateBridge.js +298 -0
- package/dist/components/TopBar/AutoSaveIndicator.d.ts +8 -0
- package/dist/components/TopBar/AutoSaveIndicator.js +44 -0
- package/dist/components/TopBar/ContextControls.d.ts +107 -0
- package/dist/components/TopBar/ContextControls.js +319 -0
- package/dist/components/TopBar/ContextToolbar.d.ts +14 -0
- package/dist/components/TopBar/ContextToolbar.js +20 -0
- package/dist/components/TopBar/CropModeControls.d.ts +35 -0
- package/dist/components/TopBar/CropModeControls.js +84 -0
- package/dist/components/TopBar/DownloadSection.d.ts +47 -0
- package/dist/components/TopBar/DownloadSection.js +102 -0
- package/dist/components/TopBar/MobileSelectionBar.d.ts +16 -0
- package/dist/components/TopBar/MobileSelectionBar.js +26 -0
- package/dist/components/TopBar/MobileSelectionControls.d.ts +10 -0
- package/dist/components/TopBar/MobileSelectionControls.js +43 -0
- package/dist/components/TopBar/MultiSelectionToolbar.d.ts +19 -0
- package/dist/components/TopBar/MultiSelectionToolbar.js +30 -0
- package/dist/components/TopBar/ShareDropdown.d.ts +54 -0
- package/dist/components/TopBar/ShareDropdown.js +110 -0
- package/dist/components/TopBar/TopBar.d.ts +6 -0
- package/dist/components/TopBar/TopBar.js +6 -0
- package/dist/components/TopBar/barTiles.d.ts +15 -0
- package/dist/components/TopBar/barTiles.js +34 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.d.ts +28 -0
- package/dist/components/TopBar/modules/FloatingAiSuggestionBanner.js +26 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingBackgroundControls.js +133 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.d.ts +16 -0
- package/dist/components/TopBar/modules/FloatingColorPicker.js +87 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.d.ts +17 -0
- package/dist/components/TopBar/modules/FloatingFontRoleControl.js +37 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.d.ts +7 -0
- package/dist/components/TopBar/modules/FloatingFontSizeControl.js +22 -0
- package/dist/components/TopBar/modules/FloatingGradientControl.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingGradientControl.js +35 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingHistoryControls.js +19 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingImageLookControl.js +15 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.d.ts +9 -0
- package/dist/components/TopBar/modules/FloatingLayerControls.js +9 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingOpacityControl.js +19 -0
- package/dist/components/TopBar/modules/FloatingOutlineControl.d.ts +11 -0
- package/dist/components/TopBar/modules/FloatingOutlineControl.js +31 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.d.ts +38 -0
- package/dist/components/TopBar/modules/FloatingPositionControl.js +74 -0
- package/dist/components/TopBar/modules/FloatingShadowControl.d.ts +12 -0
- package/dist/components/TopBar/modules/FloatingShadowControl.js +40 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.d.ts +12 -0
- package/dist/components/TopBar/modules/FloatingTextAlignControl.js +27 -0
- package/dist/components/TransformHud.d.ts +11 -0
- package/dist/components/TransformHud.js +121 -0
- package/dist/components/WholeTextFormatControls.d.ts +10 -0
- package/dist/components/WholeTextFormatControls.js +37 -0
- package/dist/components/ZoomableViewport.d.ts +6 -0
- package/dist/components/ZoomableViewport.js +4 -0
- package/dist/components/accentMark.d.ts +20 -0
- package/dist/components/accentMark.js +24 -0
- package/dist/components/canvasItemLock.d.ts +13 -0
- package/dist/components/canvasItemLock.js +12 -0
- package/dist/components/kindRenderers.d.ts +118 -0
- package/dist/components/kindRenderers.js +151 -0
- package/dist/components/markColor.d.ts +13 -0
- package/dist/components/markColor.js +21 -0
- package/dist/components/markerMark.d.ts +19 -0
- package/dist/components/markerMark.js +26 -0
- package/dist/composer/cardFollowsText.d.ts +17 -0
- package/dist/composer/cardFollowsText.js +34 -0
- package/dist/composer/marks.d.ts +4 -0
- package/dist/composer/marks.js +15 -0
- package/dist/composer/steckbriefLayout.d.ts +147 -0
- package/dist/composer/steckbriefLayout.js +468 -0
- package/dist/composer/textFit.d.ts +31 -0
- package/dist/composer/textFit.js +89 -0
- package/dist/configs/buildSharepicText.d.ts +5 -0
- package/dist/configs/buildSharepicText.js +58 -0
- package/dist/configs/configLoader.d.ts +34 -0
- package/dist/configs/configLoader.js +60 -0
- package/dist/configs/factory/actionFactories.d.ts +172 -0
- package/dist/configs/factory/actionFactories.js +611 -0
- package/dist/configs/factory/baseTypes.d.ts +150 -0
- package/dist/configs/factory/baseTypes.js +8 -0
- package/dist/configs/factory/carryInstanceState.d.ts +82 -0
- package/dist/configs/factory/carryInstanceState.js +121 -0
- package/dist/configs/factory/createTextElement.d.ts +63 -0
- package/dist/configs/factory/createTextElement.js +63 -0
- package/dist/configs/factory/defineSection.d.ts +45 -0
- package/dist/configs/factory/defineSection.js +45 -0
- package/dist/configs/factory/layoutAccessors.d.ts +15 -0
- package/dist/configs/factory/layoutAccessors.js +20 -0
- package/dist/configs/featureInjector.d.ts +40 -0
- package/dist/configs/featureInjector.js +184 -0
- package/dist/configs/pageInheritance.d.ts +8 -0
- package/dist/configs/pageInheritance.js +82 -0
- package/dist/configs/placeholders.d.ts +14 -0
- package/dist/configs/placeholders.js +33 -0
- package/dist/configs/shareSection.d.ts +11 -0
- package/dist/configs/shareSection.js +65 -0
- package/dist/configs/types.d.ts +420 -0
- package/dist/configs/types.js +1 -0
- package/dist/configs/unifiedTabs.d.ts +26 -0
- package/dist/configs/unifiedTabs.js +6 -0
- package/dist/editorSeamTypes.d.ts +41 -0
- package/dist/editorSeamTypes.js +1 -0
- package/dist/export/pptx/buildPptxModel.d.ts +44 -0
- package/dist/export/pptx/buildPptxModel.js +612 -0
- package/dist/export/pptx/exportPptxDeck.d.ts +23 -0
- package/dist/export/pptx/exportPptxDeck.js +77 -0
- package/dist/export/pptx/pptxFonts.d.ts +26 -0
- package/dist/export/pptx/pptxFonts.js +41 -0
- package/dist/export/pptx/pptxUnits.d.ts +27 -0
- package/dist/export/pptx/pptxUnits.js +54 -0
- package/dist/export/pptx/textModel.d.ts +13 -0
- package/dist/export/pptx/textModel.js +115 -0
- package/dist/export/pptx/types.d.ts +161 -0
- package/dist/export/pptx/types.js +11 -0
- package/dist/export/pptx/writePptx.d.ts +40 -0
- package/dist/export/pptx/writePptx.js +206 -0
- package/dist/export/pptx/writeText.d.ts +19 -0
- package/dist/export/pptx/writeText.js +120 -0
- package/dist/export/printExport.d.ts +42 -0
- package/dist/export/printExport.js +94 -0
- package/dist/export/printPdf.d.ts +103 -0
- package/dist/export/printPdf.js +144 -0
- package/dist/export/slidesPdf.d.ts +9 -0
- package/dist/export/slidesPdf.js +31 -0
- package/dist/formats/index.d.ts +115 -0
- package/dist/formats/index.js +287 -0
- package/dist/groups/pageGroups.d.ts +32 -0
- package/dist/groups/pageGroups.js +91 -0
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/useAiImageGeneration.d.ts +15 -0
- package/dist/hooks/useAiImageGeneration.js +73 -0
- package/dist/hooks/useAnnounce.d.ts +27 -0
- package/dist/hooks/useAnnounce.js +47 -0
- package/dist/hooks/useBoxSnap.d.ts +37 -0
- package/dist/hooks/useBoxSnap.js +49 -0
- package/dist/hooks/useCanvasAutoSave.d.ts +33 -0
- package/dist/hooks/useCanvasAutoSave.js +259 -0
- package/dist/hooks/useCanvasElementHandlers.d.ts +182 -0
- package/dist/hooks/useCanvasElementHandlers.js +326 -0
- package/dist/hooks/useCanvasHistorySetup.d.ts +37 -0
- package/dist/hooks/useCanvasHistorySetup.js +113 -0
- package/dist/hooks/useCanvasInteractions.d.ts +31 -0
- package/dist/hooks/useCanvasInteractions.js +103 -0
- package/dist/hooks/useCanvasKeyboardHandlers.d.ts +37 -0
- package/dist/hooks/useCanvasKeyboardHandlers.js +280 -0
- package/dist/hooks/useCanvasStoreReset.d.ts +25 -0
- package/dist/hooks/useCanvasStoreReset.js +35 -0
- package/dist/hooks/useCanvasUndoRedo.d.ts +34 -0
- package/dist/hooks/useCanvasUndoRedo.js +213 -0
- package/dist/hooks/useContextPress.d.ts +14 -0
- package/dist/hooks/useContextPress.js +45 -0
- package/dist/hooks/useCropSession.d.ts +23 -0
- package/dist/hooks/useCropSession.js +69 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useDebounce.js +14 -0
- package/dist/hooks/useDeckAutoSave.d.ts +30 -0
- package/dist/hooks/useDeckAutoSave.js +234 -0
- package/dist/hooks/useDeepSelect.d.ts +18 -0
- package/dist/hooks/useDeepSelect.js +135 -0
- package/dist/hooks/useElementSnapping.d.ts +13 -0
- package/dist/hooks/useElementSnapping.js +26 -0
- package/dist/hooks/useEmojiCatalog.d.ts +3 -0
- package/dist/hooks/useEmojiCatalog.js +13 -0
- package/dist/hooks/useFloatingModuleHandlers.d.ts +52 -0
- package/dist/hooks/useFloatingModuleHandlers.js +285 -0
- package/dist/hooks/useFloatingModuleState.d.ts +83 -0
- package/dist/hooks/useFloatingModuleState.js +250 -0
- package/dist/hooks/useFontGeneration.d.ts +10 -0
- package/dist/hooks/useFontGeneration.js +77 -0
- package/dist/hooks/useFontLoader.d.ts +53 -0
- package/dist/hooks/useFontLoader.js +129 -0
- package/dist/hooks/useGeometryReporter.d.ts +19 -0
- package/dist/hooks/useGeometryReporter.js +41 -0
- package/dist/hooks/useHoverOutline.d.ts +8 -0
- package/dist/hooks/useHoverOutline.js +78 -0
- package/dist/hooks/useIconCatalog.d.ts +12 -0
- package/dist/hooks/useIconCatalog.js +30 -0
- package/dist/hooks/useIconSearch.d.ts +2 -0
- package/dist/hooks/useIconSearch.js +14 -0
- package/dist/hooks/useIconSetsFor.d.ts +8 -0
- package/dist/hooks/useIconSetsFor.js +30 -0
- package/dist/hooks/useImageCoverFit.d.ts +17 -0
- package/dist/hooks/useImageCoverFit.js +35 -0
- package/dist/hooks/useIsCanvasMobile.d.ts +3 -0
- package/dist/hooks/useIsCanvasMobile.js +19 -0
- package/dist/hooks/useMarqueeSelection.d.ts +27 -0
- package/dist/hooks/useMarqueeSelection.js +140 -0
- package/dist/hooks/useMobileSheet.d.ts +48 -0
- package/dist/hooks/useMobileSheet.js +282 -0
- package/dist/hooks/useMultiPageExport.d.ts +30 -0
- package/dist/hooks/useMultiPageExport.js +117 -0
- package/dist/hooks/usePageManager.d.ts +132 -0
- package/dist/hooks/usePageManager.js +399 -0
- package/dist/hooks/usePageThumbnails.d.ts +10 -0
- package/dist/hooks/usePageThumbnails.js +122 -0
- package/dist/hooks/usePaginatedIcons.d.ts +11 -0
- package/dist/hooks/usePaginatedIcons.js +46 -0
- package/dist/hooks/useRovingToolbar.d.ts +17 -0
- package/dist/hooks/useRovingToolbar.js +76 -0
- package/dist/hooks/useSelectionAnnouncement.d.ts +13 -0
- package/dist/hooks/useSelectionAnnouncement.js +68 -0
- package/dist/hooks/useSnapScheduler.d.ts +20 -0
- package/dist/hooks/useSnapScheduler.js +61 -0
- package/dist/hooks/useTrackUnsplashDownload.d.ts +6 -0
- package/dist/hooks/useTrackUnsplashDownload.js +19 -0
- package/dist/hooks/useZoomGestures.d.ts +35 -0
- package/dist/hooks/useZoomGestures.js +185 -0
- package/dist/hostServices.d.ts +308 -0
- package/dist/hostServices.js +107 -0
- package/dist/i18n/de.d.ts +895 -0
- package/dist/i18n/de.js +959 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +948 -0
- package/dist/i18n/messages.d.ts +28 -0
- package/dist/i18n/messages.js +66 -0
- package/dist/layouts/CanvasEditorLayout.d.ts +28 -0
- package/dist/layouts/CanvasEditorLayout.js +56 -0
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/index.js +2 -0
- package/dist/primitives/AssetPrimitive.d.ts +24 -0
- package/dist/primitives/AssetPrimitive.js +158 -0
- package/dist/primitives/CanvasBackground.d.ts +33 -0
- package/dist/primitives/CanvasBackground.js +44 -0
- package/dist/primitives/CanvasIcons.d.ts +19 -0
- package/dist/primitives/CanvasIcons.js +46 -0
- package/dist/primitives/CanvasImage.d.ts +73 -0
- package/dist/primitives/CanvasImage.js +460 -0
- package/dist/primitives/CanvasRichText.d.ts +25 -0
- package/dist/primitives/CanvasRichText.js +281 -0
- package/dist/primitives/CanvasStage.d.ts +84 -0
- package/dist/primitives/CanvasStage.js +291 -0
- package/dist/primitives/CanvasText.d.ts +91 -0
- package/dist/primitives/CanvasText.js +293 -0
- package/dist/primitives/ChartPrimitive.d.ts +24 -0
- package/dist/primitives/ChartPrimitive.js +318 -0
- package/dist/primitives/CircleBadge.d.ts +43 -0
- package/dist/primitives/CircleBadge.js +233 -0
- package/dist/primitives/FramePrimitive.d.ts +14 -0
- package/dist/primitives/FramePrimitive.js +406 -0
- package/dist/primitives/IconPrimitive.d.ts +28 -0
- package/dist/primitives/IconPrimitive.js +119 -0
- package/dist/primitives/IllustrationPrimitive.d.ts +16 -0
- package/dist/primitives/IllustrationPrimitive.js +184 -0
- package/dist/primitives/PillBadge.d.ts +45 -0
- package/dist/primitives/PillBadge.js +237 -0
- package/dist/primitives/ShapePrimitive.d.ts +12 -0
- package/dist/primitives/ShapePrimitive.js +521 -0
- package/dist/primitives/SnapGuidelines.d.ts +19 -0
- package/dist/primitives/SnapGuidelines.js +34 -0
- package/dist/primitives/UserImagePrimitive.d.ts +30 -0
- package/dist/primitives/UserImagePrimitive.js +494 -0
- package/dist/primitives/index.d.ts +18 -0
- package/dist/primitives/index.js +11 -0
- package/dist/sidebar/SidebarPanel.d.ts +8 -0
- package/dist/sidebar/SidebarPanel.js +219 -0
- package/dist/sidebar/SidebarTabBar.d.ts +2 -0
- package/dist/sidebar/SidebarTabBar.js +31 -0
- package/dist/sidebar/SubsectionTabBar.d.ts +13 -0
- package/dist/sidebar/SubsectionTabBar.js +30 -0
- package/dist/sidebar/UserUploadsProvider.d.ts +31 -0
- package/dist/sidebar/UserUploadsProvider.js +139 -0
- package/dist/sidebar/components/AltTextField.d.ts +21 -0
- package/dist/sidebar/components/AltTextField.js +60 -0
- package/dist/sidebar/components/SidebarHint.d.ts +7 -0
- package/dist/sidebar/components/SidebarHint.js +38 -0
- package/dist/sidebar/components/SidebarSlider.d.ts +16 -0
- package/dist/sidebar/components/SidebarSlider.js +9 -0
- package/dist/sidebar/components/TextFieldPrimitives.d.ts +26 -0
- package/dist/sidebar/components/TextFieldPrimitives.js +56 -0
- package/dist/sidebar/sections/ChartSettingsSection.d.ts +9 -0
- package/dist/sidebar/sections/ChartSettingsSection.js +75 -0
- package/dist/sidebar/sections/CombinedTextSection.d.ts +16 -0
- package/dist/sidebar/sections/CombinedTextSection.js +42 -0
- package/dist/sidebar/sections/DiagrammeSection.d.ts +9 -0
- package/dist/sidebar/sections/DiagrammeSection.js +41 -0
- package/dist/sidebar/sections/EffectsSection.d.ts +20 -0
- package/dist/sidebar/sections/EffectsSection.js +23 -0
- package/dist/sidebar/sections/FormenSection.d.ts +26 -0
- package/dist/sidebar/sections/FormenSection.js +428 -0
- package/dist/sidebar/sections/FrameSettingsSection.d.ts +8 -0
- package/dist/sidebar/sections/FrameSettingsSection.js +26 -0
- package/dist/sidebar/sections/GenericShareSection.d.ts +26 -0
- package/dist/sidebar/sections/GenericShareSection.js +262 -0
- package/dist/sidebar/sections/IconsSection.d.ts +8 -0
- package/dist/sidebar/sections/IconsSection.js +55 -0
- package/dist/sidebar/sections/IllustrationSettings.d.ts +9 -0
- package/dist/sidebar/sections/IllustrationSettings.js +32 -0
- package/dist/sidebar/sections/IllustrationThumb.d.ts +7 -0
- package/dist/sidebar/sections/IllustrationThumb.js +15 -0
- package/dist/sidebar/sections/ImageAdjustSection.d.ts +13 -0
- package/dist/sidebar/sections/ImageAdjustSection.js +84 -0
- package/dist/sidebar/sections/LayersSection.d.ts +25 -0
- package/dist/sidebar/sections/LayersSection.js +155 -0
- package/dist/sidebar/sections/RahmenSection.d.ts +7 -0
- package/dist/sidebar/sections/RahmenSection.js +18 -0
- package/dist/sidebar/sections/StudioGallery.d.ts +33 -0
- package/dist/sidebar/sections/StudioGallery.js +58 -0
- package/dist/sidebar/sections/UploadsSection.d.ts +11 -0
- package/dist/sidebar/sections/UploadsSection.js +130 -0
- package/dist/sidebar/sections/assets/AssetsSection.d.ts +59 -0
- package/dist/sidebar/sections/assets/AssetsSection.js +27 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.d.ts +9 -0
- package/dist/sidebar/sections/assets/BackgroundCatalog.js +49 -0
- package/dist/sidebar/sections/assets/CategoryCard.d.ts +14 -0
- package/dist/sidebar/sections/assets/CategoryCard.js +15 -0
- package/dist/sidebar/sections/assets/ElementGrid.d.ts +14 -0
- package/dist/sidebar/sections/assets/ElementGrid.js +34 -0
- package/dist/sidebar/sections/assets/ElementThumb.d.ts +10 -0
- package/dist/sidebar/sections/assets/ElementThumb.js +59 -0
- package/dist/sidebar/sections/assets/ElementTile.d.ts +32 -0
- package/dist/sidebar/sections/assets/ElementTile.js +60 -0
- package/dist/sidebar/sections/assets/ElementsPanel.d.ts +7 -0
- package/dist/sidebar/sections/assets/ElementsPanel.js +249 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.d.ts +8 -0
- package/dist/sidebar/sections/assets/EmojiTonePicker.js +26 -0
- package/dist/sidebar/sections/assets/FotosCatalog.d.ts +12 -0
- package/dist/sidebar/sections/assets/FotosCatalog.js +41 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/IconifyCatalog.js +133 -0
- package/dist/sidebar/sections/assets/RecentCarousel.d.ts +7 -0
- package/dist/sidebar/sections/assets/RecentCarousel.js +42 -0
- package/dist/sidebar/sections/assets/StickerCatalog.d.ts +14 -0
- package/dist/sidebar/sections/assets/StickerCatalog.js +49 -0
- package/dist/sidebar/sections/assets/constants.d.ts +4 -0
- package/dist/sidebar/sections/assets/constants.js +15 -0
- package/dist/sidebar/sections/assets/elementPanelHost.d.ts +45 -0
- package/dist/sidebar/sections/assets/elementPanelHost.js +1 -0
- package/dist/sidebar/sections/assets/elementSearch.d.ts +10 -0
- package/dist/sidebar/sections/assets/elementSearch.js +38 -0
- package/dist/sidebar/sections/assets/elementTypes.d.ts +67 -0
- package/dist/sidebar/sections/assets/elementTypes.js +24 -0
- package/dist/sidebar/sections/assets/index.d.ts +3 -0
- package/dist/sidebar/sections/assets/index.js +3 -0
- package/dist/sidebar/sections/assets/useElementCatalog.d.ts +42 -0
- package/dist/sidebar/sections/assets/useElementCatalog.js +371 -0
- package/dist/sidebar/sections/assets/useRecentElements.d.ts +21 -0
- package/dist/sidebar/sections/assets/useRecentElements.js +67 -0
- package/dist/sidebar/sections/assets/useStockPhotos.d.ts +22 -0
- package/dist/sidebar/sections/assets/useStockPhotos.js +96 -0
- package/dist/sidebar/sections/effects/EffectCard.d.ts +11 -0
- package/dist/sidebar/sections/effects/EffectCard.js +14 -0
- package/dist/sidebar/sections/effects/GradientSettings.d.ts +10 -0
- package/dist/sidebar/sections/effects/GradientSettings.js +32 -0
- package/dist/sidebar/sections/effects/OutlineSettings.d.ts +12 -0
- package/dist/sidebar/sections/effects/OutlineSettings.js +28 -0
- package/dist/sidebar/sections/effects/ShadowSettings.d.ts +13 -0
- package/dist/sidebar/sections/effects/ShadowSettings.js +37 -0
- package/dist/sidebar/sections/effects/effectsFor.d.ts +16 -0
- package/dist/sidebar/sections/effects/effectsFor.js +24 -0
- package/dist/sidebar/sections/index.d.ts +28 -0
- package/dist/sidebar/sections/index.js +36 -0
- package/dist/sidebar/sections/lazyWithPreload.d.ts +11 -0
- package/dist/sidebar/sections/lazyWithPreload.js +29 -0
- package/dist/sidebar/sections/tools/AiCreateTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiCreateTool.js +58 -0
- package/dist/sidebar/sections/tools/AiEditTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/AiEditTool.js +57 -0
- package/dist/sidebar/sections/tools/AltTextTool.d.ts +11 -0
- package/dist/sidebar/sections/tools/AltTextTool.js +78 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/BlobCreatorTool.js +85 -0
- package/dist/sidebar/sections/tools/GradientTextTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/GradientTextTool.js +102 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.d.ts +7 -0
- package/dist/sidebar/sections/tools/ImageInputPicker.js +68 -0
- package/dist/sidebar/sections/tools/QRCodeTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/QRCodeTool.js +63 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.d.ts +4 -0
- package/dist/sidebar/sections/tools/RemoveBackgroundTool.js +52 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.d.ts +5 -0
- package/dist/sidebar/sections/tools/TextPathCreatorTool.js +123 -0
- package/dist/sidebar/sections/tools/ToolPanel.d.ts +26 -0
- package/dist/sidebar/sections/tools/ToolPanel.js +13 -0
- package/dist/sidebar/sections/tools/ToolTiles.d.ts +5 -0
- package/dist/sidebar/sections/tools/ToolTiles.js +76 -0
- package/dist/sidebar/sections/tools/ToolsSection.d.ts +15 -0
- package/dist/sidebar/sections/tools/ToolsSection.js +149 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.d.ts +8 -0
- package/dist/sidebar/sections/tools/UnsplashLimitNotice.js +22 -0
- package/dist/sidebar/sections/tools/UnsplashTool.d.ts +10 -0
- package/dist/sidebar/sections/tools/UnsplashTool.js +47 -0
- package/dist/sidebar/sections/tools/index.d.ts +1 -0
- package/dist/sidebar/sections/tools/index.js +2 -0
- package/dist/sidebar/sections/tools/toolTiles.css +335 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.d.ts +19 -0
- package/dist/sidebar/sections/tools/useToolImagePlacement.js +23 -0
- package/dist/sidebar/sections/whenIdle.d.ts +2 -0
- package/dist/sidebar/sections/whenIdle.js +10 -0
- package/dist/sidebar/sidebarStyles.d.ts +60 -0
- package/dist/sidebar/sidebarStyles.js +61 -0
- package/dist/sidebar/tabTypes.d.ts +27 -0
- package/dist/sidebar/tabTypes.js +1 -0
- package/dist/sidebar/types.d.ts +43 -0
- package/dist/sidebar/types.js +1 -0
- package/dist/sidebar/useImagePlacement.d.ts +17 -0
- package/dist/sidebar/useImagePlacement.js +28 -0
- package/dist/stores/AutoSaveStoreProvider.d.ts +28 -0
- package/dist/stores/AutoSaveStoreProvider.js +45 -0
- package/dist/stores/CanvasStoreProvider.d.ts +43 -0
- package/dist/stores/CanvasStoreProvider.js +74 -0
- package/dist/stores/createAutoSaveStore.d.ts +50 -0
- package/dist/stores/createAutoSaveStore.js +42 -0
- package/dist/stores/createCanvasEditorStore.d.ts +126 -0
- package/dist/stores/createCanvasEditorStore.js +266 -0
- package/dist/stores/useAutoSaveStore.d.ts +12 -0
- package/dist/stores/useAutoSaveStore.js +12 -0
- package/dist/styles/editor.css +445 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/tailwind.css +239 -0
- package/dist/styles/tokens.css +199 -0
- package/dist/templates/fontWidths.generated.d.ts +1 -0
- package/dist/templates/fontWidths.generated.js +17 -0
- package/dist/templates/registry.d.ts +59 -0
- package/dist/templates/registry.js +40 -0
- package/dist/templates/templateGeometry.d.ts +32 -0
- package/dist/templates/templateGeometry.js +887 -0
- package/dist/templates/testKinds.d.ts +15 -0
- package/dist/templates/testKinds.js +151 -0
- package/dist/testing/fixtureTemplates.d.ts +13 -0
- package/dist/testing/fixtureTemplates.js +376 -0
- package/dist/testing/stampKind.d.ts +91 -0
- package/dist/testing/stampKind.js +56 -0
- package/dist/types/editorTypes.d.ts +65 -0
- package/dist/types/editorTypes.js +21 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +42 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/button.js +29 -0
- package/dist/ui/dialog.d.ts +15 -0
- package/dist/ui/dialog.js +53 -0
- package/dist/ui/icon-button.d.ts +18 -0
- package/dist/ui/icon-button.js +54 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +6 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/masonry-grid.d.ts +11 -0
- package/dist/ui/masonry-grid.js +43 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +26 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +38 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +8 -0
- package/dist/utils/__snapshots__/kindSelection.vitest.ts.snap +1086 -0
- package/dist/utils/alignment.d.ts +21 -0
- package/dist/utils/alignment.js +54 -0
- package/dist/utils/axisLock.d.ts +30 -0
- package/dist/utils/axisLock.js +78 -0
- package/dist/utils/backgroundPhotoCrop.d.ts +28 -0
- package/dist/utils/backgroundPhotoCrop.js +28 -0
- package/dist/utils/balkenUtils.d.ts +22 -0
- package/dist/utils/balkenUtils.js +8 -0
- package/dist/utils/canvasAssets.d.ts +134 -0
- package/dist/utils/canvasAssets.js +121 -0
- package/dist/utils/canvasClipboard.d.ts +51 -0
- package/dist/utils/canvasClipboard.js +37 -0
- package/dist/utils/canvasCommandRegistry.d.ts +207 -0
- package/dist/utils/canvasCommandRegistry.js +124 -0
- package/dist/utils/canvasCommands.d.ts +106 -0
- package/dist/utils/canvasCommands.js +564 -0
- package/dist/utils/canvasFontFamilies.d.ts +12 -0
- package/dist/utils/canvasFontFamilies.js +24 -0
- package/dist/utils/canvasIcons.d.ts +68 -0
- package/dist/utils/canvasIcons.js +293 -0
- package/dist/utils/canvasImageSource.d.ts +12 -0
- package/dist/utils/canvasImageSource.js +19 -0
- package/dist/utils/canvasItem.d.ts +102 -0
- package/dist/utils/canvasItem.js +1 -0
- package/dist/utils/canvasLayerManager.d.ts +51 -0
- package/dist/utils/canvasLayerManager.js +107 -0
- package/dist/utils/canvasValueResolver.d.ts +9 -0
- package/dist/utils/canvasValueResolver.js +13 -0
- package/dist/utils/captureStage.d.ts +59 -0
- package/dist/utils/captureStage.js +152 -0
- package/dist/utils/chartTypes.d.ts +6 -0
- package/dist/utils/chartTypes.js +2 -0
- package/dist/utils/chartUtils.d.ts +49 -0
- package/dist/utils/chartUtils.js +191 -0
- package/dist/utils/circleBadgeUtils.d.ts +28 -0
- package/dist/utils/circleBadgeUtils.js +85 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +66 -0
- package/dist/utils/collectAltTextPages.d.ts +6 -0
- package/dist/utils/collectAltTextPages.js +20 -0
- package/dist/utils/colorLuminance.d.ts +3 -0
- package/dist/utils/colorLuminance.js +14 -0
- package/dist/utils/colorNames.d.ts +2 -0
- package/dist/utils/colorNames.js +8 -0
- package/dist/utils/colorOptions.d.ts +20 -0
- package/dist/utils/colorOptions.js +20 -0
- package/dist/utils/cornerRadius.d.ts +14 -0
- package/dist/utils/cornerRadius.js +27 -0
- package/dist/utils/cornerReservation.d.ts +19 -0
- package/dist/utils/cornerReservation.js +7 -0
- package/dist/utils/coverFit.d.ts +117 -0
- package/dist/utils/coverFit.js +207 -0
- package/dist/utils/cropAspect.d.ts +47 -0
- package/dist/utils/cropAspect.js +53 -0
- package/dist/utils/cropGhost.d.ts +63 -0
- package/dist/utils/cropGhost.js +216 -0
- package/dist/utils/cropSession.d.ts +23 -0
- package/dist/utils/cropSession.js +92 -0
- package/dist/utils/cropTarget.d.ts +22 -0
- package/dist/utils/cropTarget.js +33 -0
- package/dist/utils/deepSelect.d.ts +43 -0
- package/dist/utils/deepSelect.js +74 -0
- package/dist/utils/downloadError.d.ts +2 -0
- package/dist/utils/downloadError.js +13 -0
- package/dist/utils/duplicateElement.d.ts +127 -0
- package/dist/utils/duplicateElement.js +235 -0
- package/dist/utils/editorFocus.d.ts +36 -0
- package/dist/utils/editorFocus.js +67 -0
- package/dist/utils/editorToast.d.ts +21 -0
- package/dist/utils/editorToast.js +7 -0
- package/dist/utils/elementKinds.d.ts +212 -0
- package/dist/utils/elementKinds.js +137 -0
- package/dist/utils/emoji/emojiCatalog.d.ts +12 -0
- package/dist/utils/emoji/emojiCatalog.en.json +9997 -0
- package/dist/utils/emoji/emojiCatalog.js +53 -0
- package/dist/utils/emoji/emojiCatalog.json +9913 -0
- package/dist/utils/ensureFontsReady.d.ts +12 -0
- package/dist/utils/ensureFontsReady.js +23 -0
- package/dist/utils/expandImage.d.ts +17 -0
- package/dist/utils/expandImage.js +76 -0
- package/dist/utils/externalIcons.d.ts +67 -0
- package/dist/utils/externalIcons.js +168 -0
- package/dist/utils/filterCache.d.ts +16 -0
- package/dist/utils/filterCache.js +31 -0
- package/dist/utils/filterUtils.d.ts +2 -0
- package/dist/utils/filterUtils.js +89 -0
- package/dist/utils/followStage.d.ts +2 -0
- package/dist/utils/followStage.js +48 -0
- package/dist/utils/fontAliases.d.ts +14 -0
- package/dist/utils/fontAliases.js +32 -0
- package/dist/utils/fontMarkSupport.d.ts +25 -0
- package/dist/utils/fontMarkSupport.js +26 -0
- package/dist/utils/frameUtils.d.ts +19 -0
- package/dist/utils/frameUtils.js +282 -0
- package/dist/utils/gradientFill.d.ts +55 -0
- package/dist/utils/gradientFill.js +57 -0
- package/dist/utils/gradientHitArea.d.ts +22 -0
- package/dist/utils/gradientHitArea.js +94 -0
- package/dist/utils/grain.d.ts +29 -0
- package/dist/utils/grain.js +103 -0
- package/dist/utils/grainSpec.d.ts +2 -0
- package/dist/utils/grainSpec.js +3 -0
- package/dist/utils/groupSnap.d.ts +27 -0
- package/dist/utils/groupSnap.js +54 -0
- package/dist/utils/handDrawn.d.ts +92 -0
- package/dist/utils/handDrawn.js +523 -0
- package/dist/utils/historyStamp.d.ts +22 -0
- package/dist/utils/historyStamp.js +31 -0
- package/dist/utils/hostStorageKeys.d.ts +16 -0
- package/dist/utils/hostStorageKeys.js +27 -0
- package/dist/utils/iconInstances.d.ts +80 -0
- package/dist/utils/iconInstances.js +109 -0
- package/dist/utils/illustrations/gophers.d.ts +11 -0
- package/dist/utils/illustrations/gophers.js +1236 -0
- package/dist/utils/illustrations/humaaans.d.ts +8 -0
- package/dist/utils/illustrations/humaaans.js +265 -0
- package/dist/utils/illustrations/illlustrations.d.ts +11 -0
- package/dist/utils/illustrations/illlustrations.js +929 -0
- package/dist/utils/illustrations/kawaii.d.ts +6 -0
- package/dist/utils/illustrations/kawaii.js +73 -0
- package/dist/utils/illustrations/opendoodles.d.ts +6 -0
- package/dist/utils/illustrations/opendoodles.js +271 -0
- package/dist/utils/illustrations/openpeeps.d.ts +9 -0
- package/dist/utils/illustrations/openpeeps.js +1522 -0
- package/dist/utils/illustrations/prefetchAnalytics.d.ts +78 -0
- package/dist/utils/illustrations/prefetchAnalytics.js +162 -0
- package/dist/utils/illustrations/registry.d.ts +24 -0
- package/dist/utils/illustrations/registry.js +104 -0
- package/dist/utils/illustrations/svgCache.d.ts +60 -0
- package/dist/utils/illustrations/svgCache.js +342 -0
- package/dist/utils/illustrations/transhumans.d.ts +8 -0
- package/dist/utils/illustrations/transhumans.js +313 -0
- package/dist/utils/illustrations/types.d.ts +25 -0
- package/dist/utils/illustrations/types.js +45 -0
- package/dist/utils/imageElementComparison.d.ts +19 -0
- package/dist/utils/imageElementComparison.js +121 -0
- package/dist/utils/imageFilters.d.ts +92 -0
- package/dist/utils/imageFilters.js +303 -0
- package/dist/utils/imageLook.d.ts +16 -0
- package/dist/utils/imageLook.js +39 -0
- package/dist/utils/keyboardCrop.d.ts +25 -0
- package/dist/utils/keyboardCrop.js +98 -0
- package/dist/utils/keyboardOwnership.d.ts +30 -0
- package/dist/utils/keyboardOwnership.js +93 -0
- package/dist/utils/layerLabels.d.ts +39 -0
- package/dist/utils/layerLabels.js +181 -0
- package/dist/utils/layerLock.d.ts +24 -0
- package/dist/utils/layerLock.js +52 -0
- package/dist/utils/layerSelection.d.ts +24 -0
- package/dist/utils/layerSelection.js +16 -0
- package/dist/utils/markerBoxes.d.ts +23 -0
- package/dist/utils/markerBoxes.js +73 -0
- package/dist/utils/markerColors.d.ts +9 -0
- package/dist/utils/markerColors.js +39 -0
- package/dist/utils/mediaDrop.d.ts +76 -0
- package/dist/utils/mediaDrop.js +95 -0
- package/dist/utils/mediaPlacement.d.ts +6 -0
- package/dist/utils/mediaPlacement.js +17 -0
- package/dist/utils/motifSizes.d.ts +8 -0
- package/dist/utils/motifSizes.js +9 -0
- package/dist/utils/multiSelect.d.ts +44 -0
- package/dist/utils/multiSelect.js +139 -0
- package/dist/utils/notch.d.ts +17 -0
- package/dist/utils/notch.js +23 -0
- package/dist/utils/orientElement.d.ts +46 -0
- package/dist/utils/orientElement.js +108 -0
- package/dist/utils/orientation.d.ts +119 -0
- package/dist/utils/orientation.js +411 -0
- package/dist/utils/pageCounter.d.ts +15 -0
- package/dist/utils/pageCounter.js +17 -0
- package/dist/utils/pendingImages.d.ts +10 -0
- package/dist/utils/pendingImages.js +25 -0
- package/dist/utils/photoCredit.d.ts +9 -0
- package/dist/utils/photoCredit.js +29 -0
- package/dist/utils/photoCredits.d.ts +5 -0
- package/dist/utils/photoCredits.js +17 -0
- package/dist/utils/photoPlaceholder.d.ts +22 -0
- package/dist/utils/photoPlaceholder.js +36 -0
- package/dist/utils/pillBadgeUtils.d.ts +40 -0
- package/dist/utils/pillBadgeUtils.js +94 -0
- package/dist/utils/pixelHitArea.d.ts +13 -0
- package/dist/utils/pixelHitArea.js +33 -0
- package/dist/utils/plainTextLayout.d.ts +11 -0
- package/dist/utils/plainTextLayout.js +64 -0
- package/dist/utils/printImageInfo.d.ts +9 -0
- package/dist/utils/printImageInfo.js +14 -0
- package/dist/utils/recacheNextFrame.d.ts +6 -0
- package/dist/utils/recacheNextFrame.js +15 -0
- package/dist/utils/removeElement.d.ts +17 -0
- package/dist/utils/removeElement.js +47 -0
- package/dist/utils/renderedBoxes.d.ts +19 -0
- package/dist/utils/renderedBoxes.js +67 -0
- package/dist/utils/resolveElementValue.d.ts +44 -0
- package/dist/utils/resolveElementValue.js +72 -0
- package/dist/utils/scrollBehavior.d.ts +6 -0
- package/dist/utils/scrollBehavior.js +17 -0
- package/dist/utils/searchTranslations.d.ts +20 -0
- package/dist/utils/searchTranslations.js +366 -0
- package/dist/utils/selectionCapabilities.d.ts +53 -0
- package/dist/utils/selectionCapabilities.js +52 -0
- package/dist/utils/shade.d.ts +24 -0
- package/dist/utils/shade.js +55 -0
- package/dist/utils/shapeDevices.d.ts +72 -0
- package/dist/utils/shapeDevices.js +100 -0
- package/dist/utils/shapeTransform.d.ts +29 -0
- package/dist/utils/shapeTransform.js +69 -0
- package/dist/utils/shapes.d.ts +62 -0
- package/dist/utils/shapes.js +836 -0
- package/dist/utils/smartCrop.d.ts +30 -0
- package/dist/utils/smartCrop.js +163 -0
- package/dist/utils/snapping.d.ts +116 -0
- package/dist/utils/snapping.js +426 -0
- package/dist/utils/stageCssScale.d.ts +7 -0
- package/dist/utils/stageCssScale.js +11 -0
- package/dist/utils/stateTypeAssertions.d.ts +99 -0
- package/dist/utils/stateTypeAssertions.js +197 -0
- package/dist/utils/straighten.d.ts +51 -0
- package/dist/utils/straighten.js +254 -0
- package/dist/utils/surfaceGlow.d.ts +7 -0
- package/dist/utils/surfaceGlow.js +27 -0
- package/dist/utils/templateElementInstance.d.ts +43 -0
- package/dist/utils/templateElementInstance.js +100 -0
- package/dist/utils/templateRotation.d.ts +24 -0
- package/dist/utils/templateRotation.js +56 -0
- package/dist/utils/textAlign.d.ts +17 -0
- package/dist/utils/textAlign.js +30 -0
- package/dist/utils/textEditorOpeners.d.ts +12 -0
- package/dist/utils/textEditorOpeners.js +40 -0
- package/dist/utils/textRouting.d.ts +17 -0
- package/dist/utils/textRouting.js +22 -0
- package/dist/utils/textUtils.d.ts +102 -0
- package/dist/utils/textUtils.js +250 -0
- package/dist/utils/touchInput.d.ts +7 -0
- package/dist/utils/touchInput.js +19 -0
- package/dist/utils/transformHudLabel.d.ts +3 -0
- package/dist/utils/transformHudLabel.js +12 -0
- package/dist/utils/unsplashLinks.d.ts +2 -0
- package/dist/utils/unsplashLinks.js +7 -0
- package/dist/utils/userFacingError.d.ts +10 -0
- package/dist/utils/userFacingError.js +10 -0
- package/dist/utils/userImageCrop.d.ts +4 -0
- package/dist/utils/userImageCrop.js +26 -0
- package/dist/utils/userImageUtils.d.ts +44 -0
- package/dist/utils/userImageUtils.js +136 -0
- package/dist/utils/viewport.d.ts +16 -0
- package/dist/utils/viewport.js +30 -0
- package/dist/utils/zipPageImages.d.ts +8 -0
- package/dist/utils/zipPageImages.js +29 -0
- package/package.json +105 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snap beim Gruppenzug: der Umriss aller gezogenen Knoten rastet ein, und jeder
|
|
3
|
+
* Knoten wandert um dieselbe Strecke.
|
|
4
|
+
*
|
|
5
|
+
* Gemessen wird einmal beim Zugbeginn: je Knoten der Abstand seiner (gedrehten)
|
|
6
|
+
* Box zu seinem Ursprung. Drehung und Skala ändern sich beim Ziehen nicht, also
|
|
7
|
+
* reicht danach pro Bild x/y des Knotens — kein `getClientRect` im Zug.
|
|
8
|
+
*/
|
|
9
|
+
import type { ElementSnapResult, SnapHysteresis, SnapTarget } from './snapping.js';
|
|
10
|
+
import type Konva from 'konva';
|
|
11
|
+
export interface GroupSnap {
|
|
12
|
+
nodes: readonly Konva.Node[];
|
|
13
|
+
/** Je Knoten: linke, obere, rechte, untere Kante relativ zu x/y. */
|
|
14
|
+
edges: Float64Array;
|
|
15
|
+
targets: SnapTarget[];
|
|
16
|
+
}
|
|
17
|
+
/** Zugbeginn: Kanten je Knoten messen, Ziele ohne die Auswahl festhalten. */
|
|
18
|
+
export declare function measureGroupSnap(nodes: readonly Konva.Node[], targets: SnapTarget[], selectedIds: readonly string[]): GroupSnap;
|
|
19
|
+
/**
|
|
20
|
+
* Ein Bild des Gruppenzugs: Umriss aus den aktuellen Positionen, einrasten,
|
|
21
|
+
* alle Knoten um die Differenz schieben. Gibt das Snap-Ergebnis für die
|
|
22
|
+
* Hilfslinien zurück und ob etwas verschoben wurde.
|
|
23
|
+
*/
|
|
24
|
+
export declare function snapGroup(group: GroupSnap, stageWidth: number, stageHeight: number, hysteresis: SnapHysteresis): {
|
|
25
|
+
result: ElementSnapResult;
|
|
26
|
+
moved: boolean;
|
|
27
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Snap beim Gruppenzug: der Umriss aller gezogenen Knoten rastet ein, und jeder
|
|
4
|
+
* Knoten wandert um dieselbe Strecke.
|
|
5
|
+
*
|
|
6
|
+
* Gemessen wird einmal beim Zugbeginn: je Knoten der Abstand seiner (gedrehten)
|
|
7
|
+
* Box zu seinem Ursprung. Drehung und Skala ändern sich beim Ziehen nicht, also
|
|
8
|
+
* reicht danach pro Bild x/y des Knotens — kein `getClientRect` im Zug.
|
|
9
|
+
*/
|
|
10
|
+
import { boxFrame, createBoxFrame, snapByBounds } from './snapping.js';
|
|
11
|
+
/** Zugbeginn: Kanten je Knoten messen, Ziele ohne die Auswahl festhalten. */
|
|
12
|
+
export function measureGroupSnap(nodes, targets, selectedIds) {
|
|
13
|
+
const edges = new Float64Array(nodes.length * 4);
|
|
14
|
+
nodes.forEach((node, i) => {
|
|
15
|
+
const parent = node.getParent() ?? undefined;
|
|
16
|
+
const r = node.getClientRect({ relativeTo: parent, skipShadow: true, skipStroke: true });
|
|
17
|
+
edges[i * 4] = r.x - node.x();
|
|
18
|
+
edges[i * 4 + 1] = r.y - node.y();
|
|
19
|
+
edges[i * 4 + 2] = r.x + r.width - node.x();
|
|
20
|
+
edges[i * 4 + 3] = r.y + r.height - node.y();
|
|
21
|
+
});
|
|
22
|
+
const selected = new Set(selectedIds);
|
|
23
|
+
return { nodes, edges, targets: targets.filter((t) => !selected.has(t.id)) };
|
|
24
|
+
}
|
|
25
|
+
const frame = createBoxFrame();
|
|
26
|
+
/**
|
|
27
|
+
* Ein Bild des Gruppenzugs: Umriss aus den aktuellen Positionen, einrasten,
|
|
28
|
+
* alle Knoten um die Differenz schieben. Gibt das Snap-Ergebnis für die
|
|
29
|
+
* Hilfslinien zurück und ob etwas verschoben wurde.
|
|
30
|
+
*/
|
|
31
|
+
export function snapGroup(group, stageWidth, stageHeight, hysteresis) {
|
|
32
|
+
const { nodes, edges } = group;
|
|
33
|
+
let left = Infinity;
|
|
34
|
+
let top = Infinity;
|
|
35
|
+
let right = -Infinity;
|
|
36
|
+
let bottom = -Infinity;
|
|
37
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
38
|
+
const x = nodes[i].x();
|
|
39
|
+
const y = nodes[i].y();
|
|
40
|
+
left = Math.min(left, x + edges[i * 4]);
|
|
41
|
+
top = Math.min(top, y + edges[i * 4 + 1]);
|
|
42
|
+
right = Math.max(right, x + edges[i * 4 + 2]);
|
|
43
|
+
bottom = Math.max(bottom, y + edges[i * 4 + 3]);
|
|
44
|
+
}
|
|
45
|
+
const result = snapByBounds(boxFrame(frame, left, top, right - left, bottom - top, 0, 'top-left'), group.targets, stageWidth, stageHeight, hysteresis);
|
|
46
|
+
const dx = result.x - left;
|
|
47
|
+
const dy = result.y - top;
|
|
48
|
+
const moved = dx !== 0 || dy !== 0;
|
|
49
|
+
if (moved) {
|
|
50
|
+
for (const node of nodes)
|
|
51
|
+
node.position({ x: node.x() + dx, y: node.y() + dy });
|
|
52
|
+
}
|
|
53
|
+
return { result, moved };
|
|
54
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-drawn marks — the loose ellipse round a word, the brush underline, the
|
|
3
|
+
* swoosh arrow and the burst strokes of the AT posts (Dc_L5vriG5z, DciacLNDopH,
|
|
4
|
+
* Dc3A9PNiH6l). Each is a filled brush outline built in canvas px from the
|
|
5
|
+
* shape's own width and height, centred on 0,0: the stroke keeps its width when
|
|
6
|
+
* the shape is stretched to fit a word, which a scaled 100×100 path would not.
|
|
7
|
+
*/
|
|
8
|
+
export declare const HAND_SHAPE_TYPES: readonly ["hand-kreis", "hand-unterstrich", "hand-pfeil", "hand-ausruf", "hand-marker", "hand-marker-box", "hand-winken", "hand-pfeil-schlaufe", "hand-pfeil-welle", "hand-pfeil-bogen", "hand-pfeil-haken", "hand-pfeil-herz", "hand-pfeil-spirale"];
|
|
9
|
+
export type HandShapeType = (typeof HAND_SHAPE_TYPES)[number];
|
|
10
|
+
export declare const isHandShape: (type: string) => type is HandShapeType;
|
|
11
|
+
/**
|
|
12
|
+
* The arrows of the introduction posts, each a pen line from a tail to an
|
|
13
|
+
* open head, traced in a frame where the tail sits at 0,0 and the tip at
|
|
14
|
+
* 100,0 (y down). `pen` is the line's share of the stroke width — the curly
|
|
15
|
+
* ones are drawn with a fine pen, the plain ones with a marker — `head` the
|
|
16
|
+
* barb's length in pen widths, `lead` how thin the pen lands.
|
|
17
|
+
*/
|
|
18
|
+
declare const ARROW_DESIGNS: {
|
|
19
|
+
'hand-pfeil-bogen': {
|
|
20
|
+
pen: number;
|
|
21
|
+
head: number;
|
|
22
|
+
lead: number;
|
|
23
|
+
knots: [number, number][];
|
|
24
|
+
};
|
|
25
|
+
'hand-pfeil-haken': {
|
|
26
|
+
pen: number;
|
|
27
|
+
head: number;
|
|
28
|
+
lead: number;
|
|
29
|
+
knots: [number, number][];
|
|
30
|
+
};
|
|
31
|
+
'hand-pfeil-welle': {
|
|
32
|
+
pen: number;
|
|
33
|
+
head: number;
|
|
34
|
+
lead: number;
|
|
35
|
+
knots: [number, number][];
|
|
36
|
+
};
|
|
37
|
+
'hand-pfeil-schlaufe': {
|
|
38
|
+
pen: number;
|
|
39
|
+
head: number;
|
|
40
|
+
lead: number;
|
|
41
|
+
knots: [number, number][];
|
|
42
|
+
};
|
|
43
|
+
'hand-pfeil-herz': {
|
|
44
|
+
pen: number;
|
|
45
|
+
head: number;
|
|
46
|
+
lead: number;
|
|
47
|
+
knots: [number, number][];
|
|
48
|
+
};
|
|
49
|
+
'hand-pfeil-spirale': {
|
|
50
|
+
pen: number;
|
|
51
|
+
head: number;
|
|
52
|
+
lead: number;
|
|
53
|
+
knots: [number, number][];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type DesignedArrow = keyof typeof ARROW_DESIGNS;
|
|
57
|
+
/** The hand-drawn arrows: one stroke from a tail to an open head. */
|
|
58
|
+
export declare const HAND_ARROW_TYPES: readonly ["hand-pfeil", "hand-pfeil-bogen", "hand-pfeil-haken", "hand-pfeil-welle", "hand-pfeil-schlaufe", "hand-pfeil-herz", "hand-pfeil-spirale"];
|
|
59
|
+
export type HandArrowType = (typeof HAND_ARROW_TYPES)[number];
|
|
60
|
+
/** Height as a share of the width each arrow is drawn at by default. */
|
|
61
|
+
export declare const HAND_ARROW_ASPECT: Record<HandArrowType, number>;
|
|
62
|
+
/** Where an arrow's stroke starts and its head points, in the shape's own frame (centred on 0,0). */
|
|
63
|
+
export declare function handArrowEnds(type: HandArrowType, w: number, h: number, sw: number): {
|
|
64
|
+
tail: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
};
|
|
68
|
+
tip: {
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type DesignedArrowType = DesignedArrow;
|
|
74
|
+
/**
|
|
75
|
+
* The centre line of a designed arrow and its two barbs (each from its free
|
|
76
|
+
* end to the tip), in the shape's own frame — what the stroke covers, for
|
|
77
|
+
* keeping it clear of text.
|
|
78
|
+
*/
|
|
79
|
+
export declare function handArrowStroke(type: DesignedArrowType, w: number, h: number, sw: number): {
|
|
80
|
+
line: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
}[];
|
|
84
|
+
barbs: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
}[][];
|
|
88
|
+
pen: number;
|
|
89
|
+
};
|
|
90
|
+
/** The filled outline of a hand-drawn shape, `width` × `height` px, centred on 0,0. */
|
|
91
|
+
export declare function handDrawnPath(type: HandShapeType, width: number, height: number, strokeWidth: number): string;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Hand-drawn marks — the loose ellipse round a word, the brush underline, the
|
|
4
|
+
* swoosh arrow and the burst strokes of the AT posts (Dc_L5vriG5z, DciacLNDopH,
|
|
5
|
+
* Dc3A9PNiH6l). Each is a filled brush outline built in canvas px from the
|
|
6
|
+
* shape's own width and height, centred on 0,0: the stroke keeps its width when
|
|
7
|
+
* the shape is stretched to fit a word, which a scaled 100×100 path would not.
|
|
8
|
+
*/
|
|
9
|
+
export const HAND_SHAPE_TYPES = [
|
|
10
|
+
'hand-kreis',
|
|
11
|
+
'hand-unterstrich',
|
|
12
|
+
'hand-pfeil',
|
|
13
|
+
'hand-ausruf',
|
|
14
|
+
'hand-marker',
|
|
15
|
+
'hand-marker-box',
|
|
16
|
+
'hand-winken',
|
|
17
|
+
'hand-pfeil-schlaufe',
|
|
18
|
+
'hand-pfeil-welle',
|
|
19
|
+
'hand-pfeil-bogen',
|
|
20
|
+
'hand-pfeil-haken',
|
|
21
|
+
'hand-pfeil-herz',
|
|
22
|
+
'hand-pfeil-spirale',
|
|
23
|
+
];
|
|
24
|
+
export const isHandShape = (type) => HAND_SHAPE_TYPES.includes(type);
|
|
25
|
+
const smooth = (t) => {
|
|
26
|
+
const c = Math.min(1, Math.max(0, t));
|
|
27
|
+
return c * c * (3 - 2 * c);
|
|
28
|
+
};
|
|
29
|
+
const num = (v) => (Math.round(v * 10) / 10).toString();
|
|
30
|
+
const outline = (points) => `M${points.map(([x, y]) => `${num(x)},${num(y)}`).join('L')}Z`;
|
|
31
|
+
/** The outline of a brush stroke along `points`, `width(t)` across at t ∈ [0, 1]. */
|
|
32
|
+
function brush(points, width) {
|
|
33
|
+
const n = points.length;
|
|
34
|
+
const left = [];
|
|
35
|
+
const right = [];
|
|
36
|
+
points.forEach(([x, y], i) => {
|
|
37
|
+
const [px, py] = points[Math.max(0, i - 1)];
|
|
38
|
+
const [nx, ny] = points[Math.min(n - 1, i + 1)];
|
|
39
|
+
const len = Math.hypot(nx - px, ny - py) || 1;
|
|
40
|
+
const half = width(i / (n - 1)) / 2;
|
|
41
|
+
const ox = (-(ny - py) / len) * half;
|
|
42
|
+
const oy = ((nx - px) / len) * half;
|
|
43
|
+
left.push([x + ox, y + oy]);
|
|
44
|
+
right.push([x - ox, y - oy]);
|
|
45
|
+
});
|
|
46
|
+
return outline([...left, ...right.reverse()]);
|
|
47
|
+
}
|
|
48
|
+
const sample = (count, at) => Array.from({ length: count + 1 }, (_, i) => at(i / count));
|
|
49
|
+
/** Thin where the pen lands and lifts, full in between. */
|
|
50
|
+
const taper = (sw, start, end, lift) => (t) => sw * (start + (1 - start) * smooth(t / 0.12)) * (1 - (1 - lift) * smooth((t - end) / (1 - end)));
|
|
51
|
+
/**
|
|
52
|
+
* One loop and a bit round the box: it lands left of the word, runs under it,
|
|
53
|
+
* and its end overshoots the start above it, a little wider — never closed.
|
|
54
|
+
*/
|
|
55
|
+
function kreis(w, h, sw) {
|
|
56
|
+
// The spiral drifts outward by up to `room`: start inside, end wider than the start.
|
|
57
|
+
const room = h * 0.08;
|
|
58
|
+
const a = Math.max(1, w / 2 - sw / 2 - room);
|
|
59
|
+
const b = Math.max(1, h / 2 - sw / 2 - room);
|
|
60
|
+
const start = Math.PI * 1.1;
|
|
61
|
+
const sweep = Math.PI * 2 + 0.55;
|
|
62
|
+
const tilt = (-2.5 * Math.PI) / 180;
|
|
63
|
+
const points = sample(120, (t) => {
|
|
64
|
+
const theta = start - sweep * t;
|
|
65
|
+
const drift = room *
|
|
66
|
+
(-0.6 + 0.9 * t + 0.25 * Math.sin(t * Math.PI * 4 + 0.6) + 0.7 * smooth((t - 0.85) / 0.15));
|
|
67
|
+
// Lopsided like a quick hand: a fuller right end, a flatter top.
|
|
68
|
+
const x = (a + drift) * Math.cos(theta) * (1 - 0.03 * Math.sin(2 * theta));
|
|
69
|
+
const y = (b + drift) * Math.sin(theta) * (1 + 0.08 * Math.cos(theta) - 0.05 * Math.sin(theta));
|
|
70
|
+
return [x * Math.cos(tilt) - y * Math.sin(tilt), x * Math.sin(tilt) + y * Math.cos(tilt)];
|
|
71
|
+
});
|
|
72
|
+
// The wobble and the tilt reach past the ellipse: pull the loop back into its box.
|
|
73
|
+
const fit = (axis, half) => Math.min(1, (half - sw / 2) / Math.max(1, ...points.map((p) => Math.abs(p[axis]))));
|
|
74
|
+
const fx = fit(0, w / 2);
|
|
75
|
+
const fy = fit(1, h / 2);
|
|
76
|
+
return brush(points.map(([x, y]) => [x * fx, y * fy]), taper(sw, 0.45, 0.82, 0.25));
|
|
77
|
+
}
|
|
78
|
+
/** A single stroke under the word, rising slightly to the right, heavy start, light end. */
|
|
79
|
+
function unterstrich(w, h, sw) {
|
|
80
|
+
const half = Math.max(1, w / 2 - sw / 2);
|
|
81
|
+
const amp = Math.max(0, h - sw) / 2;
|
|
82
|
+
const points = sample(60, (t) => [
|
|
83
|
+
-half + 2 * half * t,
|
|
84
|
+
amp *
|
|
85
|
+
(0.45 * (1 - 2 * t) -
|
|
86
|
+
0.25 * Math.sin(Math.PI * t) +
|
|
87
|
+
0.05 * Math.sin(t * 11) -
|
|
88
|
+
0.35 * smooth((t - 0.9) / 0.1)),
|
|
89
|
+
]);
|
|
90
|
+
// A marker's ink runs unevenly: the width breathes a little along the stroke.
|
|
91
|
+
const width = taper(sw, 0.75, 0.72, 0.3);
|
|
92
|
+
return brush(points, (t) => width(t) * (1 + 0.1 * Math.sin(t * 19 + 1) * Math.sin(t * 7)));
|
|
93
|
+
}
|
|
94
|
+
/** A swoosh from the lower left, curving up to the right, with an open head of two strokes. */
|
|
95
|
+
function pfeil(w, h, sw) {
|
|
96
|
+
const head = Math.min(w, h) * 0.42;
|
|
97
|
+
const tip = [w / 2 - sw / 2, -h / 2 + head * 0.55 + sw / 2];
|
|
98
|
+
const tail = [-w / 2 + sw / 2, h / 2 - sw / 2];
|
|
99
|
+
const c1 = [-w * 0.18, -h * 0.05];
|
|
100
|
+
const c2 = [w * 0.15, tip[1] - h * 0.02];
|
|
101
|
+
const bezier = (t) => {
|
|
102
|
+
const u = 1 - t;
|
|
103
|
+
return [
|
|
104
|
+
u * u * u * tail[0] + 3 * u * u * t * c1[0] + 3 * u * t * t * c2[0] + t * t * t * tip[0],
|
|
105
|
+
u * u * u * tail[1] + 3 * u * u * t * c1[1] + 3 * u * t * t * c2[1] + t * t * t * tip[1],
|
|
106
|
+
];
|
|
107
|
+
};
|
|
108
|
+
const shaft = brush(sample(60, bezier), (t) => sw * (0.25 + 0.75 * smooth(t / 0.6)));
|
|
109
|
+
const [bx, by] = bezier(0.97);
|
|
110
|
+
const dir = Math.atan2(tip[1] - by, tip[0] - bx);
|
|
111
|
+
const barb = (angle, length) => {
|
|
112
|
+
const back = dir + Math.PI + angle;
|
|
113
|
+
const end = [tip[0] + Math.cos(back) * length, tip[1] + Math.sin(back) * length];
|
|
114
|
+
return brush(sample(12, (t) => [end[0] + (tip[0] - end[0]) * t, end[1] + (tip[1] - end[1]) * t]), (t) => sw * (0.35 + 0.65 * smooth(t / 0.8)));
|
|
115
|
+
};
|
|
116
|
+
return `${shaft}${barb(-0.62, head)}${barb(0.55, head * 0.9)}`;
|
|
117
|
+
}
|
|
118
|
+
/** A smooth line through `knots` (centripetal Catmull-Rom: no cusps or overshoot at tight turns). */
|
|
119
|
+
function spline(knots, perSegment) {
|
|
120
|
+
const n = knots.length;
|
|
121
|
+
const at = (i) => {
|
|
122
|
+
if (i < 0)
|
|
123
|
+
return [2 * knots[0][0] - knots[1][0], 2 * knots[0][1] - knots[1][1]];
|
|
124
|
+
if (i >= n) {
|
|
125
|
+
const [ax, ay] = knots[n - 1];
|
|
126
|
+
const [bx, by] = knots[n - 2];
|
|
127
|
+
return [2 * ax - bx, 2 * ay - by];
|
|
128
|
+
}
|
|
129
|
+
return knots[i];
|
|
130
|
+
};
|
|
131
|
+
const out = [knots[0]];
|
|
132
|
+
for (let i = 0; i < n - 1; i++) {
|
|
133
|
+
const p = [at(i - 1), at(i), at(i + 1), at(i + 2)];
|
|
134
|
+
const k = [0];
|
|
135
|
+
for (let j = 1; j < 4; j++) {
|
|
136
|
+
const [ax, ay] = p[j - 1];
|
|
137
|
+
const [bx, by] = p[j];
|
|
138
|
+
k.push(k[j - 1] + Math.max(1e-6, Math.sqrt(Math.hypot(bx - ax, by - ay))));
|
|
139
|
+
}
|
|
140
|
+
const lerp = (a, b, ta, tb, t) => {
|
|
141
|
+
const u = (t - ta) / (tb - ta);
|
|
142
|
+
return [a[0] + (b[0] - a[0]) * u, a[1] + (b[1] - a[1]) * u];
|
|
143
|
+
};
|
|
144
|
+
for (let s = 1; s <= perSegment; s++) {
|
|
145
|
+
const t = k[1] + ((k[2] - k[1]) * s) / perSegment;
|
|
146
|
+
const a1 = lerp(p[0], p[1], k[0], k[1], t);
|
|
147
|
+
const a2 = lerp(p[1], p[2], k[1], k[2], t);
|
|
148
|
+
const a3 = lerp(p[2], p[3], k[2], k[3], t);
|
|
149
|
+
const b1 = lerp(a1, a2, k[0], k[2], t);
|
|
150
|
+
const b2 = lerp(a2, a3, k[1], k[3], t);
|
|
151
|
+
out.push(lerp(b1, b2, k[1], k[2], t));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
/** A heart from its point round both lobes back to the point, `size` 1 ≈ 32 wide. */
|
|
157
|
+
const heartKnots = (x, y, size) => Array.from({ length: 17 }, (_, i) => {
|
|
158
|
+
const t = Math.PI + (2 * Math.PI * i) / 16;
|
|
159
|
+
return [
|
|
160
|
+
x + size * 16 * Math.sin(t) ** 3,
|
|
161
|
+
y -
|
|
162
|
+
size *
|
|
163
|
+
(17 + 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t)),
|
|
164
|
+
];
|
|
165
|
+
});
|
|
166
|
+
/**
|
|
167
|
+
* The arrows of the introduction posts, each a pen line from a tail to an
|
|
168
|
+
* open head, traced in a frame where the tail sits at 0,0 and the tip at
|
|
169
|
+
* 100,0 (y down). `pen` is the line's share of the stroke width — the curly
|
|
170
|
+
* ones are drawn with a fine pen, the plain ones with a marker — `head` the
|
|
171
|
+
* barb's length in pen widths, `lead` how thin the pen lands.
|
|
172
|
+
*/
|
|
173
|
+
const ARROW_DESIGNS = {
|
|
174
|
+
// A plain arc, sagging under its chord: "Rheinländerin", "Bouldert".
|
|
175
|
+
'hand-pfeil-bogen': {
|
|
176
|
+
pen: 1,
|
|
177
|
+
head: 4.4,
|
|
178
|
+
lead: 0.35,
|
|
179
|
+
knots: [
|
|
180
|
+
[0, 0],
|
|
181
|
+
[14, 9],
|
|
182
|
+
[32, 14],
|
|
183
|
+
[52, 15],
|
|
184
|
+
[72, 11],
|
|
185
|
+
[88, 5],
|
|
186
|
+
[100, 0],
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
// Leaves the label sideways, bends round and runs in: "Gamerin", "Halbtürkin".
|
|
190
|
+
'hand-pfeil-haken': {
|
|
191
|
+
pen: 1,
|
|
192
|
+
head: 4.4,
|
|
193
|
+
lead: 0.3,
|
|
194
|
+
knots: [
|
|
195
|
+
[0, 0],
|
|
196
|
+
[1, 9],
|
|
197
|
+
[6, 18],
|
|
198
|
+
[16, 24],
|
|
199
|
+
[32, 25],
|
|
200
|
+
[52, 20],
|
|
201
|
+
[72, 12],
|
|
202
|
+
[88, 5],
|
|
203
|
+
[100, 0],
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
// One soft swing: an S lying on its side.
|
|
207
|
+
'hand-pfeil-welle': {
|
|
208
|
+
pen: 0.75,
|
|
209
|
+
head: 5.5,
|
|
210
|
+
lead: 0.5,
|
|
211
|
+
knots: [
|
|
212
|
+
[0, 0],
|
|
213
|
+
[12, -6],
|
|
214
|
+
[26, -8],
|
|
215
|
+
[42, -3],
|
|
216
|
+
[58, 4],
|
|
217
|
+
[74, 7],
|
|
218
|
+
[88, 4],
|
|
219
|
+
[100, 0],
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
// One loop above the line, then a long run in: "Tierschützerin", "Jess".
|
|
223
|
+
'hand-pfeil-schlaufe': {
|
|
224
|
+
pen: 0.75,
|
|
225
|
+
head: 5.5,
|
|
226
|
+
lead: 0.5,
|
|
227
|
+
knots: [
|
|
228
|
+
[0, 0],
|
|
229
|
+
[10, 3],
|
|
230
|
+
[22, 4],
|
|
231
|
+
[31, 1],
|
|
232
|
+
[35, -6],
|
|
233
|
+
[32, -13],
|
|
234
|
+
[25, -14],
|
|
235
|
+
[21, -8],
|
|
236
|
+
[24, -1],
|
|
237
|
+
[32, 4],
|
|
238
|
+
[46, 6],
|
|
239
|
+
[64, 5],
|
|
240
|
+
[82, 3],
|
|
241
|
+
[100, 0],
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
// A hook, a small curl and a heart, then a long run in: "Musikliebhaberin".
|
|
245
|
+
'hand-pfeil-herz': {
|
|
246
|
+
pen: 0.75,
|
|
247
|
+
head: 5.5,
|
|
248
|
+
lead: 0.5,
|
|
249
|
+
knots: [
|
|
250
|
+
[0, -14],
|
|
251
|
+
[1, -7],
|
|
252
|
+
[5, -2],
|
|
253
|
+
[10, 0],
|
|
254
|
+
[14, -3],
|
|
255
|
+
[13, -7],
|
|
256
|
+
[10, -6],
|
|
257
|
+
[11, -2],
|
|
258
|
+
[17, 1],
|
|
259
|
+
[26, 2],
|
|
260
|
+
...heartKnots(36, 3, 0.62),
|
|
261
|
+
[46, 6],
|
|
262
|
+
[60, 7],
|
|
263
|
+
[78, 4],
|
|
264
|
+
[100, 0],
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
// A hook and two quick curls, then an S into the target: "Handwerklich …".
|
|
268
|
+
'hand-pfeil-spirale': {
|
|
269
|
+
pen: 0.75,
|
|
270
|
+
head: 5.5,
|
|
271
|
+
lead: 0.5,
|
|
272
|
+
knots: [
|
|
273
|
+
[0, -8],
|
|
274
|
+
[3, -2],
|
|
275
|
+
[8, 1],
|
|
276
|
+
[15, 1],
|
|
277
|
+
[20, -4],
|
|
278
|
+
[18, -10],
|
|
279
|
+
[13, -9],
|
|
280
|
+
[13, -2],
|
|
281
|
+
[20, 3],
|
|
282
|
+
[28, 2],
|
|
283
|
+
[33, -3],
|
|
284
|
+
[31, -9],
|
|
285
|
+
[26, -8],
|
|
286
|
+
[26, -1],
|
|
287
|
+
[33, 4],
|
|
288
|
+
[45, 6],
|
|
289
|
+
[58, 4],
|
|
290
|
+
[72, -1],
|
|
291
|
+
[86, -1],
|
|
292
|
+
[100, 0],
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
const KNOT_LINES = Object.fromEntries(Object.entries(ARROW_DESIGNS).map(([type, d]) => [type, spline(d.knots, 10)]));
|
|
297
|
+
const extent = (points) => {
|
|
298
|
+
const xs = points.map((p) => p[0]);
|
|
299
|
+
const ys = points.map((p) => p[1]);
|
|
300
|
+
return { x0: Math.min(...xs), x1: Math.max(...xs), y0: Math.min(...ys), y1: Math.max(...ys) };
|
|
301
|
+
};
|
|
302
|
+
/** Where the line ends and which way it runs there, judged over the last `back` px. */
|
|
303
|
+
function tipDirection(points, back) {
|
|
304
|
+
const tip = points[points.length - 1];
|
|
305
|
+
for (let i = points.length - 2; i >= 0; i--) {
|
|
306
|
+
const [x, y] = points[i];
|
|
307
|
+
if (Math.hypot(tip[0] - x, tip[1] - y) >= back || i === 0)
|
|
308
|
+
return Math.atan2(tip[1] - y, tip[0] - x);
|
|
309
|
+
}
|
|
310
|
+
return 0;
|
|
311
|
+
}
|
|
312
|
+
/** The two barbs, opened ±0.65 rad off the line, the lower a little shorter. */
|
|
313
|
+
const barbEnds = (tip, dir, length) => [
|
|
314
|
+
[-0.66, length],
|
|
315
|
+
[0.62, length * 0.88],
|
|
316
|
+
].map(([angle, len]) => [
|
|
317
|
+
tip[0] + Math.cos(dir + Math.PI + angle) * len,
|
|
318
|
+
tip[1] + Math.sin(dir + Math.PI + angle) * len,
|
|
319
|
+
]);
|
|
320
|
+
/**
|
|
321
|
+
* A designed arrow laid into `w` × `h`: its line, pen width and head. The
|
|
322
|
+
* head's barbs keep their length in px, so the line is fitted twice — once
|
|
323
|
+
* alone, once with the barbs' overhang — and the whole sits inside the box.
|
|
324
|
+
*/
|
|
325
|
+
function arrowGeometry(type, w, h, sw) {
|
|
326
|
+
const design = ARROW_DESIGNS[type];
|
|
327
|
+
const unit = KNOT_LINES[type];
|
|
328
|
+
const pen = sw * design.pen;
|
|
329
|
+
const box = extent(unit);
|
|
330
|
+
const bw = Math.max(1e-6, box.x1 - box.x0);
|
|
331
|
+
const bh = Math.max(1e-6, box.y1 - box.y0);
|
|
332
|
+
const lay = (sx, sy, ox, oy) => unit.map(([x, y]) => [ox + (x - box.x0) * sx, oy + (y - box.y0) * sy]);
|
|
333
|
+
let sx = Math.max(1e-3, (w - pen) / bw);
|
|
334
|
+
let sy = Math.max(1e-3, (h - pen) / bh);
|
|
335
|
+
let points = lay(sx, sy, 0, 0);
|
|
336
|
+
const tail = points[0];
|
|
337
|
+
const tip = points[points.length - 1];
|
|
338
|
+
const head = Math.min(pen * design.head, 0.3 * Math.hypot(tip[0] - tail[0], tip[1] - tail[1]));
|
|
339
|
+
const over = extent([...points, ...barbEnds(tip, tipDirection(points, head * 0.6), head)]);
|
|
340
|
+
sx = Math.max(sx * 0.2, (w - pen - (over.x1 - over.x0 - bw * sx)) / bw);
|
|
341
|
+
sy = Math.max(sy * 0.2, (h - pen - (over.y1 - over.y0 - bh * sy)) / bh);
|
|
342
|
+
points = lay(sx, sy, 0, 0);
|
|
343
|
+
const end = points[points.length - 1];
|
|
344
|
+
const dir = tipDirection(points, head * 0.6);
|
|
345
|
+
const all = extent([...points, ...barbEnds(end, dir, head)]);
|
|
346
|
+
const ox = -(all.x0 + all.x1) / 2;
|
|
347
|
+
const oy = -(all.y0 + all.y1) / 2;
|
|
348
|
+
points = points.map(([x, y]) => [x + ox, y + oy]);
|
|
349
|
+
return { points, pen, head, dir, lead: design.lead };
|
|
350
|
+
}
|
|
351
|
+
function designedArrow(type, w, h, sw) {
|
|
352
|
+
const { points, pen, head, dir, lead } = arrowGeometry(type, w, h, sw);
|
|
353
|
+
const tip = points[points.length - 1];
|
|
354
|
+
const line = brush(points, (t) => pen * (lead + (1 - lead) * smooth(t / 0.25)));
|
|
355
|
+
const barbs = barbEnds(tip, dir, head).map((end) => brush(sample(12, (t) => [end[0] + (tip[0] - end[0]) * t, end[1] + (tip[1] - end[1]) * t]), (t) => pen * (0.45 + 0.55 * smooth(t / 0.6))));
|
|
356
|
+
return `${line}${barbs.join('')}`;
|
|
357
|
+
}
|
|
358
|
+
/** The hand-drawn arrows: one stroke from a tail to an open head. */
|
|
359
|
+
export const HAND_ARROW_TYPES = [
|
|
360
|
+
'hand-pfeil',
|
|
361
|
+
'hand-pfeil-bogen',
|
|
362
|
+
'hand-pfeil-haken',
|
|
363
|
+
'hand-pfeil-welle',
|
|
364
|
+
'hand-pfeil-schlaufe',
|
|
365
|
+
'hand-pfeil-herz',
|
|
366
|
+
'hand-pfeil-spirale',
|
|
367
|
+
];
|
|
368
|
+
/** Height as a share of the width each arrow is drawn at by default. */
|
|
369
|
+
export const HAND_ARROW_ASPECT = {
|
|
370
|
+
'hand-pfeil': 0.5,
|
|
371
|
+
// The traced line's own proportions, plus a little for the head.
|
|
372
|
+
...Object.fromEntries(Object.entries(KNOT_LINES).map(([type, line]) => {
|
|
373
|
+
const box = extent(line);
|
|
374
|
+
return [type, (box.y1 - box.y0) / (box.x1 - box.x0) + 0.06];
|
|
375
|
+
})),
|
|
376
|
+
};
|
|
377
|
+
/** Where an arrow's stroke starts and its head points, in the shape's own frame (centred on 0,0). */
|
|
378
|
+
export function handArrowEnds(type, w, h, sw) {
|
|
379
|
+
if (type === 'hand-pfeil') {
|
|
380
|
+
const head = Math.min(w, h) * 0.42;
|
|
381
|
+
return {
|
|
382
|
+
tail: { x: -w / 2 + sw / 2, y: h / 2 - sw / 2 },
|
|
383
|
+
tip: { x: w / 2 - sw / 2, y: -h / 2 + head * 0.55 + sw / 2 },
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
const { points } = arrowGeometry(type, w, h, sw);
|
|
387
|
+
const [tx, ty] = points[0];
|
|
388
|
+
const [px, py] = points[points.length - 1];
|
|
389
|
+
return { tail: { x: tx, y: ty }, tip: { x: px, y: py } };
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* The centre line of a designed arrow and its two barbs (each from its free
|
|
393
|
+
* end to the tip), in the shape's own frame — what the stroke covers, for
|
|
394
|
+
* keeping it clear of text.
|
|
395
|
+
*/
|
|
396
|
+
export function handArrowStroke(type, w, h, sw) {
|
|
397
|
+
const { points, pen, head, dir } = arrowGeometry(type, w, h, sw);
|
|
398
|
+
const tip = points[points.length - 1];
|
|
399
|
+
return {
|
|
400
|
+
line: points.map(([x, y]) => ({ x, y })),
|
|
401
|
+
barbs: barbEnds(tip, dir, head).map((end) => sample(4, (t) => [end[0] + (tip[0] - end[0]) * t, end[1] + (tip[1] - end[1]) * t]).map(([x, y]) => ({ x, y }))),
|
|
402
|
+
pen,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
/** Three short strokes bursting up and right from the lower left corner. */
|
|
406
|
+
function ausruf(w, h, sw) {
|
|
407
|
+
const origin = [-w / 2 + sw / 2, h / 2 - sw / 2];
|
|
408
|
+
const rx = w - sw;
|
|
409
|
+
const ry = h - sw;
|
|
410
|
+
return [
|
|
411
|
+
{ angle: -1.45, from: 0.42, to: 0.92 },
|
|
412
|
+
{ angle: -0.82, from: 0.4, to: 1 },
|
|
413
|
+
{ angle: -0.2, from: 0.42, to: 0.9 },
|
|
414
|
+
]
|
|
415
|
+
.map(({ angle, from, to }) => {
|
|
416
|
+
const at = (r) => [
|
|
417
|
+
origin[0] + Math.cos(angle) * rx * r,
|
|
418
|
+
origin[1] + Math.sin(angle) * ry * r,
|
|
419
|
+
];
|
|
420
|
+
return brush(sample(10, (t) => at(from + (to - from) * t)), (t) => sw * (1 - 0.6 * smooth((t - 0.3) / 0.7)));
|
|
421
|
+
})
|
|
422
|
+
.join('');
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* A highlighter swipe: a band the full height of the shape, its ends cut at
|
|
426
|
+
* the slant of a chisel tip and frayed where the ink ran thin, the edges
|
|
427
|
+
* wavering slightly along the stroke.
|
|
428
|
+
*/
|
|
429
|
+
function marker(w, h) {
|
|
430
|
+
const half = w / 2;
|
|
431
|
+
const slant = Math.min(h * 0.3, w * 0.08);
|
|
432
|
+
const steps = 40;
|
|
433
|
+
// Deterministic waver: the same shape draws the same edge on every render.
|
|
434
|
+
const edge = (t, phase) => h * (0.025 * Math.sin(t * 13 + phase) + 0.015 * Math.sin(t * 31 + phase * 2));
|
|
435
|
+
// A parallelogram: the top edge set right by the chisel's slant, the bottom left.
|
|
436
|
+
const run = w - 2 * slant;
|
|
437
|
+
const top = sample(steps, (t) => [
|
|
438
|
+
-half + 2 * slant + run * t,
|
|
439
|
+
-h / 2 + Math.abs(edge(t, 0.4)),
|
|
440
|
+
]);
|
|
441
|
+
const bottom = sample(steps, (t) => [
|
|
442
|
+
half - 2 * slant - run * t,
|
|
443
|
+
h / 2 - Math.abs(edge(t, 1.7)),
|
|
444
|
+
]);
|
|
445
|
+
// The cut ends, frayed where the ink ran thin: one point dips in, two bulge out.
|
|
446
|
+
const fray = (from, to, sign) => [0.3, 0.55, 0.8].map((t, i) => [
|
|
447
|
+
from[0] + (to[0] - from[0]) * t + sign * slant * (i === 1 ? -0.35 : 0.12),
|
|
448
|
+
from[1] + (to[1] - from[1]) * t,
|
|
449
|
+
]);
|
|
450
|
+
return outline([
|
|
451
|
+
...top,
|
|
452
|
+
...fray(top[steps], bottom[0], 1),
|
|
453
|
+
...bottom,
|
|
454
|
+
...fray(bottom[steps], top[0], -1),
|
|
455
|
+
]);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* The marker box behind a passage, as the DE posts set it — a straight box
|
|
459
|
+
* whose edges are just short of ruler-straight, so it reads as laid by hand.
|
|
460
|
+
*/
|
|
461
|
+
function markerBox(w, h) {
|
|
462
|
+
const wobble = (t, phase) => Math.min(h, w) * 0.012 * Math.sin(t * 9 + phase);
|
|
463
|
+
const top = sample(24, (t) => [-w / 2 + w * t, -h / 2 + Math.abs(wobble(t, 0.3))]);
|
|
464
|
+
const bottom = sample(24, (t) => [w / 2 - w * t, h / 2 - Math.abs(wobble(t, 2.1))]);
|
|
465
|
+
return outline([...top, ...bottom]);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A waving hand in a few brush strokes: the palm's outline, four fingers and
|
|
469
|
+
* the thumb, two motion arcs at the upper right — the doodle beside a name.
|
|
470
|
+
*/
|
|
471
|
+
function winken(w, h, sw) {
|
|
472
|
+
const s = Math.min(w, h);
|
|
473
|
+
const line = (from, to, lift = 0.5) => brush(sample(10, (t) => [from[0] + (to[0] - from[0]) * t, from[1] + (to[1] - from[1]) * t]), (t) => sw * (1 - lift * smooth((t - 0.6) / 0.4)));
|
|
474
|
+
const arc = (cx, cy, r, from, to) => brush(sample(16, (t) => {
|
|
475
|
+
const a = from + (to - from) * t;
|
|
476
|
+
return [cx + Math.cos(a) * r, cy + Math.sin(a) * r];
|
|
477
|
+
}), (t) => sw * (0.5 + 0.5 * Math.sin(Math.PI * t)));
|
|
478
|
+
// Palm: a rounded cup open at the top, tilted like a hand mid-wave.
|
|
479
|
+
const palm = brush(sample(30, (t) => {
|
|
480
|
+
const a = Math.PI * (0.15 + 0.85 * t);
|
|
481
|
+
return [-s * 0.08 + Math.cos(a) * s * 0.2, s * 0.12 + Math.sin(a) * s * 0.26];
|
|
482
|
+
}), taper(sw, 0.6, 0.85, 0.5));
|
|
483
|
+
const fingers = [
|
|
484
|
+
{ base: [-s * 0.22, s * 0.02], tip: [-s * 0.3, -s * 0.3] },
|
|
485
|
+
{ base: [-s * 0.12, -s * 0.02], tip: [-s * 0.14, -s * 0.42] },
|
|
486
|
+
{ base: [-s * 0.02, 0], tip: [s * 0.02, -s * 0.38] },
|
|
487
|
+
{ base: [s * 0.08, s * 0.04], tip: [s * 0.16, -s * 0.26] },
|
|
488
|
+
].map(({ base, tip }) => line(base, tip));
|
|
489
|
+
const thumb = line([s * 0.12, s * 0.2], [s * 0.3, s * 0.02]);
|
|
490
|
+
return [
|
|
491
|
+
palm,
|
|
492
|
+
...fingers,
|
|
493
|
+
thumb,
|
|
494
|
+
arc(s * 0.18, -s * 0.18, s * 0.2, -1.2, -0.2),
|
|
495
|
+
arc(s * 0.18, -s * 0.18, s * 0.3, -1.25, -0.25),
|
|
496
|
+
].join('');
|
|
497
|
+
}
|
|
498
|
+
/** The filled outline of a hand-drawn shape, `width` × `height` px, centred on 0,0. */
|
|
499
|
+
export function handDrawnPath(type, width, height, strokeWidth) {
|
|
500
|
+
switch (type) {
|
|
501
|
+
case 'hand-kreis':
|
|
502
|
+
return kreis(width, height, strokeWidth);
|
|
503
|
+
case 'hand-unterstrich':
|
|
504
|
+
return unterstrich(width, height, strokeWidth);
|
|
505
|
+
case 'hand-pfeil':
|
|
506
|
+
return pfeil(width, height, strokeWidth);
|
|
507
|
+
case 'hand-ausruf':
|
|
508
|
+
return ausruf(width, height, strokeWidth);
|
|
509
|
+
case 'hand-marker':
|
|
510
|
+
return marker(width, height);
|
|
511
|
+
case 'hand-marker-box':
|
|
512
|
+
return markerBox(width, height);
|
|
513
|
+
case 'hand-winken':
|
|
514
|
+
return winken(width, height, strokeWidth);
|
|
515
|
+
case 'hand-pfeil-schlaufe':
|
|
516
|
+
case 'hand-pfeil-welle':
|
|
517
|
+
case 'hand-pfeil-bogen':
|
|
518
|
+
case 'hand-pfeil-haken':
|
|
519
|
+
case 'hand-pfeil-herz':
|
|
520
|
+
case 'hand-pfeil-spirale':
|
|
521
|
+
return designedArrow(type, width, height, strokeWidth);
|
|
522
|
+
}
|
|
523
|
+
}
|