@pixerate/flair 0.15.0 → 0.17.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +33 -6
  3. package/dist/catalog/index.d.ts +3 -3
  4. package/dist/catalog/index.js +6 -2
  5. package/dist/{chunk-SHHAIWUR.js → chunk-LKQM3GSQ.js} +12 -12
  6. package/dist/{chunk-KWNFZ5NC.js → chunk-LURJMWYM.js} +237 -185
  7. package/dist/{chunk-KWNFZ5NC.js.map → chunk-LURJMWYM.js.map} +1 -1
  8. package/dist/{chunk-DVVQRZJ5.js → chunk-MILF5MRS.js} +11 -2
  9. package/dist/chunk-MILF5MRS.js.map +1 -0
  10. package/dist/{chunk-YLJWC4N2.js → chunk-PMVJP5I4.js} +2 -2
  11. package/dist/{chunk-4RGHZWQC.js → chunk-RM3I6WZH.js} +2 -2
  12. package/dist/{chunk-4RGHZWQC.js.map → chunk-RM3I6WZH.js.map} +1 -1
  13. package/dist/{chunk-FIJOMGPG.js → chunk-UP6QQVRS.js} +2 -2
  14. package/dist/{chunk-WC3VADZC.js → chunk-VYOMXE6I.js} +46 -4
  15. package/dist/chunk-VYOMXE6I.js.map +1 -0
  16. package/dist/cli.js +7 -7
  17. package/dist/{controls-Syr6drzO.d.ts → controls-Ec6P0Vpy.d.ts} +9 -2
  18. package/dist/editor/index.d.ts +3 -3
  19. package/dist/editor/index.js +7 -7
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +80 -76
  22. package/dist/index.js.map +1 -1
  23. package/dist/node.d.ts +1 -1
  24. package/dist/node.js +2 -2
  25. package/dist/react/index.d.ts +14 -3
  26. package/dist/react/index.js +18 -9
  27. package/dist/react/index.js.map +1 -1
  28. package/dist/recorder-HKFFHQES.js +10 -0
  29. package/dist/{renderer-SNYZu__R.d.ts → renderer-Bm0oQ7Bw.d.ts} +1 -1
  30. package/dist/svelte/index.d.ts +146 -0
  31. package/dist/svelte/index.js +195 -0
  32. package/dist/svelte/index.js.map +1 -0
  33. package/dist/{types-9J6NWaN3.d.ts → types-C7g8-lTX.d.ts} +9 -3
  34. package/dist/vector/index.d.ts +27 -1
  35. package/dist/vector/index.js +4 -2
  36. package/package.json +13 -3
  37. package/dist/chunk-DVVQRZJ5.js.map +0 -1
  38. package/dist/chunk-WC3VADZC.js.map +0 -1
  39. package/dist/recorder-KEX3U35D.js +0 -10
  40. /package/dist/{chunk-SHHAIWUR.js.map → chunk-LKQM3GSQ.js.map} +0 -0
  41. /package/dist/{chunk-YLJWC4N2.js.map → chunk-PMVJP5I4.js.map} +0 -0
  42. /package/dist/{chunk-FIJOMGPG.js.map → chunk-UP6QQVRS.js.map} +0 -0
  43. /package/dist/{recorder-KEX3U35D.js.map → recorder-HKFFHQES.js.map} +0 -0
@@ -52,6 +52,13 @@ declare function componentCount(type: ControlType): number;
52
52
  declare function humanise(name: string): string;
53
53
  /** "#77C16A" (or "#7c6") → [0.467, 0.757, 0.416]; null when it is not a hex colour. */
54
54
  declare function hexToRgb(hex: string): number[] | null;
55
+ /**
56
+ * A CSS colour as [r, g, b] (0–1), or [r, g, b, a] when it gives an alpha
57
+ * below 1: hex (`#7c6`, `#7c6f`, `#77C16A`, `#77C16AFF`), `rgb()`/`rgba()`
58
+ * and `hsl()`/`hsla()`, with commas or spaces, numbers or percentages.
59
+ * Null for anything else (names like "red" and `currentColor` included).
60
+ */
61
+ declare function parseColor(css: string): number[] | null;
55
62
  /** [0.467, 0.757, 0.416] → "#77c16a". Components are clamped to 0–1; a fourth (alpha) is ignored. */
