@pixerate/editor-react 0.96.0 → 0.97.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/animation-editor/index.cjs +22 -4
- package/dist/animation-editor/index.js +1 -1
- package/dist/canvas/index.cjs +22 -4
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-IY6YOY5B.js → chunk-NC4RLZTK.js} +1 -1
- package/dist/chunk-Q7LAFHGP.js +655 -0
- package/dist/effects/EffectAuthoringEditor.d.cts +22 -0
- package/dist/effects/EffectAuthoringEditor.d.ts +22 -0
- package/dist/effects/EffectParameters.d.cts +5 -1
- package/dist/effects/EffectParameters.d.ts +5 -1
- package/dist/effects/index.cjs +456 -4
- package/dist/effects/index.d.cts +2 -0
- package/dist/effects/index.d.ts +2 -0
- package/dist/effects/index.js +5 -1
- package/dist/effects/useEffectAuthoring.d.cts +6 -0
- package/dist/effects/useEffectAuthoring.d.ts +6 -0
- package/dist/image-editor/index.cjs +22 -4
- package/dist/image-editor/index.js +2 -2
- package/dist/index.cjs +22 -4
- package/dist/index.js +2 -2
- package/dist/paint-editor/index.cjs +22 -4
- package/dist/paint-editor/index.js +1 -1
- package/dist/vector/index.cjs +22 -4
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/index.cjs +22 -4
- package/dist/video-editor/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-GLSOQNQR.js +0 -205
|
@@ -2684,13 +2684,24 @@ function ParameterFieldControl({ field, value, onChange, resolveFile, ...rest })
|
|
|
2684
2684
|
|
|
2685
2685
|
// src/effects/EffectParameters.tsx
|
|
2686
2686
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2687
|
-
function EffectParameters({
|
|
2687
|
+
function EffectParameters({
|
|
2688
|
+
description,
|
|
2689
|
+
values,
|
|
2690
|
+
onChange,
|
|
2691
|
+
onReset,
|
|
2692
|
+
keyframed,
|
|
2693
|
+
onPreset,
|
|
2694
|
+
onPresetName,
|
|
2695
|
+
renderControlAddon,
|
|
2696
|
+
disabled = false,
|
|
2697
|
+
className = ""
|
|
2698
|
+
}) {
|
|
2688
2699
|
const fields = (0, import_react19.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
|
|
2689
2700
|
const idBase = (0, import_react19.useId)();
|
|
2690
2701
|
const gesture = import_react19.default.useRef(null);
|
|
2691
2702
|
const count = import_react19.default.useRef(0);
|
|
2692
2703
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `space-y-2 ${className}`, "data-effect-parameters": description.id, children: [
|
|
2693
|
-
onPreset && description.presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2704
|
+
(onPreset || onPresetName) && description.presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2694
2705
|
"select",
|
|
2695
2706
|
{
|
|
2696
2707
|
className: "w-full rounded border border-border bg-transparent px-1 py-0.5 text-xs",
|
|
@@ -2698,8 +2709,14 @@ function EffectParameters({ description, values, onChange, onReset, keyframed, o
|
|
|
2698
2709
|
value: "",
|
|
2699
2710
|
disabled,
|
|
2700
2711
|
onChange: (e) => {
|
|
2701
|
-
const
|
|
2702
|
-
if (
|
|
2712
|
+
const name = e.currentTarget.value;
|
|
2713
|
+
if (!name) return;
|
|
2714
|
+
if (onPresetName) {
|
|
2715
|
+
onPresetName(name);
|
|
2716
|
+
} else if (onPreset) {
|
|
2717
|
+
const preset = description.presets.find((p) => p.name === name);
|
|
2718
|
+
if (preset) onPreset({ ...description.defaults, ...preset.values });
|
|
2719
|
+
}
|
|
2703
2720
|
},
|
|
2704
2721
|
children: [
|
|
2705
2722
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "", children: "Presets\u2026" }),
|
|
@@ -2717,6 +2734,7 @@ function EffectParameters({ description, values, onChange, onReset, keyframed, o
|
|
|
2717
2734
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
2718
2735
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: inputId, className: "min-w-0 flex-1 truncate text-xs font-medium", title: field.description, children: label }),
|
|
2719
2736
|
keyed && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-[10px] text-muted-foreground", children: "keyframed" }),
|
|
2737
|
+
renderControlAddon?.(field.id),
|
|
2720
2738
|
onReset && changed && !disabled && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "rounded px-1 text-[11px] text-muted-foreground hover:text-foreground", "aria-label": `Reset ${label}`, onClick: () => onReset(field.id), children: "\u21BA" })
|
|
2721
2739
|
] }),
|
|
2722
2740
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
package/dist/canvas/index.cjs
CHANGED
|
@@ -3396,13 +3396,24 @@ function ParameterFieldControl({ field, value, onChange, resolveFile, ...rest })
|
|
|
3396
3396
|
|
|
3397
3397
|
// src/effects/EffectParameters.tsx
|
|
3398
3398
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3399
|
-
function EffectParameters({
|
|
3399
|
+
function EffectParameters({
|
|
3400
|
+
description,
|
|
3401
|
+
values,
|
|
3402
|
+
onChange,
|
|
3403
|
+
onReset,
|
|
3404
|
+
keyframed,
|
|
3405
|
+
onPreset,
|
|
3406
|
+
onPresetName,
|
|
3407
|
+
renderControlAddon,
|
|
3408
|
+
disabled = false,
|
|
3409
|
+
className = ""
|
|
3410
|
+
}) {
|
|
3400
3411
|
const fields = (0, import_react26.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
|
|
3401
3412
|
const idBase = (0, import_react26.useId)();
|
|
3402
3413
|
const gesture = import_react26.default.useRef(null);
|
|
3403
3414
|
const count = import_react26.default.useRef(0);
|
|
3404
3415
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `space-y-2 ${className}`, "data-effect-parameters": description.id, children: [
|
|
3405
|
-
onPreset && description.presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3416
|
+
(onPreset || onPresetName) && description.presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3406
3417
|
"select",
|
|
3407
3418
|
{
|
|
3408
3419
|
className: "w-full rounded border border-border bg-transparent px-1 py-0.5 text-xs",
|
|
@@ -3410,8 +3421,14 @@ function EffectParameters({ description, values, onChange, onReset, keyframed, o
|
|
|
3410
3421
|
value: "",
|
|
3411
3422
|
disabled,
|
|
3412
3423
|
onChange: (e) => {
|
|
3413
|
-
const
|
|
3414
|
-
if (
|
|
3424
|
+
const name = e.currentTarget.value;
|
|
3425
|
+
if (!name) return;
|
|
3426
|
+
if (onPresetName) {
|
|
3427
|
+
onPresetName(name);
|
|
3428
|
+
} else if (onPreset) {
|
|
3429
|
+
const preset = description.presets.find((p) => p.name === name);
|
|
3430
|
+
if (preset) onPreset({ ...description.defaults, ...preset.values });
|
|
3431
|
+
}
|
|
3415
3432
|
},
|
|
3416
3433
|
children: [
|
|
3417
3434
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "Presets\u2026" }),
|
|
@@ -3429,6 +3446,7 @@ function EffectParameters({ description, values, onChange, onReset, keyframed, o
|
|
|
3429
3446
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
3430
3447
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: inputId, className: "min-w-0 flex-1 truncate text-xs font-medium", title: field.description, children: label }),
|
|
3431
3448
|
keyed && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-[10px] text-muted-foreground", children: "keyframed" }),
|
|
3449
|
+
renderControlAddon?.(field.id),
|
|
3432
3450
|
onReset && changed && !disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "rounded px-1 text-[11px] text-muted-foreground hover:text-foreground", "aria-label": `Reset ${label}`, onClick: () => onReset(field.id), children: "\u21BA" })
|
|
3433
3451
|
] }),
|
|
3434
3452
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
package/dist/canvas/index.js
CHANGED