@pixerate/editor 0.126.0 → 0.128.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/index.d.cts +2 -3
- package/dist/animation/index.d.ts +2 -3
- package/dist/animation-editor/index.cjs +63 -63
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +7 -9
- package/dist/animation-editor/index.d.ts +7 -9
- package/dist/animation-editor/index.js +10 -10
- package/dist/{arrange-BlfgJ_wt.d.ts → arrange-BUREmgD9.d.ts} +1 -1
- package/dist/{arrange-CD6Gh-pd.d.cts → arrange-CKXK_hf7.d.cts} +1 -1
- package/dist/{bezier-CWv6LQal.d.ts → bezier-CvgQiYRg.d.cts} +23 -3
- package/dist/{bezier-CBzKKDjl.d.cts → bezier-DP4NnJp3.d.ts} +23 -3
- package/dist/{brushTypes-IG7ZZjIN.d.cts → brushTypes-C7N3EBK7.d.cts} +56 -1
- package/dist/{brushTypes-IG7ZZjIN.d.ts → brushTypes-C7N3EBK7.d.ts} +56 -1
- package/dist/{brushstrokeRender-EELTV7U4.cjs → brushstrokeRender-JNHVEUFG.cjs} +29 -10
- package/dist/brushstrokeRender-JNHVEUFG.cjs.map +1 -0
- package/dist/{brushstrokeRender-LRV7GXGD.js → brushstrokeRender-SII6MG4R.js} +25 -6
- package/dist/brushstrokeRender-SII6MG4R.js.map +1 -0
- package/dist/{builtins-DMIsnNst.d.cts → builtins-Cc-bH-3U.d.cts} +3 -2
- package/dist/{builtins-B5-ipm5u.d.ts → builtins-ZU1GJnUA.d.ts} +3 -2
- package/dist/canvas/index.cjs +435 -38
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +206 -16
- package/dist/canvas/index.d.ts +206 -16
- package/dist/canvas/index.js +408 -11
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-MPQAO33O.js → chunk-A6KHMKI4.js} +3 -3
- package/dist/{chunk-V5YGPRCZ.cjs → chunk-BEGEWQHD.cjs} +41 -41
- package/dist/{chunk-V5YGPRCZ.cjs.map → chunk-BEGEWQHD.cjs.map} +1 -1
- package/dist/{chunk-N3FVUOZD.cjs → chunk-BJTCSLF6.cjs} +7 -7
- package/dist/{chunk-N3FVUOZD.cjs.map → chunk-BJTCSLF6.cjs.map} +1 -1
- package/dist/{chunk-7LQO6OHH.cjs → chunk-DDSO4HS7.cjs} +9 -5
- package/dist/chunk-DDSO4HS7.cjs.map +1 -0
- package/dist/{chunk-AKU2KQ47.cjs → chunk-DFSZO2B5.cjs} +70 -3
- package/dist/chunk-DFSZO2B5.cjs.map +1 -0
- package/dist/{chunk-WUDPFWAN.js → chunk-F7Q2NE2Y.js} +3 -3
- package/dist/{chunk-GUZ47CJM.cjs → chunk-IZ4WRXZA.cjs} +1 -1
- package/dist/{chunk-GUZ47CJM.cjs.map → chunk-IZ4WRXZA.cjs.map} +1 -1
- package/dist/{chunk-GLWZXQ4Q.js → chunk-KHNZ6MOU.js} +1 -1
- package/dist/chunk-KHNZ6MOU.js.map +1 -0
- package/dist/{chunk-GCJWMEYW.cjs → chunk-KSJLDRHK.cjs} +46 -46
- package/dist/{chunk-GCJWMEYW.cjs.map → chunk-KSJLDRHK.cjs.map} +1 -1
- package/dist/{chunk-2SDGZAJR.js → chunk-LSXXAJG3.js} +70 -3
- package/dist/chunk-LSXXAJG3.js.map +1 -0
- package/dist/{chunk-QQKTOA4U.cjs → chunk-ORE334I6.cjs} +132 -132
- package/dist/{chunk-QQKTOA4U.cjs.map → chunk-ORE334I6.cjs.map} +1 -1
- package/dist/{chunk-X6KTSFAE.js → chunk-Q4NBEVV5.js} +2 -2
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-J67OLQUQ.js → chunk-SVYE5HIM.js} +7 -3
- package/dist/chunk-SVYE5HIM.js.map +1 -0
- package/dist/{chunk-O5RVCDEC.cjs → chunk-XLUYXUBD.cjs} +88 -88
- package/dist/{chunk-O5RVCDEC.cjs.map → chunk-XLUYXUBD.cjs.map} +1 -1
- package/dist/{chunk-FG274FYT.js → chunk-YGJIER2R.js} +2 -2
- 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 +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/evaluate-BbCeF6pt.d.ts +114 -0
- package/dist/evaluate-BsxYieLN.d.cts +114 -0
- package/dist/{export-Bp7ji2r4.d.cts → export-BkYQvV56.d.cts} +4 -4
- package/dist/{export-DVl4fWy5.d.cts → export-Cbr9IqpJ.d.cts} +1 -1
- package/dist/{export-C1s4eolZ.d.ts → export-ClPKUB-v.d.ts} +1 -1
- package/dist/{export-DAyPY94f.d.ts → export-DHrFJ8r_.d.ts} +4 -4
- package/dist/{helpers-i95Ob6Vi.d.cts → helpers-C5aAd44p.d.cts} +67 -4
- package/dist/{helpers-BBLlekuM.d.ts → helpers-CPWcK504.d.ts} +67 -4
- package/dist/image-editor/index.cjs +606 -606
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +12 -14
- package/dist/image-editor/index.d.ts +12 -14
- package/dist/image-editor/index.js +4 -4
- package/dist/{opentype-D80AVmMu.d.cts → opentype-BOewaGQx.d.cts} +1 -1
- package/dist/{opentype-14PDI5D2.d.ts → opentype-sQrF3Ry1.d.ts} +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint-editor/index.cjs +9 -9
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +9 -11
- package/dist/paint-editor/index.d.ts +9 -11
- package/dist/paint-editor/index.js +4 -4
- package/dist/{pathfinder-DjISxkUv.d.ts → pathfinder-BwJx0_zM.d.ts} +2 -2
- package/dist/{pathfinder-C0UoFypx.d.cts → pathfinder-CnkW7zLI.d.cts} +2 -2
- package/dist/{player-cGLrngL_.d.ts → player-BK2kKbfd.d.ts} +1 -1
- package/dist/{player-CBtEoU2x.d.cts → player-CmbY3218.d.cts} +1 -1
- package/dist/pool-C7GtrL34.d.cts +34 -0
- package/dist/pool-CTrtciaN.d.ts +34 -0
- package/dist/{rand-CfinE-1c.d.cts → rand-DTXAssW1.d.cts} +4 -4
- package/dist/{rand-DtazXGOB.d.ts → rand-pQQ2sJTk.d.ts} +4 -4
- package/dist/{svg-DJKriJ4A.d.ts → svg-C4LlFnEw.d.cts} +2 -3
- package/dist/{svg-BkRL-fZJ.d.cts → svg-CUzZa0EO.d.ts} +2 -3
- package/dist/{tools-CM8Oe8F3.d.ts → tools-AugT22z3.d.ts} +1 -1
- package/dist/{tools-DZCv2kX1.d.cts → tools-BpCmUNxb.d.cts} +1 -1
- package/dist/vector/index.cjs +918 -918
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +11 -13
- package/dist/vector/index.d.ts +11 -13
- package/dist/vector/index.js +11 -11
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/{warp-k_PdtXOG.d.ts → warp-CIsO617e.d.ts} +1 -1
- package/dist/{warp-CH9MM435.d.cts → warp-D62N_5VK.d.cts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +30 -2
- package/dist/behavior-Ymbld6jL.d.cts +0 -60
- package/dist/behavior-Ymbld6jL.d.ts +0 -60
- package/dist/brushstrokeRender-EELTV7U4.cjs.map +0 -1
- package/dist/brushstrokeRender-LRV7GXGD.js.map +0 -1
- package/dist/chunk-2SDGZAJR.js.map +0 -1
- package/dist/chunk-7LQO6OHH.cjs.map +0 -1
- package/dist/chunk-AKU2KQ47.cjs.map +0 -1
- package/dist/chunk-GLWZXQ4Q.js.map +0 -1
- package/dist/chunk-J67OLQUQ.js.map +0 -1
- package/dist/evaluate-2S3vSPLy.d.cts +0 -55
- package/dist/evaluate-CfmT6xA3.d.ts +0 -55
- package/dist/gradient-KDfCvhuj.d.cts +0 -66
- package/dist/gradient-KDfCvhuj.d.ts +0 -66
- /package/dist/{chunk-MPQAO33O.js.map → chunk-A6KHMKI4.js.map} +0 -0
- /package/dist/{chunk-WUDPFWAN.js.map → chunk-F7Q2NE2Y.js.map} +0 -0
- /package/dist/{chunk-X6KTSFAE.js.map → chunk-Q4NBEVV5.js.map} +0 -0
- /package/dist/{chunk-FPRIUR4T.js.map → chunk-ROZFX4QI.js.map} +0 -0
- /package/dist/{chunk-FG274FYT.js.map → chunk-YGJIER2R.js.map} +0 -0
package/dist/vector/index.d.cts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { P as Point } from '../brushTypes-
|
|
4
|
-
import { a as BezierPathInput, A as AffineMatrix$1, B as BezierPath, c as BezierSegment } from '../bezier-
|
|
5
|
-
import { a as VectorGradientHandle, V as VectorSvgExportOptions, b as VectorGradientPatch, c as VectorEnvelopeParams, d as VectorRenderFilter, e as VectorAppearanceShape, f as VectorFilterParamSpec, g as VectorEffectParamSpec, h as VectorRenderStrokeParts, i as VectorPaintDef, j as VectorRgba, k as VectorSvgPatternDef } from '../svg-
|
|
6
|
-
export { l as VECTOR_EFFECT_DEFAULTS, m as VECTOR_EFFECT_LABELS, n as VECTOR_EFFECT_PARAM_SPECS, o as VECTOR_FILTER_DEFAULTS, p as VECTOR_FILTER_LABELS, q as VECTOR_FILTER_MENU, r as VECTOR_FILTER_PARAM_SPECS, s as VECTOR_GRADIENT_MAX_PERIODS, t as VECTOR_GRADIENT_MIN_STOPS, u as VectorBooleanOperand, v as VectorFilterPrimitive, w as VectorGradientPoints, x as VectorGradientRamp, y as VectorGradientSvgOptions, z as VectorPaintSvgOptions, A as VectorSvgImportOptions, B as VectorSvgWrapper, C as activeVectorEffects, D as activeVectorFilters, E as applyVectorCornersAttribute, F as applyVectorEffects, G as applyVectorGradientPatch, H as applyVectorGradientSpread, I as clearVectorLiveBooleanCache, J as convertVectorGradient, K as createVectorEffect, L as createVectorFilter, M as defaultVectorGradient, N as expandVectorAppearance, O as expandVectorAppearances, P as expandVectorGradientSpread, Q as expandVectorGradientStops, R as explicitVectorGradient, S as foldVectorBooleanOperands, T as gradientMidpointRemap, U as hasExplicitGradientGeometry, W as hasOwnVectorAppearance, X as hasVectorAppearance, Y as insertVectorGradientStop, Z as isCentredVectorGradient, _ as isVectorFilterType, $ as isVectorGradient, a0 as isVectorLiveBoolean, a1 as mapVectorGradient, a2 as mapVectorPaint, a3 as moveVectorGradientHandle, a4 as moveVectorGradientStop, a5 as normalizeVectorEffectParams, a6 as normalizeVectorFilterParams, a7 as parseSvgTransform, a8 as parseVectorColor, a9 as parseVectorSvg, aa as patternAttrs, ab as periodicVectorGradientStops, ac as pinVectorGradient, ad as removeVectorGradientStop, ae as reverseVectorGradient, af as samplePlainStops, ag as sampleVectorGradient, ah as sampleVectorGradientAt, ai as sampleVectorPaintDefAt, aj as sanitizeVectorEffects, ak as sanitizeVectorFilters, al as sanitizeVectorGradient, am as setVectorGradientVector, an as sortedVectorGradientStops, ao as spanVectorGradientStops, ap as transformVectorEffects, aq as transformVectorGradient, ar as transformVectorPaint, as as vectorAppearanceNodes, at as vectorAppearanceOutline, au as vectorAppearanceShapes, av as vectorBoxMatrix, aw as vectorChildAppearanceShapes, ax as vectorCornersAttribute, ay as vectorDocumentToSvg, az as vectorEffectInputBounds, aA as vectorEffectInputPaths, aB as vectorEnteredGroups, aC as vectorEnvelopeFrame, aD as vectorEnvelopeMap, aE as vectorEnvelopeMesh, aF as vectorFilterMarkup, aG as vectorFilterParamKeys, aH as vectorFilterReach, aI as vectorFilterSvg, aJ as vectorGradientArea, aK as vectorGradientAspect, aL as vectorGradientFocalParam, aM as vectorGradientHandles, aN as vectorGradientMatrix, aO as vectorGradientMidpointFromPosition, aP as vectorGradientMidpointPosition, aQ as vectorGradientNeedsExpansion, aR as vectorGradientParam, aS as vectorGradientPoints, aT as vectorGradientRamp, aU as vectorGradientSvgDefs, aV as vectorGradientTAt, aW as vectorGradientUnitsMatrix, aX as vectorInstanceDrawn, aY as vectorLiveBooleanSteps, aZ as vectorNodeEnvelope, a_ as vectorNodeFilterSvg, a$ as vectorNodeLocalPaintBounds, b0 as vectorOperandOperation, b1 as vectorPaintToSvg, b2 as vectorPathLocalBounds, b3 as vectorStrokeSvgParts, b4 as widthProfileFromAttribute, b5 as widthProfileToAttribute } from '../svg-
|
|
1
|
+
import { X as Vec2$1, a3 as VectorSubpath, O as VectorBounds, bp as VectorAnchor, a4 as VectorDocument, L as VectorNode, I as VectorPathNode, bq as VectorTextNode, br as VectorAnchorType, $ as VectorPaint, N as VectorGroupNode, bs as VectorCornerKind, a5 as VectorWidthPoint, W as VectorGradient, a1 as VectorGradientStop, bt as VectorViewport, bu as VectorConnectorRoute, bv as VectorConnectorSide, bw as VectorConnectorEnd, bx as VectorConnector, by as VectorConstraintKind, bz as VectorConstraint, bA as VectorCharacterStyle, bB as VectorTextRun, bC as VectorParagraphStyle, bD as VectorTextFrame, bE as VectorTransformHandle, bF as VectorAnchorRef, bG as VectorPathfinderOperation, bH as VectorTool, bI as VectorDefaults, bJ as VectorTextAlign, bK as VectorStyle, bL as VectorHandleRef, bM as VectorSegmentRef, bN as VectorBlendOptions, a0 as VectorMatrix, bO as VectorModifiers, v as EffectsSlot, E as EffectProvider, e as EffectValue, bP as VectorProviderEffect, bQ as VectorBlendMode, R as VectorFilterType, V as VectorEffectType, bR as VectorAlign, bS as VectorDistribute, bT as VectorArrange, K as VectorBooleanOperation, bU as VectorMaskType, bV as VectorSymmetryMode, bW as VectorSymmetry, bX as VectorFreeformPoint, bY as VectorMeshGradient, bZ as VectorFreeformGradient, b_ as VectorArrowhead, b$ as VectorResizing, c0 as VectorFrame, c1 as VectorHorizontalResizing, c2 as VectorVerticalResizing, c3 as VectorMask, c4 as VectorAverageAxis, c5 as VectorSymbol, c6 as VectorParameter, P as VectorWarpMesh, J as VectorFillRule, c7 as VectorBlendSpacing, c8 as VectorGradientInterpolation, Z as VectorGradientSpread, _ as VectorGradientType, a2 as VectorStrokeAlign, c9 as VectorStrokeGradientMode, ca as VectorArrowAlign, M as VectorEffect, cb as VectorPaintLayer, cc as VectorStrokeLayer, U as VectorFilter, cd as VectorBlend, ce as VectorMergeMode, cf as VectorLineJoin, H as VectorEffectParamsMap, cg as VectorStrokeSettings, ch as VectorInstanceOverrides, Q as VectorInstanceNode } from '../helpers-C5aAd44p.cjs';
|
|
2
|
+
export { S as SvgGradientDef, ci as VECTOR_ARROWHEADS, cj as VECTOR_BLEND_MODES, ck as VECTOR_BLEND_SPACINGS, cl as VECTOR_CONNECTOR_ROUTES, cm as VECTOR_CONNECTOR_SIDES, cn as VECTOR_CONSTRAINT_KINDS, co as VECTOR_CORNER_KINDS, cp as VECTOR_EFFECT_TYPES, cq as VECTOR_FILTER_TYPES, cr as VECTOR_GRADIENT_INTERPOLATIONS, cs as VECTOR_GRADIENT_SPREADS, ct as VECTOR_GRADIENT_TYPES, cu as VECTOR_HORIZONTAL_RESIZING, cv as VECTOR_MASK_TYPES, cw as VECTOR_MERGE_MODES, cx as VECTOR_PATHFINDER_OPERATIONS, cy as VECTOR_PATH_TEXT_BASELINES, cz as VECTOR_STROKE_GRADIENT_MODES, cA as VECTOR_SYMMETRY_MODES, cB as VECTOR_TEXT_ALIGNS, cC as VECTOR_TOOLS, cD as VECTOR_TRANSFORM_HANDLES, cE as VECTOR_VERTICAL_RESIZING, cF as VectorCorner, T as VectorFilterParamsMap, cG as VectorGeomRef, Y as VectorGradientUnits, cH as VectorLineCap, cI as VectorPathTextBaseline, cJ as VectorStrokeLayerKind, cK as VectorTextRunStyle, cL as VectorWarpStyle } from '../helpers-C5aAd44p.cjs';
|
|
3
|
+
import { P as Point } from '../brushTypes-C7N3EBK7.cjs';
|
|
4
|
+
import { a as BezierPathInput, A as AffineMatrix$1, B as BezierPath, c as BezierSegment } from '../bezier-CvgQiYRg.cjs';
|
|
5
|
+
import { a as VectorGradientHandle, V as VectorSvgExportOptions, b as VectorGradientPatch, c as VectorEnvelopeParams, d as VectorRenderFilter, e as VectorAppearanceShape, f as VectorFilterParamSpec, g as VectorEffectParamSpec, h as VectorRenderStrokeParts, i as VectorPaintDef, j as VectorRgba, k as VectorSvgPatternDef } from '../svg-C4LlFnEw.cjs';
|
|
6
|
+
export { l as VECTOR_EFFECT_DEFAULTS, m as VECTOR_EFFECT_LABELS, n as VECTOR_EFFECT_PARAM_SPECS, o as VECTOR_FILTER_DEFAULTS, p as VECTOR_FILTER_LABELS, q as VECTOR_FILTER_MENU, r as VECTOR_FILTER_PARAM_SPECS, s as VECTOR_GRADIENT_MAX_PERIODS, t as VECTOR_GRADIENT_MIN_STOPS, u as VectorBooleanOperand, v as VectorFilterPrimitive, w as VectorGradientPoints, x as VectorGradientRamp, y as VectorGradientSvgOptions, z as VectorPaintSvgOptions, A as VectorSvgImportOptions, B as VectorSvgWrapper, C as activeVectorEffects, D as activeVectorFilters, E as applyVectorCornersAttribute, F as applyVectorEffects, G as applyVectorGradientPatch, H as applyVectorGradientSpread, I as clearVectorLiveBooleanCache, J as convertVectorGradient, K as createVectorEffect, L as createVectorFilter, M as defaultVectorGradient, N as expandVectorAppearance, O as expandVectorAppearances, P as expandVectorGradientSpread, Q as expandVectorGradientStops, R as explicitVectorGradient, S as foldVectorBooleanOperands, T as gradientMidpointRemap, U as hasExplicitGradientGeometry, W as hasOwnVectorAppearance, X as hasVectorAppearance, Y as insertVectorGradientStop, Z as isCentredVectorGradient, _ as isVectorFilterType, $ as isVectorGradient, a0 as isVectorLiveBoolean, a1 as mapVectorGradient, a2 as mapVectorPaint, a3 as moveVectorGradientHandle, a4 as moveVectorGradientStop, a5 as normalizeVectorEffectParams, a6 as normalizeVectorFilterParams, a7 as parseSvgTransform, a8 as parseVectorColor, a9 as parseVectorSvg, aa as patternAttrs, ab as periodicVectorGradientStops, ac as pinVectorGradient, ad as removeVectorGradientStop, ae as reverseVectorGradient, af as samplePlainStops, ag as sampleVectorGradient, ah as sampleVectorGradientAt, ai as sampleVectorPaintDefAt, aj as sanitizeVectorEffects, ak as sanitizeVectorFilters, al as sanitizeVectorGradient, am as setVectorGradientVector, an as sortedVectorGradientStops, ao as spanVectorGradientStops, ap as transformVectorEffects, aq as transformVectorGradient, ar as transformVectorPaint, as as vectorAppearanceNodes, at as vectorAppearanceOutline, au as vectorAppearanceShapes, av as vectorBoxMatrix, aw as vectorChildAppearanceShapes, ax as vectorCornersAttribute, ay as vectorDocumentToSvg, az as vectorEffectInputBounds, aA as vectorEffectInputPaths, aB as vectorEnteredGroups, aC as vectorEnvelopeFrame, aD as vectorEnvelopeMap, aE as vectorEnvelopeMesh, aF as vectorFilterMarkup, aG as vectorFilterParamKeys, aH as vectorFilterReach, aI as vectorFilterSvg, aJ as vectorGradientArea, aK as vectorGradientAspect, aL as vectorGradientFocalParam, aM as vectorGradientHandles, aN as vectorGradientMatrix, aO as vectorGradientMidpointFromPosition, aP as vectorGradientMidpointPosition, aQ as vectorGradientNeedsExpansion, aR as vectorGradientParam, aS as vectorGradientPoints, aT as vectorGradientRamp, aU as vectorGradientSvgDefs, aV as vectorGradientTAt, aW as vectorGradientUnitsMatrix, aX as vectorInstanceDrawn, aY as vectorLiveBooleanSteps, aZ as vectorNodeEnvelope, a_ as vectorNodeFilterSvg, a$ as vectorNodeLocalPaintBounds, b0 as vectorOperandOperation, b1 as vectorPaintToSvg, b2 as vectorPathLocalBounds, b3 as vectorStrokeSvgParts, b4 as widthProfileFromAttribute, b5 as widthProfileToAttribute } from '../svg-C4LlFnEw.cjs';
|
|
7
7
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
8
|
-
import { a as TextFont, L as LaidFragment, f as LaidLine, e as TextLayout, T as TextShaper } from '../warp-
|
|
9
|
-
export { g as VECTOR_WARP_STYLES, h as VECTOR_WARP_STYLE_LABELS, W as VectorWarpPreset, i as dragVectorMeshPoint, j as evalVectorMesh, k as fitVectorMesh, l as isValidVectorMesh, m as mapVectorMeshPoints, p as pullVectorMesh, r as removeVectorMeshSplitU, n as removeVectorMeshSplitV, o as resizeVectorMesh, s as splitVectorMeshU, q as splitVectorMeshV, t as vectorIdentityMesh, w as vectorMeshColumns, u as vectorMeshControlBounds, v as vectorMeshEditPoints, x as vectorMeshGridCurves, y as vectorMeshParamAt, z as vectorMeshRows, A as vectorWarpPresetGrid, B as vectorWarpPresetMesh } from '../warp-
|
|
8
|
+
import { a as TextFont, L as LaidFragment, f as LaidLine, e as TextLayout, T as TextShaper } from '../warp-D62N_5VK.cjs';
|
|
9
|
+
export { g as VECTOR_WARP_STYLES, h as VECTOR_WARP_STYLE_LABELS, W as VectorWarpPreset, i as dragVectorMeshPoint, j as evalVectorMesh, k as fitVectorMesh, l as isValidVectorMesh, m as mapVectorMeshPoints, p as pullVectorMesh, r as removeVectorMeshSplitU, n as removeVectorMeshSplitV, o as resizeVectorMesh, s as splitVectorMeshU, q as splitVectorMeshV, t as vectorIdentityMesh, w as vectorMeshColumns, u as vectorMeshControlBounds, v as vectorMeshEditPoints, x as vectorMeshGridCurves, y as vectorMeshParamAt, z as vectorMeshRows, A as vectorWarpPresetGrid, B as vectorWarpPresetMesh } from '../warp-D62N_5VK.cjs';
|
|
10
10
|
import { A as AffineMatrix, V as Vec2 } from '../types-CwMPoRMU.cjs';
|
|
11
11
|
export { H as VectorHomography } from '../types-CwMPoRMU.cjs';
|
|
12
12
|
import { C as CommandSpec } from '../registry-CaR7LC6W.cjs';
|
|
13
|
-
import { S as StrokeJoin, a as StrokeCap, P as PlanarMap, b as PathfinderOperation, c as PathfinderShape } from '../pathfinder-
|
|
13
|
+
import { S as StrokeJoin, a as StrokeCap, P as PlanarMap, b as PathfinderOperation, c as PathfinderShape } from '../pathfinder-CnkW7zLI.cjs';
|
|
14
14
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.cjs';
|
|
15
|
-
export { C as CanvasTextShaperOptions, O as OpenTypeFont, a as OutlineFontEntry, b as OutlineFontFace, c as OutlinePathCommand, d as applyVectorHomography, e as createCanvasTextShaper, f as createMetricTextShaper, g as createOutlineTextShaper, h as cssFontFamily, l as loadOpenTypeFont, o as orderVectorQuad, p as parseOpenTypeFont, s as solve8, i as vectorHomography, j as vectorHomographyKeepsQuad } from '../opentype-
|
|
15
|
+
export { C as CanvasTextShaperOptions, O as OpenTypeFont, a as OutlineFontEntry, b as OutlineFontFace, c as OutlinePathCommand, d as applyVectorHomography, e as createCanvasTextShaper, f as createMetricTextShaper, g as createOutlineTextShaper, h as cssFontFamily, l as loadOpenTypeFont, o as orderVectorQuad, p as parseOpenTypeFont, s as solve8, i as vectorHomography, j as vectorHomographyKeepsQuad } from '../opentype-BOewaGQx.cjs';
|
|
16
16
|
import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
|
|
17
|
-
export { S as SvgGradientDef } from '../gradient-KDfCvhuj.cjs';
|
|
18
17
|
import '../schema-Di0CS6Pe.cjs';
|
|
19
|
-
import '../
|
|
20
|
-
import '../evaluate-2S3vSPLy.cjs';
|
|
18
|
+
import '../evaluate-BsxYieLN.cjs';
|
|
21
19
|
import '../types-DsiXGmjo.cjs';
|
|
22
20
|
|
|
23
21
|
/**
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { P as Point } from '../brushTypes-
|
|
4
|
-
import { a as BezierPathInput, A as AffineMatrix$1, B as BezierPath, c as BezierSegment } from '../bezier-
|
|
5
|
-
import { a as VectorGradientHandle, V as VectorSvgExportOptions, b as VectorGradientPatch, c as VectorEnvelopeParams, d as VectorRenderFilter, e as VectorAppearanceShape, f as VectorFilterParamSpec, g as VectorEffectParamSpec, h as VectorRenderStrokeParts, i as VectorPaintDef, j as VectorRgba, k as VectorSvgPatternDef } from '../svg-
|
|
6
|
-
export { l as VECTOR_EFFECT_DEFAULTS, m as VECTOR_EFFECT_LABELS, n as VECTOR_EFFECT_PARAM_SPECS, o as VECTOR_FILTER_DEFAULTS, p as VECTOR_FILTER_LABELS, q as VECTOR_FILTER_MENU, r as VECTOR_FILTER_PARAM_SPECS, s as VECTOR_GRADIENT_MAX_PERIODS, t as VECTOR_GRADIENT_MIN_STOPS, u as VectorBooleanOperand, v as VectorFilterPrimitive, w as VectorGradientPoints, x as VectorGradientRamp, y as VectorGradientSvgOptions, z as VectorPaintSvgOptions, A as VectorSvgImportOptions, B as VectorSvgWrapper, C as activeVectorEffects, D as activeVectorFilters, E as applyVectorCornersAttribute, F as applyVectorEffects, G as applyVectorGradientPatch, H as applyVectorGradientSpread, I as clearVectorLiveBooleanCache, J as convertVectorGradient, K as createVectorEffect, L as createVectorFilter, M as defaultVectorGradient, N as expandVectorAppearance, O as expandVectorAppearances, P as expandVectorGradientSpread, Q as expandVectorGradientStops, R as explicitVectorGradient, S as foldVectorBooleanOperands, T as gradientMidpointRemap, U as hasExplicitGradientGeometry, W as hasOwnVectorAppearance, X as hasVectorAppearance, Y as insertVectorGradientStop, Z as isCentredVectorGradient, _ as isVectorFilterType, $ as isVectorGradient, a0 as isVectorLiveBoolean, a1 as mapVectorGradient, a2 as mapVectorPaint, a3 as moveVectorGradientHandle, a4 as moveVectorGradientStop, a5 as normalizeVectorEffectParams, a6 as normalizeVectorFilterParams, a7 as parseSvgTransform, a8 as parseVectorColor, a9 as parseVectorSvg, aa as patternAttrs, ab as periodicVectorGradientStops, ac as pinVectorGradient, ad as removeVectorGradientStop, ae as reverseVectorGradient, af as samplePlainStops, ag as sampleVectorGradient, ah as sampleVectorGradientAt, ai as sampleVectorPaintDefAt, aj as sanitizeVectorEffects, ak as sanitizeVectorFilters, al as sanitizeVectorGradient, am as setVectorGradientVector, an as sortedVectorGradientStops, ao as spanVectorGradientStops, ap as transformVectorEffects, aq as transformVectorGradient, ar as transformVectorPaint, as as vectorAppearanceNodes, at as vectorAppearanceOutline, au as vectorAppearanceShapes, av as vectorBoxMatrix, aw as vectorChildAppearanceShapes, ax as vectorCornersAttribute, ay as vectorDocumentToSvg, az as vectorEffectInputBounds, aA as vectorEffectInputPaths, aB as vectorEnteredGroups, aC as vectorEnvelopeFrame, aD as vectorEnvelopeMap, aE as vectorEnvelopeMesh, aF as vectorFilterMarkup, aG as vectorFilterParamKeys, aH as vectorFilterReach, aI as vectorFilterSvg, aJ as vectorGradientArea, aK as vectorGradientAspect, aL as vectorGradientFocalParam, aM as vectorGradientHandles, aN as vectorGradientMatrix, aO as vectorGradientMidpointFromPosition, aP as vectorGradientMidpointPosition, aQ as vectorGradientNeedsExpansion, aR as vectorGradientParam, aS as vectorGradientPoints, aT as vectorGradientRamp, aU as vectorGradientSvgDefs, aV as vectorGradientTAt, aW as vectorGradientUnitsMatrix, aX as vectorInstanceDrawn, aY as vectorLiveBooleanSteps, aZ as vectorNodeEnvelope, a_ as vectorNodeFilterSvg, a$ as vectorNodeLocalPaintBounds, b0 as vectorOperandOperation, b1 as vectorPaintToSvg, b2 as vectorPathLocalBounds, b3 as vectorStrokeSvgParts, b4 as widthProfileFromAttribute, b5 as widthProfileToAttribute } from '../svg-
|
|
1
|
+
import { X as Vec2$1, a3 as VectorSubpath, O as VectorBounds, bp as VectorAnchor, a4 as VectorDocument, L as VectorNode, I as VectorPathNode, bq as VectorTextNode, br as VectorAnchorType, $ as VectorPaint, N as VectorGroupNode, bs as VectorCornerKind, a5 as VectorWidthPoint, W as VectorGradient, a1 as VectorGradientStop, bt as VectorViewport, bu as VectorConnectorRoute, bv as VectorConnectorSide, bw as VectorConnectorEnd, bx as VectorConnector, by as VectorConstraintKind, bz as VectorConstraint, bA as VectorCharacterStyle, bB as VectorTextRun, bC as VectorParagraphStyle, bD as VectorTextFrame, bE as VectorTransformHandle, bF as VectorAnchorRef, bG as VectorPathfinderOperation, bH as VectorTool, bI as VectorDefaults, bJ as VectorTextAlign, bK as VectorStyle, bL as VectorHandleRef, bM as VectorSegmentRef, bN as VectorBlendOptions, a0 as VectorMatrix, bO as VectorModifiers, v as EffectsSlot, E as EffectProvider, e as EffectValue, bP as VectorProviderEffect, bQ as VectorBlendMode, R as VectorFilterType, V as VectorEffectType, bR as VectorAlign, bS as VectorDistribute, bT as VectorArrange, K as VectorBooleanOperation, bU as VectorMaskType, bV as VectorSymmetryMode, bW as VectorSymmetry, bX as VectorFreeformPoint, bY as VectorMeshGradient, bZ as VectorFreeformGradient, b_ as VectorArrowhead, b$ as VectorResizing, c0 as VectorFrame, c1 as VectorHorizontalResizing, c2 as VectorVerticalResizing, c3 as VectorMask, c4 as VectorAverageAxis, c5 as VectorSymbol, c6 as VectorParameter, P as VectorWarpMesh, J as VectorFillRule, c7 as VectorBlendSpacing, c8 as VectorGradientInterpolation, Z as VectorGradientSpread, _ as VectorGradientType, a2 as VectorStrokeAlign, c9 as VectorStrokeGradientMode, ca as VectorArrowAlign, M as VectorEffect, cb as VectorPaintLayer, cc as VectorStrokeLayer, U as VectorFilter, cd as VectorBlend, ce as VectorMergeMode, cf as VectorLineJoin, H as VectorEffectParamsMap, cg as VectorStrokeSettings, ch as VectorInstanceOverrides, Q as VectorInstanceNode } from '../helpers-CPWcK504.js';
|
|
2
|
+
export { S as SvgGradientDef, ci as VECTOR_ARROWHEADS, cj as VECTOR_BLEND_MODES, ck as VECTOR_BLEND_SPACINGS, cl as VECTOR_CONNECTOR_ROUTES, cm as VECTOR_CONNECTOR_SIDES, cn as VECTOR_CONSTRAINT_KINDS, co as VECTOR_CORNER_KINDS, cp as VECTOR_EFFECT_TYPES, cq as VECTOR_FILTER_TYPES, cr as VECTOR_GRADIENT_INTERPOLATIONS, cs as VECTOR_GRADIENT_SPREADS, ct as VECTOR_GRADIENT_TYPES, cu as VECTOR_HORIZONTAL_RESIZING, cv as VECTOR_MASK_TYPES, cw as VECTOR_MERGE_MODES, cx as VECTOR_PATHFINDER_OPERATIONS, cy as VECTOR_PATH_TEXT_BASELINES, cz as VECTOR_STROKE_GRADIENT_MODES, cA as VECTOR_SYMMETRY_MODES, cB as VECTOR_TEXT_ALIGNS, cC as VECTOR_TOOLS, cD as VECTOR_TRANSFORM_HANDLES, cE as VECTOR_VERTICAL_RESIZING, cF as VectorCorner, T as VectorFilterParamsMap, cG as VectorGeomRef, Y as VectorGradientUnits, cH as VectorLineCap, cI as VectorPathTextBaseline, cJ as VectorStrokeLayerKind, cK as VectorTextRunStyle, cL as VectorWarpStyle } from '../helpers-CPWcK504.js';
|
|
3
|
+
import { P as Point } from '../brushTypes-C7N3EBK7.js';
|
|
4
|
+
import { a as BezierPathInput, A as AffineMatrix$1, B as BezierPath, c as BezierSegment } from '../bezier-DP4NnJp3.js';
|
|
5
|
+
import { a as VectorGradientHandle, V as VectorSvgExportOptions, b as VectorGradientPatch, c as VectorEnvelopeParams, d as VectorRenderFilter, e as VectorAppearanceShape, f as VectorFilterParamSpec, g as VectorEffectParamSpec, h as VectorRenderStrokeParts, i as VectorPaintDef, j as VectorRgba, k as VectorSvgPatternDef } from '../svg-CUzZa0EO.js';
|
|
6
|
+
export { l as VECTOR_EFFECT_DEFAULTS, m as VECTOR_EFFECT_LABELS, n as VECTOR_EFFECT_PARAM_SPECS, o as VECTOR_FILTER_DEFAULTS, p as VECTOR_FILTER_LABELS, q as VECTOR_FILTER_MENU, r as VECTOR_FILTER_PARAM_SPECS, s as VECTOR_GRADIENT_MAX_PERIODS, t as VECTOR_GRADIENT_MIN_STOPS, u as VectorBooleanOperand, v as VectorFilterPrimitive, w as VectorGradientPoints, x as VectorGradientRamp, y as VectorGradientSvgOptions, z as VectorPaintSvgOptions, A as VectorSvgImportOptions, B as VectorSvgWrapper, C as activeVectorEffects, D as activeVectorFilters, E as applyVectorCornersAttribute, F as applyVectorEffects, G as applyVectorGradientPatch, H as applyVectorGradientSpread, I as clearVectorLiveBooleanCache, J as convertVectorGradient, K as createVectorEffect, L as createVectorFilter, M as defaultVectorGradient, N as expandVectorAppearance, O as expandVectorAppearances, P as expandVectorGradientSpread, Q as expandVectorGradientStops, R as explicitVectorGradient, S as foldVectorBooleanOperands, T as gradientMidpointRemap, U as hasExplicitGradientGeometry, W as hasOwnVectorAppearance, X as hasVectorAppearance, Y as insertVectorGradientStop, Z as isCentredVectorGradient, _ as isVectorFilterType, $ as isVectorGradient, a0 as isVectorLiveBoolean, a1 as mapVectorGradient, a2 as mapVectorPaint, a3 as moveVectorGradientHandle, a4 as moveVectorGradientStop, a5 as normalizeVectorEffectParams, a6 as normalizeVectorFilterParams, a7 as parseSvgTransform, a8 as parseVectorColor, a9 as parseVectorSvg, aa as patternAttrs, ab as periodicVectorGradientStops, ac as pinVectorGradient, ad as removeVectorGradientStop, ae as reverseVectorGradient, af as samplePlainStops, ag as sampleVectorGradient, ah as sampleVectorGradientAt, ai as sampleVectorPaintDefAt, aj as sanitizeVectorEffects, ak as sanitizeVectorFilters, al as sanitizeVectorGradient, am as setVectorGradientVector, an as sortedVectorGradientStops, ao as spanVectorGradientStops, ap as transformVectorEffects, aq as transformVectorGradient, ar as transformVectorPaint, as as vectorAppearanceNodes, at as vectorAppearanceOutline, au as vectorAppearanceShapes, av as vectorBoxMatrix, aw as vectorChildAppearanceShapes, ax as vectorCornersAttribute, ay as vectorDocumentToSvg, az as vectorEffectInputBounds, aA as vectorEffectInputPaths, aB as vectorEnteredGroups, aC as vectorEnvelopeFrame, aD as vectorEnvelopeMap, aE as vectorEnvelopeMesh, aF as vectorFilterMarkup, aG as vectorFilterParamKeys, aH as vectorFilterReach, aI as vectorFilterSvg, aJ as vectorGradientArea, aK as vectorGradientAspect, aL as vectorGradientFocalParam, aM as vectorGradientHandles, aN as vectorGradientMatrix, aO as vectorGradientMidpointFromPosition, aP as vectorGradientMidpointPosition, aQ as vectorGradientNeedsExpansion, aR as vectorGradientParam, aS as vectorGradientPoints, aT as vectorGradientRamp, aU as vectorGradientSvgDefs, aV as vectorGradientTAt, aW as vectorGradientUnitsMatrix, aX as vectorInstanceDrawn, aY as vectorLiveBooleanSteps, aZ as vectorNodeEnvelope, a_ as vectorNodeFilterSvg, a$ as vectorNodeLocalPaintBounds, b0 as vectorOperandOperation, b1 as vectorPaintToSvg, b2 as vectorPathLocalBounds, b3 as vectorStrokeSvgParts, b4 as widthProfileFromAttribute, b5 as widthProfileToAttribute } from '../svg-CUzZa0EO.js';
|
|
7
7
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
8
|
-
import { a as TextFont, L as LaidFragment, f as LaidLine, e as TextLayout, T as TextShaper } from '../warp-
|
|
9
|
-
export { g as VECTOR_WARP_STYLES, h as VECTOR_WARP_STYLE_LABELS, W as VectorWarpPreset, i as dragVectorMeshPoint, j as evalVectorMesh, k as fitVectorMesh, l as isValidVectorMesh, m as mapVectorMeshPoints, p as pullVectorMesh, r as removeVectorMeshSplitU, n as removeVectorMeshSplitV, o as resizeVectorMesh, s as splitVectorMeshU, q as splitVectorMeshV, t as vectorIdentityMesh, w as vectorMeshColumns, u as vectorMeshControlBounds, v as vectorMeshEditPoints, x as vectorMeshGridCurves, y as vectorMeshParamAt, z as vectorMeshRows, A as vectorWarpPresetGrid, B as vectorWarpPresetMesh } from '../warp-
|
|
8
|
+
import { a as TextFont, L as LaidFragment, f as LaidLine, e as TextLayout, T as TextShaper } from '../warp-CIsO617e.js';
|
|
9
|
+
export { g as VECTOR_WARP_STYLES, h as VECTOR_WARP_STYLE_LABELS, W as VectorWarpPreset, i as dragVectorMeshPoint, j as evalVectorMesh, k as fitVectorMesh, l as isValidVectorMesh, m as mapVectorMeshPoints, p as pullVectorMesh, r as removeVectorMeshSplitU, n as removeVectorMeshSplitV, o as resizeVectorMesh, s as splitVectorMeshU, q as splitVectorMeshV, t as vectorIdentityMesh, w as vectorMeshColumns, u as vectorMeshControlBounds, v as vectorMeshEditPoints, x as vectorMeshGridCurves, y as vectorMeshParamAt, z as vectorMeshRows, A as vectorWarpPresetGrid, B as vectorWarpPresetMesh } from '../warp-CIsO617e.js';
|
|
10
10
|
import { A as AffineMatrix, V as Vec2 } from '../types-CwMPoRMU.js';
|
|
11
11
|
export { H as VectorHomography } from '../types-CwMPoRMU.js';
|
|
12
12
|
import { C as CommandSpec } from '../registry-rVtFJjRM.js';
|
|
13
|
-
import { S as StrokeJoin, a as StrokeCap, P as PlanarMap, b as PathfinderOperation, c as PathfinderShape } from '../pathfinder-
|
|
13
|
+
import { S as StrokeJoin, a as StrokeCap, P as PlanarMap, b as PathfinderOperation, c as PathfinderShape } from '../pathfinder-BwJx0_zM.js';
|
|
14
14
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
15
|
-
export { C as CanvasTextShaperOptions, O as OpenTypeFont, a as OutlineFontEntry, b as OutlineFontFace, c as OutlinePathCommand, d as applyVectorHomography, e as createCanvasTextShaper, f as createMetricTextShaper, g as createOutlineTextShaper, h as cssFontFamily, l as loadOpenTypeFont, o as orderVectorQuad, p as parseOpenTypeFont, s as solve8, i as vectorHomography, j as vectorHomographyKeepsQuad } from '../opentype-
|
|
15
|
+
export { C as CanvasTextShaperOptions, O as OpenTypeFont, a as OutlineFontEntry, b as OutlineFontFace, c as OutlinePathCommand, d as applyVectorHomography, e as createCanvasTextShaper, f as createMetricTextShaper, g as createOutlineTextShaper, h as cssFontFamily, l as loadOpenTypeFont, o as orderVectorQuad, p as parseOpenTypeFont, s as solve8, i as vectorHomography, j as vectorHomographyKeepsQuad } from '../opentype-sQrF3Ry1.js';
|
|
16
16
|
import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
|
|
17
|
-
export { S as SvgGradientDef } from '../gradient-KDfCvhuj.js';
|
|
18
17
|
import '../schema-Di0CS6Pe.js';
|
|
19
|
-
import '../
|
|
20
|
-
import '../evaluate-CfmT6xA3.js';
|
|
18
|
+
import '../evaluate-BbCeF6pt.js';
|
|
21
19
|
import '../types-DsiXGmjo.js';
|
|
22
20
|
|
|
23
21
|
/**
|
package/dist/vector/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
cutOutPiece,
|
|
4
4
|
hatchPath,
|
|
5
5
|
pathfinder
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-Q4NBEVV5.js";
|
|
7
7
|
import {
|
|
8
8
|
loadOpenTypeFont,
|
|
9
9
|
parseOpenTypeFont
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
reverseMorphContour,
|
|
43
43
|
subpathToMorphContour,
|
|
44
44
|
turnMorphContour
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-A6KHMKI4.js";
|
|
46
46
|
import {
|
|
47
47
|
DEFAULT_VECTOR_FONT,
|
|
48
48
|
IDENTITY_MATRIX,
|
|
@@ -478,13 +478,7 @@ import {
|
|
|
478
478
|
withVectorStrokes,
|
|
479
479
|
withVectorTargetPaint,
|
|
480
480
|
zigzagPaths
|
|
481
|
-
} from "../chunk-
|
|
482
|
-
import {
|
|
483
|
-
EffectUnsupportedError,
|
|
484
|
-
EffectsSlot,
|
|
485
|
-
createEffectToolProvider,
|
|
486
|
-
resolveEffectValues
|
|
487
|
-
} from "../chunk-QFSTQHZY.js";
|
|
481
|
+
} from "../chunk-ROZFX4QI.js";
|
|
488
482
|
import {
|
|
489
483
|
bezierPathBounds,
|
|
490
484
|
bezierPathToSvg,
|
|
@@ -501,13 +495,19 @@ import {
|
|
|
501
495
|
segmentPoint,
|
|
502
496
|
segmentTangent,
|
|
503
497
|
transformBezierPath
|
|
504
|
-
} from "../chunk-
|
|
498
|
+
} from "../chunk-YGJIER2R.js";
|
|
505
499
|
import {
|
|
506
500
|
fitCubicWithTangents,
|
|
507
501
|
fitCubics,
|
|
508
502
|
parseSvgPath,
|
|
509
503
|
simplifyRing
|
|
510
|
-
} from "../chunk-
|
|
504
|
+
} from "../chunk-KHNZ6MOU.js";
|
|
505
|
+
import {
|
|
506
|
+
EffectUnsupportedError,
|
|
507
|
+
EffectsSlot,
|
|
508
|
+
createEffectToolProvider,
|
|
509
|
+
resolveEffectValues
|
|
510
|
+
} from "../chunk-QFSTQHZY.js";
|
|
511
511
|
import "../chunk-4FX5ACVG.js";
|
|
512
512
|
import {
|
|
513
513
|
HistoryManager
|
|
@@ -1,16 +1,14 @@
|
|
|
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-
|
|
3
|
-
import { A as AnimationPlayer, C as Clock } from '../player-
|
|
4
|
-
import { b as AnimationLoopMode } from '../evaluate-
|
|
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-Cbr9IqpJ.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-Cbr9IqpJ.cjs';
|
|
3
|
+
import { A as AnimationPlayer, C as Clock } from '../player-CmbY3218.cjs';
|
|
4
|
+
import { b as AnimationLoopMode } from '../evaluate-BsxYieLN.cjs';
|
|
5
5
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
6
|
-
import {
|
|
6
|
+
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-C5aAd44p.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-BpCmUNxb.cjs';
|
|
9
9
|
import '../easing-lM0Xo9Ni.cjs';
|
|
10
10
|
import '../types-DsiXGmjo.cjs';
|
|
11
11
|
import '../schema-Di0CS6Pe.cjs';
|
|
12
|
-
import '../behavior-Ymbld6jL.cjs';
|
|
13
|
-
import '../gradient-KDfCvhuj.cjs';
|
|
14
12
|
import '../types-CwMPoRMU.cjs';
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -1,16 +1,14 @@
|
|
|
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-
|
|
3
|
-
import { A as AnimationPlayer, C as Clock } from '../player-
|
|
4
|
-
import { b as AnimationLoopMode } from '../evaluate-
|
|
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-ClPKUB-v.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-ClPKUB-v.js';
|
|
3
|
+
import { A as AnimationPlayer, C as Clock } from '../player-BK2kKbfd.js';
|
|
4
|
+
import { b as AnimationLoopMode } from '../evaluate-BbCeF6pt.js';
|
|
5
5
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
6
|
-
import {
|
|
6
|
+
import { v as EffectsSlot, E as EffectProvider, f as EffectDescription, e as EffectValue } from '../helpers-CPWcK504.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-AugT22z3.js';
|
|
9
9
|
import '../easing-lM0Xo9Ni.js';
|
|
10
10
|
import '../types-DsiXGmjo.js';
|
|
11
11
|
import '../schema-Di0CS6Pe.js';
|
|
12
|
-
import '../behavior-Ymbld6jL.js';
|
|
13
|
-
import '../gradient-KDfCvhuj.js';
|
|
14
12
|
import '../types-CwMPoRMU.js';
|
|
15
13
|
|
|
16
14
|
/**
|
package/package.json
CHANGED
|
@@ -167,11 +167,12 @@ are kept exactly). They need unlocked shapes; other selected nodes are ignored.
|
|
|
167
167
|
|
|
168
168
|
Freehand strokes are `path` shape nodes, so they select, move, group, erase and export like any
|
|
169
169
|
shape. A stroke with `data.shape.brush` is painted with a dry paint brush instead of an SVG stroke
|
|
170
|
-
(the path stays the data; the paint is rendered from it).
|
|
170
|
+
(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).
|
|
171
172
|
|
|
172
173
|
| Command | Use it to |
|
|
173
174
|
| --- | --- |
|
|
174
|
-
| `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). Returns the node `id`, its `bounds` and the stored `brush
|
|
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). |
|
|
175
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. |
|
|
176
177
|
|
|
177
178
|
### Components (command form)
|
|
@@ -225,11 +226,38 @@ easing applies to the segment leaving a keyframe. Animatable properties: `x`, `y
|
|
|
225
226
|
| `canvas.animation.previousKeyframe` | Jump the playhead to the previous keyframe. |
|
|
226
227
|
| `canvas.animation.exportCss` | Read-only: CSS `@keyframes` for `nodeId`'s animation, as `{ css, exact }`. `exact: false` means some tracks were sampled (OKLab colour tweens, `x` / `y` with different timing, motion paths). |
|
|
227
228
|
|
|
229
|
+
### Provider effects
|
|
230
|
+
|
|
231
|
+
These tools come from `createCanvasEffectsToolProvider`. They work once the host registers an
|
|
232
|
+
effects provider (for example Flair); without one the read tools say so and the write tools refuse.
|
|
233
|
+
|
|
234
|
+
| Tool | Use it to |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| `search_effects` | Find effects: use `generator` for fills, `overlay`, `title` or `interactive` for overlays, and `transition` for scene transitions. |
|
|
237
|
+
| `describe_effect` | Read an effect's controls, ranges, defaults and presets before applying it. |
|
|
238
|
+
| `list_applied_effects` | List the shape nodes that carry effects, with each effect's role (fill or overlay), opacity and values. |
|
|
239
|
+
| `apply_effect` | Put an effect on a shape node: a generator fills the shape (clipped to its outline), anything else draws over its box. This replaces any effect already there. Returns the effect. |
|
|
240
|
+
| `update_effect` | Change a node's effect (`effect` is "effect"): `values` (`null` resets a control), `opacity`, and `enabled` (false holds the first frame). |
|
|
241
|
+
| `remove_effect` | Take the effect off a node. |
|
|
242
|
+
| `set_canvas_effect_mode` | Switch a node's effect between `fill` and `overlay`. |
|
|
243
|
+
| `list_scene_transitions` | List the Scenes in order, each with the transition played when moving to it. |
|
|
244
|
+
| `set_scene_transition` | Set (or with `effect` null, remove) the transition effect played when moving to a scene, with its `duration` in ms. |
|
|
245
|
+
|
|
228
246
|
## Pitfalls
|
|
229
247
|
|
|
248
|
+
- **A shape node holds one effect.** `apply_effect` replaces the effect that is there. Effects draw on shape nodes only (nodes with `data.shape`).
|
|
249
|
+
|
|
230
250
|
- **Brushes are dry only.** Wet presets (watercolour, gouache, wet oils), mixer, blender, smudge and
|
|
231
251
|
eraser presets are refused: wet paint needs an area to flow in, and the others need paint under
|
|
232
252
|
them. `pressure` and tilt without a `brush` are refused too.
|
|
253
|
+
- **Gradient paint needs a brush, and no timing.** `paint` without `brush` is refused; use
|
|
254
|
+
`color` for a plain stroke. Canvas strokes record no timing, so `velocity` and `time` mappings
|
|
255
|
+
are refused: use `distance` for colour that changes along the stroke. The stroke `color` still
|
|
256
|
+
sets the alpha and fills `"paint"` stops (`"secondary"` is white). A distance `length` shorter
|
|
257
|
+
than the stroke with `repeat: "mirror"` (the default) runs back and forth; use `clamp` and a
|
|
258
|
+
length near the stroke's to go from one end to the other once.
|
|
259
|
+
- A canvas gradient in `color` does not reach the brush: a brushed stroke with a gradient
|
|
260
|
+
`color` and no `paint` uses its first stop. Pass `paint` instead.
|
|
233
261
|
- **Shape operations drop the brush.** Unite, subtract, offset path and outline stroke turn
|
|
234
262
|
brushed strokes into plain filled or stroked paths.
|
|
235
263
|
- `canvas_*` tools validate ids against the current state; an "Unknown node id" error means call
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Behaviours: how a change gets from `from` to `to` other than straight along its ease (a
|
|
3
|
-
* pulse there and back, an oscillation, a seeded wriggle, a springy overshoot). Ported from
|
|
4
|
-
* `@pixerate/flair` (MIT): `SvgBehavior` and `behaviorProgress` in `vector/motion.ts`, the
|
|
5
|
-
* oscillate and overshoot evaluators in `scene/behavior.ts` and the noise in `time/noise.ts`.
|
|
6
|
-
* The numbers must stay identical to Flair's, so a behaviour exported to Flair plays the same
|
|
7
|
-
* frames there as here (the animation editor writes them as Flair `behavior`s, Flair ≥ 0.38).
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* A behaviour: its progress `u` at each moment, where 0 is `from`, 1 is `to`, and numbers go
|
|
11
|
-
* past either. `t` is the change's time, 0–1, through its ease (linear unless given).
|
|
12
|
-
*
|
|
13
|
-
* - `pulse`: there and back `count` times (default 1): u = sin²(π·count·t).
|
|
14
|
-
* - `oscillate`: swings round `from`, out to `to` and as far the other way, `count` times
|
|
15
|
-
* (default 1), dying away by (1 − t)^`decay` (default 0, no decay).
|
|
16
|
-
* - `wriggle`: wanders round `from` by up to about `to − from`, as seeded smooth fractal noise
|
|
17
|
-
* at `frequency` Hz (default 2) with `octaves` layers (default 2); each number in a value
|
|
18
|
-
* wanders on its own channel. It eases out of and back to rest over the first and last 15%
|
|
19
|
-
* of its time. The same `seed` (default 42) gives the same wander.
|
|
20
|
-
* - `overshoot`: goes to `to`, past it and back, settling like a spring:
|
|
21
|
-
* u = 1 − e^(−damping·t)·cos(cycles·π·t) (default 3 cycles, damping 4).
|
|
22
|
-
*/
|
|
23
|
-
type MotionBehavior = {
|
|
24
|
-
type: 'pulse';
|
|
25
|
-
count?: number;
|
|
26
|
-
} | {
|
|
27
|
-
type: 'oscillate';
|
|
28
|
-
count?: number;
|
|
29
|
-
decay?: number;
|
|
30
|
-
wave?: 'sine' | 'triangle' | 'square' | 'sawtooth';
|
|
31
|
-
} | {
|
|
32
|
-
type: 'wriggle';
|
|
33
|
-
frequency?: number;
|
|
34
|
-
octaves?: number;
|
|
35
|
-
seed?: number;
|
|
36
|
-
} | {
|
|
37
|
-
type: 'overshoot';
|
|
38
|
-
cycles?: number;
|
|
39
|
-
damping?: number;
|
|
40
|
-
};
|
|
41
|
-
/** Every `MotionBehavior` type. */
|
|
42
|
-
declare const MOTION_BEHAVIORS: readonly ["pulse", "oscillate", "wriggle", "overshoot"];
|
|
43
|
-
/**
|
|
44
|
-
* A behaviour's progress at `t` (0–1, eased) of a change lasting `ms`, for the `index`-th number
|
|
45
|
-
* in a value (only a wriggle tells numbers apart).
|
|
46
|
-
*/
|
|
47
|
-
declare function behaviorProgress(behavior: MotionBehavior, t: number, index?: number, ms?: number): number;
|
|
48
|
-
/** Whether `value` is a well-formed `MotionBehavior`. */
|
|
49
|
-
declare function isMotionBehavior(value: unknown): value is MotionBehavior;
|
|
50
|
-
/** A seed from an id (FNV-1a), so each element wriggles its own way: Flair's `seedOf`. */
|
|
51
|
-
declare function motionSeedFromId(id: string): number;
|
|
52
|
-
/** 6t⁵ − 15t⁴ + 10t³: zero slope and curvature at 0 and 1. */
|
|
53
|
-
declare function quinticFade(t: number): number;
|
|
54
|
-
/**
|
|
55
|
-
* Multi-octave smooth noise (After Effects' `wiggle`): the sum over `octaves` of
|
|
56
|
-
* amp·ampMult^k · noise(freq·2^k·t), each octave and `dimension` seeded apart. `t` in seconds.
|
|
57
|
-
*/
|
|
58
|
-
declare function fractalWiggle(freq: number, amp: number, octaves?: number, ampMult?: number, t?: number, seed?: number, dimension?: number): number;
|
|
59
|
-
|
|
60
|
-
export { MOTION_BEHAVIORS as M, type MotionBehavior as a, behaviorProgress as b, fractalWiggle as f, isMotionBehavior as i, motionSeedFromId as m, quinticFade as q };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Behaviours: how a change gets from `from` to `to` other than straight along its ease (a
|
|
3
|
-
* pulse there and back, an oscillation, a seeded wriggle, a springy overshoot). Ported from
|
|
4
|
-
* `@pixerate/flair` (MIT): `SvgBehavior` and `behaviorProgress` in `vector/motion.ts`, the
|
|
5
|
-
* oscillate and overshoot evaluators in `scene/behavior.ts` and the noise in `time/noise.ts`.
|
|
6
|
-
* The numbers must stay identical to Flair's, so a behaviour exported to Flair plays the same
|
|
7
|
-
* frames there as here (the animation editor writes them as Flair `behavior`s, Flair ≥ 0.38).
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* A behaviour: its progress `u` at each moment, where 0 is `from`, 1 is `to`, and numbers go
|
|
11
|
-
* past either. `t` is the change's time, 0–1, through its ease (linear unless given).
|
|
12
|
-
*
|
|
13
|
-
* - `pulse`: there and back `count` times (default 1): u = sin²(π·count·t).
|
|
14
|
-
* - `oscillate`: swings round `from`, out to `to` and as far the other way, `count` times
|
|
15
|
-
* (default 1), dying away by (1 − t)^`decay` (default 0, no decay).
|
|
16
|
-
* - `wriggle`: wanders round `from` by up to about `to − from`, as seeded smooth fractal noise
|
|
17
|
-
* at `frequency` Hz (default 2) with `octaves` layers (default 2); each number in a value
|
|
18
|
-
* wanders on its own channel. It eases out of and back to rest over the first and last 15%
|
|
19
|
-
* of its time. The same `seed` (default 42) gives the same wander.
|
|
20
|
-
* - `overshoot`: goes to `to`, past it and back, settling like a spring:
|
|
21
|
-
* u = 1 − e^(−damping·t)·cos(cycles·π·t) (default 3 cycles, damping 4).
|
|
22
|
-
*/
|
|
23
|
-
type MotionBehavior = {
|
|
24
|
-
type: 'pulse';
|
|
25
|
-
count?: number;
|
|
26
|
-
} | {
|
|
27
|
-
type: 'oscillate';
|
|
28
|
-
count?: number;
|
|
29
|
-
decay?: number;
|
|
30
|
-
wave?: 'sine' | 'triangle' | 'square' | 'sawtooth';
|
|
31
|
-
} | {
|
|
32
|
-
type: 'wriggle';
|
|
33
|
-
frequency?: number;
|
|
34
|
-
octaves?: number;
|
|
35
|
-
seed?: number;
|
|
36
|
-
} | {
|
|
37
|
-
type: 'overshoot';
|
|
38
|
-
cycles?: number;
|
|
39
|
-
damping?: number;
|
|
40
|
-
};
|
|
41
|
-
/** Every `MotionBehavior` type. */
|
|
42
|
-
declare const MOTION_BEHAVIORS: readonly ["pulse", "oscillate", "wriggle", "overshoot"];
|
|
43
|
-
/**
|
|
44
|
-
* A behaviour's progress at `t` (0–1, eased) of a change lasting `ms`, for the `index`-th number
|
|
45
|
-
* in a value (only a wriggle tells numbers apart).
|
|
46
|
-
*/
|
|
47
|
-
declare function behaviorProgress(behavior: MotionBehavior, t: number, index?: number, ms?: number): number;
|
|
48
|
-
/** Whether `value` is a well-formed `MotionBehavior`. */
|
|
49
|
-
declare function isMotionBehavior(value: unknown): value is MotionBehavior;
|
|
50
|
-
/** A seed from an id (FNV-1a), so each element wriggles its own way: Flair's `seedOf`. */
|
|
51
|
-
declare function motionSeedFromId(id: string): number;
|
|
52
|
-
/** 6t⁵ − 15t⁴ + 10t³: zero slope and curvature at 0 and 1. */
|
|
53
|
-
declare function quinticFade(t: number): number;
|
|
54
|
-
/**
|
|
55
|
-
* Multi-octave smooth noise (After Effects' `wiggle`): the sum over `octaves` of
|
|
56
|
-
* amp·ampMult^k · noise(freq·2^k·t), each octave and `dimension` seeded apart. `t` in seconds.
|
|
57
|
-
*/
|
|
58
|
-
declare function fractalWiggle(freq: number, amp: number, octaves?: number, ampMult?: number, t?: number, seed?: number, dimension?: number): number;
|
|
59
|
-
|
|
60
|
-
export { MOTION_BEHAVIORS as M, type MotionBehavior as a, behaviorProgress as b, fractalWiggle as f, isMotionBehavior as i, motionSeedFromId as m, quinticFade as q };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/brushstrokeRender-EELTV7U4.cjs","../src/canvas/brushstrokeRender.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACbA,IAAM,IAAA,EAAM,iCAAA,CAAgB,MAAA,CAAO,CAAC,CAAA,EAAA,GAAM,kDAAA,CAAoB,CAAC,CAAA;AAExD,SAAS,iBAAA,CAAA,EAAyC;AACxD,EAAA,OAAO,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,EAAA,GAAA,CAAO,EAAE,EAAA,EAAI,CAAA,CAAE,EAAA,EAAI,IAAA,EAAM,CAAA,CAAE,IAAA,EAAM,QAAA,EAAU,CAAA,CAAE,QAAA,EAAU,IAAA,EAAM,CAAA,CAAE,GAAA,CAAI,KAAK,CAAA,CAAE,CAAA;AAC3F;AAGO,SAAS,kBAAA,CAAmB,KAAA,EAAoB,KAAA,EAAiC;AACvF,EAAA,MAAM,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,MAAA,CAAO,QAAA,CAAS,KAAK,EAAA,EA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AA0B,KAAA,EAAO,KAAK,CAAA;AACpD,EAAA,MAAM,IAAA,EAAM,2CAAA,KAAY,EAAO,IAAI,CAAA;AACnC,EAAA,MAAM,KAAA,EAAO,MAAA,EACV,CAAA,aAAA,EAAgB,UAAA,CAAW,KAAA,CAAM,IAAI,CAAC,CAAA,KAAA,EAAQ,CAAA,CAAE,KAAA,CAAM,CAAC,CAAC,CAAA,KAAA,EAAQ,CAAA,CAAE,KAAA,CAAM,CAAC,CAAC,CAAA,SAAA,EAAY,CAAA,CAAE,KAAA,CAAM,KAAK,CAAC,CAAA,UAAA,EAAa,CAAA,CAAE,KAAA,CAAM,MAAM,CAAC,CAAA,4BAAA,EAA+B,KAAA,CAAM,QAAA,IAAY,KAAA,EAAA,EAAY,CAAA,UAAA,EAAa,CAAA,CAAE,KAAA,CAAM,OAAO,CAAC,CAAA,CAAA,EAAA,EAAM,EAAE,CAAA,EAAA,EAAA,EAClO,EAAA;AACH,EAAA,MAAM,QAAA,EAAU,GAAA,CAAI,UAAA,GAAa,KAAA,EAAO,CAAA,cAAA,EAAiB,GAAA,CAAI,SAAS,CAAA,EAAA,EAAK,IAAI,CAAA,IAAA,EAAA,EAAS,IAAA;AACxF,EAAA,OAAO,CAAA,+CAAA,EAAkD,CAAA,CAAE,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;ADIA;AACE;AACA;AACA;AACA;AACF,+MAAC","file":"/home/runner/work/editor/editor/packages/core/dist/brushstrokeRender-EELTV7U4.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 { 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 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/** RGBA of a shape's stroke paint. Gradients use their first stop until gradient paint (`PaintSource`) reaches the brush engine. */\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 stroke = cache.render(input, brush, { scale, color: strokeColor(shape) });\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"]}
|
|
@@ -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 { 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 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/** RGBA of a shape's stroke paint. Gradients use their first stop until gradient paint (`PaintSource`) reaches the brush engine. */\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 stroke = cache.render(input, brush, { scale, color: strokeColor(shape) });\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAM,MAAM,gBAAgB,OAAO,CAAC,MAAM,mBAAmB,CAAC,CAAC;AAExD,SAAS,oBAAyC;AACxD,SAAO,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,MAAM,UAAU,EAAE,UAAU,MAAM,EAAE,IAAI,KAAK,EAAE;AAC3F;AAGO,SAAS,mBAAmB,OAAoB,OAAiC;AACvF,QAAM,OAAO,KAAK,IAAI,GAAG,OAAO,SAAS,KAAK,IAAI,QAAQ,CAAC;AAC3D,MAAI,OAAO,UAAU,UAAU;AAC9B,UAAM,SAAS,gBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK;AACzD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