56
63
  declare function rgbToHex(rgb: number[]): string;
57
64
  /**
@@ -73,7 +80,7 @@ type ControlCheck = {
73
80
  };
74
81
  /**
75
82
  * Checks a value from outside (an agent's tool call, a URL, a form) against a
76
- * control. Colours also accept "#RRGGBB"; `int` values are rounded. Images
83
+ * control. Colours also accept CSS colours (see {@link parseColor}); `int` values are rounded. Images
77
84
  * take a URL: `https:`, `http:`, `data:image/…`, `blob:` or a relative path
78
85
  * ("" for none).
79
86
  */
@@ -95,4 +102,4 @@ declare function imageUrls(controls: ControlDef[], values: Record<string, Contro
95
102
  */
96
103
  declare function describeValue(control: ControlDef, value: ControlValue): unknown;
97
104
 
98
- export { type ControlValue as C, type TextureSettings as T, type ControlDef as a, type ControlType as b, type ControlCheck as c, checkControlValue as d, coerceControlValue as e, componentCount as f, controlValue as g, describeValue as h, hexToRgb as i, humanise as j, imageUrls as k, isImageUrl as l, parseControls as p, rgbToHex as r };
105
+ export { type ControlValue as C, type TextureSettings as T, type ControlDef as a, type ControlType as b, type ControlCheck as c, checkControlValue as d, coerceControlValue as e, componentCount as f, controlValue as g, describeValue as h, hexToRgb as i, humanise as j, imageUrls as k, isImageUrl as l, parseControls as m, parseColor as p, rgbToHex as r };
@@ -1,11 +1,11 @@
1
- import { e as VectorControl, c as EffectPreset, E as EffectDefinition } from '../types-9J6NWaN3.js';
2
- import { C as ControlValue, a as ControlDef, b as ControlType } from '../controls-Syr6drzO.js';
1
+ import { e as VectorControl, c as EffectPreset, E as EffectDefinition } from '../types-C7g8-lTX.js';
2
+ import { C as ControlValue, a as ControlDef, b as ControlType } from '../controls-Ec6P0Vpy.js';
3
3
  import { S as SvgMotion, C as Clock } from '../svg-XugR-6Ec.js';
4
4
  import { AnimationEasingPreset, AnimationEasing, AnimationTrack, AnimationKeyframe, cubicBezierAt as cubicBezierAt$1, evaluateEasing as evaluateEasing$1 } from '@pixerate/editor/animation';
5
5
  export { CubicBezierEasing, SpringEasing } from '@pixerate/editor/animation';
6
6
  import { CommandRegistry, CommandSpec } from '@pixerate/editor/commands';
7
7
  import { HistoryManager, HistoryState } from '@pixerate/editor/history';
8
- import { C as CompileError, a as CompileStatus } from '../renderer-SNYZu__R.js';
8
+ import { C as CompileError, a as CompileStatus } from '../renderer-Bm0oQ7Bw.js';
9
9
  import { AgentToolProvider, McpToolResult, ToolRegistryOptions, ToolRegistry, McpToolDefinition } from '@pixerate/editor/tools';
10
10
  import { ParameterImageOption, ParametersController, ParameterField, ParameterSchema, ParameterValue, ParameterValues } from '@pixerate/editor/parameters';
11
11
 
@@ -5,25 +5,25 @@ import {
5
5
  renderVectorEffect,
6
6
  vectorControlIssues,
7
7
  vectorEffectControls
8
- } from "../chunk-KWNFZ5NC.js";
8
+ } from "../chunk-LURJMWYM.js";
9
9
  import {
10
10
  svgMotionIssues,
11
11
  svgView
12
- } from "../chunk-4RGHZWQC.js";
12
+ } from "../chunk-RM3I6WZH.js";
13
13
  import "../chunk-OHW7UG6D.js";
