@pixerate/editor-react 0.61.0 → 0.63.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/{chunk-OSOGA2OJ.js → chunk-QJSMW4CM.js} +59 -3
- package/dist/{chunk-OSOGA2OJ.js.map → chunk-QJSMW4CM.js.map} +1 -1
- package/dist/image-editor/index.cjs +57 -1
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -3
- package/dist/image-editor/index.d.ts +5 -3
- package/dist/image-editor/index.js +1 -1
- package/dist/index.cjs +57 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/video-editor/index.cjs +12 -2
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.js +13 -2
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1020,7 +1020,7 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
1020
1020
|
(0, import_react6.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
1021
1021
|
const [error, setError] = (0, import_react6.useState)(null);
|
|
1022
1022
|
const state = controller.getState();
|
|
1023
|
-
const { brush, foreground, background } = state.paint;
|
|
1023
|
+
const { brush, foreground, background, mixer, mixerLoad } = state.paint;
|
|
1024
1024
|
const attempt = (fn) => {
|
|
1025
1025
|
try {
|
|
1026
1026
|
setError(null);
|
|
@@ -1081,6 +1081,62 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
1081
1081
|
},
|
|
1082
1082
|
spec.id
|
|
1083
1083
|
)),
|
|
1084
|
+
state.activeTool === "mixer" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-2 border-t border-slate-800 pt-2", role: "group", "aria-label": "Mixer Brush", "data-testid": "mixer-options", children: [
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1087
|
+
"span",
|
|
1088
|
+
{
|
|
1089
|
+
"aria-label": "Brush load",
|
|
1090
|
+
title: mixerLoad.reservoir ? `Loaded ${(0, import_image_editor7.rgbUnitToHex)(mixerLoad.reservoir)}, ${Math.round(mixerLoad.amount * 100)}% left` : "Unloaded",
|
|
1091
|
+
className: "h-6 w-6 rounded border border-slate-700",
|
|
1092
|
+
style: { background: mixerLoad.reservoir ? (0, import_image_editor7.rgbUnitToHex)(mixerLoad.reservoir) : "transparent" }
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: chip(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", title: "Empty the picked-up colour", className: chip(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
|
|
1097
|
+
] }),
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: import_image_editor7.MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1099
|
+
"button",
|
|
1100
|
+
{
|
|
1101
|
+
type: "button",
|
|
1102
|
+
"aria-pressed": mixer.mixing === m.id,
|
|
1103
|
+
title: m.title,
|
|
1104
|
+
className: chip(mixer.mixing === m.id),
|
|
1105
|
+
onClick: () => controller.setPaintOptions({ mixer: { mixing: m.id } }),
|
|
1106
|
+
children: m.label
|
|
1107
|
+
},
|
|
1108
|
+
m.id
|
|
1109
|
+
)) }),
|
|
1110
|
+
import_image_editor7.MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
|
|
1111
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-wrap gap-3 text-slate-300", children: [
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1114
|
+
"input",
|
|
1115
|
+
{
|
|
1116
|
+
type: "checkbox",
|
|
1117
|
+
"aria-label": "Load the brush after each stroke",
|
|
1118
|
+
checked: mixer.loadEachStroke,
|
|
1119
|
+
onChange: (e) => controller.setPaintOptions({ mixer: { loadEachStroke: e.target.checked } }),
|
|
1120
|
+
className: "accent-indigo-500"
|
|
1121
|
+
}
|
|
1122
|
+
),
|
|
1123
|
+
"Load each stroke"
|
|
1124
|
+
] }),
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1127
|
+
"input",
|
|
1128
|
+
{
|
|
1129
|
+
type: "checkbox",
|
|
1130
|
+
"aria-label": "Clean the brush after each stroke",
|
|
1131
|
+
checked: mixer.cleanEachStroke,
|
|
1132
|
+
onChange: (e) => controller.setPaintOptions({ mixer: { cleanEachStroke: e.target.checked } }),
|
|
1133
|
+
className: "accent-indigo-500"
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
"Clean each stroke"
|
|
1137
|
+
] })
|
|
1138
|
+
] })
|
|
1139
|
+
] }),
|
|
1084
1140
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-wrap gap-3 text-slate-300", role: "group", "aria-label": "Pressure", children: [
|
|
1085
1141
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
1086
1142
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|