@pixerate/editor 0.137.0 → 0.139.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/dist/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/index.cjs +57 -57
- package/dist/animation-editor/index.d.cts +6 -5
- package/dist/animation-editor/index.d.ts +6 -5
- package/dist/animation-editor/index.js +4 -4
- package/dist/{arrange-CKXK_hf7.d.cts → arrange-j_mLiFMO.d.cts} +1 -1
- package/dist/{arrange-BUREmgD9.d.ts → arrange-q5HQvnnB.d.ts} +1 -1
- package/dist/{bezier-Dywv3Bw8.d.ts → bezier-B6cK8SR6.d.ts} +2 -2
- package/dist/{bezier-CZ2AhjID.d.cts → bezier-CEJ8Uw4O.d.cts} +2 -2
- package/dist/{brushTypes-C7N3EBK7.d.cts → brushTypes-MX5UVs_m.d.cts} +27 -2
- package/dist/{brushTypes-C7N3EBK7.d.ts → brushTypes-MX5UVs_m.d.ts} +27 -2
- package/dist/{brushes-DJmUbIgz.d.ts → brushes-CQpL7_Lc.d.ts} +2 -107
- package/dist/{brushes-CnvZSYYU.d.cts → brushes-aEnjqoji.d.cts} +2 -107
- package/dist/{brushstrokeRender-IMFY3FF6.cjs → brushstrokeRender-PP6NTF6M.cjs} +52 -24
- package/dist/brushstrokeRender-PP6NTF6M.cjs.map +1 -0
- package/dist/{brushstrokeRender-2FAXA3XC.js → brushstrokeRender-QGEYJ4OZ.js} +40 -12
- package/dist/brushstrokeRender-QGEYJ4OZ.js.map +1 -0
- package/dist/{builtins-Cc-bH-3U.d.cts → builtins-BakDiKWf.d.cts} +3 -2
- package/dist/{builtins-ZU1GJnUA.d.ts → builtins-CE33vyv2.d.ts} +3 -2
- package/dist/canvas/index.cjs +16 -9
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +60 -14
- package/dist/canvas/index.d.ts +60 -14
- package/dist/canvas/index.js +10 -3
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-PRSRYHQD.cjs → chunk-3QHPFSQM.cjs} +36 -36
- package/dist/{chunk-PRSRYHQD.cjs.map → chunk-3QHPFSQM.cjs.map} +1 -1
- package/dist/{chunk-QBWEH3IM.cjs → chunk-3T5O225T.cjs} +391 -76
- package/dist/chunk-3T5O225T.cjs.map +1 -0
- package/dist/{chunk-EQQMGO42.js → chunk-C2J7GOMJ.js} +18 -5
- package/dist/chunk-C2J7GOMJ.js.map +1 -0
- package/dist/{chunk-2XS6LTUP.cjs → chunk-C46AZEBE.cjs} +104 -339
- package/dist/chunk-C46AZEBE.cjs.map +1 -0
- package/dist/{chunk-HUO3TI4C.js → chunk-CPSMARTX.js} +6 -241
- package/dist/chunk-CPSMARTX.js.map +1 -0
- package/dist/{chunk-KEENUAFN.cjs → chunk-DLLUOVQX.cjs} +18 -5
- package/dist/chunk-DLLUOVQX.cjs.map +1 -0
- package/dist/{chunk-LSXXAJG3.js → chunk-J7DSKTKB.js} +5 -4
- package/dist/chunk-J7DSKTKB.js.map +1 -0
- package/dist/{chunk-6S6362D2.js → chunk-NI6RORDS.js} +2 -2
- package/dist/{chunk-XN2NBLV5.cjs → chunk-PMEHFHSP.cjs} +82 -82
- package/dist/{chunk-XN2NBLV5.cjs.map → chunk-PMEHFHSP.cjs.map} +1 -1
- package/dist/{chunk-5FSRTP6E.js → chunk-PQFVLOMR.js} +319 -4
- package/dist/chunk-PQFVLOMR.js.map +1 -0
- package/dist/{chunk-OIBIRXRG.js → chunk-PSPLRQL6.js} +2 -2
- package/dist/{chunk-SYT2TLQF.js → chunk-QEIN6JQO.js} +2 -2
- package/dist/{chunk-3D77LOBM.js → chunk-TJBYBSTN.js} +51 -6
- package/dist/chunk-TJBYBSTN.js.map +1 -0
- package/dist/{chunk-DFSZO2B5.cjs → chunk-UFL5N4DK.cjs} +5 -4
- package/dist/chunk-UFL5N4DK.cjs.map +1 -0
- package/dist/{chunk-TLCTTQFF.cjs → chunk-VEHVXRJU.cjs} +17 -17
- package/dist/{chunk-TLCTTQFF.cjs.map → chunk-VEHVXRJU.cjs.map} +1 -1
- package/dist/{chunk-5OOIUXNJ.cjs → chunk-XFXHA5MU.cjs} +55 -10
- package/dist/chunk-XFXHA5MU.cjs.map +1 -0
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.d.cts +3 -3
- package/dist/commands/index.d.ts +3 -3
- package/dist/commands/index.js +1 -1
- package/dist/effects/index.d.cts +5 -4
- package/dist/effects/index.d.ts +5 -4
- package/dist/{export-DwnZ_hvQ.d.ts → export-0ZaTK__4.d.ts} +4 -4
- package/dist/{export-41rL6Cne.d.ts → export-C45v6MYq.d.ts} +1 -1
- package/dist/{export-CyJdfP_Z.d.cts → export-D-7WCDJ9.d.cts} +4 -4
- package/dist/{export-D9mXp05Q.d.cts → export-DSdCfd6O.d.cts} +1 -1
- package/dist/grain-BWmGZxP4.d.cts +58 -0
- package/dist/grain-BWmGZxP4.d.ts +58 -0
- package/dist/{helpers-v6GMazzg.d.cts → helpers-Cavy1TB7.d.cts} +21 -1
- package/dist/{helpers-C-RgeyvH.d.ts → helpers-LZQ4cpg4.d.ts} +21 -1
- package/dist/image-editor/index.cjs +695 -677
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +12 -11
- package/dist/image-editor/index.d.ts +12 -11
- package/dist/image-editor/index.js +23 -5
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-KR_jj6b_.d.cts → opentype-BpIJhGpj.d.cts} +1 -1
- package/dist/{opentype-a1KAW-qs.d.ts → opentype-CyxDScVz.d.ts} +1 -1
- package/dist/paint/index.cjs +21 -3
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +72 -5
- package/dist/paint/index.d.ts +72 -5
- package/dist/paint/index.js +20 -2
- package/dist/paint-editor/index.cjs +171 -171
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +77 -29
- package/dist/paint-editor/index.d.ts +77 -29
- package/dist/paint-editor/index.js +12 -12
- package/dist/{pathfinder-BHS4vQNm.d.cts → pathfinder-BMQEcS0k.d.cts} +2 -2
- package/dist/{pathfinder-BVvTIBMo.d.ts → pathfinder-CQIxubuP.d.ts} +2 -2
- package/dist/{pool-CZQOrSXZ.d.ts → pool-Cynuj89K.d.ts} +1 -1
- package/dist/{pool-FjZZmZ80.d.cts → pool-DedjxDKo.d.cts} +1 -1
- package/dist/{rand-8xbUb6ur.d.ts → rand-COS4_E1g.d.ts} +17 -1
- package/dist/{rand-Cw9VLrVC.d.cts → rand-D1JqpR-p.d.cts} +17 -1
- package/dist/{svg-DTb40ICU.d.cts → svg-RcixtBFR.d.cts} +2 -2
- package/dist/{svg-CSz3mzkw.d.ts → svg-nWBJEpnk.d.ts} +2 -2
- package/dist/{tools-Ca0kI1qo.d.cts → tools-CL82d7nw.d.cts} +1 -1
- package/dist/{tools-B0wXP5cF.d.ts → tools-DrxgDnXY.d.ts} +1 -1
- package/dist/vector/index.cjs +995 -955
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +44 -18
- package/dist/vector/index.d.ts +44 -18
- package/dist/vector/index.js +55 -15
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +5 -4
- package/dist/video-editor/index.d.ts +5 -4
- package/dist/{warp-DTOp0lON.d.cts → warp-CHi_P_G6.d.cts} +1 -1
- package/dist/{warp-pd7hrH4T.d.ts → warp-CPaHULUL.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +12 -5
- package/skills/pixerate-vector/SKILL.md +4 -2
- package/dist/brushstrokeRender-2FAXA3XC.js.map +0 -1
- package/dist/brushstrokeRender-IMFY3FF6.cjs.map +0 -1
- package/dist/chunk-2XS6LTUP.cjs.map +0 -1
- package/dist/chunk-3D77LOBM.js.map +0 -1
- package/dist/chunk-5FSRTP6E.js.map +0 -1
- package/dist/chunk-5OOIUXNJ.cjs.map +0 -1
- package/dist/chunk-DFSZO2B5.cjs.map +0 -1
- package/dist/chunk-EQQMGO42.js.map +0 -1
- package/dist/chunk-HUO3TI4C.js.map +0 -1
- package/dist/chunk-KEENUAFN.cjs.map +0 -1
- package/dist/chunk-LSXXAJG3.js.map +0 -1
- package/dist/chunk-QBWEH3IM.cjs.map +0 -1
- /package/dist/{chunk-6S6362D2.js.map → chunk-NI6RORDS.js.map} +0 -0
- /package/dist/{chunk-OIBIRXRG.js.map → chunk-PSPLRQL6.js.map} +0 -0
- /package/dist/{chunk-SYT2TLQF.js.map → chunk-QEIN6JQO.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { V as VideoProject, a as VideoAnimatable, b as VideoAsset, c as VideoAssetProxy, d as VideoClip, e as VideoClipAnimation, f as VideoClipEffect, g as VideoEffectRef, h as VideoEffectValues, i as VideoGrade, j as VideoGradeLut, k as VideoKeyframes, l as VideoMarker, m as VideoSequence, n as VideoTrack, o as VideoTranscriptWord, p as VideoTransform, q as VideoTransition, v as videoKeysOf, r as VideoTrackKind, s as VideoPlacementMode, t as VideoKeyframeProperty, u as VideoKey, w as VideoMediaClip, x as VideoEffectsEngine, y as VideoLayer, z as VideoFrame, A as VideoRect, B as VideoEffectPlace, C as VideoFfmpegOptions, D as VideoFfmpegExport, E as VideoEdlOptions, F as VideoFadeCurve, G as VideoFit, H as VideoBlendMode, I as VideoAssetKind, J as VideoClipAnimationEffect, K as VideoTransitionType } from '../export-
|
|
2
|
-
export { L as VIDEO_BLEND_MODES, M as VIDEO_CLIP_ANIMATION_EFFECTS, N as VIDEO_CLIP_TYPES, O as VIDEO_EASE_NAMES, P as VIDEO_EFFECT_PLACES, Q as VIDEO_FADE_CURVES, R as VIDEO_FITS, S as VIDEO_KEYFRAME_LIMITS, T as VIDEO_KEYFRAME_PROPERTIES, U as VIDEO_PLACEMENT_MODES, W as VIDEO_TRANSFORM_PROPERTIES, X as VIDEO_TRANSITION_TYPES, Y as VIDEO_WIPE_DIRECTIONS, Z as VideoAudioSource, _ as VideoClipType, $ as VideoColorClip, a0 as VideoEase, a1 as VideoEffectClip, a2 as VideoEffectJob, a3 as VideoEffectUse, a4 as VideoEffectsEngineOptions, a5 as VideoLayerEffect, a6 as VideoLoudnessMeasurement, a7 as VideoLoudnessTarget, a8 as VideoSequenceClip, a9 as VideoTextClip, aa as VideoWipeDirection, ab as checkVideoEffectPlace, ac as checkVideoEffectValues, ad as ffmpegFilterValue, ae as isVideoKeyframes, af as mixEffectPixels, ag as overEffectPixels, ah as parseVideoLoudnessMeasurement, ai as placeVideoRect, aj as removeVideoKey, ak as retimeVideoAnimatable, al as setVideoKey, am as sortVideoKeys, an as splitVideoAnimatable, ao as toVideoEdl, ap as toVideoFfmpeg, aq as toVideoLoudnessMeasure, ar as videoClipEffectUses, as as videoClipSoundGain, at as videoEaseBezier, au as videoEaseProgress, av as videoEffectFrameTime, aw as videoEffectLayerKey, ax as videoEffectValuesAt, ay as videoFadeCurveGain, az as videoFfmpegUnsupportedEffects, aA as videoFrameAt, aB as videoFrameLeafLayers, aC as videoKeyframeBreakpoints, aD as videoKeyframeFfmpegExpr, aE as videoLayersUseEffects, aF as videoLayersWithoutTransitionEffects, aG as videoProjectEffects, aH as videoShellQuote, aI as videoTextStyle, aJ as videoTitleFrame, aK as videoTransformAt, aL as videoTransitionAudioCurve, aM as videoTransitionEase, aN as videoValueAt } from '../export-
|
|
1
|
+
import { V as VideoProject, a as VideoAnimatable, b as VideoAsset, c as VideoAssetProxy, d as VideoClip, e as VideoClipAnimation, f as VideoClipEffect, g as VideoEffectRef, h as VideoEffectValues, i as VideoGrade, j as VideoGradeLut, k as VideoKeyframes, l as VideoMarker, m as VideoSequence, n as VideoTrack, o as VideoTranscriptWord, p as VideoTransform, q as VideoTransition, v as videoKeysOf, r as VideoTrackKind, s as VideoPlacementMode, t as VideoKeyframeProperty, u as VideoKey, w as VideoMediaClip, x as VideoEffectsEngine, y as VideoLayer, z as VideoFrame, A as VideoRect, B as VideoEffectPlace, C as VideoFfmpegOptions, D as VideoFfmpegExport, E as VideoEdlOptions, F as VideoFadeCurve, G as VideoFit, H as VideoBlendMode, I as VideoAssetKind, J as VideoClipAnimationEffect, K as VideoTransitionType } from '../export-DSdCfd6O.cjs';
|
|
2
|
+
export { L as VIDEO_BLEND_MODES, M as VIDEO_CLIP_ANIMATION_EFFECTS, N as VIDEO_CLIP_TYPES, O as VIDEO_EASE_NAMES, P as VIDEO_EFFECT_PLACES, Q as VIDEO_FADE_CURVES, R as VIDEO_FITS, S as VIDEO_KEYFRAME_LIMITS, T as VIDEO_KEYFRAME_PROPERTIES, U as VIDEO_PLACEMENT_MODES, W as VIDEO_TRANSFORM_PROPERTIES, X as VIDEO_TRANSITION_TYPES, Y as VIDEO_WIPE_DIRECTIONS, Z as VideoAudioSource, _ as VideoClipType, $ as VideoColorClip, a0 as VideoEase, a1 as VideoEffectClip, a2 as VideoEffectJob, a3 as VideoEffectUse, a4 as VideoEffectsEngineOptions, a5 as VideoLayerEffect, a6 as VideoLoudnessMeasurement, a7 as VideoLoudnessTarget, a8 as VideoSequenceClip, a9 as VideoTextClip, aa as VideoWipeDirection, ab as checkVideoEffectPlace, ac as checkVideoEffectValues, ad as ffmpegFilterValue, ae as isVideoKeyframes, af as mixEffectPixels, ag as overEffectPixels, ah as parseVideoLoudnessMeasurement, ai as placeVideoRect, aj as removeVideoKey, ak as retimeVideoAnimatable, al as setVideoKey, am as sortVideoKeys, an as splitVideoAnimatable, ao as toVideoEdl, ap as toVideoFfmpeg, aq as toVideoLoudnessMeasure, ar as videoClipEffectUses, as as videoClipSoundGain, at as videoEaseBezier, au as videoEaseProgress, av as videoEffectFrameTime, aw as videoEffectLayerKey, ax as videoEffectValuesAt, ay as videoFadeCurveGain, az as videoFfmpegUnsupportedEffects, aA as videoFrameAt, aB as videoFrameLeafLayers, aC as videoKeyframeBreakpoints, aD as videoKeyframeFfmpegExpr, aE as videoLayersUseEffects, aF as videoLayersWithoutTransitionEffects, aG as videoProjectEffects, aH as videoShellQuote, aI as videoTextStyle, aJ as videoTitleFrame, aK as videoTransformAt, aL as videoTransitionAudioCurve, aM as videoTransitionEase, aN as videoValueAt } from '../export-DSdCfd6O.cjs';
|
|
3
3
|
import { A as AnimationPlayer, C as Clock } from '../player-CmbY3218.cjs';
|
|
4
4
|
import { b as AnimationLoopMode } from '../evaluate-BsxYieLN.cjs';
|
|
5
5
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
6
|
-
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-
|
|
6
|
+
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-Cavy1TB7.cjs';
|
|
7
7
|
import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
|
|
8
|
-
import { A as AppliedEffectInfo } from '../tools-
|
|
8
|
+
import { A as AppliedEffectInfo } from '../tools-CL82d7nw.cjs';
|
|
9
9
|
import '../easing-lM0Xo9Ni.cjs';
|
|
10
10
|
import '../types-DsiXGmjo.cjs';
|
|
11
11
|
import '../schema-Di0CS6Pe.cjs';
|
|
@@ -13,6 +13,7 @@ import '../provenance-DmlcgdzT.cjs';
|
|
|
13
13
|
import '../sourcemap-C8AH3MBQ.cjs';
|
|
14
14
|
import '../tokens-D7yXvUU6.cjs';
|
|
15
15
|
import '../types-CwMPoRMU.cjs';
|
|
16
|
+
import '../grain-BWmGZxP4.cjs';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Keyframes `{ keys: [{ t, v, ease }] }`: at least one key, in strictly increasing time (clip-relative
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { V as VideoProject, a as VideoAnimatable, b as VideoAsset, c as VideoAssetProxy, d as VideoClip, e as VideoClipAnimation, f as VideoClipEffect, g as VideoEffectRef, h as VideoEffectValues, i as VideoGrade, j as VideoGradeLut, k as VideoKeyframes, l as VideoMarker, m as VideoSequence, n as VideoTrack, o as VideoTranscriptWord, p as VideoTransform, q as VideoTransition, v as videoKeysOf, r as VideoTrackKind, s as VideoPlacementMode, t as VideoKeyframeProperty, u as VideoKey, w as VideoMediaClip, x as VideoEffectsEngine, y as VideoLayer, z as VideoFrame, A as VideoRect, B as VideoEffectPlace, C as VideoFfmpegOptions, D as VideoFfmpegExport, E as VideoEdlOptions, F as VideoFadeCurve, G as VideoFit, H as VideoBlendMode, I as VideoAssetKind, J as VideoClipAnimationEffect, K as VideoTransitionType } from '../export-
|
|
2
|
-
export { L as VIDEO_BLEND_MODES, M as VIDEO_CLIP_ANIMATION_EFFECTS, N as VIDEO_CLIP_TYPES, O as VIDEO_EASE_NAMES, P as VIDEO_EFFECT_PLACES, Q as VIDEO_FADE_CURVES, R as VIDEO_FITS, S as VIDEO_KEYFRAME_LIMITS, T as VIDEO_KEYFRAME_PROPERTIES, U as VIDEO_PLACEMENT_MODES, W as VIDEO_TRANSFORM_PROPERTIES, X as VIDEO_TRANSITION_TYPES, Y as VIDEO_WIPE_DIRECTIONS, Z as VideoAudioSource, _ as VideoClipType, $ as VideoColorClip, a0 as VideoEase, a1 as VideoEffectClip, a2 as VideoEffectJob, a3 as VideoEffectUse, a4 as VideoEffectsEngineOptions, a5 as VideoLayerEffect, a6 as VideoLoudnessMeasurement, a7 as VideoLoudnessTarget, a8 as VideoSequenceClip, a9 as VideoTextClip, aa as VideoWipeDirection, ab as checkVideoEffectPlace, ac as checkVideoEffectValues, ad as ffmpegFilterValue, ae as isVideoKeyframes, af as mixEffectPixels, ag as overEffectPixels, ah as parseVideoLoudnessMeasurement, ai as placeVideoRect, aj as removeVideoKey, ak as retimeVideoAnimatable, al as setVideoKey, am as sortVideoKeys, an as splitVideoAnimatable, ao as toVideoEdl, ap as toVideoFfmpeg, aq as toVideoLoudnessMeasure, ar as videoClipEffectUses, as as videoClipSoundGain, at as videoEaseBezier, au as videoEaseProgress, av as videoEffectFrameTime, aw as videoEffectLayerKey, ax as videoEffectValuesAt, ay as videoFadeCurveGain, az as videoFfmpegUnsupportedEffects, aA as videoFrameAt, aB as videoFrameLeafLayers, aC as videoKeyframeBreakpoints, aD as videoKeyframeFfmpegExpr, aE as videoLayersUseEffects, aF as videoLayersWithoutTransitionEffects, aG as videoProjectEffects, aH as videoShellQuote, aI as videoTextStyle, aJ as videoTitleFrame, aK as videoTransformAt, aL as videoTransitionAudioCurve, aM as videoTransitionEase, aN as videoValueAt } from '../export-
|
|
1
|
+
import { V as VideoProject, a as VideoAnimatable, b as VideoAsset, c as VideoAssetProxy, d as VideoClip, e as VideoClipAnimation, f as VideoClipEffect, g as VideoEffectRef, h as VideoEffectValues, i as VideoGrade, j as VideoGradeLut, k as VideoKeyframes, l as VideoMarker, m as VideoSequence, n as VideoTrack, o as VideoTranscriptWord, p as VideoTransform, q as VideoTransition, v as videoKeysOf, r as VideoTrackKind, s as VideoPlacementMode, t as VideoKeyframeProperty, u as VideoKey, w as VideoMediaClip, x as VideoEffectsEngine, y as VideoLayer, z as VideoFrame, A as VideoRect, B as VideoEffectPlace, C as VideoFfmpegOptions, D as VideoFfmpegExport, E as VideoEdlOptions, F as VideoFadeCurve, G as VideoFit, H as VideoBlendMode, I as VideoAssetKind, J as VideoClipAnimationEffect, K as VideoTransitionType } from '../export-C45v6MYq.js';
|
|
2
|
+
export { L as VIDEO_BLEND_MODES, M as VIDEO_CLIP_ANIMATION_EFFECTS, N as VIDEO_CLIP_TYPES, O as VIDEO_EASE_NAMES, P as VIDEO_EFFECT_PLACES, Q as VIDEO_FADE_CURVES, R as VIDEO_FITS, S as VIDEO_KEYFRAME_LIMITS, T as VIDEO_KEYFRAME_PROPERTIES, U as VIDEO_PLACEMENT_MODES, W as VIDEO_TRANSFORM_PROPERTIES, X as VIDEO_TRANSITION_TYPES, Y as VIDEO_WIPE_DIRECTIONS, Z as VideoAudioSource, _ as VideoClipType, $ as VideoColorClip, a0 as VideoEase, a1 as VideoEffectClip, a2 as VideoEffectJob, a3 as VideoEffectUse, a4 as VideoEffectsEngineOptions, a5 as VideoLayerEffect, a6 as VideoLoudnessMeasurement, a7 as VideoLoudnessTarget, a8 as VideoSequenceClip, a9 as VideoTextClip, aa as VideoWipeDirection, ab as checkVideoEffectPlace, ac as checkVideoEffectValues, ad as ffmpegFilterValue, ae as isVideoKeyframes, af as mixEffectPixels, ag as overEffectPixels, ah as parseVideoLoudnessMeasurement, ai as placeVideoRect, aj as removeVideoKey, ak as retimeVideoAnimatable, al as setVideoKey, am as sortVideoKeys, an as splitVideoAnimatable, ao as toVideoEdl, ap as toVideoFfmpeg, aq as toVideoLoudnessMeasure, ar as videoClipEffectUses, as as videoClipSoundGain, at as videoEaseBezier, au as videoEaseProgress, av as videoEffectFrameTime, aw as videoEffectLayerKey, ax as videoEffectValuesAt, ay as videoFadeCurveGain, az as videoFfmpegUnsupportedEffects, aA as videoFrameAt, aB as videoFrameLeafLayers, aC as videoKeyframeBreakpoints, aD as videoKeyframeFfmpegExpr, aE as videoLayersUseEffects, aF as videoLayersWithoutTransitionEffects, aG as videoProjectEffects, aH as videoShellQuote, aI as videoTextStyle, aJ as videoTitleFrame, aK as videoTransformAt, aL as videoTransitionAudioCurve, aM as videoTransitionEase, aN as videoValueAt } from '../export-C45v6MYq.js';
|
|
3
3
|
import { A as AnimationPlayer, C as Clock } from '../player-BK2kKbfd.js';
|
|
4
4
|
import { b as AnimationLoopMode } from '../evaluate-BbCeF6pt.js';
|
|
5
5
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
6
|
-
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-
|
|
6
|
+
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-LZQ4cpg4.js';
|
|
7
7
|
import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
|
|
8
|
-
import { A as AppliedEffectInfo } from '../tools-
|
|
8
|
+
import { A as AppliedEffectInfo } from '../tools-DrxgDnXY.js';
|
|
9
9
|
import '../easing-lM0Xo9Ni.js';
|
|
10
10
|
import '../types-DsiXGmjo.js';
|
|
11
11
|
import '../schema-Di0CS6Pe.js';
|
|
@@ -13,6 +13,7 @@ import '../provenance-uh5r2TQ8.js';
|
|
|
13
13
|
import '../sourcemap-DA1Evhrv.js';
|
|
14
14
|
import '../tokens-D7yXvUU6.js';
|
|
15
15
|
import '../types-CwMPoRMU.js';
|
|
16
|
+
import '../grain-BWmGZxP4.js';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Keyframes `{ keys: [{ t, v, ease }] }`: at least one key, in strictly increasing time (clip-relative
|
package/package.json
CHANGED
|
@@ -74,8 +74,14 @@ batching and error codes.
|
|
|
74
74
|
- **Brushed strokes.** Use a brush when the user wants a hand-drawn look (sketching, ink,
|
|
75
75
|
pencil, marker); keep plain strokes for diagrams and UI. Send points every 2 to 8 canvas units
|
|
76
76
|
along a curve, and shape the line with a short `pressure` profile (tapered ends:
|
|
77
|
-
`[0.2, 0.9, 1, 0.9, 0.2]`) rather than many points of different widths. `width`
|
|
78
|
-
size.
|
|
77
|
+
`[0.2, 0.9, 1, 0.9, 0.2]`) rather than many points of different widths. Leave `width` out to
|
|
78
|
+
use the preset's own size (`canvas.listBrushes` gives it); pass it only to make the mark finer
|
|
79
|
+
or bolder.
|
|
80
|
+
- **Brush character.** Each preset draws with its own character: charcoal and pastel are broad and
|
|
81
|
+
grainy (they catch the paper's tooth), pencil is fine and slightly grainy, ink, marker and brush
|
|
82
|
+
pen are clean, the airbrush is a soft spray. The grain and jitter are seeded per stroke, so a
|
|
83
|
+
stroke always looks the same, and neighbouring strokes share one sheet of paper. Pick the brush
|
|
84
|
+
for the look, then the colour; for a sketch, use one or two brushes rather than all of them.
|
|
79
85
|
|
|
80
86
|
## Tool reference
|
|
81
87
|
|
|
@@ -168,12 +174,13 @@ are kept exactly). They need unlocked shapes; other selected nodes are ignored.
|
|
|
168
174
|
Freehand strokes are `path` shape nodes, so they select, move, group, erase and export like any
|
|
169
175
|
shape. A stroke with `data.shape.brush` is painted with a dry paint brush instead of an SVG stroke
|
|
170
176
|
(the path stays the data; the paint is rendered from it); `brush.paint` gives it gradient paint, sampled dab by dab
|
|
171
|
-
along the path, instead of the stroke colour).
|
|
177
|
+
along the path, instead of the stroke colour). New brushed strokes store a `brush.seed` (their
|
|
178
|
+
character: seeded jitter and the paper grain they catch) and, when a width was chosen, `brush.size`.
|
|
172
179
|
|
|
173
180
|
| Command | Use it to |
|
|
174
181
|
| --- | --- |
|
|
175
|
-
| `canvas.drawFreehand` | Draw a pen or highlighter stroke through `points` (`[x, y]` pairs in canvas units, in drawing order; one undo step). `tool` picks the defaults (`pen`: blue, width 3; `highlighter`: yellow, width 24, opacity 0.35); `color`, `width`, `opacity` override them. Pass `brush` (a preset id from `canvas.listBrushes`, or tip settings) to paint it with a dry brush, plus `pressure` / `tiltX` / `tiltY` profiles spread along its length (`[0.2, 1, 0.3]` swells in the middle). Add `paint` (only with `brush`) for gradient paint that changes colour along the stroke: `{ "type": "gradient", "stops": [...], "map": { "by": "distance", "length": 200 } }` (length in canvas units), or `by` `pressure`, `tilt`, `direction`, `across-tip`, `random`. Returns the node `id`, its `bounds` and the stored `brush` (with `paint` normalised: defaults filled in, colours lowercased). |
|
|
176
|
-
| `canvas.listBrushes` | Read-only: the dry paint presets `canvas.drawFreehand` accepts as `brush` (`id`, `name`, `category`, the preset's own `size`). Call it before the first brushed stroke instead of guessing ids. |
|
|
182
|
+
| `canvas.drawFreehand` | Draw a pen or highlighter stroke through `points` (`[x, y]` pairs in canvas units, in drawing order; one undo step). `tool` picks the defaults (`pen`: blue, width 3; `highlighter`: yellow, width 24, opacity 0.35); `color`, `width`, `opacity` override them (with a `brush`, `width` is the brush diameter and defaults to the preset's own size). Pass `brush` (a preset id from `canvas.listBrushes`, or tip settings) to paint it with a dry brush, plus `pressure` / `tiltX` / `tiltY` profiles spread along its length (`[0.2, 1, 0.3]` swells in the middle). Add `paint` (only with `brush`) for gradient paint that changes colour along the stroke: `{ "type": "gradient", "stops": [...], "map": { "by": "distance", "length": 200 } }` (length in canvas units), or `by` `pressure`, `tilt`, `direction`, `across-tip`, `random`. Returns the node `id`, its `bounds` and the stored `brush` (with `paint` normalised: defaults filled in, colours lowercased). |
|
|
183
|
+
| `canvas.listBrushes` | Read-only: the dry paint presets `canvas.drawFreehand` accepts as `brush` (`id`, `name`, `category`, the preset's own `size`, which a stroke uses unless you pass `width`). Call it before the first brushed stroke instead of guessing ids. |
|
|
177
184
|
|
|
178
185
|
### Components (command form)
|
|
179
186
|
|
|
@@ -416,8 +416,10 @@ contents whole while you work, without losing the mask.
|
|
|
416
416
|
| Command | Use it to |
|
|
417
417
|
| --- | --- |
|
|
418
418
|
| `vector.listBrushes` | List the natural-media brushes (pencils, pastels, charcoal, markers, inks) with their sizes. |
|
|
419
|
-
| `vector.addBrushstroke` | Paint paths with a brush along their outline (`brushId`, `size`, `pressure` profile such as [0.2, 1, 0.2] for a taper, `color`): sketchy, hand-drawn or inked lines that stay editable. Returns the stroke stacks. |
|
|
420
|
-
| `vector.setBrushstroke` | Change brushstroke layer `index` of path `id`: brush, size, pressure, colour, opacity. Remove it with `vector.removeStroke`. |
|
|
419
|
+
| `vector.addBrushstroke` | Paint paths with a brush along their outline (`brushId`, `size`, `pressure` profile such as [0.2, 1, 0.2] for a taper, `color`): sketchy, hand-drawn or inked lines that stay editable. Pass a `seed` (any integer) so the brush gets its character, the seeded jitter and paper grain that make pencil, pastel and charcoal look real; `paper` picks the grain (`{ pattern, seed, scale, depth }`) or `null` turns it off. Returns the stroke stacks. |
|
|
420
|
+
| `vector.setBrushstroke` | Change brushstroke layer `index` of path `id`: brush, size, pressure, colour, opacity, `seed` (a new seed is a new take on the same stroke; null: plain dabs) and `paper` (replaced whole; null: no grain; {}: the default sanded paper). Remove it with `vector.removeStroke`. |
|
|
421
|
+
|
|
422
|
+
Give brushstrokes a `seed` unless you want flat, even dabs: without one a charcoal or pastel line looks like a felt pen. Use different seeds on neighbouring strokes so they do not repeat each other, and `paper: null` for clean ink or marker lines that should not catch grain. The grain is laid in each path's own space, so it moves with the path.
|
|
421
423
|
|
|
422
424
|
### Editor settings
|
|
423
425
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/canvas/brushstrokeRender.ts"],"sourcesContent":["/**\n * The lazily loaded half of brushed freehand strokes (`./brushstroke.ts` imports it on first use):\n * the paint engine's dry brushstroke renderer, the paint presets and a CSS colour parser. Keep\n * every import of the paint engine in this file, so the canvas entry never reaches it statically.\n */\nimport { BrushstrokeCache, brushstrokeDataUrl, isBrushstrokeBrush, type BrushstrokeBrush, type BrushstrokeImage } from '../paint/brushstroke.js';\nimport { parsePaintSource, type PaintSource } from '../paint/gradient-paint.js';\nimport { BUILTIN_BRUSHES } from '../paint-editor/brushes.js';\nimport { parseCssColor } from '../image-editor/layers/css-color.js';\nimport { resolveCanvasGradient } from './gradient.js';\nimport { formatNumber, getShapeSvg, type ShapeSize } from './shapeGeometry.js';\nimport { pathDataToPolyline, type BrushedPathShape, type CanvasBrush, type CanvasBrushPaint, type CanvasBrushPreset, type CanvasBrushstrokeImage } from './brushstroke.js';\n\nconst DRY = BUILTIN_BRUSHES.filter((b) => isBrushstrokeBrush(b));\n\nexport function listCanvasBrushes(): CanvasBrushPreset[] {\n\treturn DRY.map((b) => ({ id: b.id, name: b.name, category: b.category, size: b.tip.size }));\n}\n\n/** The paint engine brush for a canvas brush at stroke width `width`; throws with the usable ids. */\nexport function resolveCanvasBrush(brush: CanvasBrush, width: number): BrushstrokeBrush {\n\tconst size = Math.max(1, Number.isFinite(width) ? width : 1);\n\tif (typeof brush === 'string') {\n\t\tconst preset = BUILTIN_BRUSHES.find((b) => b.id === brush);\n\t\tconst ids = DRY.map((b) => b.id).join(', ');\n\t\tif (!preset) throw new Error(`Unknown brush '${brush}'. Use one of the dry paint presets (${ids}) or tip settings ({ hardness, spacing, flow, … }).`);\n\t\tif (!isBrushstrokeBrush(preset)) {\n\t\t\tthrow new Error(`Brush '${brush}' (${preset.name}) is not a dry brush: brushed canvas strokes use dry media only (wet paint needs an area to flow in; mixer, blender, smudge and eraser brushes need paint under them). Use one of: ${ids}.`);\n\t\t}\n\t\treturn { ...preset, tip: { ...preset.tip, size } };\n\t}\n\tif (!brush || typeof brush !== 'object' || Array.isArray(brush)) {\n\t\tthrow new Error('A brush is a dry paint preset id (see listCanvasBrushes / canvas.listBrushes) or an object of tip settings.');\n\t}\n\treturn { size, ...brush };\n}\n\n/**\n * The paint engine's `PaintSource` for a brushed stroke's `paint`; throws with what is wrong.\n * Mappings that need timed samples (`velocity`, `time`) are refused: canvas strokes carry no timing.\n */\nexport function resolveCanvasPaint(paint: CanvasBrushPaint | unknown): PaintSource {\n\tconst source = parsePaintSource(paint, 'paint');\n\tif (source.type === 'gradient' && (source.map.by === 'velocity' || source.map.by === 'time')) {\n\t\tthrow new Error(`paint.map.by \"${source.map.by}\" needs timed samples, which canvas strokes do not record; use distance, pressure, tilt, direction, across-tip or random.`);\n\t}\n\treturn source;\n}\n\n/** A stored stroke's paint, or null when it has none or it is not valid paint (the stroke colour is used then). */\nfunction shapePaint(shape: BrushedPathShape): PaintSource | null {\n\tif (shape.brush.paint === undefined || shape.brush.paint === null) return null;\n\ttry {\n\t\treturn resolveCanvasPaint(shape.brush.paint);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * RGBA of a shape's stroke paint: with `brush.paint` its alpha and the colour of `paint` stops.\n * A canvas gradient stroke without `brush.paint` uses its first stop.\n */\nfunction strokeColor(shape: BrushedPathShape): [number, number, number, number] {\n\tconst gradient = resolveCanvasGradient(shape.strokeGradient ?? shape.stroke);\n\tconst css = gradient ? (gradient.stops[0]?.color ?? '#000') : typeof shape.stroke === 'string' && shape.stroke !== 'none' ? shape.stroke : '#000';\n\tconst parsed = parseCssColor(css) ?? { hex: '#000000', alpha: 1 };\n\tconst n = parseInt(parsed.hex.slice(1), 16);\n\treturn [(n >> 16) & 255, (n >> 8) & 255, n & 255, Math.round(parsed.alpha * 255)];\n}\n\nconst cache = new BrushstrokeCache(128);\nconst urls = new WeakMap<BrushstrokeImage, string>();\n\nexport function renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number): CanvasBrushstrokeImage | null {\n\tconst brush = resolveCanvasBrush(shape.brush.brush, shape.strokeWidth ?? 3);\n\tconst points = pathDataToPolyline(shape.d);\n\tif (!points.length) return null;\n\tconst { pressure, tiltX, tiltY } = shape.brush;\n\tconst input = {\n\t\tpoints: points.map(([x, y]) => ({ x, y })),\n\t\t...(pressure?.length ? { pressure } : {}),\n\t\t...(tiltX?.length ? { tiltX } : {}),\n\t\t...(tiltY?.length ? { tiltY } : {})\n\t};\n\tconst paint = shapePaint(shape);\n\tconst stroke = cache.render(input, brush, { scale, color: strokeColor(shape), ...(paint ? { paint } : {}) });\n\tif (!stroke.bounds) return null;\n\tlet href = urls.get(stroke);\n\tif (href === undefined) {\n\t\thref = brushstrokeDataUrl(stroke);\n\t\turls.set(stroke, href);\n\t}\n\treturn { href, ...stroke.bounds, scale: stroke.scale };\n}\n\nconst escapeAttr = (s: string) => s.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<');\n\nexport function brushedShapeSvgNow(shape: BrushedPathShape, size: ShapeSize, scale: number): string {\n\tconst f = (n: number) => formatNumber(n, 3);\n\tconst image = renderShapeBrushstrokeNow(shape, scale);\n\tconst svg = getShapeSvg(shape, size);\n\tconst body = image\n\t\t? `<image href=\"${escapeAttr(image.href)}\" x=\"${f(image.x)}\" y=\"${f(image.y)}\" width=\"${f(image.width)}\" height=\"${f(image.height)}\" preserveAspectRatio=\"none\"${shape.opacity !== undefined ? ` opacity=\"${f(shape.opacity)}\"` : ''}/>`\n\t\t: '';\n\tconst content = svg.transform && body ? `<g transform=\"${svg.transform}\">${body}</g>` : body;\n\treturn `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${f(size.width)}\" height=\"${f(size.height)}\" viewBox=\"0 0 ${f(size.width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,IAAA,CAAK,KAAK,CAAC,CAAA,UAAA,EAAa,CAAA,CAAE,IAAA,CAAK,MAAM,CAAC,CAAA,eAAA,EAAkB,CAAA,CAAE,IAAA,CAAK,KAAK,CAAC,CAAA,CAAA,EAAI,CAAA,CAAE,IAAA,CAAK,MAAM,CAAC,CAAA,EAAA,EAAK,OAAO,CAAA,MAAA,CAAA;AAC/J;ADRA;AACE;AACA;AACA;AACA;AACA;AACF,gQAAC","file":"/home/runner/work/editor/editor/packages/core/dist/brushstrokeRender-IMFY3FF6.cjs","sourcesContent":[null,"/**\n * The lazily loaded half of brushed freehand strokes (`./brushstroke.ts` imports it on first use):\n * the paint engine's dry brushstroke renderer, the paint presets and a CSS colour parser. Keep\n * every import of the paint engine in this file, so the canvas entry never reaches it statically.\n */\nimport { BrushstrokeCache, brushstrokeDataUrl, isBrushstrokeBrush, type BrushstrokeBrush, type BrushstrokeImage } from '../paint/brushstroke.js';\nimport { parsePaintSource, type PaintSource } from '../paint/gradient-paint.js';\nimport { BUILTIN_BRUSHES } from '../paint-editor/brushes.js';\nimport { parseCssColor } from '../image-editor/layers/css-color.js';\nimport { resolveCanvasGradient } from './gradient.js';\nimport { formatNumber, getShapeSvg, type ShapeSize } from './shapeGeometry.js';\nimport { pathDataToPolyline, type BrushedPathShape, type CanvasBrush, type CanvasBrushPaint, type CanvasBrushPreset, type CanvasBrushstrokeImage } from './brushstroke.js';\n\nconst DRY = BUILTIN_BRUSHES.filter((b) => isBrushstrokeBrush(b));\n\nexport function listCanvasBrushes(): CanvasBrushPreset[] {\n\treturn DRY.map((b) => ({ id: b.id, name: b.name, category: b.category, size: b.tip.size }));\n}\n\n/** The paint engine brush for a canvas brush at stroke width `width`; throws with the usable ids. */\nexport function resolveCanvasBrush(brush: CanvasBrush, width: number): BrushstrokeBrush {\n\tconst size = Math.max(1, Number.isFinite(width) ? width : 1);\n\tif (typeof brush === 'string') {\n\t\tconst preset = BUILTIN_BRUSHES.find((b) => b.id === brush);\n\t\tconst ids = DRY.map((b) => b.id).join(', ');\n\t\tif (!preset) throw new Error(`Unknown brush '${brush}'. Use one of the dry paint presets (${ids}) or tip settings ({ hardness, spacing, flow, … }).`);\n\t\tif (!isBrushstrokeBrush(preset)) {\n\t\t\tthrow new Error(`Brush '${brush}' (${preset.name}) is not a dry brush: brushed canvas strokes use dry media only (wet paint needs an area to flow in; mixer, blender, smudge and eraser brushes need paint under them). Use one of: ${ids}.`);\n\t\t}\n\t\treturn { ...preset, tip: { ...preset.tip, size } };\n\t}\n\tif (!brush || typeof brush !== 'object' || Array.isArray(brush)) {\n\t\tthrow new Error('A brush is a dry paint preset id (see listCanvasBrushes / canvas.listBrushes) or an object of tip settings.');\n\t}\n\treturn { size, ...brush };\n}\n\n/**\n * The paint engine's `PaintSource` for a brushed stroke's `paint`; throws with what is wrong.\n * Mappings that need timed samples (`velocity`, `time`) are refused: canvas strokes carry no timing.\n */\nexport function resolveCanvasPaint(paint: CanvasBrushPaint | unknown): PaintSource {\n\tconst source = parsePaintSource(paint, 'paint');\n\tif (source.type === 'gradient' && (source.map.by === 'velocity' || source.map.by === 'time')) {\n\t\tthrow new Error(`paint.map.by \"${source.map.by}\" needs timed samples, which canvas strokes do not record; use distance, pressure, tilt, direction, across-tip or random.`);\n\t}\n\treturn source;\n}\n\n/** A stored stroke's paint, or null when it has none or it is not valid paint (the stroke colour is used then). */\nfunction shapePaint(shape: BrushedPathShape): PaintSource | null {\n\tif (shape.brush.paint === undefined || shape.brush.paint === null) return null;\n\ttry {\n\t\treturn resolveCanvasPaint(shape.brush.paint);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/**\n * RGBA of a shape's stroke paint: with `brush.paint` its alpha and the colour of `paint` stops.\n * A canvas gradient stroke without `brush.paint` uses its first stop.\n */\nfunction strokeColor(shape: BrushedPathShape): [number, number, number, number] {\n\tconst gradient = resolveCanvasGradient(shape.strokeGradient ?? shape.stroke);\n\tconst css = gradient ? (gradient.stops[0]?.color ?? '#000') : typeof shape.stroke === 'string' && shape.stroke !== 'none' ? shape.stroke : '#000';\n\tconst parsed = parseCssColor(css) ?? { hex: '#000000', alpha: 1 };\n\tconst n = parseInt(parsed.hex.slice(1), 16);\n\treturn [(n >> 16) & 255, (n >> 8) & 255, n & 255, Math.round(parsed.alpha * 255)];\n}\n\nconst cache = new BrushstrokeCache(128);\nconst urls = new WeakMap<BrushstrokeImage, string>();\n\nexport function renderShapeBrushstrokeNow(shape: BrushedPathShape, scale: number): CanvasBrushstrokeImage | null {\n\tconst brush = resolveCanvasBrush(shape.brush.brush, shape.strokeWidth ?? 3);\n\tconst points = pathDataToPolyline(shape.d);\n\tif (!points.length) return null;\n\tconst { pressure, tiltX, tiltY } = shape.brush;\n\tconst input = {\n\t\tpoints: points.map(([x, y]) => ({ x, y })),\n\t\t...(pressure?.length ? { pressure } : {}),\n\t\t...(tiltX?.length ? { tiltX } : {}),\n\t\t...(tiltY?.length ? { tiltY } : {})\n\t};\n\tconst paint = shapePaint(shape);\n\tconst stroke = cache.render(input, brush, { scale, color: strokeColor(shape), ...(paint ? { paint } : {}) });\n\tif (!stroke.bounds) return null;\n\tlet href = urls.get(stroke);\n\tif (href === undefined) {\n\t\thref = brushstrokeDataUrl(stroke);\n\t\turls.set(stroke, href);\n\t}\n\treturn { href, ...stroke.bounds, scale: stroke.scale };\n}\n\nconst escapeAttr = (s: string) => s.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<');\n\nexport function brushedShapeSvgNow(shape: BrushedPathShape, size: ShapeSize, scale: number): string {\n\tconst f = (n: number) => formatNumber(n, 3);\n\tconst image = renderShapeBrushstrokeNow(shape, scale);\n\tconst svg = getShapeSvg(shape, size);\n\tconst body = image\n\t\t? `<image href=\"${escapeAttr(image.href)}\" x=\"${f(image.x)}\" y=\"${f(image.y)}\" width=\"${f(image.width)}\" height=\"${f(image.height)}\" preserveAspectRatio=\"none\"${shape.opacity !== undefined ? ` opacity=\"${f(shape.opacity)}\"` : ''}/>`\n\t\t: '';\n\tconst content = svg.transform && body ? `<g transform=\"${svg.transform}\">${body}</g>` : body;\n\treturn `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${f(size.width)}\" height=\"${f(size.height)}\" viewBox=\"0 0 ${f(size.width)} ${f(size.height)}\">${content}</svg>`;\n}\n"]}
|