14
14
  import {
15
15
  BUILTIN_UNIFORMS,
16
16
  interpolateOklab
17
- } from "../chunk-YLJWC4N2.js";
17
+ } from "../chunk-PMVJP5I4.js";
18
18
  import "../chunk-EHDJ3CPJ.js";
19
+ import {
20
+ realClock
21
+ } from "../chunk-WMZQCUFJ.js";
19
22
  import {
20
23
  checkControlValue,
21
24
  controlValue,
22
25
  parseControls
23
- } from "../chunk-WC3VADZC.js";
24
- import {
25
- realClock
26
- } from "../chunk-WMZQCUFJ.js";
26
+ } from "../chunk-VYOMXE6I.js";
27
27
 
28
28
  // src/editor/timeline.ts
29
29
  import {
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as ControlValue, a as ControlDef } from './controls-Syr6drzO.js';
2
- export { c as ControlCheck, b as ControlType, T as TextureSettings, d as checkControlValue, e as coerceControlValue, f as componentCount, g as controlValue, h as describeValue, i as hexToRgb, j as humanise, k as imageUrls, l as isImageUrl, p as parseControls, r as rgbToHex } from './controls-Syr6drzO.js';
3
- export { B as BUILTIN_UNIFORMS, C as CompileError, b as CompileResult, a as CompileStatus, c as CompiledShader, F as FrameState, I as ImageLoadError, R as RendererStats, S as SVG_EDGE, d as ShaderCompileError, e as ShaderRenderer, f as ShaderRendererOptions, T as TextureCache, g as TextureSource, V as VERTEX_SOURCE, h as applyTextureSettings, i as compileShader, j as createContext, k as drawFrame, l as formatCompileError, m as isSvgUrl, n as loadImage, p as parseCompileLog, o as preloadImages, r as releaseImages, q as resetGlCaches, s as sizeSvg, w as wrapSource } from './renderer-SNYZu__R.js';
1
+ import { C as ControlValue, a as ControlDef } from './controls-Ec6P0Vpy.js';
2
+ export { c as ControlCheck, b as ControlType, T as TextureSettings, d as checkControlValue, e as coerceControlValue, f as componentCount, g as controlValue, h as describeValue, i as hexToRgb, j as humanise, k as imageUrls, l as isImageUrl, p as parseColor, m as parseControls, r as rgbToHex } from './controls-Ec6P0Vpy.js';
3
+ export { B as BUILTIN_UNIFORMS, C as CompileError, b as CompileResult, a as CompileStatus, c as CompiledShader, F as FrameState, I as ImageLoadError, R as RendererStats, S as SVG_EDGE, d as ShaderCompileError, e as ShaderRenderer, f as ShaderRendererOptions, T as TextureCache, g as TextureSource, V as VERTEX_SOURCE, h as applyTextureSettings, i as compileShader, j as createContext, k as drawFrame, l as formatCompileError, m as isSvgUrl, n as loadImage, p as parseCompileLog, o as preloadImages, r as releaseImages, q as resetGlCaches, s as sizeSvg, w as wrapSource } from './renderer-Bm0oQ7Bw.js';
4
4
  import { C as Clock } from './svg-XugR-6Ec.js';
5
5
  export { A as AnimateCountOptions, D as DataKey, E as EASES, c as EaseName, M as ManualClock, d as SCRAMBLE_MS, e as STEP_MS, f as SVG_PICTURE, g as SvgAnimation, h as SvgBox, i as SvgElementFrame, S as SvgMotion, b as SvgPlayer, j as SvgPlayerOptions, a as SvgTrigger, k as SvgView, l as SvgViewOptions, m as animateCount, n as defaultDataKey, o as formatCount, p as jitter, q as lerpAttr, r as lerpData, s as pageHidden, t as parseSvg, u as realClock, v as stepData, w as stepProgress, x as stepStart, y as svgDuration, z as svgFrame, B as svgMotionIssues, F as svgOpeningTag, G as svgView, H as writtenText } from './svg-XugR-6Ec.js';
