@pixerate/editor 0.124.0 → 0.125.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 +3 -3
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +424 -85
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +174 -7
- package/dist/animation-editor/index.d.ts +174 -7
- package/dist/animation-editor/index.js +348 -9
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/chunk-FJ3324TZ.js +59 -0
- package/dist/chunk-FJ3324TZ.js.map +1 -0
- package/dist/{chunk-5EO2IXQE.js → chunk-FPRIUR4T.js} +1 -1
- package/dist/chunk-FPRIUR4T.js.map +1 -0
- package/dist/{chunk-YVVSTD3B.js → chunk-G6WXWS4Y.js} +9 -18
- package/dist/chunk-G6WXWS4Y.js.map +1 -0
- package/dist/{chunk-NGYD3AMN.js → chunk-MPQAO33O.js} +2 -2
- package/dist/{chunk-PEHYWUVV.cjs → chunk-O5RVCDEC.cjs} +82 -82
- package/dist/{chunk-PEHYWUVV.cjs.map → chunk-O5RVCDEC.cjs.map} +1 -1
- package/dist/{chunk-TK53AB4Q.cjs → chunk-QDJKUBWE.cjs} +3 -3
- package/dist/{chunk-TK53AB4Q.cjs.map → chunk-QDJKUBWE.cjs.map} +1 -1
- package/dist/{chunk-5XXMLBH4.cjs → chunk-QQKTOA4U.cjs} +1 -1
- package/dist/chunk-QQKTOA4U.cjs.map +1 -0
- package/dist/{chunk-IWSMDQE5.cjs → chunk-UXFI3CDZ.cjs} +13 -22
- package/dist/chunk-UXFI3CDZ.cjs.map +1 -0
- package/dist/{chunk-WE25VLCO.cjs → chunk-V5YGPRCZ.cjs} +36 -36
- package/dist/{chunk-WE25VLCO.cjs.map → chunk-V5YGPRCZ.cjs.map} +1 -1
- package/dist/chunk-W6QTLHZ3.cjs +59 -0
- package/dist/chunk-W6QTLHZ3.cjs.map +1 -0
- package/dist/{chunk-WATAQ2Z2.js → chunk-WUDPFWAN.js} +2 -2
- package/dist/{chunk-VFAKN46Z.js → chunk-XZWOLXWA.js} +3 -3
- package/dist/{chunk-VFAKN46Z.js.map → chunk-XZWOLXWA.js.map} +1 -1
- package/dist/effects/index.cjs +51 -6
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +39 -8
- package/dist/effects/index.d.ts +39 -8
- package/dist/effects/index.js +48 -3
- package/dist/effects/index.js.map +1 -1
- package/dist/{export-TqXMOlDt.d.cts → export-Bp7ji2r4.d.cts} +4 -3
- package/dist/{export-BzSRXyH6.d.cts → export-C1s4eolZ.d.ts} +5 -3
- package/dist/{export-8RnlngAv.d.ts → export-DAyPY94f.d.ts} +4 -3
- package/dist/{export-DM3h7QEI.d.ts → export-DVl4fWy5.d.cts} +5 -3
- package/dist/generation/index.cjs +3 -3
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +3 -3
- package/dist/helpers-BBLlekuM.d.ts +2009 -0
- package/dist/helpers-i95Ob6Vi.d.cts +2009 -0
- package/dist/image-editor/index.cjs +712 -721
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -7
- package/dist/image-editor/index.d.ts +5 -7
- package/dist/image-editor/index.js +19 -28
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint-editor/index.cjs +12 -11
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +3 -5
- package/dist/paint-editor/index.d.ts +3 -5
- package/dist/paint-editor/index.js +6 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{svg-BDrjRnL1.d.cts → svg-BkRL-fZJ.d.cts} +1 -1
- package/dist/{svg-C-vZ3q50.d.ts → svg-DJKriJ4A.d.ts} +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/{tools-C7JtLYzo.d.ts → tools-CM8Oe8F3.d.ts} +1 -1
- package/dist/{tools-DHKGHiSK.d.cts → tools-DZCv2kX1.d.cts} +1 -1
- package/dist/vector/index.cjs +1032 -883
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +61 -6
- package/dist/vector/index.d.ts +61 -6
- package/dist/vector/index.js +155 -6
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +271 -270
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +4 -6
- package/dist/video-editor/index.d.ts +4 -6
- package/dist/video-editor/index.js +6 -5
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +24 -1
- package/skills/pixerate-vector/SKILL.md +15 -0
- package/dist/chunk-5EO2IXQE.js.map +0 -1
- package/dist/chunk-5XXMLBH4.cjs.map +0 -1
- package/dist/chunk-IWSMDQE5.cjs.map +0 -1
- package/dist/chunk-YVVSTD3B.js.map +0 -1
- package/dist/flair-CxB3fOcU.d.ts +0 -739
- package/dist/flair-D7BxyBwL.d.cts +0 -739
- package/dist/helpers-777mC6dc.d.cts +0 -253
- package/dist/helpers-DX2_7L5t.d.ts +0 -253
- package/dist/types-BcX7sCsn.d.ts +0 -993
- package/dist/types-CznabG7m.d.cts +0 -993
- /package/dist/{chunk-NGYD3AMN.js.map → chunk-MPQAO33O.js.map} +0 -0
- /package/dist/{chunk-WATAQ2Z2.js.map → chunk-WUDPFWAN.js.map} +0 -0
|
@@ -74,7 +74,7 @@ function createEffectToolProvider(host) {
|
|
|
74
74
|
description: `${what}: control name \u2192 value, as listed by describe_effect (its "controls" schema: types, ranges, units and defaults). Only the given controls change; colours are "#rrggbb".${keyframes ? " A number control may instead be keyframes { keys: [{ t: ms from the start, v, ease }] }." : ""} Unknown controls and out-of-range values are refused with the valid ones.`
|
|
75
75
|
});
|
|
76
76
|
const effectIdSchema = (uses) => {
|
|
77
|
-
const effects = _optionalChain([catalogFor, 'call', _2 => _2(host.provider()), 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((e) => e.kind !== "motion" && e.uses.some((u) => uses.includes(u)))]);
|
|
77
|
+
const effects = _optionalChain([catalogFor, 'call', _2 => _2(host.provider()), 'optionalAccess', _3 => _3.filter, 'call', _4 => _4((e) => (e.kind !== "motion" || uses.includes("motion")) && e.uses.some((u) => uses.includes(u)))]);
|
|
78
78
|
const base = `An effect id from search_effects (use ${uses.map((u) => `"${u}"`).join(" or ")}).`;
|
|
79
79
|
return effects && effects.length && effects.length <= ENUM_LIMIT ? { type: "string", enum: effects.map((e) => e.id), description: `${base} One of: ${effects.map((e) => `${e.id} (${e.name})`).join(", ")}.` } : { type: "string", minLength: 1, description: base };
|
|
80
80
|
};
|
|
@@ -115,7 +115,7 @@ function createEffectToolProvider(host) {
|
|
|
115
115
|
const p = host.provider();
|
|
116
116
|
if (!p) return { available: false, reason: NO_PROVIDER };
|
|
117
117
|
const d = await explain(async () => p.describe(args.effect));
|
|
118
|
-
return { available: true, ...summaryOut(d), controls: d.controls, defaults: d.defaults, presets: d.presets, inputs: d.inputs, appliesHere: d.kind !== "motion" && d.uses.some((u) => host.applyUses.includes(u)) };
|
|
118
|
+
return { available: true, ...summaryOut(d), controls: d.controls, defaults: d.defaults, presets: d.presets, inputs: d.inputs, appliesHere: (d.kind !== "motion" || host.applyUses.includes("motion")) && d.uses.some((u) => host.applyUses.includes(u)) };
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
{
|
|
@@ -212,4 +212,4 @@ function createEffectToolProvider(host) {
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
exports.EFFECT_KINDS = EFFECT_KINDS; exports.EFFECT_USES = EFFECT_USES; exports.createEffectToolProvider = createEffectToolProvider;
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
215
|
+
//# sourceMappingURL=chunk-QDJKUBWE.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/pack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;AACN,IAAA;AAGR,EAAA;AACmC,EAAA;AAEpB,EAAA;AACT,EAAA;AACU,EAAA;AACA,EAAA;AACA,EAAA;AAEV,EAAA;AACL,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACU,QAAA;AACD,QAAA;AACE,QAAA;AACH,QAAA;AACE,QAAA;AACT,MAAA;AACD,MAAA;AACS,MAAA;AACE,QAAA;AACF,QAAA;AACF,QAAA;AACA,QAAA;AACG,QAAA;AACV,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACE,QAAA;AACF,QAAA;AACqB,QAAA;AACpB,QAAA;AACV,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACE,QAAA;AACJ,QAAA;AACA,QAAA;AACG,QAAA;AACV,MAAA;AACD,IAAA;AACD,EAAA;AAEM,EAAA;AACL,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACC,QAAA;AACS,UAAA;AACA,UAAA;AACA,UAAA;AACD,UAAA;AACP,UAAA;AACA,UAAA;AACD,QAAA;AACC,QAAA;AACF,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACC,QAAA;AACS,UAAA;AACA,UAAA;AACA,UAAA;AACR,UAAA;AACA,UAAA;AACO,UAAA;AACR,QAAA;AACC,QAAA;AACF,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACA,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACD,EAAA;AAEO,EAAA;AACG,IAAA;AACA,IAAA;AACI,IAAA;AACN,MAAA;AACG,MAAA;AACE,MAAA;AACZ,IAAA;AACY,IAAA;AACD,MAAA;AACE,MAAA;AACL,MAAA;AACI,QAAA;AACJ,wBAAA;AACP,MAAA;AACD,IAAA;AACD,EAAA;AACD;AFzGkB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-TK53AB4Q.cjs","sourcesContent":[null,"/**\n * The effects contract: how an editor finds, describes and renders effects that live in another\n * package. This library ships no effects of its own here, only the shapes a provider fills in;\n * a host passes a provider to an editor (`setEffectsProvider`) and the editor degrades to its\n * old behaviour without one.\n *\n * Every time is in milliseconds. Pixels are straight-alpha RGBA rows, top to bottom.\n */\n\nimport type { JsonSchema } from '../tools/schema.js';\nimport type { FlairSvgAnimation } from '../animation-editor/flair.js';\n\n/** How an effect is drawn: a pixel shader, an animated vector picture, or motion applied to someone else's vector art. */\nexport type EffectKind = 'shader' | 'vector' | 'motion';\n\n/**\n * What an effect is for. An effect may have several uses.\n *\n * - `filter`: changes an input picture (`inputs.source`).\n * - `transition`: blends `inputs.from` into `inputs.to`; `progress` runs 0 → 1.\n * - `generator`: draws a picture from nothing (a background, a texture).\n * - `overlay`: draws something meant to sit over other content, usually with transparency.\n * - `title`: draws type or a graphic meant as a title.\n * - `motion`: animates vector art (`applyVectorEffect`).\n * - `interactive`: reacts to pointer, scroll or audio input at run time.\n */\nexport type EffectUse = 'filter' | 'transition' | 'generator' | 'overlay' | 'title' | 'motion' | 'interactive';\n\nexport const EFFECT_KINDS: readonly EffectKind[] = ['shader', 'vector', 'motion'];\nexport const EFFECT_USES: readonly EffectUse[] = ['filter', 'transition', 'generator', 'overlay', 'title', 'motion', 'interactive'];\n\n/** One entry of a provider's catalog. */\nexport interface EffectSummary {\n\t/** Stable id, saved in documents. Never reused for a different effect. */\n\tid: string;\n\tname: string;\n\tkind: EffectKind;\n\t/** The provider's own grouping (e.g. `gradient`, `light`, `transition`). */\n\tcategory: string;\n\tuses: readonly EffectUse[];\n\tdescription?: string;\n\ttags?: readonly string[];\n\t/** True when the effect's output has transparent pixels (it can sit over other content). */\n\ttransparent: boolean;\n\t/** True when the effect loops; its `duration` is then one cycle. */\n\tloop: boolean;\n\t/** Length of one play (ms). Absent for effects that do not change over time. */\n\tduration?: number;\n}\n\nexport interface EffectSearchOptions {\n\tkind?: EffectKind;\n\tcategory?: string;\n\tuse?: EffectUse;\n\t/** Most results to return. */\n\tlimit?: number;\n}\n\n/** One control value: a number, a `#rrggbb` colour or other string, a switch, or a vector of numbers. */\nexport type EffectValue = number | string | boolean | readonly number[];\nexport type EffectValues = Readonly<Record<string, EffectValue>>;\n\n/**\n * The controls of an effect as a strict JSON Schema: `type: 'object'`, `additionalProperties:\n * false`, and a `description` on every property (with units and range). `checkEffectProvider`\n * checks this.\n */\nexport type EffectControlSchema = JsonSchema & {\n\ttype: 'object';\n\tproperties: { readonly [control: string]: JsonSchema };\n\tadditionalProperties: false;\n};\n\nexport interface EffectPreset {\n\tname: string;\n\t/** Values to apply over the defaults. */\n\tvalues: EffectValues;\n}\n\n/**\n * A named input the effect reads. Filters read `source`, transitions `from` and `to`; a mask is\n * passed separately (`EffectRenderRequest.mask`), not as an input.\n */\nexport interface EffectInputSpec {\n\tname: string;\n\tkind: 'image' | 'audio';\n\tdescription: string;\n\trequired: boolean;\n}\n\n/** Everything an editor needs to show an effect's controls and render it. */\nexport interface EffectDescription extends EffectSummary {\n\tcontrols: EffectControlSchema;\n\t/** A value for every control. */\n\tdefaults: EffectValues;\n\tpresets: readonly EffectPreset[];\n\tinputs: readonly EffectInputSpec[];\n}\n\n/**\n * Pixels in and out of a renderer, shaped like `ImageData`.\n *\n * `data` is 8-bit sRGB with straight alpha and is always present. `float`, when present, is the\n * same picture as 32-bit floats in **linear light** (sRGB primaries), straight alpha, where colour\n * may exceed 1. Renderers created with `depth` 16 or 32 return `float` when the provider\n * `supportsFloat`; `data` is then its clamped sRGB encoding.\n */\nexport interface EffectPixels {\n\twidth: number;\n\theight: number;\n\tdata: Uint8ClampedArray;\n\tfloat?: Float32Array;\n}\n\n/**\n * An input picture. Always accepted as `EffectPixels`; a provider whose capabilities include\n * `supportsHostImages` also takes the host's own image objects, which saves a read back.\n */\nexport type EffectImageSource = EffectPixels | ImageBitmap | OffscreenCanvas | VideoFrame;\n\nexport interface EffectRendererOptions {\n\t/** Output size in pixels. */\n\twidth: number;\n\theight: number;\n\t/** Bits per channel of the target (default 8). 16 and 32 ask for `float` output. */\n\tdepth?: 8 | 16 | 32;\n}\n\nexport interface EffectRenderRequest {\n\t/** Effect time (ms), from the start of the effect. */\n\ttime: number;\n\t/** Control values; missing controls take their defaults. Invalid values reject with `EffectControlError`. */\n\tvalues?: EffectValues;\n\t/** Pictures for the effect's named inputs (see `EffectDescription.inputs`). */\n\tinputs?: Readonly<Record<string, EffectImageSource>>;\n\t/** Coverage (alpha channel, 0 = untouched) limiting where the effect applies. Only with `supportsMask`. */\n\tmask?: EffectImageSource;\n\t/** Transitions: how far from `from` to `to`, 0–1. Defaults to `time / duration`. */\n\tprogress?: number;\n}\n\n/** A live renderer for one effect at one size. Not safe for concurrent `render` calls. */\nexport interface EffectRenderer {\n\treadonly effectId: string;\n\treadonly width: number;\n\treadonly height: number;\n\treadonly depth: 8 | 16 | 32;\n\trender(request: EffectRenderRequest): Promise<EffectPixels>;\n\t/** Frees GPU or worker resources. Rendering afterwards rejects. */\n\tdispose(): void;\n}\n\n/** One change of an animated SVG (the shape of Flair's `SvgAnimation`). */\nexport type EffectSvgAnimation = FlairSvgAnimation;\n\n/** An animated SVG: markup plus changes to its elements (the shape of Flair's `SvgMotion`). */\nexport interface EffectVectorMotion {\n\tsvg: string;\n\tanimate?: readonly EffectSvgAnimation[];\n\t/** Length of one play (ms). */\n\tduration: number;\n\tloop: boolean;\n\t/** Ms held on the last frame before looping. */\n\thold?: number;\n}\n\n/** What a vector or motion effect is applied to: SVG markup, optionally with the ids of the elements to animate (default: all). */\nexport type EffectVectorTarget = string | { svg: string; nodeIds?: readonly string[] };\n\n/** What a provider can do, so editors can degrade cleanly. */\nexport interface EffectProviderCapabilities {\n\t/** Renders off the main thread. */\n\tsupportsWorker: boolean;\n\t/** Returns `float` pixels for depth 16 and 32 renderers. */\n\tsupportsFloat: boolean;\n\t/** Honours `EffectRenderRequest.mask`; otherwise the editor masks the result itself. */\n\tsupportsMask: boolean;\n\t/** Takes `ImageBitmap`, `OffscreenCanvas` or `VideoFrame` inputs, not only `EffectPixels`. */\n\tsupportsHostImages: boolean;\n\t/** Implements `applyVectorEffect`. */\n\tsupportsVector: boolean;\n\t/** Largest width or height a renderer accepts (px). */\n\tmaxSize?: number;\n}\n\ntype MaybePromise<T> = T | Promise<T>;\n\n/**\n * A source of effects. Implementations live outside this library (for example Flair's\n * `flairEffects()`); `createFakeEffectProvider` is a small reference implementation.\n *\n * Unknown ids reject or throw `UnknownEffectError`, invalid values `EffectControlError`, and an\n * operation the provider cannot do `EffectUnsupportedError`.\n */\nexport interface EffectProvider {\n\t/** Stable id of the provider, saved next to effect ids (e.g. `flair`). */\n\treadonly id: string;\n\treadonly name: string;\n\treadonly version?: string;\n\treadonly capabilities: EffectProviderCapabilities;\n\tlist(options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;\n\t/** Effects matching every word of `query` (in name, id, category, tags or description), best first. */\n\tsearch(query: string, options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;\n\tdescribe(id: string): MaybePromise<EffectDescription>;\n\t/** A pixel renderer. A `vector` effect may refuse with `EffectUnsupportedError` where it cannot lay out SVG (a Worker). */\n\tcreateRenderer(id: string, options: EffectRendererOptions): MaybePromise<EffectRenderer>;\n\t/**\n\t * Vector and motion effects as an animated SVG. Present when `capabilities.supportsVector`. A\n\t * `motion` effect animates the target's elements (`nodeIds`, else each top-level element with an\n\t * id); a `vector` effect brings its own picture and ignores the target. Refuse a target the\n\t * effect cannot use with `EffectUnsupportedError`.\n\t */\n\tapplyVectorEffect?(id: string, target: EffectVectorTarget, values?: EffectValues): MaybePromise<EffectVectorMotion>;\n}\n","/**\n * The agent tools for provider effects, shared by every editor that takes an `EffectProvider`:\n * `search_effects`, `describe_effect`, `list_applied_effects`, `apply_effect`, `update_effect` and\n * `remove_effect`. An editor supplies an `EffectToolHost` (what its targets are and how to change\n * them as one undo step each) and may add tools of its own (`extraTools`).\n *\n * Without a provider the read tools say so (and `list_applied_effects` still lists what a\n * document holds), and the write tools refuse with the reason. On a read-only surface the write\n * tools are hidden.\n */\n\nimport type { AgentTool, AgentToolProvider } from '../tools/registry.js';\nimport type { JsonSchema } from '../tools/schema.js';\nimport { isEffectError } from './errors.js';\nimport { EFFECT_KINDS, EFFECT_USES, type EffectDescription, type EffectProvider, type EffectSummary, type EffectUse } from './types.js';\n\n/** One effect applied to a target, as the tools report it. */\nexport interface AppliedEffectInfo {\n\t/** Its id on the target: what `update_effect` and `remove_effect` take. */\n\tid: string;\n\teffect: string;\n\tname?: string;\n\tprovider?: string;\n\t/** What it is on the target (e.g. `clip effect`, `effect clip`, `transition`, `smart filter`, `effect layer`). */\n\trole: string;\n\tenabled: boolean;\n\t/** 0–1, or keyframes, where the role has an opacity. */\n\topacity?: unknown;\n\t/** Its saved control values (numbers may be keyframes where the editor allows them). */\n\tvalues: Record<string, unknown>;\n\t/** Its place in the target's stack (0 = applied first), for stacked roles. */\n\tindex?: number;\n}\n\nexport interface EffectTargetEffects {\n\ttarget: string;\n\t/** A label for the target (a clip or layer name). */\n\tname?: string;\n\teffects: AppliedEffectInfo[];\n}\n\nexport interface EffectChangeResult {\n\ttarget: string;\n\t/** What was added, changed or removed. */\n\teffect: AppliedEffectInfo;\n\t/** The target's effects afterwards. */\n\teffects: AppliedEffectInfo[];\n\t/** Other things the change made (a new clip or layer id, ...). */\n\t[extra: string]: unknown;\n}\n\n/** What an editor gives the shared effect tools. */\nexport interface EffectToolHost {\n\t/** Provider id (unique per registry). */\n\tid: string;\n\t/** Always prefix tool names with `<namespace>__`. */\n\tnamespace?: string;\n\t/** Words for the editor's targets, e.g. `{ noun: 'clip', id: 'A clip id from get_video_project (e.g. \"c1\").' }`. */\n\ttarget: { noun: string; id: string };\n\t/** The uses `apply_effect` takes on a target (others go through `extraTools`). */\n\tapplyUses: readonly EffectUse[];\n\t/** Text added to `apply_effect`'s description: where the effect goes and how it is drawn. */\n\tapplyDetails: string;\n\t/** The current provider, or `null`. */\n\tprovider(): EffectProvider | null;\n\t/** Why edits are refused now (read-only), or `null`. */\n\treadOnlyReason(): string | null;\n\t/** Every target with effects, or one target (throws for an unknown id, naming valid ones). */\n\tlist(target?: string): EffectTargetEffects[];\n\tapply(target: string, effect: string, args: { values?: Record<string, unknown>; index?: number; enabled?: boolean; opacity?: number }): Promise<EffectChangeResult>;\n\tupdate(target: string, instance: string, changes: { values?: Record<string, unknown>; index?: number; enabled?: boolean; opacity?: number }): Promise<EffectChangeResult>;\n\tremove(target: string, instance: string): Promise<EffectChangeResult>;\n\t/** Editor-specific effect tools (transitions, effect clips, effect layers, keyframes). */\n\textraTools?: (context: EffectToolContext) => AgentTool[];\n\t/** Lets the tool list follow the provider and read-only changes. */\n\tsubscribe?: (notify: () => void) => () => void;\n}\n\n/** Shared pieces for `extraTools`. */\nexport interface EffectToolContext {\n\t/** The provider, or a thrown error saying none is registered. */\n\trequireProvider(): EffectProvider;\n\t/** The schema of a `values` argument. */\n\tvaluesSchema(what: string, keyframes?: boolean): JsonSchema;\n\t/** The schema of an `effect` argument for effects with one of `uses`. */\n\teffectIdSchema(uses: readonly EffectUse[]): JsonSchema;\n\treadonly annotations: typeof ANNOTATIONS;\n}\n\nconst ANNOTATIONS = {\n\tread: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n\twrite: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n\twriteIdempotent: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n\tdestructive: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false }\n} as const;\n\nconst NO_PROVIDER = 'No effects provider is registered with this editor, so there are no effects to search, describe or apply. The host app must register one (setEffectsProvider); effects already in the document are kept and shown as placeholders.';\n\nconst object = (properties: Record<string, JsonSchema>, required: string[] = []): JsonSchema & { type: 'object' } => ({\n\ttype: 'object',\n\tproperties,\n\t...(required.length ? { required } : {}),\n\tadditionalProperties: false\n});\n\n/** The catalog fetched once per provider, so tool schemas can list effect ids. */\ninterface Catalog {\n\tprovider: EffectProvider;\n\teffects: readonly EffectSummary[] | null;\n}\n\n/** Most effect ids listed in an `effect` argument's enum; larger catalogs are searched instead. */\nconst ENUM_LIMIT = 60;\n\nconst summaryOut = (e: EffectSummary) => ({\n\tid: e.id,\n\tname: e.name,\n\tkind: e.kind,\n\tcategory: e.category,\n\tuses: e.uses,\n\t...(e.description ? { description: e.description } : {}),\n\ttransparent: e.transparent,\n\tloop: e.loop,\n\t...(e.duration !== undefined ? { duration: e.duration } : {})\n});\n\n/** The agent tools for provider effects in one editor (see the module comment). */\nexport function createEffectToolProvider(host: EffectToolHost): AgentToolProvider {\n\tlet catalog: Catalog | null = null;\n\tconst listeners = new Set<() => void>();\n\tconst notify = () => listeners.forEach((l) => l());\n\n\t/** Fetches the catalog of a new provider in the background; the tool list changes when it lands. */\n\tconst catalogFor = (provider: EffectProvider | null): readonly EffectSummary[] | null => {\n\t\tif (!provider) return null;\n\t\tif (catalog?.provider !== provider) {\n\t\t\tconst entry: Catalog = { provider, effects: null };\n\t\t\tcatalog = entry;\n\t\t\tPromise.resolve()\n\t\t\t\t.then(() => provider.list())\n\t\t\t\t.then((effects) => {\n\t\t\t\t\tif (catalog === entry) {\n\t\t\t\t\t\tentry.effects = effects;\n\t\t\t\t\t\tnotify();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\t\treturn catalog.effects;\n\t};\n\n\tconst requireProvider = (): EffectProvider => {\n\t\tconst p = host.provider();\n\t\tif (!p) throw new Error(NO_PROVIDER);\n\t\treturn p;\n\t};\n\tconst writable = () => {\n\t\tconst reason = host.readOnlyReason();\n\t\tif (reason) throw new Error(reason);\n\t\treturn requireProvider();\n\t};\n\t/** Turns provider errors into messages a model can act on. */\n\tconst explain = async <T>(run: () => Promise<T>): Promise<T> => {\n\t\ttry {\n\t\t\treturn await run();\n\t\t} catch (error) {\n\t\t\tif (isEffectError(error)) throw new Error(error.message);\n\t\t\tthrow error;\n\t\t}\n\t};\n\n\tconst valuesSchema = (what: string, keyframes = false): JsonSchema => ({\n\t\ttype: 'object',\n\t\tdescription: `${what}: control name → value, as listed by describe_effect (its \"controls\" schema: types, ranges, units and defaults). Only the given controls change; colours are \"#rrggbb\".${keyframes ? ' A number control may instead be keyframes { keys: [{ t: ms from the start, v, ease }] }.' : ''} Unknown controls and out-of-range values are refused with the valid ones.`\n\t});\n\tconst effectIdSchema = (uses: readonly EffectUse[]): JsonSchema => {\n\t\tconst effects = catalogFor(host.provider())?.filter((e) => e.kind !== 'motion' && e.uses.some((u) => uses.includes(u)));\n\t\tconst base = `An effect id from search_effects (use ${uses.map((u) => `\"${u}\"`).join(' or ')}).`;\n\t\treturn effects && effects.length && effects.length <= ENUM_LIMIT\n\t\t\t? { type: 'string', enum: effects.map((e) => e.id), description: `${base} One of: ${effects.map((e) => `${e.id} (${e.name})`).join(', ')}.` }\n\t\t\t: { type: 'string', minLength: 1, description: base };\n\t};\n\tconst context: EffectToolContext = { requireProvider: writable, valuesSchema, effectIdSchema, annotations: ANNOTATIONS };\n\n\tconst TARGET = { type: 'string', minLength: 1, description: host.target.id } as const;\n\tconst INSTANCE = { type: 'string', minLength: 1, description: `The effect's id on the ${host.target.noun}, from list_applied_effects or apply_effect.` } as const;\n\tconst INDEX = { type: 'integer', minimum: 0, description: `Place in the ${host.target.noun}'s effect stack: 0 is applied first (default: the end, applied last).` } as const;\n\tconst OPACITY = { type: 'number', minimum: 0, maximum: 1, description: 'How much of the effect shows over its input, 0–1 (default 1).' } as const;\n\tconst ENABLED = { type: 'boolean', description: 'false turns the effect off but keeps it (default true).' } as const;\n\n\tconst readTools = (): AgentTool[] => [\n\t\t{\n\t\t\tname: 'search_effects',\n\t\t\ttitle: 'Search effects',\n\t\t\tdescription: `Searches the effects provider's catalog. Every word of query must appear in an effect's id, name, category, tags or description; filter by kind (shader, vector, motion), category or use (${EFFECT_USES.join(', ')}). For this editor, apply_effect takes uses ${host.applyUses.join(' or ')}. Returns { provider, effects: [{ id, name, kind, category, uses, description, transparent, loop, duration (ms) }], total }. With no provider registered it returns available: false and the reason. Call describe_effect next for an effect's controls.`,\n\t\t\tinputSchema: object({\n\t\t\t\tquery: { type: 'string', description: 'Words to match (default: every effect).' },\n\t\t\t\tkind: { type: 'string', enum: [...EFFECT_KINDS], description: 'shader (pixels), vector (animated SVG) or motion (animates vector art).' },\n\t\t\t\tcategory: { type: 'string', minLength: 1, description: 'The provider\\'s category, e.g. \"gradient\", \"light\", \"transition\".' },\n\t\t\t\tuse: { type: 'string', enum: [...EFFECT_USES], description: 'What the effect is for: filter changes a picture, transition blends two, generator draws a background, overlay draws over content, title draws a title, motion animates vector art, interactive reacts to input.' },\n\t\t\t\tlimit: { type: 'integer', minimum: 1, maximum: 200, description: 'Most effects to return (default 20).' }\n\t\t\t}),\n\t\t\tannotations: { title: 'Search effects', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tif (!p) return { available: false, reason: NO_PROVIDER, effects: [], total: 0 };\n\t\t\t\tconst found = await explain(async () => p.search((args.query as string | undefined) ?? '', { kind: args.kind, category: args.category, use: args.use }));\n\t\t\t\tconst limit = (args.limit as number | undefined) ?? 20;\n\t\t\t\treturn { available: true, provider: { id: p.id, name: p.name, capabilities: p.capabilities }, effects: found.slice(0, limit).map(summaryOut), total: found.length };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'describe_effect',\n\t\t\ttitle: 'Describe an effect',\n\t\t\tdescription: 'Returns one effect\\'s controls as a strict JSON Schema (each control described, with its type, range and units), its defaults, presets (named sets of values) and inputs, plus its summary. Use the control names and ranges for apply_effect and update_effect values. With no provider registered it returns available: false and the reason.',\n\t\t\tinputSchema: object({ effect: { type: 'string', minLength: 1, description: 'An effect id from search_effects or list_applied_effects.' } }, ['effect']),\n\t\t\tannotations: { title: 'Describe an effect', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tif (!p) return { available: false, reason: NO_PROVIDER };\n\t\t\t\tconst d: EffectDescription = await explain(async () => p.describe(args.effect as string));\n\t\t\t\treturn { available: true, ...summaryOut(d), controls: d.controls, defaults: d.defaults, presets: d.presets, inputs: d.inputs, appliesHere: d.kind !== 'motion' && d.uses.some((u) => host.applyUses.includes(u)) };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'list_applied_effects',\n\t\t\ttitle: 'List applied effects',\n\t\t\tdescription: `Lists the effects in the document: for each ${host.target.noun} that has any (or the one given), its effects in order with id, effect id, name, role, enabled, opacity and saved values. available is false for an effect the current provider does not have (or when none is registered): it is kept and drawn as a placeholder, and can still be removed. Works without a provider.`,\n\t\t\tinputSchema: object({ target: { ...TARGET, description: `${host.target.id} Leave out to list every ${host.target.noun} with effects.` } }),\n\t\t\tannotations: { title: 'List applied effects', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tconst known = new Set((p ? await explain(async () => p.list()) : []).map((e) => e.id));\n\t\t\t\tconst targets = host.list(args.target as string | undefined).map((t) => ({ ...t, effects: t.effects.map((e) => ({ ...e, available: known.has(e.effect) })) }));\n\t\t\t\treturn { provider: p ? { id: p.id, name: p.name } : null, ...(p ? {} : { reason: NO_PROVIDER }), targets };\n\t\t\t}\n\t\t}\n\t];\n\n\tconst writeTools = (): AgentTool[] => [\n\t\t{\n\t\t\tname: 'apply_effect',\n\t\t\ttitle: 'Apply an effect',\n\t\t\tdescription: `Adds a provider effect to a ${host.target.noun}. ${host.applyDetails} values are checked against describe_effect's controls first; nothing changes if any is wrong. One undo step. Returns the effect with its new id (for update_effect and remove_effect) and the ${host.target.noun}'s effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object(\n\t\t\t\t{\n\t\t\t\t\ttarget: TARGET,\n\t\t\t\t\teffect: effectIdSchema(host.applyUses),\n\t\t\t\t\tvalues: valuesSchema('Control values over the effect\\'s defaults', true),\n\t\t\t\t\tindex: INDEX,\n\t\t\t\t\tenabled: ENABLED,\n\t\t\t\t\topacity: OPACITY\n\t\t\t\t},\n\t\t\t\t['target', 'effect']\n\t\t\t),\n\t\t\tannotations: { title: 'Apply an effect', ...ANNOTATIONS.write },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\treturn explain(() => host.apply(args.target as string, args.effect as string, { values: args.values, index: args.index, enabled: args.enabled, opacity: args.opacity }));\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'update_effect',\n\t\t\ttitle: 'Change an applied effect',\n\t\t\tdescription: `Changes one applied effect on a ${host.target.noun}: its values (merged over the current ones; null resets a control to its default), enabled, opacity or place in the stack. Values are checked against describe_effect's controls first. One undo step. Returns the effect as it is now and the ${host.target.noun}'s effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object(\n\t\t\t\t{\n\t\t\t\t\ttarget: TARGET,\n\t\t\t\t\teffect: INSTANCE,\n\t\t\t\t\tvalues: { ...valuesSchema('Control values to change', true), description: `${valuesSchema('Control values to change', true).description} null resets a control to its default.` },\n\t\t\t\t\tenabled: ENABLED,\n\t\t\t\t\topacity: OPACITY,\n\t\t\t\t\tindex: { ...INDEX, description: `Move it to this place in the ${host.target.noun}'s stack (0 = applied first).` }\n\t\t\t\t},\n\t\t\t\t['target', 'effect']\n\t\t\t),\n\t\t\tannotations: { title: 'Change an applied effect', ...ANNOTATIONS.writeIdempotent },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\tif (args.values === undefined && args.enabled === undefined && args.opacity === undefined && args.index === undefined) throw new Error('Give at least one of values, enabled, opacity or index to change.');\n\t\t\t\treturn explain(() => host.update(args.target as string, args.effect as string, { values: args.values, enabled: args.enabled, opacity: args.opacity, index: args.index }));\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'remove_effect',\n\t\t\ttitle: 'Remove an applied effect',\n\t\t\tdescription: `Removes one applied effect from a ${host.target.noun} (an effect the provider no longer has included). One undo step. Returns what was removed and the ${host.target.noun}'s remaining effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object({ target: TARGET, effect: INSTANCE }, ['target', 'effect']),\n\t\t\tannotations: { title: 'Remove an applied effect', ...ANNOTATIONS.destructive },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\treturn explain(() => host.remove(args.target as string, args.effect as string));\n\t\t\t}\n\t\t}\n\t];\n\n\treturn {\n\t\tid: host.id,\n\t\t...(host.namespace ? { namespace: host.namespace } : {}),\n\t\ttools: () => {\n\t\t\tconst extra = host.extraTools?.(context) ?? [];\n\t\t\tif (host.readOnlyReason()) return [...readTools(), ...extra.filter((t) => t.annotations?.readOnlyHint)];\n\t\t\treturn [...readTools(), ...writeTools(), ...extra];\n\t\t},\n\t\tsubscribe: (l) => {\n\t\t\tlisteners.add(l);\n\t\t\tconst off = host.subscribe?.(l);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(l);\n\t\t\t\toff?.();\n\t\t\t};\n\t\t}\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-QDJKUBWE.cjs","../src/effects/types.ts","../src/effects/tools.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwBO,IAAM,aAAA,EAAsC,CAAC,QAAA,EAAU,QAAA,EAAU,QAAQ,CAAA;AACzE,IAAM,YAAA,EAAoC,CAAC,QAAA,EAAU,YAAA,EAAc,WAAA,EAAa,SAAA,EAAW,OAAA,EA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A;AACF,QAAA;AACA,QAAA;AACG,QAAA;AACV,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACE,QAAA;AACF,QAAA;AACqB,QAAA;AACpB,QAAA;AACV,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACE,QAAA;AACJ,QAAA;AACA,QAAA;AACG,QAAA;AACV,MAAA;AACD,IAAA;AACD,EAAA;AAEM,EAAA;AACL,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACC,QAAA;AACS,UAAA;AACA,UAAA;AACA,UAAA;AACD,UAAA;AACP,UAAA;AACA,UAAA;AACD,QAAA;AACC,QAAA;AACF,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACC,QAAA;AACS,UAAA;AACA,UAAA;AACA,UAAA;AACR,UAAA;AACA,UAAA;AACO,UAAA;AACR,QAAA;AACC,QAAA;AACF,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACA,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACA,IAAA;AACO,MAAA;AACC,MAAA;AACP,MAAA;AACA,MAAA;AACA,MAAA;AACS,MAAA;AACC,QAAA;AACF,QAAA;AACR,MAAA;AACD,IAAA;AACD,EAAA;AAEO,EAAA;AACG,IAAA;AACA,IAAA;AACI,IAAA;AACN,MAAA;AACG,MAAA;AACE,MAAA;AACZ,IAAA;AACY,IAAA;AACD,MAAA;AACE,MAAA;AACL,MAAA;AACI,QAAA;AACJ,wBAAA;AACP,MAAA;AACD,IAAA;AACD,EAAA;AACD;AFzGkB;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-QDJKUBWE.cjs","sourcesContent":[null,"/**\n * The effects contract: how an editor finds, describes and renders effects that live in another\n * package. This library ships no effects of its own here, only the shapes a provider fills in;\n * a host passes a provider to an editor (`setEffectsProvider`) and the editor degrades to its\n * old behaviour without one.\n *\n * Every time is in milliseconds. Pixels are straight-alpha RGBA rows, top to bottom.\n */\n\nimport type { JsonSchema } from '../tools/schema.js';\nimport type { FlairSvgAnimation } from '../animation-editor/flair.js';\n\n/** How an effect is drawn: a pixel shader, an animated vector picture, or motion applied to someone else's vector art. */\nexport type EffectKind = 'shader' | 'vector' | 'motion';\n\n/**\n * What an effect is for. An effect may have several uses.\n *\n * - `filter`: changes an input picture (`inputs.source`).\n * - `transition`: blends `inputs.from` into `inputs.to`; `progress` runs 0 → 1.\n * - `generator`: draws a picture from nothing (a background, a texture).\n * - `overlay`: draws something meant to sit over other content, usually with transparency.\n * - `title`: draws type or a graphic meant as a title.\n * - `motion`: animates vector art (`applyVectorEffect`).\n * - `interactive`: reacts to pointer, scroll or audio input at run time.\n */\nexport type EffectUse = 'filter' | 'transition' | 'generator' | 'overlay' | 'title' | 'motion' | 'interactive';\n\nexport const EFFECT_KINDS: readonly EffectKind[] = ['shader', 'vector', 'motion'];\nexport const EFFECT_USES: readonly EffectUse[] = ['filter', 'transition', 'generator', 'overlay', 'title', 'motion', 'interactive'];\n\n/** One entry of a provider's catalog. */\nexport interface EffectSummary {\n\t/** Stable id, saved in documents. Never reused for a different effect. */\n\tid: string;\n\tname: string;\n\tkind: EffectKind;\n\t/** The provider's own grouping (e.g. `gradient`, `light`, `transition`). */\n\tcategory: string;\n\tuses: readonly EffectUse[];\n\tdescription?: string;\n\ttags?: readonly string[];\n\t/** True when the effect's output has transparent pixels (it can sit over other content). */\n\ttransparent: boolean;\n\t/** True when the effect loops; its `duration` is then one cycle. */\n\tloop: boolean;\n\t/** Length of one play (ms). Absent for effects that do not change over time. */\n\tduration?: number;\n}\n\nexport interface EffectSearchOptions {\n\tkind?: EffectKind;\n\tcategory?: string;\n\tuse?: EffectUse;\n\t/** Most results to return. */\n\tlimit?: number;\n}\n\n/** One control value: a number, a `#rrggbb` colour or other string, a switch, or a vector of numbers. */\nexport type EffectValue = number | string | boolean | readonly number[];\nexport type EffectValues = Readonly<Record<string, EffectValue>>;\n\n/**\n * The controls of an effect as a strict JSON Schema: `type: 'object'`, `additionalProperties:\n * false`, and a `description` on every property (with units and range). `checkEffectProvider`\n * checks this.\n */\nexport type EffectControlSchema = JsonSchema & {\n\ttype: 'object';\n\tproperties: { readonly [control: string]: JsonSchema };\n\tadditionalProperties: false;\n};\n\nexport interface EffectPreset {\n\tname: string;\n\t/** Values to apply over the defaults. */\n\tvalues: EffectValues;\n}\n\n/**\n * A named input the effect reads. Filters read `source`, transitions `from` and `to`; a mask is\n * passed separately (`EffectRenderRequest.mask`), not as an input.\n */\nexport interface EffectInputSpec {\n\tname: string;\n\tkind: 'image' | 'audio';\n\tdescription: string;\n\trequired: boolean;\n}\n\n/** Everything an editor needs to show an effect's controls and render it. */\nexport interface EffectDescription extends EffectSummary {\n\tcontrols: EffectControlSchema;\n\t/** A value for every control. */\n\tdefaults: EffectValues;\n\tpresets: readonly EffectPreset[];\n\tinputs: readonly EffectInputSpec[];\n}\n\n/**\n * Pixels in and out of a renderer, shaped like `ImageData`.\n *\n * `data` is 8-bit sRGB with straight alpha and is always present. `float`, when present, is the\n * same picture as 32-bit floats in **linear light** (sRGB primaries), straight alpha, where colour\n * may exceed 1. Renderers created with `depth` 16 or 32 return `float` when the provider\n * `supportsFloat`; `data` is then its clamped sRGB encoding.\n */\nexport interface EffectPixels {\n\twidth: number;\n\theight: number;\n\tdata: Uint8ClampedArray;\n\tfloat?: Float32Array;\n}\n\n/**\n * An input picture. Always accepted as `EffectPixels`; a provider whose capabilities include\n * `supportsHostImages` also takes the host's own image objects, which saves a read back.\n */\nexport type EffectImageSource = EffectPixels | ImageBitmap | OffscreenCanvas | VideoFrame;\n\nexport interface EffectRendererOptions {\n\t/** Output size in pixels. */\n\twidth: number;\n\theight: number;\n\t/** Bits per channel of the target (default 8). 16 and 32 ask for `float` output. */\n\tdepth?: 8 | 16 | 32;\n}\n\nexport interface EffectRenderRequest {\n\t/** Effect time (ms), from the start of the effect. */\n\ttime: number;\n\t/** Control values; missing controls take their defaults. Invalid values reject with `EffectControlError`. */\n\tvalues?: EffectValues;\n\t/** Pictures for the effect's named inputs (see `EffectDescription.inputs`). */\n\tinputs?: Readonly<Record<string, EffectImageSource>>;\n\t/** Coverage (alpha channel, 0 = untouched) limiting where the effect applies. Only with `supportsMask`. */\n\tmask?: EffectImageSource;\n\t/** Transitions: how far from `from` to `to`, 0–1. Defaults to `time / duration`. */\n\tprogress?: number;\n}\n\n/** A live renderer for one effect at one size. Not safe for concurrent `render` calls. */\nexport interface EffectRenderer {\n\treadonly effectId: string;\n\treadonly width: number;\n\treadonly height: number;\n\treadonly depth: 8 | 16 | 32;\n\trender(request: EffectRenderRequest): Promise<EffectPixels>;\n\t/** Frees GPU or worker resources. Rendering afterwards rejects. */\n\tdispose(): void;\n}\n\n/** One change of an animated SVG (the shape of Flair's `SvgAnimation`). */\nexport type EffectSvgAnimation = FlairSvgAnimation;\n\n/** An animated SVG: markup plus changes to its elements (the shape of Flair's `SvgMotion`). */\nexport interface EffectVectorMotion {\n\tsvg: string;\n\tanimate?: readonly EffectSvgAnimation[];\n\t/** Length of one play (ms). */\n\tduration: number;\n\tloop: boolean;\n\t/** Ms held on the last frame before looping. */\n\thold?: number;\n}\n\n/** What a vector or motion effect is applied to: SVG markup, optionally with the ids of the elements to animate (default: all). */\nexport type EffectVectorTarget = string | { svg: string; nodeIds?: readonly string[] };\n\n/** What a provider can do, so editors can degrade cleanly. */\nexport interface EffectProviderCapabilities {\n\t/** Renders off the main thread. */\n\tsupportsWorker: boolean;\n\t/** Returns `float` pixels for depth 16 and 32 renderers. */\n\tsupportsFloat: boolean;\n\t/** Honours `EffectRenderRequest.mask`; otherwise the editor masks the result itself. */\n\tsupportsMask: boolean;\n\t/** Takes `ImageBitmap`, `OffscreenCanvas` or `VideoFrame` inputs, not only `EffectPixels`. */\n\tsupportsHostImages: boolean;\n\t/** Implements `applyVectorEffect`. */\n\tsupportsVector: boolean;\n\t/** Largest width or height a renderer accepts (px). */\n\tmaxSize?: number;\n}\n\ntype MaybePromise<T> = T | Promise<T>;\n\n/**\n * A source of effects. Implementations live outside this library (for example Flair's\n * `flairEffects()`); `createFakeEffectProvider` is a small reference implementation.\n *\n * Unknown ids reject or throw `UnknownEffectError`, invalid values `EffectControlError`, and an\n * operation the provider cannot do `EffectUnsupportedError`.\n */\nexport interface EffectProvider {\n\t/** Stable id of the provider, saved next to effect ids (e.g. `flair`). */\n\treadonly id: string;\n\treadonly name: string;\n\treadonly version?: string;\n\treadonly capabilities: EffectProviderCapabilities;\n\tlist(options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;\n\t/** Effects matching every word of `query` (in name, id, category, tags or description), best first. */\n\tsearch(query: string, options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;\n\tdescribe(id: string): MaybePromise<EffectDescription>;\n\t/** A pixel renderer. A `vector` effect may refuse with `EffectUnsupportedError` where it cannot lay out SVG (a Worker). */\n\tcreateRenderer(id: string, options: EffectRendererOptions): MaybePromise<EffectRenderer>;\n\t/**\n\t * Vector and motion effects as an animated SVG. Present when `capabilities.supportsVector`. A\n\t * `motion` effect animates the target's elements (`nodeIds`, else each top-level element with an\n\t * id); a `vector` effect brings its own picture and ignores the target. Refuse a target the\n\t * effect cannot use with `EffectUnsupportedError`.\n\t */\n\tapplyVectorEffect?(id: string, target: EffectVectorTarget, values?: EffectValues): MaybePromise<EffectVectorMotion>;\n}\n","/**\n * The agent tools for provider effects, shared by every editor that takes an `EffectProvider`:\n * `search_effects`, `describe_effect`, `list_applied_effects`, `apply_effect`, `update_effect` and\n * `remove_effect`. An editor supplies an `EffectToolHost` (what its targets are and how to change\n * them as one undo step each) and may add tools of its own (`extraTools`).\n *\n * Without a provider the read tools say so (and `list_applied_effects` still lists what a\n * document holds), and the write tools refuse with the reason. On a read-only surface the write\n * tools are hidden.\n */\n\nimport type { AgentTool, AgentToolProvider } from '../tools/registry.js';\nimport type { JsonSchema } from '../tools/schema.js';\nimport { isEffectError } from './errors.js';\nimport { EFFECT_KINDS, EFFECT_USES, type EffectDescription, type EffectProvider, type EffectSummary, type EffectUse } from './types.js';\n\n/** One effect applied to a target, as the tools report it. */\nexport interface AppliedEffectInfo {\n\t/** Its id on the target: what `update_effect` and `remove_effect` take. */\n\tid: string;\n\teffect: string;\n\tname?: string;\n\tprovider?: string;\n\t/** What it is on the target (e.g. `clip effect`, `effect clip`, `transition`, `smart filter`, `effect layer`). */\n\trole: string;\n\tenabled: boolean;\n\t/** 0–1, or keyframes, where the role has an opacity. */\n\topacity?: unknown;\n\t/** Its saved control values (numbers may be keyframes where the editor allows them). */\n\tvalues: Record<string, unknown>;\n\t/** Its place in the target's stack (0 = applied first), for stacked roles. */\n\tindex?: number;\n}\n\nexport interface EffectTargetEffects {\n\ttarget: string;\n\t/** A label for the target (a clip or layer name). */\n\tname?: string;\n\teffects: AppliedEffectInfo[];\n}\n\nexport interface EffectChangeResult {\n\ttarget: string;\n\t/** What was added, changed or removed. */\n\teffect: AppliedEffectInfo;\n\t/** The target's effects afterwards. */\n\teffects: AppliedEffectInfo[];\n\t/** Other things the change made (a new clip or layer id, ...). */\n\t[extra: string]: unknown;\n}\n\n/** What an editor gives the shared effect tools. */\nexport interface EffectToolHost {\n\t/** Provider id (unique per registry). */\n\tid: string;\n\t/** Always prefix tool names with `<namespace>__`. */\n\tnamespace?: string;\n\t/** Words for the editor's targets, e.g. `{ noun: 'clip', id: 'A clip id from get_video_project (e.g. \"c1\").' }`. */\n\ttarget: { noun: string; id: string };\n\t/** The uses `apply_effect` takes on a target (others go through `extraTools`). */\n\tapplyUses: readonly EffectUse[];\n\t/** Text added to `apply_effect`'s description: where the effect goes and how it is drawn. */\n\tapplyDetails: string;\n\t/** The current provider, or `null`. */\n\tprovider(): EffectProvider | null;\n\t/** Why edits are refused now (read-only), or `null`. */\n\treadOnlyReason(): string | null;\n\t/** Every target with effects, or one target (throws for an unknown id, naming valid ones). */\n\tlist(target?: string): EffectTargetEffects[];\n\tapply(target: string, effect: string, args: { values?: Record<string, unknown>; index?: number; enabled?: boolean; opacity?: number }): Promise<EffectChangeResult>;\n\tupdate(target: string, instance: string, changes: { values?: Record<string, unknown>; index?: number; enabled?: boolean; opacity?: number }): Promise<EffectChangeResult>;\n\tremove(target: string, instance: string): Promise<EffectChangeResult>;\n\t/** Editor-specific effect tools (transitions, effect clips, effect layers, keyframes). */\n\textraTools?: (context: EffectToolContext) => AgentTool[];\n\t/** Lets the tool list follow the provider and read-only changes. */\n\tsubscribe?: (notify: () => void) => () => void;\n}\n\n/** Shared pieces for `extraTools`. */\nexport interface EffectToolContext {\n\t/** The provider, or a thrown error saying none is registered. */\n\trequireProvider(): EffectProvider;\n\t/** The schema of a `values` argument. */\n\tvaluesSchema(what: string, keyframes?: boolean): JsonSchema;\n\t/** The schema of an `effect` argument for effects with one of `uses`. */\n\teffectIdSchema(uses: readonly EffectUse[]): JsonSchema;\n\treadonly annotations: typeof ANNOTATIONS;\n}\n\nconst ANNOTATIONS = {\n\tread: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n\twrite: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n\twriteIdempotent: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n\tdestructive: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false }\n} as const;\n\nconst NO_PROVIDER = 'No effects provider is registered with this editor, so there are no effects to search, describe or apply. The host app must register one (setEffectsProvider); effects already in the document are kept and shown as placeholders.';\n\nconst object = (properties: Record<string, JsonSchema>, required: string[] = []): JsonSchema & { type: 'object' } => ({\n\ttype: 'object',\n\tproperties,\n\t...(required.length ? { required } : {}),\n\tadditionalProperties: false\n});\n\n/** The catalog fetched once per provider, so tool schemas can list effect ids. */\ninterface Catalog {\n\tprovider: EffectProvider;\n\teffects: readonly EffectSummary[] | null;\n}\n\n/** Most effect ids listed in an `effect` argument's enum; larger catalogs are searched instead. */\nconst ENUM_LIMIT = 60;\n\nconst summaryOut = (e: EffectSummary) => ({\n\tid: e.id,\n\tname: e.name,\n\tkind: e.kind,\n\tcategory: e.category,\n\tuses: e.uses,\n\t...(e.description ? { description: e.description } : {}),\n\ttransparent: e.transparent,\n\tloop: e.loop,\n\t...(e.duration !== undefined ? { duration: e.duration } : {})\n});\n\n/** The agent tools for provider effects in one editor (see the module comment). */\nexport function createEffectToolProvider(host: EffectToolHost): AgentToolProvider {\n\tlet catalog: Catalog | null = null;\n\tconst listeners = new Set<() => void>();\n\tconst notify = () => listeners.forEach((l) => l());\n\n\t/** Fetches the catalog of a new provider in the background; the tool list changes when it lands. */\n\tconst catalogFor = (provider: EffectProvider | null): readonly EffectSummary[] | null => {\n\t\tif (!provider) return null;\n\t\tif (catalog?.provider !== provider) {\n\t\t\tconst entry: Catalog = { provider, effects: null };\n\t\t\tcatalog = entry;\n\t\t\tPromise.resolve()\n\t\t\t\t.then(() => provider.list())\n\t\t\t\t.then((effects) => {\n\t\t\t\t\tif (catalog === entry) {\n\t\t\t\t\t\tentry.effects = effects;\n\t\t\t\t\t\tnotify();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => {});\n\t\t}\n\t\treturn catalog.effects;\n\t};\n\n\tconst requireProvider = (): EffectProvider => {\n\t\tconst p = host.provider();\n\t\tif (!p) throw new Error(NO_PROVIDER);\n\t\treturn p;\n\t};\n\tconst writable = () => {\n\t\tconst reason = host.readOnlyReason();\n\t\tif (reason) throw new Error(reason);\n\t\treturn requireProvider();\n\t};\n\t/** Turns provider errors into messages a model can act on. */\n\tconst explain = async <T>(run: () => Promise<T>): Promise<T> => {\n\t\ttry {\n\t\t\treturn await run();\n\t\t} catch (error) {\n\t\t\tif (isEffectError(error)) throw new Error(error.message);\n\t\t\tthrow error;\n\t\t}\n\t};\n\n\tconst valuesSchema = (what: string, keyframes = false): JsonSchema => ({\n\t\ttype: 'object',\n\t\tdescription: `${what}: control name → value, as listed by describe_effect (its \"controls\" schema: types, ranges, units and defaults). Only the given controls change; colours are \"#rrggbb\".${keyframes ? ' A number control may instead be keyframes { keys: [{ t: ms from the start, v, ease }] }.' : ''} Unknown controls and out-of-range values are refused with the valid ones.`\n\t});\n\tconst effectIdSchema = (uses: readonly EffectUse[]): JsonSchema => {\n\t\tconst effects = catalogFor(host.provider())?.filter((e) => (e.kind !== 'motion' || uses.includes('motion')) && e.uses.some((u) => uses.includes(u)));\n\t\tconst base = `An effect id from search_effects (use ${uses.map((u) => `\"${u}\"`).join(' or ')}).`;\n\t\treturn effects && effects.length && effects.length <= ENUM_LIMIT\n\t\t\t? { type: 'string', enum: effects.map((e) => e.id), description: `${base} One of: ${effects.map((e) => `${e.id} (${e.name})`).join(', ')}.` }\n\t\t\t: { type: 'string', minLength: 1, description: base };\n\t};\n\tconst context: EffectToolContext = { requireProvider: writable, valuesSchema, effectIdSchema, annotations: ANNOTATIONS };\n\n\tconst TARGET = { type: 'string', minLength: 1, description: host.target.id } as const;\n\tconst INSTANCE = { type: 'string', minLength: 1, description: `The effect's id on the ${host.target.noun}, from list_applied_effects or apply_effect.` } as const;\n\tconst INDEX = { type: 'integer', minimum: 0, description: `Place in the ${host.target.noun}'s effect stack: 0 is applied first (default: the end, applied last).` } as const;\n\tconst OPACITY = { type: 'number', minimum: 0, maximum: 1, description: 'How much of the effect shows over its input, 0–1 (default 1).' } as const;\n\tconst ENABLED = { type: 'boolean', description: 'false turns the effect off but keeps it (default true).' } as const;\n\n\tconst readTools = (): AgentTool[] => [\n\t\t{\n\t\t\tname: 'search_effects',\n\t\t\ttitle: 'Search effects',\n\t\t\tdescription: `Searches the effects provider's catalog. Every word of query must appear in an effect's id, name, category, tags or description; filter by kind (shader, vector, motion), category or use (${EFFECT_USES.join(', ')}). For this editor, apply_effect takes uses ${host.applyUses.join(' or ')}. Returns { provider, effects: [{ id, name, kind, category, uses, description, transparent, loop, duration (ms) }], total }. With no provider registered it returns available: false and the reason. Call describe_effect next for an effect's controls.`,\n\t\t\tinputSchema: object({\n\t\t\t\tquery: { type: 'string', description: 'Words to match (default: every effect).' },\n\t\t\t\tkind: { type: 'string', enum: [...EFFECT_KINDS], description: 'shader (pixels), vector (animated SVG) or motion (animates vector art).' },\n\t\t\t\tcategory: { type: 'string', minLength: 1, description: 'The provider\\'s category, e.g. \"gradient\", \"light\", \"transition\".' },\n\t\t\t\tuse: { type: 'string', enum: [...EFFECT_USES], description: 'What the effect is for: filter changes a picture, transition blends two, generator draws a background, overlay draws over content, title draws a title, motion animates vector art, interactive reacts to input.' },\n\t\t\t\tlimit: { type: 'integer', minimum: 1, maximum: 200, description: 'Most effects to return (default 20).' }\n\t\t\t}),\n\t\t\tannotations: { title: 'Search effects', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tif (!p) return { available: false, reason: NO_PROVIDER, effects: [], total: 0 };\n\t\t\t\tconst found = await explain(async () => p.search((args.query as string | undefined) ?? '', { kind: args.kind, category: args.category, use: args.use }));\n\t\t\t\tconst limit = (args.limit as number | undefined) ?? 20;\n\t\t\t\treturn { available: true, provider: { id: p.id, name: p.name, capabilities: p.capabilities }, effects: found.slice(0, limit).map(summaryOut), total: found.length };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'describe_effect',\n\t\t\ttitle: 'Describe an effect',\n\t\t\tdescription: 'Returns one effect\\'s controls as a strict JSON Schema (each control described, with its type, range and units), its defaults, presets (named sets of values) and inputs, plus its summary. Use the control names and ranges for apply_effect and update_effect values. With no provider registered it returns available: false and the reason.',\n\t\t\tinputSchema: object({ effect: { type: 'string', minLength: 1, description: 'An effect id from search_effects or list_applied_effects.' } }, ['effect']),\n\t\t\tannotations: { title: 'Describe an effect', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tif (!p) return { available: false, reason: NO_PROVIDER };\n\t\t\t\tconst d: EffectDescription = await explain(async () => p.describe(args.effect as string));\n\t\t\t\treturn { available: true, ...summaryOut(d), controls: d.controls, defaults: d.defaults, presets: d.presets, inputs: d.inputs, appliesHere: (d.kind !== 'motion' || host.applyUses.includes('motion')) && d.uses.some((u) => host.applyUses.includes(u)) };\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'list_applied_effects',\n\t\t\ttitle: 'List applied effects',\n\t\t\tdescription: `Lists the effects in the document: for each ${host.target.noun} that has any (or the one given), its effects in order with id, effect id, name, role, enabled, opacity and saved values. available is false for an effect the current provider does not have (or when none is registered): it is kept and drawn as a placeholder, and can still be removed. Works without a provider.`,\n\t\t\tinputSchema: object({ target: { ...TARGET, description: `${host.target.id} Leave out to list every ${host.target.noun} with effects.` } }),\n\t\t\tannotations: { title: 'List applied effects', ...ANNOTATIONS.read },\n\t\t\thandler: async (args) => {\n\t\t\t\tconst p = host.provider();\n\t\t\t\tconst known = new Set((p ? await explain(async () => p.list()) : []).map((e) => e.id));\n\t\t\t\tconst targets = host.list(args.target as string | undefined).map((t) => ({ ...t, effects: t.effects.map((e) => ({ ...e, available: known.has(e.effect) })) }));\n\t\t\t\treturn { provider: p ? { id: p.id, name: p.name } : null, ...(p ? {} : { reason: NO_PROVIDER }), targets };\n\t\t\t}\n\t\t}\n\t];\n\n\tconst writeTools = (): AgentTool[] => [\n\t\t{\n\t\t\tname: 'apply_effect',\n\t\t\ttitle: 'Apply an effect',\n\t\t\tdescription: `Adds a provider effect to a ${host.target.noun}. ${host.applyDetails} values are checked against describe_effect's controls first; nothing changes if any is wrong. One undo step. Returns the effect with its new id (for update_effect and remove_effect) and the ${host.target.noun}'s effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object(\n\t\t\t\t{\n\t\t\t\t\ttarget: TARGET,\n\t\t\t\t\teffect: effectIdSchema(host.applyUses),\n\t\t\t\t\tvalues: valuesSchema('Control values over the effect\\'s defaults', true),\n\t\t\t\t\tindex: INDEX,\n\t\t\t\t\tenabled: ENABLED,\n\t\t\t\t\topacity: OPACITY\n\t\t\t\t},\n\t\t\t\t['target', 'effect']\n\t\t\t),\n\t\t\tannotations: { title: 'Apply an effect', ...ANNOTATIONS.write },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\treturn explain(() => host.apply(args.target as string, args.effect as string, { values: args.values, index: args.index, enabled: args.enabled, opacity: args.opacity }));\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'update_effect',\n\t\t\ttitle: 'Change an applied effect',\n\t\t\tdescription: `Changes one applied effect on a ${host.target.noun}: its values (merged over the current ones; null resets a control to its default), enabled, opacity or place in the stack. Values are checked against describe_effect's controls first. One undo step. Returns the effect as it is now and the ${host.target.noun}'s effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object(\n\t\t\t\t{\n\t\t\t\t\ttarget: TARGET,\n\t\t\t\t\teffect: INSTANCE,\n\t\t\t\t\tvalues: { ...valuesSchema('Control values to change', true), description: `${valuesSchema('Control values to change', true).description} null resets a control to its default.` },\n\t\t\t\t\tenabled: ENABLED,\n\t\t\t\t\topacity: OPACITY,\n\t\t\t\t\tindex: { ...INDEX, description: `Move it to this place in the ${host.target.noun}'s stack (0 = applied first).` }\n\t\t\t\t},\n\t\t\t\t['target', 'effect']\n\t\t\t),\n\t\t\tannotations: { title: 'Change an applied effect', ...ANNOTATIONS.writeIdempotent },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\tif (args.values === undefined && args.enabled === undefined && args.opacity === undefined && args.index === undefined) throw new Error('Give at least one of values, enabled, opacity or index to change.');\n\t\t\t\treturn explain(() => host.update(args.target as string, args.effect as string, { values: args.values, enabled: args.enabled, opacity: args.opacity, index: args.index }));\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tname: 'remove_effect',\n\t\t\ttitle: 'Remove an applied effect',\n\t\t\tdescription: `Removes one applied effect from a ${host.target.noun} (an effect the provider no longer has included). One undo step. Returns what was removed and the ${host.target.noun}'s remaining effects. Refused when no provider is registered.`,\n\t\t\tinputSchema: object({ target: TARGET, effect: INSTANCE }, ['target', 'effect']),\n\t\t\tannotations: { title: 'Remove an applied effect', ...ANNOTATIONS.destructive },\n\t\t\thandler: async (args) => {\n\t\t\t\twritable();\n\t\t\t\treturn explain(() => host.remove(args.target as string, args.effect as string));\n\t\t\t}\n\t\t}\n\t];\n\n\treturn {\n\t\tid: host.id,\n\t\t...(host.namespace ? { namespace: host.namespace } : {}),\n\t\ttools: () => {\n\t\t\tconst extra = host.extraTools?.(context) ?? [];\n\t\t\tif (host.readOnlyReason()) return [...readTools(), ...extra.filter((t) => t.annotations?.readOnlyHint)];\n\t\t\treturn [...readTools(), ...writeTools(), ...extra];\n\t\t},\n\t\tsubscribe: (l) => {\n\t\t\tlisteners.add(l);\n\t\t\tconst off = host.subscribe?.(l);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(l);\n\t\t\t\toff?.();\n\t\t\t};\n\t\t}\n\t};\n}\n"]}
|
|
@@ -10037,4 +10037,4 @@ function transformVectorSymmetry(s, m) {
|
|
|
10037
10037
|
|
|
10038
10038
|
|
|
10039
10039
|
exports.isVectorMeshGradient = isVectorMeshGradient; exports.isVectorFreeformGradient = isVectorFreeformGradient; exports.isVectorShadedPaint = isVectorShadedPaint; exports.vectorRgbaToCss = vectorRgbaToCss; exports.VECTOR_MESH_MAX = VECTOR_MESH_MAX; exports.createVectorMeshGradient = createVectorMeshGradient; exports.vectorMeshPointAt = vectorMeshPointAt; exports.vectorMeshColorAt = vectorMeshColorAt; exports.vectorMeshLines = vectorMeshLines; exports.vectorFreeformSpreadScale = vectorFreeformSpreadScale; exports.vectorFreeformLineSegments = vectorFreeformLineSegments; exports.vectorFreeformField = vectorFreeformField; exports.sampleVectorFreeform = sampleVectorFreeform; exports.autoVectorFreeformGradient = autoVectorFreeformGradient; exports.vectorShadedSvgDefs = vectorShadedSvgDefs; exports.mapVectorShadedPaint = mapVectorShadedPaint; exports.transformVectorShadedPaint = transformVectorShadedPaint; exports.sanitizeVectorShadedPaint = sanitizeVectorShadedPaint; exports.removeVectorFreeformPoint = removeVectorFreeformPoint; exports.nearestVectorShadingPoint = nearestVectorShadingPoint; exports.VECTOR_CORNER_KINDS = VECTOR_CORNER_KINDS; exports.VECTOR_GRADIENT_TYPES = VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_SPREADS = VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_INTERPOLATIONS = VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_STROKE_GRADIENT_MODES = VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_ARROWHEADS = VECTOR_ARROWHEADS; exports.VECTOR_BLEND_MODES = VECTOR_BLEND_MODES; exports.VECTOR_HORIZONTAL_RESIZING = VECTOR_HORIZONTAL_RESIZING; exports.VECTOR_VERTICAL_RESIZING = VECTOR_VERTICAL_RESIZING; exports.VECTOR_CONNECTOR_SIDES = VECTOR_CONNECTOR_SIDES; exports.VECTOR_CONNECTOR_ROUTES = VECTOR_CONNECTOR_ROUTES; exports.VECTOR_BLEND_SPACINGS = VECTOR_BLEND_SPACINGS; exports.VECTOR_MASK_TYPES = VECTOR_MASK_TYPES; exports.VECTOR_SYMMETRY_MODES = VECTOR_SYMMETRY_MODES; exports.VECTOR_TEXT_ALIGNS = VECTOR_TEXT_ALIGNS; exports.VECTOR_PATH_TEXT_BASELINES = VECTOR_PATH_TEXT_BASELINES; exports.VECTOR_CONSTRAINT_KINDS = VECTOR_CONSTRAINT_KINDS; exports.VECTOR_TOOLS = VECTOR_TOOLS; exports.VECTOR_TRANSFORM_HANDLES = VECTOR_TRANSFORM_HANDLES; exports.VECTOR_PATHFINDER_OPERATIONS = VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_EFFECT_TYPES = VECTOR_EFFECT_TYPES; exports.VECTOR_MERGE_MODES = VECTOR_MERGE_MODES; exports.VECTOR_FILTER_TYPES = VECTOR_FILTER_TYPES; exports.isVectorGradient = isVectorGradient; exports.parseVectorColor = parseVectorColor; exports.VECTOR_GRADIENT_MIN_STOPS = VECTOR_GRADIENT_MIN_STOPS; exports.gradientMidpointRemap = gradientMidpointRemap; exports.sortedVectorGradientStops = sortedVectorGradientStops; exports.vectorGradientNeedsExpansion = vectorGradientNeedsExpansion; exports.vectorGradientRamp = vectorGradientRamp; exports.sampleVectorGradient = sampleVectorGradient; exports.expandVectorGradientStops = expandVectorGradientStops; exports.samplePlainStops = samplePlainStops; exports.reverseVectorGradient = reverseVectorGradient; exports.insertVectorGradientStop = insertVectorGradientStop; exports.moveVectorGradientStop = moveVectorGradientStop; exports.removeVectorGradientStop = removeVectorGradientStop; exports.vectorGradientMidpointPosition = vectorGradientMidpointPosition; exports.vectorGradientMidpointFromPosition = vectorGradientMidpointFromPosition; exports.spanVectorGradientStops = spanVectorGradientStops; exports.hasExplicitGradientGeometry = hasExplicitGradientGeometry; exports.vectorGradientPoints = vectorGradientPoints; exports.vectorBoxMatrix = vectorBoxMatrix; exports.vectorGradientUnitsMatrix = vectorGradientUnitsMatrix; exports.vectorGradientMatrix = vectorGradientMatrix; exports.vectorGradientFocalParam = vectorGradientFocalParam; exports.vectorGradientParam = vectorGradientParam; exports.applyVectorGradientSpread = applyVectorGradientSpread; exports.vectorGradientTAt = vectorGradientTAt; exports.sampleVectorGradientAt = sampleVectorGradientAt; exports.vectorGradientAspect = vectorGradientAspect; exports.explicitVectorGradient = explicitVectorGradient; exports.pinVectorGradient = pinVectorGradient; exports.transformVectorGradient = transformVectorGradient; exports.mapVectorGradient = mapVectorGradient; exports.mapVectorPaint = mapVectorPaint; exports.transformVectorPaint = transformVectorPaint; exports.isCentredVectorGradient = isCentredVectorGradient; exports.vectorGradientHandles = vectorGradientHandles; exports.moveVectorGradientHandle = moveVectorGradientHandle; exports.setVectorGradientVector = setVectorGradientVector; exports.VECTOR_GRADIENT_MAX_PERIODS = VECTOR_GRADIENT_MAX_PERIODS; exports.periodicVectorGradientStops = periodicVectorGradientStops; exports.expandVectorGradientSpread = expandVectorGradientSpread; exports.vectorGradientArea = vectorGradientArea; exports.patternAttrs = patternAttrs; exports.vectorGradientSvgDefs = vectorGradientSvgDefs; exports.sampleVectorPaintDefAt = sampleVectorPaintDefAt; exports.sanitizeVectorGradient = sanitizeVectorGradient; exports.convertVectorGradient = convertVectorGradient; exports.defaultVectorGradient = defaultVectorGradient; exports.applyVectorGradientPatch = applyVectorGradientPatch; exports.IDENTITY_MATRIX = IDENTITY_MATRIX; exports.multiplyMatrices = multiplyMatrices; exports.translateMatrix = translateMatrix; exports.scaleMatrix = scaleMatrix; exports.rotateMatrix = rotateMatrix; exports.matrixAbout = matrixAbout; exports.skewMatrix = skewMatrix; exports.applyMatrix = applyMatrix; exports.isIdentityMatrix = isIdentityMatrix; exports.invertMatrix = invertMatrix; exports.applyMatrixLinear = applyMatrixLinear; exports.matrixRotation = matrixRotation; exports.decomposeRigid = decomposeRigid; exports.isVectorSymmetryGroup = isVectorSymmetryGroup; exports.vectorSymmetryMatrices = vectorSymmetryMatrices; exports.vectorSymmetryDrawn = vectorSymmetryDrawn; exports.vectorSymmetryAxes = vectorSymmetryAxes; exports.sanitizeVectorSymmetry = sanitizeVectorSymmetry; exports.VECTOR_SYMMETRY_MODE_LABELS = VECTOR_SYMMETRY_MODE_LABELS; exports.transformVectorSymmetry = transformVectorSymmetry; exports.vectorCornerAt = vectorCornerAt; exports.vectorCorners = vectorCorners; exports.cornerSetback = cornerSetback; exports.fitCornerRadius = fitCornerRadius; exports.cornerBisectorPoint = cornerBisectorPoint; exports.cornerRadiusChange = cornerRadiusChange; exports.hasVectorCorners = hasVectorCorners; exports.expandVectorCornersOf = expandVectorCornersOf; exports.expandVectorCorners = expandVectorCorners; exports.setAnchorCorner = setAnchorCorner; exports.nextVectorCornerKind = nextVectorCornerKind; exports.setSubpathCorners = setSubpathCorners; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = VECTOR_WIDTH_SAME_T; exports.VECTOR_WIDTH_PRESETS = VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = VECTOR_WIDTH_PRESET_IDS; exports.sanitizeWidthProfile = sanitizeWidthProfile; exports.isUniformWidthProfile = isUniformWidthProfile; exports.widthProfileAt = widthProfileAt; exports.widthProfileMaxScale = widthProfileMaxScale; exports.widthProfilePreset = widthProfilePreset; exports.widthProfilePresetId = widthProfilePresetId; exports.reverseWidthProfile = reverseWidthProfile; exports.mirrorWidthProfile = mirrorWidthProfile; exports.insertWidthPoint = insertWidthPoint; exports.setWidthPoint = setWidthPoint; exports.removeWidthPoints = removeWidthPoints; exports.taperWaveFactor = taperWaveFactor; exports.generateWidthProfile = generateWidthProfile; exports.VECTOR_PRESSURE_NOMINAL = VECTOR_PRESSURE_NOMINAL; exports.pressureWidthProfile = pressureWidthProfile; exports.dashIntervals = dashIntervals; exports.variableStrokeRings = variableStrokeRings; exports.variableStrokeOutline = variableStrokeOutline; exports.nearestStrokePosition = nearestStrokePosition; exports.strokePositionPoint = strokePositionPoint; exports.isClosedBezierShape = isClosedBezierShape; exports.effectiveStrokeAlign = effectiveStrokeAlign; exports.strokeWidthProfileOf = strokeWidthProfileOf; exports.hasStrokeExtras = hasStrokeExtras; exports.vectorStrokeLineArea = vectorStrokeLineArea; exports.arrowheadWeight = arrowheadWeight; exports.arrowheadInset = arrowheadInset; exports.arrowheadPath = arrowheadPath; exports.vectorStrokeParts = vectorStrokeParts; exports.vectorStrokeOutlinePath = vectorStrokeOutlinePath; exports.hitTestVectorStroke = hitTestVectorStroke; exports.vectorStrokeReach = vectorStrokeReach; exports.VECTOR_STROKE_SETTING_KEYS = VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_BLEND_MODE_LABELS = VECTOR_BLEND_MODE_LABELS; exports.isVectorBlendMode = isVectorBlendMode; exports.vectorBlendModeCss = vectorBlendModeCss; exports.vectorBlendModeFromCss = vectorBlendModeFromCss; exports.isPlainVectorPaintLayer = isPlainVectorPaintLayer; exports.isDrawnVectorPaintLayer = isDrawnVectorPaintLayer; exports.vectorFills = vectorFills; exports.vectorStrokeSettings = vectorStrokeSettings; exports.vectorStrokes = vectorStrokes; exports.hasVectorPaintStacks = hasVectorPaintStacks; exports.withVectorFills = withVectorFills; exports.withVectorStrokes = withVectorStrokes; exports.normalizeVectorPaintStacks = normalizeVectorPaintStacks; exports.sanitizeVectorFills = sanitizeVectorFills; exports.sanitizeVectorStrokeSettings = sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = sanitizeVectorStrokes; exports.vectorPaintLayerNodes = vectorPaintLayerNodes; exports.needsVectorPaintLayers = needsVectorPaintLayers; exports.vectorStrokeStackReach = vectorStrokeStackReach; exports.hitTestVectorPaintLayer = hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = hitTestVectorPaintStack; exports.vectorStacksHaveGradient = vectorStacksHaveGradient; exports.newVectorStrokeLayer = newVectorStrokeLayer; exports.vectorTargetPaint = vectorTargetPaint; exports.withVectorTargetPaint = withVectorTargetPaint; exports.effectPathLength = effectPathLength; exports.effectPathVertexCount = effectPathVertexCount; exports.trimIntervals = trimIntervals; exports.trimPaths = trimPaths; exports.trimPathsIndividually = trimPathsIndividually; exports.puckerBloatPaths = puckerBloatPaths; exports.roundCornerPaths = roundCornerPaths; exports.offsetPaths = offsetPaths; exports.sweepPath = sweepPath; exports.twistPaths = twistPaths; exports.zigzagPaths = zigzagPaths; exports.wigglePaths = wigglePaths; exports.mergePaths = mergePaths; exports.vectorRepeaterCopies = vectorRepeaterCopies; exports.repeatPaths = repeatPaths; exports.pathsCenter = pathsCenter; exports.mapVectorPoints = mapVectorPoints; exports.mapVectorSubpaths = mapVectorSubpaths; exports.mapBezierPath = mapBezierPath; exports.isVectorFrame = isVectorFrame; exports.vectorFrameRectPath = vectorFrameRectPath; exports.vectorFrameDrawn = vectorFrameDrawn; exports.vectorFrameContains = vectorFrameContains; exports.vectorFrameChildMatrix = vectorFrameChildMatrix; exports.sanitizeVectorFrame = sanitizeVectorFrame; exports.sanitizeVectorResizing = sanitizeVectorResizing; exports.VECTOR_HORIZONTAL_RESIZING_LABELS = VECTOR_HORIZONTAL_RESIZING_LABELS; exports.VECTOR_VERTICAL_RESIZING_LABELS = VECTOR_VERTICAL_RESIZING_LABELS; exports.vectorBoundsInside = vectorBoundsInside; exports.vectorArtboards = vectorArtboards; exports.vectorFrameDocument = vectorFrameDocument; exports.getVectorFramePanel = getVectorFramePanel; exports.splitIntoFaces = splitIntoFaces; exports.knifePath = knifePath; exports.eraserRegion = eraserRegion; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.polylineBounds = polylineBounds; exports.simplifyPolyline = simplifyPolyline; exports.VECTOR_FILTER_DEFAULTS = VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_PARAM_SPECS = VECTOR_FILTER_PARAM_SPECS; exports.isVectorFilterType = isVectorFilterType; exports.normalizeVectorFilterParams = normalizeVectorFilterParams; exports.vectorFilterParamKeys = vectorFilterParamKeys; exports.createVectorFilter = createVectorFilter; exports.sanitizeVectorFilters = sanitizeVectorFilters; exports.activeVectorFilters = activeVectorFilters; exports.vectorFilterReach = vectorFilterReach; exports.vectorFilterSvg = vectorFilterSvg; exports.vectorFilterMarkup = vectorFilterMarkup; exports.VECTOR_FILTER_MENU = VECTOR_FILTER_MENU; exports.isVectorMaskType = isVectorMaskType; exports.sanitizeVectorMask = sanitizeVectorMask; exports.isVectorMaskGroup = isVectorMaskGroup; exports.isVectorMaskActive = isVectorMaskActive; exports.vectorMaskSource = vectorMaskSource; exports.vectorMaskContents = vectorMaskContents; exports.vectorMaskOwner = vectorMaskOwner; exports.vectorMaskSummary = vectorMaskSummary; exports.vectorMaskRegionShapes = vectorMaskRegionShapes; exports.vectorMaskRegion = vectorMaskRegion; exports.vectorMaskRegionPath = vectorMaskRegionPath; exports.vectorMaskContains = vectorMaskContains; exports.vectorMaskedShapes = vectorMaskedShapes; exports.vectorMaskedGeometry = vectorMaskedGeometry; exports.vectorMaskedLocalBounds = vectorMaskedLocalBounds; exports.vectorMaskContentBounds = vectorMaskContentBounds; exports.vectorMaskRenderData = vectorMaskRenderData; exports.DEFAULT_TEXT_STYLE = DEFAULT_TEXT_STYLE; exports.DEFAULT_AUTO_LEADING = DEFAULT_AUTO_LEADING; exports.fitRuns = fitRuns; exports.styleAt = styleAt; exports.restyleRange = restyleRange; exports.spliceRuns = spliceRuns; exports.paragraphRanges = paragraphRanges; exports.fitParagraphRuns = fitParagraphRuns; exports.fontOf = fontOf; exports.isTextSpace = isTextSpace; exports.layoutText = layoutText; exports.textIndexAt = textIndexAt; exports.caretAt = caretAt; exports.textDecorations = textDecorations; exports.textRectPath = textRectPath; exports.textFragmentOutline = textFragmentOutline; exports.cssFontFamily = cssFontFamily; exports.cssFont = cssFont; exports.createCanvasTextShaper = createCanvasTextShaper; exports.createOutlineTextShaper = createOutlineTextShaper; exports.createMetricTextShaper = createMetricTextShaper; exports.setVectorTextShaper = setVectorTextShaper; exports.getVectorTextShaper = getVectorTextShaper; exports.vectorTextShaperGeneration = vectorTextShaperGeneration; exports.vectorTextHasOutlines = vectorTextHasOutlines; exports.vectorTextFamilies = vectorTextFamilies; exports.DEFAULT_VECTOR_FONT = DEFAULT_VECTOR_FONT; exports.VECTOR_CHARACTER_STYLE_KEYS = VECTOR_CHARACTER_STYLE_KEYS; exports.VECTOR_PARAGRAPH_STYLE_KEYS = VECTOR_PARAGRAPH_STYLE_KEYS; exports.VectorTextError = VectorTextError; exports.fitVectorTextRuns = fitVectorTextRuns; exports.vectorTextRuns = vectorTextRuns; exports.vectorTextStyleAt = vectorTextStyleAt; exports.measureVectorPath = measureVectorPath; exports.vectorPathAt = vectorPathAt; exports.vectorPathTextPositions = vectorPathTextPositions; exports.layoutVectorText = layoutVectorText; exports.glyphBox = glyphBox; exports.vectorTextPaths = vectorTextPaths; exports.vectorTextPaintSource = vectorTextPaintSource; exports.vectorTextCaret = vectorTextCaret; exports.vectorTextIndexAt = vectorTextIndexAt; exports.vectorTextSelectionQuads = vectorTextSelectionQuads; exports.patchVectorCharacterStyle = patchVectorCharacterStyle; exports.patchVectorParagraphStyle = patchVectorParagraphStyle; exports.sanitizeVectorTextFrame = sanitizeVectorTextFrame; exports.normalizeVectorTextRuns = normalizeVectorTextRuns; exports.sanitizeVectorTextFields = sanitizeVectorTextFields; exports.vectorTextRange = vectorTextRange; exports.replaceVectorText = replaceVectorText; exports.styleVectorText = styleVectorText; exports.bakeVectorTextGeometry = bakeVectorTextGeometry; exports.vectorTextName = vectorTextName; exports.pathTextFrameFromBezier = pathTextFrameFromBezier; exports.vectorTextBoxOutline = vectorTextBoxOutline; exports.vectorTextSpans = vectorTextSpans; exports.vectorTextGeometryNode = vectorTextGeometryNode; exports.vectorTextSpanSvg = vectorTextSpanSvg; exports.VECTOR_SYMBOL_MAX_DEPTH = VECTOR_SYMBOL_MAX_DEPTH; exports.vectorSymbolsUsedIn = vectorSymbolsUsedIn; exports.vectorSymbolUses = vectorSymbolUses; exports.resolveVectorSymbols = resolveVectorSymbols; exports.stripVectorSymbolArt = stripVectorSymbolArt; exports.scaleVectorStrokeWidths = scaleVectorStrokeWidths; exports.tintVectorNode = tintVectorNode; exports.prefixVectorIds = prefixVectorIds; exports.vectorInstanceGroup = vectorInstanceGroup; exports.composeVectorMatrices = composeVectorMatrices; exports.WARP_STYLES = WARP_STYLES; exports.WARP_STYLE_LABELS = WARP_STYLE_LABELS; exports.warpPresetGrid = warpPresetGrid; exports.warpPresetMesh = warpPresetMesh; exports.warpMeshColumns = warpMeshColumns; exports.warpMeshRows = warpMeshRows; exports.isValidWarpMesh = isValidWarpMesh; exports.fitWarpMesh = fitWarpMesh; exports.identityWarpMesh = identityWarpMesh; exports.evalWarpMesh = evalWarpMesh; exports.splitWarpMeshU = splitWarpMeshU; exports.splitWarpMeshV = splitWarpMeshV; exports.removeWarpMeshSplitU = removeWarpMeshSplitU; exports.removeWarpMeshSplitV = removeWarpMeshSplitV; exports.mapWarpMeshPoints = mapWarpMeshPoints; exports.resizeWarpMesh = resizeWarpMesh; exports.warpMeshControlBounds = warpMeshControlBounds; exports.warpMeshParamAt = warpMeshParamAt; exports.dragWarpMeshPoint = dragWarpMeshPoint; exports.pullWarpMesh = pullWarpMesh; exports.warpMeshEditPoints = warpMeshEditPoints; exports.warpMeshGridCurves = warpMeshGridCurves; exports.vectorMeshFromOutline = vectorMeshFromOutline; exports.vectorMeshOutline = vectorMeshOutline; exports.VECTOR_EFFECT_DEFAULTS = VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_PARAM_SPECS = VECTOR_EFFECT_PARAM_SPECS; exports.vectorEnvelopeMesh = vectorEnvelopeMesh; exports.vectorEnvelopeMap = vectorEnvelopeMap; exports.normalizeVectorEffectParams = normalizeVectorEffectParams; exports.createVectorEffect = createVectorEffect; exports.activeVectorEffects = activeVectorEffects; exports.hasOwnVectorAppearance = hasOwnVectorAppearance; exports.hasVectorAppearance = hasVectorAppearance; exports.isVectorLiveBoolean = isVectorLiveBoolean; exports.vectorOperandOperation = vectorOperandOperation; exports.vectorLiveBooleanSteps = vectorLiveBooleanSteps; exports.clearVectorLiveBooleanCache = clearVectorLiveBooleanCache; exports.foldVectorBooleanOperands = foldVectorBooleanOperands; exports.applyVectorEffects = applyVectorEffects; exports.vectorInstanceDrawn = vectorInstanceDrawn; exports.vectorChildAppearanceShapes = vectorChildAppearanceShapes; exports.vectorEffectInputPaths = vectorEffectInputPaths; exports.vectorEffectInputBounds = vectorEffectInputBounds; exports.vectorNodeEnvelope = vectorNodeEnvelope; exports.vectorEnvelopeFrame = vectorEnvelopeFrame; exports.vectorAppearanceShapes = vectorAppearanceShapes; exports.vectorAppearanceOutline = vectorAppearanceOutline; exports.vectorAppearanceNodes = vectorAppearanceNodes; exports.expandVectorAppearance = expandVectorAppearance; exports.expandVectorAppearances = expandVectorAppearances; exports.sanitizeVectorEffects = sanitizeVectorEffects; exports.transformVectorEffects = transformVectorEffects; exports.vectorEnteredGroups = vectorEnteredGroups; exports.isVectorConnector = isVectorConnector; exports.vectorConnectionSites = vectorConnectionSites; exports.nearestVectorConnectionSite = nearestVectorConnectionSite; exports.vectorConnectorWorldAnchors = vectorConnectorWorldAnchors; exports.routeVectorConnector = routeVectorConnector; exports.rerouteVectorConnectors = rerouteVectorConnectors; exports.sanitizeVectorConnector = sanitizeVectorConnector; exports.VECTOR_CONNECTOR_ROUTE_LABELS = VECTOR_CONNECTOR_ROUTE_LABELS; exports.VECTOR_CONNECTOR_SIDE_LABELS = VECTOR_CONNECTOR_SIDE_LABELS; exports.getVectorConnectorPanel = getVectorConnectorPanel; exports.vectorConnectorTargetAt = vectorConnectorTargetAt; exports.vectorStrokeGradientDefs = vectorStrokeGradientDefs; exports.vectorCornersAttribute = vectorCornersAttribute; exports.applyVectorCornersAttribute = applyVectorCornersAttribute; exports.vectorPathLocalBounds = vectorPathLocalBounds; exports.vectorPaintToSvg = vectorPaintToSvg; exports.vectorStrokeSvgParts = vectorStrokeSvgParts; exports.vectorNodeLocalPaintBounds = vectorNodeLocalPaintBounds; exports.vectorNodeFilterSvg = vectorNodeFilterSvg; exports.widthProfileToAttribute = widthProfileToAttribute; exports.widthProfileFromAttribute = widthProfileFromAttribute; exports.vectorDocumentToSvg = vectorDocumentToSvg; exports.parseSvgTransform = parseSvgTransform; exports.parseVectorSvg = parseVectorSvg; exports.VECTOR_SPATIAL_MIN = VECTOR_SPATIAL_MIN; exports.VectorRTree = VectorRTree; exports.vectorNodePaintBox = vectorNodePaintBox; exports.vectorSpatialIndex = vectorSpatialIndex; exports.vectorNodesNear = vectorNodesNear; exports.cloneAnchor = cloneAnchor; exports.cloneSubpath = cloneSubpath; exports.cloneVectorNode = cloneVectorNode; exports.cloneVectorDocument = cloneVectorDocument; exports.hasPaint = hasPaint; exports.subpathSegmentCount = subpathSegmentCount; exports.subpathSegment = subpathSegment; exports.subpathsToBezier = subpathsToBezier; exports.vectorNodeToBezier = vectorNodeToBezier; exports.vectorPathData = vectorPathData; exports.inferAnchorType = inferAnchorType; exports.bezierToSubpaths = bezierToSubpaths; exports.walkVectorNodes = walkVectorNodes; exports.findVectorNode = findVectorNode; exports.locateVectorNode = locateVectorNode; exports.collectPaintedNodes = collectPaintedNodes; exports.collectPathNodes = collectPathNodes; exports.nodeMatrix = nodeMatrix; exports.vectorPathWorldBezier = vectorPathWorldBezier; exports.vectorNodeBounds = vectorNodeBounds; exports.unionBounds = unionBounds; exports.boundsIntersect = boundsIntersect; exports.boundsFromPoints = boundsFromPoints; exports.hitTestVectorNode = hitTestVectorNode; exports.vectorStrokeOutline = vectorStrokeOutline; exports.hitTestVectorNodes = hitTestVectorNodes; exports.nearestSegment = nearestSegment; exports.transformVectorNode = transformVectorNode; exports.vectorNodeRotation = vectorNodeRotation; exports.vectorWorldMatrix = vectorWorldMatrix; exports.vectorParentMatrix = vectorParentMatrix; exports.translateAnchor = translateAnchor; exports.moveAnchorHandle = moveAnchorHandle; exports.convertAnchor = convertAnchor; exports.insertAnchor = insertAnchor; exports.removeAnchors = removeAnchors; exports.reverseSubpath = reverseSubpath; exports.KAPPA = KAPPA2; exports.rectSubpath = rectSubpath; exports.ellipseSubpath = ellipseSubpath; exports.polygonSubpath = polygonSubpath; exports.starSubpath = starSubpath; exports.lineSubpath = lineSubpath; exports.roundSubpaths = roundSubpaths;
|
|
10040
|
-
//# sourceMappingURL=chunk-
|
|
10040
|
+
//# sourceMappingURL=chunk-QQKTOA4U.cjs.map
|