@pixerate/editor-react 0.114.1 → 0.114.3
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/animation-editor/index.cjs +342 -215
- package/dist/animation-editor/index.js +2 -2
- package/dist/canvas/index.cjs +520 -393
- package/dist/canvas/index.js +2 -2
- package/dist/chart/index.cjs +2 -2
- package/dist/chart/index.js +1 -1
- package/dist/{chunk-5LFQ2UQZ.js → chunk-354TA5QV.js} +221 -101
- package/dist/{chunk-2INOKIJN.js → chunk-SH63DFOO.js} +345 -297
- package/dist/{chunk-BWEARAWR.js → chunk-TOGMXZM4.js} +40 -18
- package/dist/{chunk-N2F53ESC.js → chunk-VUSYAHIU.js} +2 -2
- package/dist/effects/EffectParameters.d.cts +4 -1
- package/dist/effects/EffectParameters.d.ts +4 -1
- package/dist/effects/index.cjs +348 -221
- package/dist/effects/index.js +2 -2
- package/dist/image-editor/ImageEffectControls.d.cts +4 -1
- package/dist/image-editor/ImageEffectControls.d.ts +4 -1
- package/dist/image-editor/ImageProviderEffectsPanel.d.cts +4 -1
- package/dist/image-editor/ImageProviderEffectsPanel.d.ts +4 -1
- package/dist/image-editor/controls/parameterControls.d.cts +4 -0
- package/dist/image-editor/controls/parameterControls.d.ts +4 -0
- package/dist/image-editor/index.cjs +868 -697
- package/dist/image-editor/index.js +3 -3
- package/dist/index.cjs +1390 -1219
- package/dist/index.js +4 -4
- package/dist/paint-editor/index.cjs +335 -208
- package/dist/paint-editor/index.js +2 -2
- package/dist/parameters/ParametersPanel.d.cts +4 -1
- package/dist/parameters/ParametersPanel.d.ts +4 -1
- package/dist/parameters/controls.d.cts +72 -0
- package/dist/parameters/controls.d.ts +72 -0
- package/dist/parameters/fields.d.cts +19 -6
- package/dist/parameters/fields.d.ts +19 -6
- package/dist/parameters/index.cjs +350 -183
- package/dist/parameters/index.d.cts +1 -0
- package/dist/parameters/index.d.ts +1 -0
- package/dist/parameters/index.js +70 -14
- package/dist/vector/index.cjs +321 -194
- package/dist/vector/index.js +2 -2
- package/dist/video-editor/index.cjs +418 -291
- package/dist/video-editor/index.js +2 -2
- package/package.json +3 -3
package/dist/parameters/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
KeyframeDiamond,
|
|
6
6
|
ParameterColor,
|
|
7
7
|
ParameterCommitInput,
|
|
8
|
+
ParameterComponentsProvider,
|
|
8
9
|
ParameterFieldControl,
|
|
9
10
|
ParameterImage,
|
|
10
11
|
ParameterNumberInput,
|
|
@@ -14,8 +15,14 @@ import {
|
|
|
14
15
|
ParameterToggle,
|
|
15
16
|
ParameterVector,
|
|
16
17
|
parameterButtonClass,
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
parameterButtonStyle,
|
|
19
|
+
parameterInputClass,
|
|
20
|
+
parameterInputStyle,
|
|
21
|
+
parameterRangeStyle,
|
|
22
|
+
parameterSelectStyle,
|
|
23
|
+
resolveParameterComponents,
|
|
24
|
+
useParameterComponents
|
|
25
|
+
} from "../chunk-354TA5QV.js";
|
|
19
26
|
import "../chunk-KIRIU53A.js";
|
|
20
27
|
import "../chunk-3I7FOSLF.js";
|
|
21
28
|
import {
|
|
@@ -94,7 +101,8 @@ function FieldRow({
|
|
|
94
101
|
idBase,
|
|
95
102
|
showKeyframes,
|
|
96
103
|
showFieldReset,
|
|
97
|
-
resolveFile
|
|
104
|
+
resolveFile,
|
|
105
|
+
components
|
|
98
106
|
}) {
|
|
99
107
|
const label = parameterLabel(field);
|
|
100
108
|
const inputId = `${idBase}-${field.id}`;
|
|
@@ -125,6 +133,7 @@ function FieldRow({
|
|
|
125
133
|
value,
|
|
126
134
|
id: inputId,
|
|
127
135
|
resolveFile,
|
|
136
|
+
components,
|
|
128
137
|
onChange: (v) => controller.setValue(field.id, v),
|
|
129
138
|
onGestureStart: () => controller.beginGesture(field.id),
|
|
130
139
|
onGestureEnd: () => controller.endGesture()
|
|
@@ -133,11 +142,12 @@ function FieldRow({
|
|
|
133
142
|
error && /* @__PURE__ */ jsx("p", { role: "alert", className: "text-[11px] text-destructive", children: error })
|
|
134
143
|
] });
|
|
135
144
|
}
|
|
136
|
-
function PresetBar({ controller, state }) {
|
|
145
|
+
function PresetBar({ controller, state, components }) {
|
|
137
146
|
const [saving, setSaving] = useState(false);
|
|
138
147
|
const [name, setName] = useState("");
|
|
139
148
|
const [message, setMessage] = useState(null);
|
|
140
149
|
const active = state.presets.find((p) => p.name === state.activePreset);
|
|
150
|
+
const CustomPresetSelect = resolveParameterComponents(components, useParameterComponents()).select;
|
|
141
151
|
const save = (e) => {
|
|
142
152
|
e.preventDefault();
|
|
143
153
|
const result = controller.savePreset(name);
|
|
@@ -149,21 +159,36 @@ function PresetBar({ controller, state }) {
|
|
|
149
159
|
};
|
|
150
160
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", "data-parameter-presets": "", children: [
|
|
151
161
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
152
|
-
/* @__PURE__ */
|
|
162
|
+
CustomPresetSelect ? /* @__PURE__ */ jsx(
|
|
163
|
+
CustomPresetSelect,
|
|
164
|
+
{
|
|
165
|
+
"aria-label": "Preset",
|
|
166
|
+
label: "Preset",
|
|
167
|
+
className: parameterInputClass,
|
|
168
|
+
style: parameterSelectStyle,
|
|
169
|
+
value: state.activePreset ?? "",
|
|
170
|
+
options: [
|
|
171
|
+
{ value: "", label: state.presets.length ? "Presets\u2026" : "No presets" },
|
|
172
|
+
...state.presets.map((p) => ({ value: p.name, label: p.name, description: p.description }))
|
|
173
|
+
],
|
|
174
|
+
onChange: (val) => val && controller.applyPreset(String(val))
|
|
175
|
+
}
|
|
176
|
+
) : /* @__PURE__ */ jsxs(
|
|
153
177
|
"select",
|
|
154
178
|
{
|
|
155
179
|
"aria-label": "Preset",
|
|
156
180
|
className: parameterInputClass,
|
|
181
|
+
style: parameterSelectStyle,
|
|
157
182
|
value: state.activePreset ?? "",
|
|
158
183
|
onChange: (e) => e.target.value && controller.applyPreset(e.target.value),
|
|
159
184
|
children: [
|
|
160
|
-
/* @__PURE__ */ jsx("option", { value: "", children: state.presets.length ? "Presets\u2026" : "No presets" }),
|
|
161
|
-
state.presets.map((p) => /* @__PURE__ */ jsx("option", { value: p.name, title: p.description, children: p.name }, p.name))
|
|
185
|
+
/* @__PURE__ */ jsx("option", { value: "", style: parameterSelectStyle, children: state.presets.length ? "Presets\u2026" : "No presets" }),
|
|
186
|
+
state.presets.map((p) => /* @__PURE__ */ jsx("option", { value: p.name, title: p.description, style: parameterSelectStyle, children: p.name }, p.name))
|
|
162
187
|
]
|
|
163
188
|
}
|
|
164
189
|
),
|
|
165
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: parameterButtonClass, onClick: () => setSaving((s) => !s), "aria-expanded": saving, children: "Save\u2026" }),
|
|
166
|
-
active && !active.builtIn && /* @__PURE__ */ jsx("button", { type: "button", className: parameterButtonClass, "aria-label": `Delete preset ${active.name}`, onClick: () => controller.deletePreset(active.name), children: "Delete" })
|
|
190
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: parameterButtonClass, style: parameterButtonStyle, onClick: () => setSaving((s) => !s), "aria-expanded": saving, children: "Save\u2026" }),
|
|
191
|
+
active && !active.builtIn && /* @__PURE__ */ jsx("button", { type: "button", className: parameterButtonClass, style: parameterButtonStyle, "aria-label": `Delete preset ${active.name}`, onClick: () => controller.deletePreset(active.name), children: "Delete" })
|
|
167
192
|
] }),
|
|
168
193
|
saving && /* @__PURE__ */ jsxs("form", { className: "flex items-center gap-1.5", onSubmit: save, children: [
|
|
169
194
|
/* @__PURE__ */ jsx(
|
|
@@ -173,11 +198,12 @@ function PresetBar({ controller, state }) {
|
|
|
173
198
|
"aria-label": "Preset name",
|
|
174
199
|
placeholder: "Preset name",
|
|
175
200
|
className: parameterInputClass,
|
|
201
|
+
style: parameterInputStyle,
|
|
176
202
|
value: name,
|
|
177
203
|
onChange: (e) => setName(e.target.value)
|
|
178
204
|
}
|
|
179
205
|
),
|
|
180
|
-
/* @__PURE__ */ jsx("button", { type: "submit", className: parameterButtonClass, children: "Save" })
|
|
206
|
+
/* @__PURE__ */ jsx("button", { type: "submit", className: parameterButtonClass, style: parameterButtonStyle, children: "Save" })
|
|
181
207
|
] }),
|
|
182
208
|
message && /* @__PURE__ */ jsx("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
|
|
183
209
|
] });
|
|
@@ -192,6 +218,7 @@ function ParametersPanel({
|
|
|
192
218
|
resolveFile,
|
|
193
219
|
emptyMessage = "No parameters.",
|
|
194
220
|
className = "",
|
|
221
|
+
components,
|
|
195
222
|
playback,
|
|
196
223
|
playbackId = "parameters",
|
|
197
224
|
onPlaybackReveal
|
|
@@ -220,7 +247,8 @@ function ParametersPanel({
|
|
|
220
247
|
idBase,
|
|
221
248
|
showKeyframes: keys,
|
|
222
249
|
showFieldReset,
|
|
223
|
-
resolveFile
|
|
250
|
+
resolveFile,
|
|
251
|
+
components
|
|
224
252
|
},
|
|
225
253
|
item.id
|
|
226
254
|
);
|
|
@@ -258,6 +286,7 @@ function ParametersPanel({
|
|
|
258
286
|
{
|
|
259
287
|
type: "button",
|
|
260
288
|
className: parameterButtonClass,
|
|
289
|
+
style: parameterButtonStyle,
|
|
261
290
|
disabled: !state.canUndo,
|
|
262
291
|
title: state.canUndo ? `Undo ${state.undoLabel}` : "Nothing to undo",
|
|
263
292
|
onClick: () => controller.undo(),
|
|
@@ -269,17 +298,37 @@ function ParametersPanel({
|
|
|
269
298
|
{
|
|
270
299
|
type: "button",
|
|
271
300
|
className: parameterButtonClass,
|
|
301
|
+
style: parameterButtonStyle,
|
|
272
302
|
disabled: !state.canRedo,
|
|
273
303
|
title: state.canRedo ? `Redo ${state.redoLabel}` : "Nothing to redo",
|
|
274
304
|
onClick: () => controller.redo(),
|
|
275
305
|
children: "Redo"
|
|
276
306
|
}
|
|
277
307
|
),
|
|
278
|
-
/* @__PURE__ */ jsx(
|
|
279
|
-
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
"button",
|
|
310
|
+
{
|
|
311
|
+
type: "button",
|
|
312
|
+
className: parameterButtonClass,
|
|
313
|
+
style: parameterButtonStyle,
|
|
314
|
+
disabled: !state.modified,
|
|
315
|
+
onClick: () => controller.reset(),
|
|
316
|
+
children: "Reset"
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
/* @__PURE__ */ jsx(
|
|
320
|
+
"button",
|
|
321
|
+
{
|
|
322
|
+
type: "button",
|
|
323
|
+
className: parameterButtonClass,
|
|
324
|
+
style: parameterButtonStyle,
|
|
325
|
+
onClick: () => controller.randomize(),
|
|
326
|
+
children: "Randomize"
|
|
327
|
+
}
|
|
328
|
+
)
|
|
280
329
|
] })
|
|
281
330
|
] }),
|
|
282
|
-
showPresets && /* @__PURE__ */ jsx(PresetBar, { controller, state }),
|
|
331
|
+
showPresets && /* @__PURE__ */ jsx(PresetBar, { controller, state, components }),
|
|
283
332
|
state.fields.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: emptyMessage }) : renderItems(state.schema.fields),
|
|
284
333
|
playing && /* @__PURE__ */ jsx(PresenceLayer, { presence: agentPresence })
|
|
285
334
|
] });
|
|
@@ -288,6 +337,7 @@ export {
|
|
|
288
337
|
KeyframeDiamond,
|
|
289
338
|
ParameterColor,
|
|
290
339
|
ParameterCommitInput,
|
|
340
|
+
ParameterComponentsProvider,
|
|
291
341
|
ParameterFieldControl,
|
|
292
342
|
ParameterImage,
|
|
293
343
|
ParameterNumberInput,
|
|
@@ -298,8 +348,14 @@ export {
|
|
|
298
348
|
ParameterVector,
|
|
299
349
|
ParametersPanel,
|
|
300
350
|
parameterButtonClass,
|
|
351
|
+
parameterButtonStyle,
|
|
301
352
|
parameterInputClass,
|
|
353
|
+
parameterInputStyle,
|
|
354
|
+
parameterRangeStyle,
|
|
355
|
+
parameterSelectStyle,
|
|
356
|
+
resolveParameterComponents,
|
|
302
357
|
useParameterCommands,
|
|
358
|
+
useParameterComponents,
|
|
303
359
|
useParameters,
|
|
304
360
|
useParametersController,
|
|
305
361
|
useParametersState
|