@nice2dev/ui-graphics 1.1.0 → 1.1.1
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/dist/cjs/animation/AnimatedPerson.js +69 -63
- package/dist/cjs/animation/AnimatedPerson.js.map +1 -1
- package/dist/cjs/animation/AnimationEditor.js +27 -20
- package/dist/cjs/animation/AnimationEditor.js.map +1 -1
- package/dist/cjs/animation/Audience.js +17 -11
- package/dist/cjs/animation/Audience.js.map +1 -1
- package/dist/cjs/animation/BodyRenderer.js +7 -7
- package/dist/cjs/animation/BodyRenderer.js.map +1 -1
- package/dist/cjs/animation/animationHelper.js +83 -52
- package/dist/cjs/animation/animationHelper.js.map +1 -1
- package/dist/cjs/animation/characterTypes.js +171 -30
- package/dist/cjs/animation/characterTypes.js.map +1 -1
- package/dist/cjs/animation/choreoDSL.js +114 -62
- package/dist/cjs/animation/choreoDSL.js.map +1 -1
- package/dist/cjs/animation/karaokeIntegration.js +10 -11
- package/dist/cjs/animation/karaokeIntegration.js.map +1 -1
- package/dist/cjs/animation/lottieExport.js +15 -9
- package/dist/cjs/animation/lottieExport.js.map +1 -1
- package/dist/cjs/animation/motionPath.js +125 -30
- package/dist/cjs/animation/motionPath.js.map +1 -1
- package/dist/cjs/animation/physics.js +157 -57
- package/dist/cjs/animation/physics.js.map +1 -1
- package/dist/cjs/animation/rig/RigPlayer.js +7 -6
- package/dist/cjs/animation/rig/RigPlayer.js.map +1 -1
- package/dist/cjs/animation/rig/RiggedBody.js +7 -7
- package/dist/cjs/animation/rig/RiggedBody.js.map +1 -1
- package/dist/cjs/animation/rig/choreoRigBridge.js +52 -29
- package/dist/cjs/animation/rig/choreoRigBridge.js.map +1 -1
- package/dist/cjs/animation/rig/poseOps.js +6 -3
- package/dist/cjs/animation/rig/poseOps.js.map +1 -1
- package/dist/cjs/animation/shapes/arms.js +7 -6
- package/dist/cjs/animation/shapes/arms.js.map +1 -1
- package/dist/cjs/animation/shapes/eyes.js +31 -18
- package/dist/cjs/animation/shapes/eyes.js.map +1 -1
- package/dist/cjs/animation/shapes/hair.js +39 -23
- package/dist/cjs/animation/shapes/hair.js.map +1 -1
- package/dist/cjs/animation/shapes/heads.js +47 -29
- package/dist/cjs/animation/shapes/heads.js.map +1 -1
- package/dist/cjs/animation/shapes/headwear.js +26 -14
- package/dist/cjs/animation/shapes/headwear.js.map +1 -1
- package/dist/cjs/animation/shapes/legs.js +7 -6
- package/dist/cjs/animation/shapes/legs.js.map +1 -1
- package/dist/cjs/animation/shapes/mouths.js +28 -18
- package/dist/cjs/animation/shapes/mouths.js.map +1 -1
- package/dist/cjs/animation/shapes/noses.js +18 -9
- package/dist/cjs/animation/shapes/noses.js.map +1 -1
- package/dist/cjs/animation/shapes/outfits.js +25 -14
- package/dist/cjs/animation/shapes/outfits.js.map +1 -1
- package/dist/cjs/animation/shapes/torsos.js +5 -4
- package/dist/cjs/animation/shapes/torsos.js.map +1 -1
- package/dist/cjs/animation/spineExport.js +33 -26
- package/dist/cjs/animation/spineExport.js.map +1 -1
- package/dist/cjs/core/LocalUI.js +16 -16
- package/dist/cjs/core/LocalUI.js.map +1 -1
- package/dist/cjs/core/NiceBrushEngine.js +205 -69
- package/dist/cjs/core/NiceBrushEngine.js.map +1 -1
- package/dist/cjs/core/collaboration.js +35 -21
- package/dist/cjs/core/collaboration.js.map +1 -1
- package/dist/cjs/core/colorBlindness.js +64 -24
- package/dist/cjs/core/colorBlindness.js.map +1 -1
- package/dist/cjs/core/dragDrop.js +34 -26
- package/dist/cjs/core/dragDrop.js.map +1 -1
- package/dist/cjs/core/fixes.js +26 -14
- package/dist/cjs/core/fixes.js.map +1 -1
- package/dist/cjs/core/gridGuides.js +24 -16
- package/dist/cjs/core/gridGuides.js.map +1 -1
- package/dist/cjs/core/historyVisual.js +42 -23
- package/dist/cjs/core/historyVisual.js.map +1 -1
- package/dist/cjs/core/integrations.js +65 -48
- package/dist/cjs/core/integrations.js.map +1 -1
- package/dist/cjs/core/minimap.js +40 -24
- package/dist/cjs/core/minimap.js.map +1 -1
- package/dist/cjs/core/plugins.js +10 -6
- package/dist/cjs/core/plugins.js.map +1 -1
- package/dist/cjs/core/rtl.js +32 -27
- package/dist/cjs/core/rtl.js.map +1 -1
- package/dist/cjs/core/shortcuts.js +77 -39
- package/dist/cjs/core/shortcuts.js.map +1 -1
- package/dist/cjs/core/theme.js +68 -61
- package/dist/cjs/core/theme.js.map +1 -1
- package/dist/cjs/core/yjsCollaboration.js +61 -28
- package/dist/cjs/core/yjsCollaboration.js.map +1 -1
- package/dist/cjs/font/NiceFontEditor.js +160 -57
- package/dist/cjs/font/NiceFontEditor.js.map +1 -1
- package/dist/cjs/font/fontFormatUtils.js +37 -24
- package/dist/cjs/font/fontFormatUtils.js.map +1 -1
- package/dist/cjs/game/GameAsset2dEditor.js +73 -60
- package/dist/cjs/game/GameAsset2dEditor.js.map +1 -1
- package/dist/cjs/game/gameAssetUtils.js +18 -13
- package/dist/cjs/game/gameAssetUtils.js.map +1 -1
- package/dist/cjs/game/useGameAssetEditor.js +160 -143
- package/dist/cjs/game/useGameAssetEditor.js.map +1 -1
- package/dist/cjs/icon/NiceIconEditor.js +329 -106
- package/dist/cjs/icon/NiceIconEditor.js.map +1 -1
- package/dist/cjs/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js +572 -0
- package/dist/cjs/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceForm-CKoJA6NG.js +4979 -0
- package/dist/cjs/packages/ui/dist/NiceForm-CKoJA6NG.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceModal-1QX7NhyH.js +98 -0
- package/dist/cjs/packages/ui/dist/NiceModal-1QX7NhyH.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5244 -0
- package/dist/cjs/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NicePagination-DbE-uOkl.js +174 -0
- package/dist/cjs/packages/ui/dist/NicePagination-DbE-uOkl.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js +10459 -0
- package/dist/cjs/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6313 -0
- package/dist/cjs/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceTabs-DzLHzwuA.js +1639 -0
- package/dist/cjs/packages/ui/dist/NiceTabs-DzLHzwuA.js.map +1 -0
- package/dist/cjs/packages/ui/dist/NiceWindow-DeC83yfE.js +807 -0
- package/dist/cjs/packages/ui/dist/NiceWindow-DeC83yfE.js.map +1 -0
- package/dist/cjs/packages/ui/dist/charts-BAS21jkC.js +3833 -0
- package/dist/cjs/packages/ui/dist/charts-BAS21jkC.js.map +1 -0
- package/dist/cjs/packages/ui/dist/core-Da43q-pO.js +11683 -0
- package/dist/cjs/packages/ui/dist/core-Da43q-pO.js.map +1 -0
- package/dist/cjs/packages/ui/dist/index-pAuGTbuB.js +28876 -0
- package/dist/cjs/packages/ui/dist/index-pAuGTbuB.js.map +1 -0
- package/dist/cjs/photo/FilterThumb.js +7 -5
- package/dist/cjs/photo/FilterThumb.js.map +1 -1
- package/dist/cjs/photo/NiceAITools.js +78 -32
- package/dist/cjs/photo/NiceAITools.js.map +1 -1
- package/dist/cjs/photo/PhotoEditor.js +4 -4
- package/dist/cjs/photo/PhotoEditor.js.map +1 -1
- package/dist/cjs/photo/PhotoEditorCanvas.js +56 -22
- package/dist/cjs/photo/PhotoEditorCanvas.js.map +1 -1
- package/dist/cjs/photo/PhotoEditorLeftPanel.js +106 -48
- package/dist/cjs/photo/PhotoEditorLeftPanel.js.map +1 -1
- package/dist/cjs/photo/PhotoEditorToolbar.js +2 -2
- package/dist/cjs/photo/PhotoEditorToolbar.js.map +1 -1
- package/dist/cjs/photo/photoEditorActions.js +27 -18
- package/dist/cjs/photo/photoEditorActions.js.map +1 -1
- package/dist/cjs/photo/photoFilters.js +316 -81
- package/dist/cjs/photo/photoFilters.js.map +1 -1
- package/dist/cjs/photo/photoOverlays.js +521 -165
- package/dist/cjs/photo/photoOverlays.js.map +1 -1
- package/dist/cjs/photo/photoSelection.js +69 -35
- package/dist/cjs/photo/photoSelection.js.map +1 -1
- package/dist/cjs/photo/usePhotoEditor.js +203 -97
- package/dist/cjs/photo/usePhotoEditor.js.map +1 -1
- package/dist/cjs/pixel/HSVPicker.js +32 -19
- package/dist/cjs/pixel/HSVPicker.js.map +1 -1
- package/dist/cjs/pixel/PixelEditor.js +25 -14
- package/dist/cjs/pixel/PixelEditor.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorCanvas.js +2 -2
- package/dist/cjs/pixel/PixelEditorCanvas.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorMenuBar.js +3 -3
- package/dist/cjs/pixel/PixelEditorMenuBar.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorRightPanel.js +28 -8
- package/dist/cjs/pixel/PixelEditorRightPanel.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorStatusBar.js +2 -2
- package/dist/cjs/pixel/PixelEditorStatusBar.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorTimeline.js +3 -4
- package/dist/cjs/pixel/PixelEditorTimeline.js.map +1 -1
- package/dist/cjs/pixel/PixelEditorToolbar.js +3 -3
- package/dist/cjs/pixel/PixelEditorToolbar.js.map +1 -1
- package/dist/cjs/pixel/SpriteGeneratorPanel.js +136 -54
- package/dist/cjs/pixel/SpriteGeneratorPanel.js.map +1 -1
- package/dist/cjs/pixel/asepriteFormat.js +122 -38
- package/dist/cjs/pixel/asepriteFormat.js.map +1 -1
- package/dist/cjs/pixel/characterGeneratorPresets.js +208 -54
- package/dist/cjs/pixel/characterGeneratorPresets.js.map +1 -1
- package/dist/cjs/pixel/pixelEditorExports.js +42 -35
- package/dist/cjs/pixel/pixelEditorExports.js.map +1 -1
- package/dist/cjs/pixel/pixelEditorTypes.js +67 -33
- package/dist/cjs/pixel/pixelEditorTypes.js.map +1 -1
- package/dist/cjs/pixel/pixelEditorUtils.js +62 -38
- package/dist/cjs/pixel/pixelEditorUtils.js.map +1 -1
- package/dist/cjs/pixel/spriteGeneratorCore.js +47 -24
- package/dist/cjs/pixel/spriteGeneratorCore.js.map +1 -1
- package/dist/cjs/pixel/usePixelEditor.js +475 -213
- package/dist/cjs/pixel/usePixelEditor.js.map +1 -1
- package/dist/cjs/texture/Nice3DTexturePainter.js +201 -71
- package/dist/cjs/texture/Nice3DTexturePainter.js.map +1 -1
- package/dist/cjs/ui/NiceUIDesigner.js +280 -91
- package/dist/cjs/ui/NiceUIDesigner.js.map +1 -1
- package/dist/cjs/vector/NiceSvgToCode.js +96 -34
- package/dist/cjs/vector/NiceSvgToCode.js.map +1 -1
- package/dist/cjs/vector/VectorEditor.js +14 -13
- package/dist/cjs/vector/VectorEditor.js.map +1 -1
- package/dist/cjs/vector/VectorEditorMenuBar.js +7 -6
- package/dist/cjs/vector/VectorEditorMenuBar.js.map +1 -1
- package/dist/cjs/vector/VectorEditorRightPanel.js +87 -32
- package/dist/cjs/vector/VectorEditorRightPanel.js.map +1 -1
- package/dist/cjs/vector/VectorEditorShapeRenderer.js +17 -15
- package/dist/cjs/vector/VectorEditorShapeRenderer.js.map +1 -1
- package/dist/cjs/vector/VectorEditorStatusBar.js.map +1 -1
- package/dist/cjs/vector/useVectorEditor.js +312 -122
- package/dist/cjs/vector/useVectorEditor.js.map +1 -1
- package/dist/cjs/vector/vectorBooleanOps.js +60 -42
- package/dist/cjs/vector/vectorBooleanOps.js.map +1 -1
- package/dist/cjs/vector/vectorEditorExport.js +40 -34
- package/dist/cjs/vector/vectorEditorExport.js.map +1 -1
- package/dist/cjs/vector/vectorGradients.js +41 -40
- package/dist/cjs/vector/vectorGradients.js.map +1 -1
- package/dist/esm/animation/AnimatedPerson.js +69 -63
- package/dist/esm/animation/AnimatedPerson.js.map +1 -1
- package/dist/esm/animation/AnimationEditor.js +27 -20
- package/dist/esm/animation/AnimationEditor.js.map +1 -1
- package/dist/esm/animation/Audience.js +17 -11
- package/dist/esm/animation/Audience.js.map +1 -1
- package/dist/esm/animation/BodyRenderer.js +7 -7
- package/dist/esm/animation/BodyRenderer.js.map +1 -1
- package/dist/esm/animation/animationHelper.js +83 -52
- package/dist/esm/animation/animationHelper.js.map +1 -1
- package/dist/esm/animation/characterTypes.js +171 -30
- package/dist/esm/animation/characterTypes.js.map +1 -1
- package/dist/esm/animation/choreoDSL.js +114 -62
- package/dist/esm/animation/choreoDSL.js.map +1 -1
- package/dist/esm/animation/karaokeIntegration.js +10 -11
- package/dist/esm/animation/karaokeIntegration.js.map +1 -1
- package/dist/esm/animation/lottieExport.js +15 -9
- package/dist/esm/animation/lottieExport.js.map +1 -1
- package/dist/esm/animation/motionPath.js +125 -30
- package/dist/esm/animation/motionPath.js.map +1 -1
- package/dist/esm/animation/physics.js +157 -57
- package/dist/esm/animation/physics.js.map +1 -1
- package/dist/esm/animation/rig/RigPlayer.js +7 -6
- package/dist/esm/animation/rig/RigPlayer.js.map +1 -1
- package/dist/esm/animation/rig/RiggedBody.js +7 -7
- package/dist/esm/animation/rig/RiggedBody.js.map +1 -1
- package/dist/esm/animation/rig/choreoRigBridge.js +52 -29
- package/dist/esm/animation/rig/choreoRigBridge.js.map +1 -1
- package/dist/esm/animation/rig/poseOps.js +6 -3
- package/dist/esm/animation/rig/poseOps.js.map +1 -1
- package/dist/esm/animation/shapes/arms.js +7 -6
- package/dist/esm/animation/shapes/arms.js.map +1 -1
- package/dist/esm/animation/shapes/eyes.js +31 -18
- package/dist/esm/animation/shapes/eyes.js.map +1 -1
- package/dist/esm/animation/shapes/hair.js +39 -23
- package/dist/esm/animation/shapes/hair.js.map +1 -1
- package/dist/esm/animation/shapes/heads.js +47 -29
- package/dist/esm/animation/shapes/heads.js.map +1 -1
- package/dist/esm/animation/shapes/headwear.js +26 -14
- package/dist/esm/animation/shapes/headwear.js.map +1 -1
- package/dist/esm/animation/shapes/legs.js +7 -6
- package/dist/esm/animation/shapes/legs.js.map +1 -1
- package/dist/esm/animation/shapes/mouths.js +28 -18
- package/dist/esm/animation/shapes/mouths.js.map +1 -1
- package/dist/esm/animation/shapes/noses.js +18 -9
- package/dist/esm/animation/shapes/noses.js.map +1 -1
- package/dist/esm/animation/shapes/outfits.js +25 -14
- package/dist/esm/animation/shapes/outfits.js.map +1 -1
- package/dist/esm/animation/shapes/torsos.js +5 -4
- package/dist/esm/animation/shapes/torsos.js.map +1 -1
- package/dist/esm/animation/spineExport.js +33 -26
- package/dist/esm/animation/spineExport.js.map +1 -1
- package/dist/esm/core/LocalUI.js +16 -16
- package/dist/esm/core/LocalUI.js.map +1 -1
- package/dist/esm/core/NiceBrushEngine.js +205 -69
- package/dist/esm/core/NiceBrushEngine.js.map +1 -1
- package/dist/esm/core/collaboration.js +35 -21
- package/dist/esm/core/collaboration.js.map +1 -1
- package/dist/esm/core/colorBlindness.js +64 -24
- package/dist/esm/core/colorBlindness.js.map +1 -1
- package/dist/esm/core/dragDrop.js +34 -26
- package/dist/esm/core/dragDrop.js.map +1 -1
- package/dist/esm/core/fixes.js +26 -14
- package/dist/esm/core/fixes.js.map +1 -1
- package/dist/esm/core/gridGuides.js +24 -16
- package/dist/esm/core/gridGuides.js.map +1 -1
- package/dist/esm/core/historyVisual.js +42 -23
- package/dist/esm/core/historyVisual.js.map +1 -1
- package/dist/esm/core/integrations.js +65 -48
- package/dist/esm/core/integrations.js.map +1 -1
- package/dist/esm/core/minimap.js +40 -24
- package/dist/esm/core/minimap.js.map +1 -1
- package/dist/esm/core/plugins.js +10 -6
- package/dist/esm/core/plugins.js.map +1 -1
- package/dist/esm/core/rtl.js +32 -27
- package/dist/esm/core/rtl.js.map +1 -1
- package/dist/esm/core/shortcuts.js +77 -39
- package/dist/esm/core/shortcuts.js.map +1 -1
- package/dist/esm/core/theme.js +68 -61
- package/dist/esm/core/theme.js.map +1 -1
- package/dist/esm/core/yjsCollaboration.js +61 -28
- package/dist/esm/core/yjsCollaboration.js.map +1 -1
- package/dist/esm/font/NiceFontEditor.js +160 -57
- package/dist/esm/font/NiceFontEditor.js.map +1 -1
- package/dist/esm/font/fontFormatUtils.js +37 -24
- package/dist/esm/font/fontFormatUtils.js.map +1 -1
- package/dist/esm/game/GameAsset2dEditor.js +73 -60
- package/dist/esm/game/GameAsset2dEditor.js.map +1 -1
- package/dist/esm/game/gameAssetUtils.js +18 -13
- package/dist/esm/game/gameAssetUtils.js.map +1 -1
- package/dist/esm/game/useGameAssetEditor.js +160 -143
- package/dist/esm/game/useGameAssetEditor.js.map +1 -1
- package/dist/esm/icon/NiceIconEditor.js +329 -106
- package/dist/esm/icon/NiceIconEditor.js.map +1 -1
- package/dist/esm/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js +563 -0
- package/dist/esm/packages/ui/dist/NiceErrorBoundary-D75yr_WE.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceForm-CKoJA6NG.js +4960 -0
- package/dist/esm/packages/ui/dist/NiceForm-CKoJA6NG.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceModal-1QX7NhyH.js +96 -0
- package/dist/esm/packages/ui/dist/NiceModal-1QX7NhyH.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5201 -0
- package/dist/esm/packages/ui/dist/NiceModuleLifecyclePanel-CMrPbSw9.js.map +1 -0
- package/dist/esm/packages/ui/dist/NicePagination-DbE-uOkl.js +172 -0
- package/dist/esm/packages/ui/dist/NicePagination-DbE-uOkl.js.map +1 -0
- package/dist/esm/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js +10408 -0
- package/dist/esm/packages/ui/dist/NicePinCodeInput-B8cI8zu8.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6296 -0
- package/dist/esm/packages/ui/dist/NiceSavedQueryPanel-CZ5bYOe_.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceTabs-DzLHzwuA.js +1630 -0
- package/dist/esm/packages/ui/dist/NiceTabs-DzLHzwuA.js.map +1 -0
- package/dist/esm/packages/ui/dist/NiceWindow-DeC83yfE.js +796 -0
- package/dist/esm/packages/ui/dist/NiceWindow-DeC83yfE.js.map +1 -0
- package/dist/esm/packages/ui/dist/charts-BAS21jkC.js +3809 -0
- package/dist/esm/packages/ui/dist/charts-BAS21jkC.js.map +1 -0
- package/dist/esm/packages/ui/dist/core-Da43q-pO.js +11502 -0
- package/dist/esm/packages/ui/dist/core-Da43q-pO.js.map +1 -0
- package/dist/esm/packages/ui/dist/index-pAuGTbuB.js +28792 -0
- package/dist/esm/packages/ui/dist/index-pAuGTbuB.js.map +1 -0
- package/dist/esm/photo/FilterThumb.js +7 -5
- package/dist/esm/photo/FilterThumb.js.map +1 -1
- package/dist/esm/photo/NiceAITools.js +78 -32
- package/dist/esm/photo/NiceAITools.js.map +1 -1
- package/dist/esm/photo/PhotoEditor.js +4 -4
- package/dist/esm/photo/PhotoEditor.js.map +1 -1
- package/dist/esm/photo/PhotoEditorCanvas.js +56 -22
- package/dist/esm/photo/PhotoEditorCanvas.js.map +1 -1
- package/dist/esm/photo/PhotoEditorLeftPanel.js +106 -48
- package/dist/esm/photo/PhotoEditorLeftPanel.js.map +1 -1
- package/dist/esm/photo/PhotoEditorToolbar.js +2 -2
- package/dist/esm/photo/PhotoEditorToolbar.js.map +1 -1
- package/dist/esm/photo/photoEditorActions.js +27 -18
- package/dist/esm/photo/photoEditorActions.js.map +1 -1
- package/dist/esm/photo/photoFilters.js +316 -81
- package/dist/esm/photo/photoFilters.js.map +1 -1
- package/dist/esm/photo/photoOverlays.js +521 -165
- package/dist/esm/photo/photoOverlays.js.map +1 -1
- package/dist/esm/photo/photoSelection.js +69 -35
- package/dist/esm/photo/photoSelection.js.map +1 -1
- package/dist/esm/photo/usePhotoEditor.js +203 -97
- package/dist/esm/photo/usePhotoEditor.js.map +1 -1
- package/dist/esm/pixel/HSVPicker.js +32 -19
- package/dist/esm/pixel/HSVPicker.js.map +1 -1
- package/dist/esm/pixel/PixelEditor.js +25 -14
- package/dist/esm/pixel/PixelEditor.js.map +1 -1
- package/dist/esm/pixel/PixelEditorCanvas.js +2 -2
- package/dist/esm/pixel/PixelEditorCanvas.js.map +1 -1
- package/dist/esm/pixel/PixelEditorMenuBar.js +3 -3
- package/dist/esm/pixel/PixelEditorMenuBar.js.map +1 -1
- package/dist/esm/pixel/PixelEditorRightPanel.js +28 -8
- package/dist/esm/pixel/PixelEditorRightPanel.js.map +1 -1
- package/dist/esm/pixel/PixelEditorStatusBar.js +2 -2
- package/dist/esm/pixel/PixelEditorStatusBar.js.map +1 -1
- package/dist/esm/pixel/PixelEditorTimeline.js +3 -4
- package/dist/esm/pixel/PixelEditorTimeline.js.map +1 -1
- package/dist/esm/pixel/PixelEditorToolbar.js +3 -3
- package/dist/esm/pixel/PixelEditorToolbar.js.map +1 -1
- package/dist/esm/pixel/SpriteGeneratorPanel.js +136 -54
- package/dist/esm/pixel/SpriteGeneratorPanel.js.map +1 -1
- package/dist/esm/pixel/asepriteFormat.js +122 -38
- package/dist/esm/pixel/asepriteFormat.js.map +1 -1
- package/dist/esm/pixel/characterGeneratorPresets.js +208 -54
- package/dist/esm/pixel/characterGeneratorPresets.js.map +1 -1
- package/dist/esm/pixel/pixelEditorExports.js +42 -35
- package/dist/esm/pixel/pixelEditorExports.js.map +1 -1
- package/dist/esm/pixel/pixelEditorTypes.js +67 -33
- package/dist/esm/pixel/pixelEditorTypes.js.map +1 -1
- package/dist/esm/pixel/pixelEditorUtils.js +62 -38
- package/dist/esm/pixel/pixelEditorUtils.js.map +1 -1
- package/dist/esm/pixel/spriteGeneratorCore.js +47 -24
- package/dist/esm/pixel/spriteGeneratorCore.js.map +1 -1
- package/dist/esm/pixel/usePixelEditor.js +475 -213
- package/dist/esm/pixel/usePixelEditor.js.map +1 -1
- package/dist/esm/texture/Nice3DTexturePainter.js +201 -71
- package/dist/esm/texture/Nice3DTexturePainter.js.map +1 -1
- package/dist/esm/ui/NiceUIDesigner.js +280 -91
- package/dist/esm/ui/NiceUIDesigner.js.map +1 -1
- package/dist/esm/vector/NiceSvgToCode.js +96 -34
- package/dist/esm/vector/NiceSvgToCode.js.map +1 -1
- package/dist/esm/vector/VectorEditor.js +14 -13
- package/dist/esm/vector/VectorEditor.js.map +1 -1
- package/dist/esm/vector/VectorEditorMenuBar.js +7 -6
- package/dist/esm/vector/VectorEditorMenuBar.js.map +1 -1
- package/dist/esm/vector/VectorEditorRightPanel.js +87 -32
- package/dist/esm/vector/VectorEditorRightPanel.js.map +1 -1
- package/dist/esm/vector/VectorEditorShapeRenderer.js +17 -15
- package/dist/esm/vector/VectorEditorShapeRenderer.js.map +1 -1
- package/dist/esm/vector/VectorEditorStatusBar.js.map +1 -1
- package/dist/esm/vector/useVectorEditor.js +312 -122
- package/dist/esm/vector/useVectorEditor.js.map +1 -1
- package/dist/esm/vector/vectorBooleanOps.js +60 -42
- package/dist/esm/vector/vectorBooleanOps.js.map +1 -1
- package/dist/esm/vector/vectorEditorExport.js +40 -34
- package/dist/esm/vector/vectorEditorExport.js.map +1 -1
- package/dist/esm/vector/vectorGradients.js +41 -40
- package/dist/esm/vector/vectorGradients.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,116 +9,436 @@
|
|
|
9
9
|
*/
|
|
10
10
|
const EMOJI_CATALOG = [
|
|
11
11
|
{
|
|
12
|
-
id:
|
|
13
|
-
label:
|
|
14
|
-
icon:
|
|
12
|
+
id: 'faces',
|
|
13
|
+
label: 'Buźki',
|
|
14
|
+
icon: '😊',
|
|
15
15
|
emojis: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
'😀',
|
|
17
|
+
'😃',
|
|
18
|
+
'😄',
|
|
19
|
+
'😁',
|
|
20
|
+
'😆',
|
|
21
|
+
'😅',
|
|
22
|
+
'🤣',
|
|
23
|
+
'😂',
|
|
24
|
+
'🙂',
|
|
25
|
+
'😉',
|
|
26
|
+
'😊',
|
|
27
|
+
'😇',
|
|
28
|
+
'🥰',
|
|
29
|
+
'😍',
|
|
30
|
+
'🤩',
|
|
31
|
+
'😘',
|
|
32
|
+
'😗',
|
|
33
|
+
'😚',
|
|
34
|
+
'😋',
|
|
35
|
+
'😛',
|
|
36
|
+
'😜',
|
|
37
|
+
'🤪',
|
|
38
|
+
'😝',
|
|
39
|
+
'🤑',
|
|
40
|
+
'🤗',
|
|
41
|
+
'🤭',
|
|
42
|
+
'🤫',
|
|
43
|
+
'🤔',
|
|
44
|
+
'😐',
|
|
45
|
+
'😑',
|
|
46
|
+
'😶',
|
|
47
|
+
'🙄',
|
|
48
|
+
'😏',
|
|
49
|
+
'😣',
|
|
50
|
+
'😥',
|
|
51
|
+
'😮',
|
|
52
|
+
'🤐',
|
|
53
|
+
'😯',
|
|
54
|
+
'😪',
|
|
55
|
+
'😫',
|
|
56
|
+
'🥱',
|
|
57
|
+
'😴',
|
|
58
|
+
'🤤',
|
|
59
|
+
'😌',
|
|
60
|
+
'😷',
|
|
61
|
+
'🤒',
|
|
62
|
+
'🤕',
|
|
63
|
+
'🤢',
|
|
64
|
+
'🤮',
|
|
65
|
+
'🥵',
|
|
66
|
+
'🥶',
|
|
67
|
+
'🥴',
|
|
68
|
+
'😵',
|
|
69
|
+
'🤯',
|
|
70
|
+
'🤠',
|
|
71
|
+
'🥳',
|
|
72
|
+
'🥸',
|
|
73
|
+
'😎',
|
|
74
|
+
'🤓',
|
|
75
|
+
'🧐',
|
|
76
|
+
'😤',
|
|
77
|
+
'😡',
|
|
78
|
+
'🤬',
|
|
79
|
+
'😈',
|
|
80
|
+
'👿',
|
|
81
|
+
'💀',
|
|
82
|
+
'☠️',
|
|
83
|
+
'💩',
|
|
84
|
+
'🤡',
|
|
85
|
+
'👹',
|
|
86
|
+
'👻',
|
|
87
|
+
'👽',
|
|
88
|
+
'🤖',
|
|
22
89
|
],
|
|
23
90
|
},
|
|
24
91
|
{
|
|
25
|
-
id:
|
|
26
|
-
label:
|
|
27
|
-
icon:
|
|
92
|
+
id: 'gestures',
|
|
93
|
+
label: 'Gesty',
|
|
94
|
+
icon: '👍',
|
|
28
95
|
emojis: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
96
|
+
'👍',
|
|
97
|
+
'👎',
|
|
98
|
+
'👊',
|
|
99
|
+
'✊',
|
|
100
|
+
'🤛',
|
|
101
|
+
'🤜',
|
|
102
|
+
'🤝',
|
|
103
|
+
'👏',
|
|
104
|
+
'🙌',
|
|
105
|
+
'🫶',
|
|
106
|
+
'👐',
|
|
107
|
+
'🤲',
|
|
108
|
+
'🙏',
|
|
109
|
+
'✌️',
|
|
110
|
+
'🤞',
|
|
111
|
+
'🤟',
|
|
112
|
+
'🤘',
|
|
113
|
+
'🤙',
|
|
114
|
+
'👈',
|
|
115
|
+
'👉',
|
|
116
|
+
'👆',
|
|
117
|
+
'👇',
|
|
118
|
+
'☝️',
|
|
119
|
+
'✋',
|
|
120
|
+
'🤚',
|
|
121
|
+
'🖐️',
|
|
122
|
+
'🖖',
|
|
123
|
+
'👋',
|
|
124
|
+
'🤏',
|
|
125
|
+
'✍️',
|
|
126
|
+
'💪',
|
|
127
|
+
'🦾',
|
|
128
|
+
'🦵',
|
|
129
|
+
'🦶',
|
|
130
|
+
'👂',
|
|
131
|
+
'👃',
|
|
132
|
+
'👀',
|
|
133
|
+
'👁️',
|
|
134
|
+
'👅',
|
|
135
|
+
'👄',
|
|
33
136
|
],
|
|
34
137
|
},
|
|
35
138
|
{
|
|
36
|
-
id:
|
|
37
|
-
label:
|
|
38
|
-
icon:
|
|
139
|
+
id: 'hearts',
|
|
140
|
+
label: 'Serca',
|
|
141
|
+
icon: '❤️',
|
|
39
142
|
emojis: [
|
|
40
|
-
|
|
41
|
-
|
|
143
|
+
'❤️',
|
|
144
|
+
'🧡',
|
|
145
|
+
'💛',
|
|
146
|
+
'💚',
|
|
147
|
+
'💙',
|
|
148
|
+
'💜',
|
|
149
|
+
'🖤',
|
|
150
|
+
'🤍',
|
|
151
|
+
'🤎',
|
|
152
|
+
'❤️🔥',
|
|
153
|
+
'💔',
|
|
154
|
+
'❣️',
|
|
155
|
+
'💕',
|
|
156
|
+
'💞',
|
|
157
|
+
'💓',
|
|
158
|
+
'💗',
|
|
159
|
+
'💖',
|
|
160
|
+
'💘',
|
|
161
|
+
'💝',
|
|
162
|
+
'💟',
|
|
163
|
+
'♥️',
|
|
164
|
+
'💌',
|
|
165
|
+
'💋',
|
|
166
|
+
'💍',
|
|
167
|
+
'💎',
|
|
42
168
|
],
|
|
43
169
|
},
|
|
44
170
|
{
|
|
45
|
-
id:
|
|
46
|
-
label:
|
|
47
|
-
icon:
|
|
171
|
+
id: 'animals',
|
|
172
|
+
label: 'Zwierzki',
|
|
173
|
+
icon: '🐶',
|
|
48
174
|
emojis: [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
175
|
+
'🐶',
|
|
176
|
+
'🐱',
|
|
177
|
+
'🐭',
|
|
178
|
+
'🐹',
|
|
179
|
+
'🐰',
|
|
180
|
+
'🦊',
|
|
181
|
+
'🐻',
|
|
182
|
+
'🐼',
|
|
183
|
+
'🐨',
|
|
184
|
+
'🐯',
|
|
185
|
+
'🦁',
|
|
186
|
+
'🐮',
|
|
187
|
+
'🐷',
|
|
188
|
+
'🐸',
|
|
189
|
+
'🐵',
|
|
190
|
+
'🙈',
|
|
191
|
+
'🙉',
|
|
192
|
+
'🙊',
|
|
193
|
+
'🐔',
|
|
194
|
+
'🐧',
|
|
195
|
+
'🐦',
|
|
196
|
+
'🦆',
|
|
197
|
+
'🦅',
|
|
198
|
+
'🦉',
|
|
199
|
+
'🦋',
|
|
200
|
+
'🐌',
|
|
201
|
+
'🐞',
|
|
202
|
+
'🐙',
|
|
203
|
+
'🐬',
|
|
204
|
+
'🐳',
|
|
205
|
+
'🦈',
|
|
206
|
+
'🐊',
|
|
207
|
+
'🐘',
|
|
208
|
+
'🦒',
|
|
209
|
+
'🦘',
|
|
210
|
+
'🐴',
|
|
211
|
+
'🦄',
|
|
52
212
|
],
|
|
53
213
|
},
|
|
54
214
|
{
|
|
55
|
-
id:
|
|
56
|
-
label:
|
|
57
|
-
icon:
|
|
215
|
+
id: 'party',
|
|
216
|
+
label: 'Impreza',
|
|
217
|
+
icon: '🎉',
|
|
58
218
|
emojis: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
219
|
+
'🎉',
|
|
220
|
+
'🎊',
|
|
221
|
+
'🎈',
|
|
222
|
+
'🎁',
|
|
223
|
+
'🎀',
|
|
224
|
+
'🎃',
|
|
225
|
+
'🎄',
|
|
226
|
+
'🎆',
|
|
227
|
+
'🎇',
|
|
228
|
+
'✨',
|
|
229
|
+
'🏆',
|
|
230
|
+
'🏅',
|
|
231
|
+
'🥇',
|
|
232
|
+
'🥈',
|
|
233
|
+
'🥉',
|
|
234
|
+
'🎪',
|
|
235
|
+
'🎭',
|
|
236
|
+
'🎨',
|
|
237
|
+
'🎬',
|
|
238
|
+
'🎤',
|
|
239
|
+
'🎧',
|
|
240
|
+
'🎼',
|
|
241
|
+
'🎵',
|
|
242
|
+
'🎶',
|
|
243
|
+
'🎹',
|
|
244
|
+
'🥁',
|
|
245
|
+
'🎷',
|
|
246
|
+
'🎺',
|
|
247
|
+
'🎸',
|
|
248
|
+
'🎻',
|
|
249
|
+
'🎲',
|
|
250
|
+
'🎯',
|
|
251
|
+
'🎳',
|
|
252
|
+
'🕹️',
|
|
253
|
+
'🎮',
|
|
254
|
+
'🎰',
|
|
62
255
|
],
|
|
63
256
|
},
|
|
64
257
|
{
|
|
65
|
-
id:
|
|
66
|
-
label:
|
|
67
|
-
icon:
|
|
258
|
+
id: 'food',
|
|
259
|
+
label: 'Jedzenie',
|
|
260
|
+
icon: '🍕',
|
|
68
261
|
emojis: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
262
|
+
'🍏',
|
|
263
|
+
'🍎',
|
|
264
|
+
'🍐',
|
|
265
|
+
'🍊',
|
|
266
|
+
'🍋',
|
|
267
|
+
'🍌',
|
|
268
|
+
'🍉',
|
|
269
|
+
'🍇',
|
|
270
|
+
'🍓',
|
|
271
|
+
'🍒',
|
|
272
|
+
'🍑',
|
|
273
|
+
'🥭',
|
|
274
|
+
'🍍',
|
|
275
|
+
'🥝',
|
|
276
|
+
'🍅',
|
|
277
|
+
'🥑',
|
|
278
|
+
'🍆',
|
|
279
|
+
'🌽',
|
|
280
|
+
'🌶️',
|
|
281
|
+
'🍞',
|
|
282
|
+
'🧀',
|
|
283
|
+
'🥚',
|
|
284
|
+
'🍳',
|
|
285
|
+
'🥓',
|
|
286
|
+
'🍗',
|
|
287
|
+
'🌭',
|
|
288
|
+
'🍔',
|
|
289
|
+
'🍟',
|
|
290
|
+
'🍕',
|
|
291
|
+
'🌮',
|
|
292
|
+
'🌯',
|
|
293
|
+
'🥪',
|
|
294
|
+
'🍝',
|
|
295
|
+
'🍜',
|
|
296
|
+
'🍣',
|
|
297
|
+
'🍤',
|
|
298
|
+
'🍦',
|
|
299
|
+
'🍰',
|
|
300
|
+
'🎂',
|
|
301
|
+
'🍩',
|
|
302
|
+
'🍪',
|
|
303
|
+
'🍫',
|
|
304
|
+
'🍬',
|
|
305
|
+
'🍭',
|
|
306
|
+
'🍿',
|
|
307
|
+
'☕',
|
|
308
|
+
'🍵',
|
|
309
|
+
'🍺',
|
|
310
|
+
'🍻',
|
|
311
|
+
'🥂',
|
|
312
|
+
'🍷',
|
|
313
|
+
'🍸',
|
|
314
|
+
'🍹',
|
|
315
|
+
'🧃',
|
|
316
|
+
'🍾',
|
|
74
317
|
],
|
|
75
318
|
},
|
|
76
319
|
{
|
|
77
|
-
id:
|
|
78
|
-
label:
|
|
79
|
-
icon:
|
|
320
|
+
id: 'nature',
|
|
321
|
+
label: 'Natura',
|
|
322
|
+
icon: '🌸',
|
|
80
323
|
emojis: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
324
|
+
'🌸',
|
|
325
|
+
'🌺',
|
|
326
|
+
'🌹',
|
|
327
|
+
'🌻',
|
|
328
|
+
'🌼',
|
|
329
|
+
'💐',
|
|
330
|
+
'🌷',
|
|
331
|
+
'🌱',
|
|
332
|
+
'🪴',
|
|
333
|
+
'🌲',
|
|
334
|
+
'🌳',
|
|
335
|
+
'🌴',
|
|
336
|
+
'🌵',
|
|
337
|
+
'🍀',
|
|
338
|
+
'☘️',
|
|
339
|
+
'🌿',
|
|
340
|
+
'🍃',
|
|
341
|
+
'🍂',
|
|
342
|
+
'🍁',
|
|
343
|
+
'🌊',
|
|
344
|
+
'🌈',
|
|
345
|
+
'☀️',
|
|
346
|
+
'🌤️',
|
|
347
|
+
'⛅',
|
|
348
|
+
'☁️',
|
|
349
|
+
'🌧️',
|
|
350
|
+
'⛈️',
|
|
351
|
+
'🌩️',
|
|
352
|
+
'❄️',
|
|
353
|
+
'☃️',
|
|
354
|
+
'⛄',
|
|
355
|
+
'🔥',
|
|
356
|
+
'💧',
|
|
357
|
+
'💦',
|
|
358
|
+
'🌏',
|
|
359
|
+
'🌙',
|
|
360
|
+
'🌟',
|
|
361
|
+
'💫',
|
|
362
|
+
'✨',
|
|
363
|
+
'☄️',
|
|
85
364
|
],
|
|
86
365
|
},
|
|
87
366
|
{
|
|
88
|
-
id:
|
|
89
|
-
label:
|
|
90
|
-
icon:
|
|
367
|
+
id: 'symbols',
|
|
368
|
+
label: 'Symbole',
|
|
369
|
+
icon: '⚡',
|
|
91
370
|
emojis: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
371
|
+
'⚡',
|
|
372
|
+
'💥',
|
|
373
|
+
'🔥',
|
|
374
|
+
'✨',
|
|
375
|
+
'💫',
|
|
376
|
+
'🌟',
|
|
377
|
+
'⭐',
|
|
378
|
+
'💡',
|
|
379
|
+
'💣',
|
|
380
|
+
'🧨',
|
|
381
|
+
'🎯',
|
|
382
|
+
'♠️',
|
|
383
|
+
'♥️',
|
|
384
|
+
'♦️',
|
|
385
|
+
'♣️',
|
|
386
|
+
'🔮',
|
|
387
|
+
'🧿',
|
|
388
|
+
'♻️',
|
|
389
|
+
'⚜️',
|
|
390
|
+
'⭕',
|
|
391
|
+
'✅',
|
|
392
|
+
'❌',
|
|
393
|
+
'➕',
|
|
394
|
+
'➖',
|
|
395
|
+
'❗',
|
|
396
|
+
'❓',
|
|
397
|
+
'‼️',
|
|
398
|
+
'⁉️',
|
|
399
|
+
'💯',
|
|
400
|
+
'🔴',
|
|
401
|
+
'🟠',
|
|
402
|
+
'🟡',
|
|
403
|
+
'🟢',
|
|
404
|
+
'🔵',
|
|
405
|
+
'🟣',
|
|
406
|
+
'⚫',
|
|
407
|
+
'⚪',
|
|
408
|
+
'🔺',
|
|
409
|
+
'🔻',
|
|
410
|
+
'🔶',
|
|
411
|
+
'🔷',
|
|
412
|
+
'🏳️',
|
|
413
|
+
'🏴',
|
|
414
|
+
'🚩',
|
|
415
|
+
'🏳️🌈',
|
|
96
416
|
],
|
|
97
417
|
},
|
|
98
418
|
];
|
|
99
419
|
const SHAPE_CATALOG = [
|
|
100
|
-
{ id:
|
|
101
|
-
{ id:
|
|
102
|
-
{ id:
|
|
103
|
-
{ id:
|
|
104
|
-
{ id:
|
|
105
|
-
{ id:
|
|
106
|
-
{ id:
|
|
107
|
-
{ id:
|
|
108
|
-
{ id:
|
|
109
|
-
{ id:
|
|
420
|
+
{ id: 'rect', label: 'Prostokąt', icon: '⬜' },
|
|
421
|
+
{ id: 'circle', label: 'Koło', icon: '⭕' },
|
|
422
|
+
{ id: 'triangle', label: 'Trójkąt', icon: '🔺' },
|
|
423
|
+
{ id: 'star', label: 'Gwiazda', icon: '⭐' },
|
|
424
|
+
{ id: 'heart', label: 'Serce', icon: '❤️' },
|
|
425
|
+
{ id: 'arrow', label: 'Strzałka', icon: '➡️' },
|
|
426
|
+
{ id: 'diamond', label: 'Romb', icon: '💎' },
|
|
427
|
+
{ id: 'hexagon', label: 'Sześciokąt', icon: '⬡' },
|
|
428
|
+
{ id: 'cross', label: 'Krzyżyk', icon: '✚' },
|
|
429
|
+
{ id: 'lightning', label: 'Błyskawica', icon: '⚡' },
|
|
110
430
|
];
|
|
111
431
|
const FRAME_CATALOG = [
|
|
112
|
-
{ id:
|
|
113
|
-
{ id:
|
|
114
|
-
{ id:
|
|
115
|
-
{ id:
|
|
116
|
-
{ id:
|
|
117
|
-
{ id:
|
|
118
|
-
{ id:
|
|
119
|
-
{ id:
|
|
120
|
-
{ id:
|
|
121
|
-
{ id:
|
|
432
|
+
{ id: 'simple', label: 'Prosta', icon: '▪️' },
|
|
433
|
+
{ id: 'double', label: 'Podwójna', icon: '◻️' },
|
|
434
|
+
{ id: 'rounded', label: 'Zaokrąglona', icon: '⬜' },
|
|
435
|
+
{ id: 'polaroid', label: 'Polaroid', icon: '📸' },
|
|
436
|
+
{ id: 'film', label: 'Klisza', icon: '🎞️' },
|
|
437
|
+
{ id: 'vintage', label: 'Vintage', icon: '🖼️' },
|
|
438
|
+
{ id: 'ornate', label: 'Ozdobna', icon: '🏛️' },
|
|
439
|
+
{ id: 'shadow', label: 'Cień', icon: '🌑' },
|
|
440
|
+
{ id: 'neon', label: 'Neon', icon: '💡' },
|
|
441
|
+
{ id: 'torn', label: 'Podarta', icon: '📃' },
|
|
122
442
|
];
|
|
123
443
|
// ═══════════════════════════════════════════════════════════════
|
|
124
444
|
// ── ID generation
|
|
@@ -132,18 +452,19 @@ function generateOverlayId() {
|
|
|
132
452
|
// ═══════════════════════════════════════════════════════════════
|
|
133
453
|
/** Render all overlays to a canvas context. */
|
|
134
454
|
function renderAllOverlays(ctx, overlays, w, h) {
|
|
135
|
-
for (const ov of overlays)
|
|
455
|
+
for (const ov of overlays) {
|
|
136
456
|
renderSingleOverlay(ctx, ov, w, h);
|
|
457
|
+
}
|
|
137
458
|
}
|
|
138
459
|
function renderSingleOverlay(ctx, ov, w, h) {
|
|
139
460
|
ctx.save();
|
|
140
461
|
ctx.globalAlpha = ov.opacity;
|
|
141
|
-
if (ov.type ===
|
|
462
|
+
if (ov.type === 'drawing') {
|
|
142
463
|
renderDrawing(ctx, ov, w, h);
|
|
143
464
|
ctx.restore();
|
|
144
465
|
return;
|
|
145
466
|
}
|
|
146
|
-
if (ov.type ===
|
|
467
|
+
if (ov.type === 'frame') {
|
|
147
468
|
renderFrame(ctx, ov, w, h);
|
|
148
469
|
ctx.restore();
|
|
149
470
|
return;
|
|
@@ -155,13 +476,13 @@ function renderSingleOverlay(ctx, ov, w, h) {
|
|
|
155
476
|
ctx.rotate((ov.rotation * Math.PI) / 180);
|
|
156
477
|
ctx.scale(ov.scaleX, ov.scaleY);
|
|
157
478
|
switch (ov.type) {
|
|
158
|
-
case
|
|
479
|
+
case 'emoji':
|
|
159
480
|
renderEmoji(ctx, ov);
|
|
160
481
|
break;
|
|
161
|
-
case
|
|
482
|
+
case 'text':
|
|
162
483
|
renderText(ctx, ov);
|
|
163
484
|
break;
|
|
164
|
-
case
|
|
485
|
+
case 'shape':
|
|
165
486
|
renderShape(ctx, ov);
|
|
166
487
|
break;
|
|
167
488
|
}
|
|
@@ -170,23 +491,23 @@ function renderSingleOverlay(ctx, ov, w, h) {
|
|
|
170
491
|
// -- Emoji -------------------------------------------------------
|
|
171
492
|
function renderEmoji(ctx, ov) {
|
|
172
493
|
ctx.font = `${ov.fontSize}px "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif`;
|
|
173
|
-
ctx.textAlign =
|
|
174
|
-
ctx.textBaseline =
|
|
494
|
+
ctx.textAlign = 'center';
|
|
495
|
+
ctx.textBaseline = 'middle';
|
|
175
496
|
ctx.fillText(ov.emoji, 0, 0);
|
|
176
497
|
}
|
|
177
498
|
// -- Text --------------------------------------------------------
|
|
178
499
|
function renderText(ctx, ov) {
|
|
179
|
-
const style = `${ov.italic ?
|
|
180
|
-
ctx.font = `${style}${ov.fontSize}px ${ov.fontFamily ||
|
|
181
|
-
ctx.textAlign =
|
|
182
|
-
ctx.textBaseline =
|
|
183
|
-
const lines = ov.text.split(
|
|
500
|
+
const style = `${ov.italic ? 'italic ' : ''}${ov.bold ? 'bold ' : ''}`;
|
|
501
|
+
ctx.font = `${style}${ov.fontSize}px ${ov.fontFamily || 'Arial'},sans-serif`;
|
|
502
|
+
ctx.textAlign = 'center';
|
|
503
|
+
ctx.textBaseline = 'middle';
|
|
504
|
+
const lines = ov.text.split('\n');
|
|
184
505
|
const lineH = ov.fontSize * 1.25;
|
|
185
506
|
const totalH = lineH * lines.length;
|
|
186
507
|
const startY = -(totalH / 2) + lineH / 2;
|
|
187
508
|
// Background
|
|
188
509
|
if (ov.background) {
|
|
189
|
-
const maxW = Math.max(...lines.map(l => ctx.measureText(l).width));
|
|
510
|
+
const maxW = Math.max(...lines.map((l) => ctx.measureText(l).width));
|
|
190
511
|
const pad = ov.backgroundPadding;
|
|
191
512
|
ctx.fillStyle = ov.background;
|
|
192
513
|
const rx = -(maxW / 2 + pad);
|
|
@@ -206,13 +527,13 @@ function renderText(ctx, ov) {
|
|
|
206
527
|
if (ov.outlineColor && ov.outlineWidth > 0) {
|
|
207
528
|
ctx.strokeStyle = ov.outlineColor;
|
|
208
529
|
ctx.lineWidth = ov.outlineWidth;
|
|
209
|
-
ctx.lineJoin =
|
|
530
|
+
ctx.lineJoin = 'round';
|
|
210
531
|
ctx.strokeText(lines[i], 0, ly);
|
|
211
532
|
}
|
|
212
533
|
ctx.fillStyle = ov.color;
|
|
213
534
|
ctx.fillText(lines[i], 0, ly);
|
|
214
535
|
}
|
|
215
|
-
ctx.shadowColor =
|
|
536
|
+
ctx.shadowColor = 'transparent';
|
|
216
537
|
}
|
|
217
538
|
// -- Shape -------------------------------------------------------
|
|
218
539
|
function renderShape(ctx, ov) {
|
|
@@ -231,39 +552,41 @@ function drawShapePath(ctx, kind, w, h) {
|
|
|
231
552
|
const hw = w / 2, hh = h / 2;
|
|
232
553
|
ctx.beginPath();
|
|
233
554
|
switch (kind) {
|
|
234
|
-
case
|
|
555
|
+
case 'rect':
|
|
235
556
|
ctx.rect(-hw, -hh, w, h);
|
|
236
557
|
break;
|
|
237
|
-
case
|
|
558
|
+
case 'circle':
|
|
238
559
|
ctx.ellipse(0, 0, hw, hh, 0, 0, Math.PI * 2);
|
|
239
560
|
break;
|
|
240
|
-
case
|
|
561
|
+
case 'triangle':
|
|
241
562
|
ctx.moveTo(0, -hh);
|
|
242
563
|
ctx.lineTo(hw, hh);
|
|
243
564
|
ctx.lineTo(-hw, hh);
|
|
244
565
|
ctx.closePath();
|
|
245
566
|
break;
|
|
246
|
-
case
|
|
567
|
+
case 'star': {
|
|
247
568
|
const spikes = 5, outer = Math.min(hw, hh), inner = outer * 0.4;
|
|
248
569
|
for (let i = 0; i < spikes * 2; i++) {
|
|
249
570
|
const r = i % 2 === 0 ? outer : inner;
|
|
250
571
|
const a = (Math.PI * i) / spikes - Math.PI / 2;
|
|
251
|
-
if (i === 0)
|
|
572
|
+
if (i === 0) {
|
|
252
573
|
ctx.moveTo(Math.cos(a) * r, Math.sin(a) * r);
|
|
253
|
-
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
254
576
|
ctx.lineTo(Math.cos(a) * r, Math.sin(a) * r);
|
|
577
|
+
}
|
|
255
578
|
}
|
|
256
579
|
ctx.closePath();
|
|
257
580
|
break;
|
|
258
581
|
}
|
|
259
|
-
case
|
|
582
|
+
case 'heart': {
|
|
260
583
|
const s = Math.min(hw, hh);
|
|
261
584
|
ctx.moveTo(0, s * 0.4);
|
|
262
585
|
ctx.bezierCurveTo(-s, -s * 0.2, -s * 0.6, -s, 0, -s * 0.4);
|
|
263
586
|
ctx.bezierCurveTo(s * 0.6, -s, s, -s * 0.2, 0, s * 0.4);
|
|
264
587
|
break;
|
|
265
588
|
}
|
|
266
|
-
case
|
|
589
|
+
case 'arrow':
|
|
267
590
|
ctx.moveTo(-hw, -hh * 0.3);
|
|
268
591
|
ctx.lineTo(hw * 0.3, -hh * 0.3);
|
|
269
592
|
ctx.lineTo(hw * 0.3, -hh);
|
|
@@ -273,26 +596,28 @@ function drawShapePath(ctx, kind, w, h) {
|
|
|
273
596
|
ctx.lineTo(-hw, hh * 0.3);
|
|
274
597
|
ctx.closePath();
|
|
275
598
|
break;
|
|
276
|
-
case
|
|
599
|
+
case 'diamond':
|
|
277
600
|
ctx.moveTo(0, -hh);
|
|
278
601
|
ctx.lineTo(hw, 0);
|
|
279
602
|
ctx.lineTo(0, hh);
|
|
280
603
|
ctx.lineTo(-hw, 0);
|
|
281
604
|
ctx.closePath();
|
|
282
605
|
break;
|
|
283
|
-
case
|
|
606
|
+
case 'hexagon':
|
|
284
607
|
for (let i = 0; i < 6; i++) {
|
|
285
608
|
const a = (Math.PI * 2 * i) / 6 - Math.PI / 2;
|
|
286
609
|
const r = Math.min(hw, hh);
|
|
287
610
|
const px = Math.cos(a) * r, py = Math.sin(a) * r;
|
|
288
|
-
if (i === 0)
|
|
611
|
+
if (i === 0) {
|
|
289
612
|
ctx.moveTo(px, py);
|
|
290
|
-
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
291
615
|
ctx.lineTo(px, py);
|
|
616
|
+
}
|
|
292
617
|
}
|
|
293
618
|
ctx.closePath();
|
|
294
619
|
break;
|
|
295
|
-
case
|
|
620
|
+
case 'cross': {
|
|
296
621
|
const t = Math.min(hw, hh) * 0.3;
|
|
297
622
|
ctx.moveTo(-t, -hh);
|
|
298
623
|
ctx.lineTo(t, -hh);
|
|
@@ -309,7 +634,7 @@ function drawShapePath(ctx, kind, w, h) {
|
|
|
309
634
|
ctx.closePath();
|
|
310
635
|
break;
|
|
311
636
|
}
|
|
312
|
-
case
|
|
637
|
+
case 'lightning': {
|
|
313
638
|
const s = Math.min(hw, hh);
|
|
314
639
|
ctx.moveTo(-s * 0.1, -s);
|
|
315
640
|
ctx.lineTo(s * 0.5, -s * 0.1);
|
|
@@ -326,13 +651,14 @@ function drawShapePath(ctx, kind, w, h) {
|
|
|
326
651
|
// -- Drawing (freehand strokes) ----------------------------------
|
|
327
652
|
function renderDrawing(ctx, ov, w, h) {
|
|
328
653
|
for (const stroke of ov.strokes) {
|
|
329
|
-
if (stroke.points.length < 2)
|
|
654
|
+
if (stroke.points.length < 2) {
|
|
330
655
|
continue;
|
|
656
|
+
}
|
|
331
657
|
ctx.beginPath();
|
|
332
658
|
ctx.strokeStyle = stroke.color;
|
|
333
659
|
ctx.lineWidth = stroke.width;
|
|
334
|
-
ctx.lineCap =
|
|
335
|
-
ctx.lineJoin =
|
|
660
|
+
ctx.lineCap = 'round';
|
|
661
|
+
ctx.lineJoin = 'round';
|
|
336
662
|
ctx.globalAlpha = stroke.opacity;
|
|
337
663
|
const [sx, sy] = stroke.points[0];
|
|
338
664
|
ctx.moveTo(sx * w, sy * h);
|
|
@@ -345,14 +671,15 @@ function renderDrawing(ctx, ov, w, h) {
|
|
|
345
671
|
}
|
|
346
672
|
// -- Canvas stroke (draw a live, in-progress stroke) -------------
|
|
347
673
|
function renderLiveStroke(ctx, points, color, width, canvasW, canvasH) {
|
|
348
|
-
if (points.length < 2)
|
|
674
|
+
if (points.length < 2) {
|
|
349
675
|
return;
|
|
676
|
+
}
|
|
350
677
|
ctx.save();
|
|
351
678
|
ctx.beginPath();
|
|
352
679
|
ctx.strokeStyle = color;
|
|
353
680
|
ctx.lineWidth = width;
|
|
354
|
-
ctx.lineCap =
|
|
355
|
-
ctx.lineJoin =
|
|
681
|
+
ctx.lineCap = 'round';
|
|
682
|
+
ctx.lineJoin = 'round';
|
|
356
683
|
ctx.moveTo(points[0][0] * canvasW, points[0][1] * canvasH);
|
|
357
684
|
for (let i = 1; i < points.length; i++) {
|
|
358
685
|
ctx.lineTo(points[i][0] * canvasW, points[i][1] * canvasH);
|
|
@@ -366,33 +693,33 @@ function renderFrame(ctx, ov, w, h) {
|
|
|
366
693
|
ctx.strokeStyle = ov.color;
|
|
367
694
|
ctx.fillStyle = ov.color;
|
|
368
695
|
switch (ov.frameStyle) {
|
|
369
|
-
case
|
|
696
|
+
case 'simple':
|
|
370
697
|
ctx.lineWidth = t;
|
|
371
698
|
ctx.strokeRect(t / 2, t / 2, w - t, h - t);
|
|
372
699
|
break;
|
|
373
|
-
case
|
|
700
|
+
case 'double':
|
|
374
701
|
ctx.lineWidth = t * 0.3;
|
|
375
702
|
ctx.strokeRect(t * 0.15, t * 0.15, w - t * 0.3, h - t * 0.3);
|
|
376
703
|
ctx.strokeRect(t * 0.7, t * 0.7, w - t * 1.4, h - t * 1.4);
|
|
377
704
|
break;
|
|
378
|
-
case
|
|
705
|
+
case 'rounded':
|
|
379
706
|
ctx.lineWidth = t;
|
|
380
707
|
roundRect(ctx, t / 2, t / 2, w - t, h - t, t * 2);
|
|
381
708
|
ctx.stroke();
|
|
382
709
|
break;
|
|
383
|
-
case
|
|
710
|
+
case 'polaroid':
|
|
384
711
|
ctx.fillRect(0, 0, w, t);
|
|
385
712
|
ctx.fillRect(0, 0, t, h);
|
|
386
713
|
ctx.fillRect(w - t, 0, t, h);
|
|
387
714
|
ctx.fillRect(0, h - t * 3, w, t * 3);
|
|
388
715
|
break;
|
|
389
|
-
case
|
|
716
|
+
case 'film': {
|
|
390
717
|
ctx.fillRect(0, 0, w, t);
|
|
391
718
|
ctx.fillRect(0, h - t, w, t);
|
|
392
719
|
const holeW = t * 0.5, holeH = t * 0.7;
|
|
393
720
|
const count = Math.floor(w / (t * 1.5)) || 1;
|
|
394
721
|
const spacing = w / (count + 1);
|
|
395
|
-
ctx.fillStyle =
|
|
722
|
+
ctx.fillStyle = '#111';
|
|
396
723
|
for (let i = 1; i <= count; i++) {
|
|
397
724
|
const cx = spacing * i;
|
|
398
725
|
roundRect(ctx, cx - holeW / 2, (t - holeH) / 2, holeW, holeH, 2);
|
|
@@ -402,14 +729,19 @@ function renderFrame(ctx, ov, w, h) {
|
|
|
402
729
|
}
|
|
403
730
|
break;
|
|
404
731
|
}
|
|
405
|
-
case
|
|
732
|
+
case 'vintage': {
|
|
406
733
|
ctx.lineWidth = t * 0.5;
|
|
407
734
|
ctx.strokeRect(t * 0.25, t * 0.25, w - t * 0.5, h - t * 0.5);
|
|
408
735
|
ctx.lineWidth = 1;
|
|
409
|
-
ctx.strokeStyle = ov.color +
|
|
736
|
+
ctx.strokeStyle = ov.color + '88';
|
|
410
737
|
ctx.strokeRect(t, t, w - t * 2, h - t * 2);
|
|
411
738
|
const os = t * 0.8;
|
|
412
|
-
for (const [dx, dy] of [
|
|
739
|
+
for (const [dx, dy] of [
|
|
740
|
+
[0, 0],
|
|
741
|
+
[w - os, 0],
|
|
742
|
+
[0, h - os],
|
|
743
|
+
[w - os, h - os],
|
|
744
|
+
]) {
|
|
413
745
|
ctx.beginPath();
|
|
414
746
|
ctx.moveTo(dx + os * 0.2, dy + os * 0.2);
|
|
415
747
|
ctx.lineTo(dx + os * 0.8, dy + os * 0.2);
|
|
@@ -422,13 +754,16 @@ function renderFrame(ctx, ov, w, h) {
|
|
|
422
754
|
}
|
|
423
755
|
break;
|
|
424
756
|
}
|
|
425
|
-
case
|
|
757
|
+
case 'ornate': {
|
|
426
758
|
ctx.lineWidth = t * 0.4;
|
|
427
759
|
ctx.strokeRect(t * 0.2, t * 0.2, w - t * 0.4, h - t * 0.4);
|
|
428
760
|
const cs = t * 1.5;
|
|
429
761
|
ctx.lineWidth = 2;
|
|
430
762
|
for (const [ox, oy, sx, sy] of [
|
|
431
|
-
[0, 0, 1, 1],
|
|
763
|
+
[0, 0, 1, 1],
|
|
764
|
+
[w, 0, -1, 1],
|
|
765
|
+
[0, h, 1, -1],
|
|
766
|
+
[w, h, -1, -1],
|
|
432
767
|
]) {
|
|
433
768
|
ctx.save();
|
|
434
769
|
ctx.translate(ox, oy);
|
|
@@ -444,61 +779,65 @@ function renderFrame(ctx, ov, w, h) {
|
|
|
444
779
|
}
|
|
445
780
|
break;
|
|
446
781
|
}
|
|
447
|
-
case
|
|
448
|
-
ctx.shadowColor =
|
|
782
|
+
case 'shadow':
|
|
783
|
+
ctx.shadowColor = 'rgba(0,0,0,0.5)';
|
|
449
784
|
ctx.shadowBlur = t * 2;
|
|
450
785
|
ctx.shadowOffsetX = t * 0.5;
|
|
451
786
|
ctx.shadowOffsetY = t * 0.5;
|
|
452
787
|
ctx.lineWidth = t * 0.3;
|
|
453
788
|
ctx.strokeRect(t, t, w - t * 2, h - t * 2);
|
|
454
|
-
ctx.shadowColor =
|
|
789
|
+
ctx.shadowColor = 'transparent';
|
|
455
790
|
break;
|
|
456
|
-
case
|
|
791
|
+
case 'neon':
|
|
457
792
|
for (let i = 3; i >= 0; i--) {
|
|
458
793
|
ctx.shadowColor = ov.color;
|
|
459
794
|
ctx.shadowBlur = t * (i + 1) * 2;
|
|
460
795
|
ctx.lineWidth = t * 0.2;
|
|
461
|
-
ctx.strokeStyle = i === 0 ?
|
|
796
|
+
ctx.strokeStyle = i === 0 ? '#fff' : ov.color;
|
|
462
797
|
ctx.globalAlpha = i === 0 ? ov.opacity : 0.3 * ov.opacity;
|
|
463
798
|
ctx.strokeRect(t, t, w - t * 2, h - t * 2);
|
|
464
799
|
}
|
|
465
|
-
ctx.shadowColor =
|
|
800
|
+
ctx.shadowColor = 'transparent';
|
|
466
801
|
break;
|
|
467
|
-
case
|
|
802
|
+
case 'torn': {
|
|
468
803
|
const step = 8;
|
|
469
804
|
const seed = (i) => {
|
|
470
805
|
const x = Math.sin(i * 127.1 + 311.7) * 43758.5453;
|
|
471
|
-
return
|
|
806
|
+
return x - Math.floor(x) - 0.5;
|
|
472
807
|
};
|
|
473
808
|
// Top
|
|
474
809
|
ctx.beginPath();
|
|
475
810
|
ctx.moveTo(0, 0);
|
|
476
|
-
for (let i = 0, x = 0; x <= w; x += step, i++)
|
|
811
|
+
for (let i = 0, x = 0; x <= w; x += step, i++) {
|
|
477
812
|
ctx.lineTo(x, t + seed(i) * t * 0.8);
|
|
813
|
+
}
|
|
478
814
|
ctx.lineTo(w, 0);
|
|
479
815
|
ctx.closePath();
|
|
480
816
|
ctx.fill();
|
|
481
817
|
// Bottom
|
|
482
818
|
ctx.beginPath();
|
|
483
819
|
ctx.moveTo(0, h);
|
|
484
|
-
for (let i = 0, x = 0; x <= w; x += step, i++)
|
|
820
|
+
for (let i = 0, x = 0; x <= w; x += step, i++) {
|
|
485
821
|
ctx.lineTo(x, h - t - seed(i + 1000) * t * 0.8);
|
|
822
|
+
}
|
|
486
823
|
ctx.lineTo(w, h);
|
|
487
824
|
ctx.closePath();
|
|
488
825
|
ctx.fill();
|
|
489
826
|
// Left
|
|
490
827
|
ctx.beginPath();
|
|
491
828
|
ctx.moveTo(0, 0);
|
|
492
|
-
for (let i = 0, y = 0; y <= h; y += step, i++)
|
|
829
|
+
for (let i = 0, y = 0; y <= h; y += step, i++) {
|
|
493
830
|
ctx.lineTo(t + seed(i + 2000) * t * 0.8, y);
|
|
831
|
+
}
|
|
494
832
|
ctx.lineTo(0, h);
|
|
495
833
|
ctx.closePath();
|
|
496
834
|
ctx.fill();
|
|
497
835
|
// Right
|
|
498
836
|
ctx.beginPath();
|
|
499
837
|
ctx.moveTo(w, 0);
|
|
500
|
-
for (let i = 0, y = 0; y <= h; y += step, i++)
|
|
838
|
+
for (let i = 0, y = 0; y <= h; y += step, i++) {
|
|
501
839
|
ctx.lineTo(w - t - seed(i + 3000) * t * 0.8, y);
|
|
840
|
+
}
|
|
502
841
|
ctx.lineTo(w, h);
|
|
503
842
|
ctx.closePath();
|
|
504
843
|
ctx.fill();
|
|
@@ -527,19 +866,20 @@ function roundRect(ctx, x, y, w, h, r) {
|
|
|
527
866
|
* hits the bounding box of the overlay (ignoring rotation).
|
|
528
867
|
*/
|
|
529
868
|
function hitTestOverlay(ov, px, py, _w, _h) {
|
|
530
|
-
if (ov.type ===
|
|
869
|
+
if (ov.type === 'drawing' || ov.type === 'frame') {
|
|
531
870
|
return false;
|
|
871
|
+
}
|
|
532
872
|
let hitW, hitH;
|
|
533
873
|
switch (ov.type) {
|
|
534
|
-
case
|
|
874
|
+
case 'emoji':
|
|
535
875
|
hitW = hitH = (ov.fontSize * ov.scaleX) / _w;
|
|
536
876
|
break;
|
|
537
|
-
case
|
|
877
|
+
case 'text': {
|
|
538
878
|
hitW = (ov.text.length * ov.fontSize * 0.55 * ov.scaleX) / _w;
|
|
539
879
|
hitH = (ov.fontSize * 1.3 * ov.scaleY) / _h;
|
|
540
880
|
break;
|
|
541
881
|
}
|
|
542
|
-
case
|
|
882
|
+
case 'shape':
|
|
543
883
|
hitW = (ov.width * ov.scaleX) / _w;
|
|
544
884
|
hitH = (ov.height * ov.scaleY) / _h;
|
|
545
885
|
break;
|
|
@@ -555,28 +895,34 @@ function hitTestOverlay(ov, px, py, _w, _h) {
|
|
|
555
895
|
function createEmojiOverlay(emoji, canvasW, canvasH) {
|
|
556
896
|
return {
|
|
557
897
|
id: generateOverlayId(),
|
|
558
|
-
type:
|
|
559
|
-
x: 0.5,
|
|
560
|
-
|
|
561
|
-
|
|
898
|
+
type: 'emoji',
|
|
899
|
+
x: 0.5,
|
|
900
|
+
y: 0.5,
|
|
901
|
+
scaleX: 1,
|
|
902
|
+
scaleY: 1,
|
|
903
|
+
rotation: 0,
|
|
904
|
+
opacity: 1,
|
|
562
905
|
emoji,
|
|
563
906
|
fontSize: Math.round(Math.min(canvasW, canvasH) * 0.08),
|
|
564
907
|
};
|
|
565
908
|
}
|
|
566
|
-
function createTextOverlay(text =
|
|
909
|
+
function createTextOverlay(text = 'Tekst') {
|
|
567
910
|
return {
|
|
568
911
|
id: generateOverlayId(),
|
|
569
|
-
type:
|
|
570
|
-
x: 0.5,
|
|
571
|
-
|
|
572
|
-
|
|
912
|
+
type: 'text',
|
|
913
|
+
x: 0.5,
|
|
914
|
+
y: 0.5,
|
|
915
|
+
scaleX: 1,
|
|
916
|
+
scaleY: 1,
|
|
917
|
+
rotation: 0,
|
|
918
|
+
opacity: 1,
|
|
573
919
|
text,
|
|
574
|
-
fontFamily:
|
|
920
|
+
fontFamily: 'Arial',
|
|
575
921
|
fontSize: 36,
|
|
576
|
-
color:
|
|
922
|
+
color: '#ffffff',
|
|
577
923
|
bold: true,
|
|
578
924
|
italic: false,
|
|
579
|
-
outlineColor:
|
|
925
|
+
outlineColor: '#000000',
|
|
580
926
|
outlineWidth: 2,
|
|
581
927
|
shadow: null,
|
|
582
928
|
background: null,
|
|
@@ -586,34 +932,44 @@ function createTextOverlay(text = "Tekst") {
|
|
|
586
932
|
function createShapeOverlay(kind) {
|
|
587
933
|
return {
|
|
588
934
|
id: generateOverlayId(),
|
|
589
|
-
type:
|
|
590
|
-
x: 0.5,
|
|
591
|
-
|
|
592
|
-
|
|
935
|
+
type: 'shape',
|
|
936
|
+
x: 0.5,
|
|
937
|
+
y: 0.5,
|
|
938
|
+
scaleX: 1,
|
|
939
|
+
scaleY: 1,
|
|
940
|
+
rotation: 0,
|
|
941
|
+
opacity: 1,
|
|
593
942
|
shapeKind: kind,
|
|
594
|
-
width: 100,
|
|
943
|
+
width: 100,
|
|
944
|
+
height: 100,
|
|
595
945
|
fillColor: null,
|
|
596
|
-
strokeColor:
|
|
946
|
+
strokeColor: '#ffffff',
|
|
597
947
|
strokeWidth: 3,
|
|
598
948
|
};
|
|
599
949
|
}
|
|
600
950
|
function createDrawingOverlay() {
|
|
601
951
|
return {
|
|
602
952
|
id: generateOverlayId(),
|
|
603
|
-
type:
|
|
604
|
-
x: 0,
|
|
605
|
-
|
|
606
|
-
|
|
953
|
+
type: 'drawing',
|
|
954
|
+
x: 0,
|
|
955
|
+
y: 0,
|
|
956
|
+
scaleX: 1,
|
|
957
|
+
scaleY: 1,
|
|
958
|
+
rotation: 0,
|
|
959
|
+
opacity: 1,
|
|
607
960
|
strokes: [],
|
|
608
961
|
};
|
|
609
962
|
}
|
|
610
|
-
function createFrameOverlay(style, color =
|
|
963
|
+
function createFrameOverlay(style, color = '#ffffff') {
|
|
611
964
|
return {
|
|
612
965
|
id: generateOverlayId(),
|
|
613
|
-
type:
|
|
614
|
-
x: 0,
|
|
615
|
-
|
|
616
|
-
|
|
966
|
+
type: 'frame',
|
|
967
|
+
x: 0,
|
|
968
|
+
y: 0,
|
|
969
|
+
scaleX: 1,
|
|
970
|
+
scaleY: 1,
|
|
971
|
+
rotation: 0,
|
|
972
|
+
opacity: 1,
|
|
617
973
|
frameStyle: style,
|
|
618
974
|
color,
|
|
619
975
|
thickness: 0.03,
|