6
- export { BoxAlignment, BoxFit, FittedBoxResult, FormatUnitOptions, MorphOptions, StackLayoutOptions, SvgFrameMarkupOptions, UnitFormat, computeBoxFit, formatUnit, layoutStack, morphPaths, morphSequence, parseViewBox, remap, stepVariant, svgFrameMarkup, svgViewBox } from './vector/index.js';
6
+ export { BoxAlignment, BoxFit, FittedBoxResult, FormatUnitOptions, MorphOptions, StackLayoutOptions, SvgFrameMarkupOptions, SvgInlineLayout, UnitFormat, computeBoxFit, formatUnit, layoutStack, morphPaths, morphSequence, parseViewBox, remap, stepVariant, svgFrameMarkup, svgInlineLayout, svgViewBox } from './vector/index.js';
7
7
 
8
8
  /** Controls a registered thumbnail. */
9
9
  interface ThumbnailHandle {
package/dist/index.js CHANGED
@@ -1,3 +1,13 @@
1
+ import {
2
+ calculateShotTimings,
3
+ createLottieEase,
4
+ exportCmx3600Edl,
5
+ exportFcp7Xml,
6
+ exportLottie,
7
+ exportMotn,
8
+ framesToTimecode,
9
+ timecodeToFrames
10
+ } from "./chunk-GTIAOYOK.js";
1
11
  import {
2
12
  computeBoxFit,
3
13
  formatUnit,
@@ -8,8 +18,9 @@ import {
8
18
  import {
9
19
  parseViewBox,
10
20
  svgFrameMarkup,
21
+ svgInlineLayout,
11
22
  svgViewBox
12
- } from "./chunk-DVVQRZJ5.js";
23
+ } from "./chunk-MILF5MRS.js";
13
24
  import {
14
25
  EASES,
15
26
  SCRAMBLE_MS,
@@ -31,7 +42,7 @@ import {
31
42
  svgOpeningTag,
32
43
  svgView,
33
44
  writtenText
34
- } from "./chunk-4RGHZWQC.js";
45
+ } from "./chunk-RM3I6WZH.js";
35
46
  import {
36
47
  morphPaths,
37
48
  morphSequence
@@ -49,80 +60,7 @@ import {
49
60
  standaloneHtml,
50
61
  standaloneSceneHtml,
51
62
  validateScene
52
- } from "./chunk-SHHAIWUR.js";
53
- import {
54
- BUILTIN_UNIFORMS,
55
- HOVER_SECONDS,
56
- ImageLoadError,
57
- MAX_CLICKS,
58
- PointerTracker,
59
- SVG_EDGE,
60
- ShaderCompileError,
61
- TextureCache,
62
- VERTEX_SOURCE,
63
- applyAscCdl,
64
- applyLiftGammaGain,
65
- applyTextureSettings,
66
- applyVibrance,
67
- clicksUniform,
68
- compileShader,
69
- convertColorSpace,
70
- createContext,
71
- drawFrame,
72
- formatCompileError,
73
- getColorGradingGLSL,
74
- getOklabGLSL,
75
- getWhiteBalanceGains,
76
- interpolateOklab,
77
- interpolateOklch,
78
- isSvgUrl,
79
- linearRgbToSrgb,
80
- linearSrgbToOklab,
81
- linearToSrgb,
82
- loadImage,
83
- oklabToLinearSrgb,
84
- oklabToOklch,
85
- oklabToSrgb,
86
- oklchToOklab,
87
- parseCompileLog,
88
- preloadImages,
89
- releaseImages,
90
- resetGlCaches,
91
- sizeSvg,
92
- srgbToLinear,
93
- srgbToLinearRgb,
94
- srgbToOklab,
95
- wrapSource
96
- } from "./chunk-YLJWC4N2.js";
97
- import {
98
- ALL_TRANSITION_TYPES,
99
- blendTransitionPixel,
100
- getTransitionGLSL,
101
- sampleTransition
102
- } from "./chunk-EHDJ3CPJ.js";
103
- import {
104
- checkControlValue,
105
- coerceControlValue,
106
- componentCount,
107
- controlValue,
108
- describeValue,
109
- hexToRgb,
110
- humanise,
111
- imageUrls,
112
- isImageUrl,
113
- parseControls,
114
- rgbToHex
115
- } from "./chunk-WC3VADZC.js";
116
- import {
117
- calculateShotTimings,
118
- createLottieEase,
119
- exportCmx3600Edl,
120
- exportFcp7Xml,
121
- exportLottie,
122
- exportMotn,
123
- framesToTimecode,
124
- timecodeToFrames
125
- } from "./chunk-GTIAOYOK.js";
63
+ } from "./chunk-LKQM3GSQ.js";
126
64
  import {
127
65
  CAMERA_MS,
128
66
  CAMERA_STEP_MS,
@@ -180,12 +118,76 @@ import {
180
118
  viewAt,
181
119
  visibleRect
182
120
  } from "./chunk-WAMA45G3.js";
121
+ import {
122
+ BUILTIN_UNIFORMS,
123
+ HOVER_SECONDS,
124
+ ImageLoadError,
125
+ MAX_CLICKS,
126
+ PointerTracker,
127
+ SVG_EDGE,
128
+ ShaderCompileError,
129
+ TextureCache,
130
+ VERTEX_SOURCE,
131
+ applyAscCdl,
132
+ applyLiftGammaGain,
133
+ applyTextureSettings,
134
+ applyVibrance,
135
+ clicksUniform,
136
+ compileShader,
137
+ convertColorSpace,
138
+ createContext,
139
+ drawFrame,
140
+ formatCompileError,
141
+ getColorGradingGLSL,
142
+ getOklabGLSL,
143
+ getWhiteBalanceGains,
144
+ interpolateOklab,
145
+ interpolateOklch,
146
+ isSvgUrl,
147
+ linearRgbToSrgb,
148
+ linearSrgbToOklab,
149
+ linearToSrgb,
150
+ loadImage,
151
+ oklabToLinearSrgb,
152
+ oklabToOklch,
153
+ oklabToSrgb,
154
+ oklchToOklab,
155
+ parseCompileLog,
156
+ preloadImages,
157
+ releaseImages,
158
+ resetGlCaches,
159
+ sizeSvg,
160
+ srgbToLinear,
161
+ srgbToLinearRgb,
162
+ srgbToOklab,
163
+ wrapSource
164
+ } from "./chunk-PMVJP5I4.js";
165
+ import {
166
+ ALL_TRANSITION_TYPES,
167
+ blendTransitionPixel,
168
+ getTransitionGLSL,
169
+ sampleTransition
170
+ } from "./chunk-EHDJ3CPJ.js";
183
171
  import {
184
172
  ManualClock,
185
173
  jitter,
186
174
  pageHidden,
187
175
  realClock
188
176
  } from "./chunk-WMZQCUFJ.js";
177
+ import {
178
+ checkControlValue,
179
+ coerceControlValue,
180
+ componentCount,
181
+ controlValue,
182
+ describeValue,
183
+ hexToRgb,
184
+ humanise,
185
+ imageUrls,
186
+ isImageUrl,
187
+ parseColor,
188
+ parseControls,
189
+ rgbToHex
190
+ } from "./chunk-VYOMXE6I.js";
189
191
 
190
192
  // src/time/retiming.ts
191
193
  function loopTime(t, duration, start = 0) {
@@ -1304,6 +1306,7 @@ export {
1304
1306
  oklchToOklab,
1305
1307
  overlapArea,
1306
1308
  pageHidden,
1309
+ parseColor,
1307
1310
  parseCompileLog,
1308
1311
  parseControls,
1309
1312
  parseSvg,
@@ -1350,6 +1353,7 @@ export {
1350
1353
  svgDuration,
1351
1354
  svgFrame,
1352
1355
  svgFrameMarkup,
1356
+ svgInlineLayout,
1353
1357
  svgMotionIssues,
1354
1358
  svgOpeningTag,
1355
1359
  svgView,