@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
|
@@ -1013,7 +1013,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1013
1013
|
|
|
1014
1014
|
// src/image-editor/BrushOptionsBar.tsx
|
|
1015
1015
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
1016
|
-
import { BRUSH_OPTION_CONTROLS, PAINT_TOOLS } from "@pixerate/editor/image-editor";
|
|
1016
|
+
import { BRUSH_OPTION_CONTROLS, MIXER_MIXING_OPTIONS, MIXER_OPTION_CONTROLS, PAINT_TOOLS, rgbUnitToHex } from "@pixerate/editor/image-editor";
|
|
1017
1017
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1018
1018
|
var chip = (on) => `px-2 py-1 rounded text-[11px] ${on ? "bg-indigo-600 text-white" : "bg-slate-800 text-slate-300 hover:text-white"}`;
|
|
1019
1019
|
var BrushOptionsBar = ({ controller, className }) => {
|
|
@@ -1021,7 +1021,7 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
1021
1021
|
useEffect5(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
1022
1022
|
const [error, setError] = useState6(null);
|
|
1023
1023
|
const state = controller.getState();
|
|
1024
|
-
const { brush, foreground, background } = state.paint;
|
|
1024
|
+
const { brush, foreground, background, mixer, mixerLoad } = state.paint;
|
|
1025
1025
|
const attempt = (fn) => {
|
|
1026
1026
|
try {
|
|
1027
1027
|
setError(null);
|
|
@@ -1082,6 +1082,62 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
1082
1082
|
},
|
|
1083
1083
|
spec.id
|
|
1084
1084
|
)),
|
|
1085
|
+
state.activeTool === "mixer" && /* @__PURE__ */ jsxs6("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: [
|
|
1086
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
1087
|
+
/* @__PURE__ */ jsx6(
|
|
1088
|
+
"span",
|
|
1089
|
+
{
|
|
1090
|
+
"aria-label": "Brush load",
|
|
1091
|
+
title: mixerLoad.reservoir ? `Loaded ${rgbUnitToHex(mixerLoad.reservoir)}, ${Math.round(mixerLoad.amount * 100)}% left` : "Unloaded",
|
|
1092
|
+
className: "h-6 w-6 rounded border border-slate-700",
|
|
1093
|
+
style: { background: mixerLoad.reservoir ? rgbUnitToHex(mixerLoad.reservoir) : "transparent" }
|
|
1094
|
+
}
|
|
1095
|
+
),
|
|
1096
|
+
/* @__PURE__ */ jsx6("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: chip(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
|
|
1097
|
+
/* @__PURE__ */ jsx6("button", { type: "button", title: "Empty the picked-up colour", className: chip(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
|
|
1098
|
+
] }),
|
|
1099
|
+
/* @__PURE__ */ jsx6("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx6(
|
|
1100
|
+
"button",
|
|
1101
|
+
{
|
|
1102
|
+
type: "button",
|
|
1103
|
+
"aria-pressed": mixer.mixing === m.id,
|
|
1104
|
+
title: m.title,
|
|
1105
|
+
className: chip(mixer.mixing === m.id),
|
|
1106
|
+
onClick: () => controller.setPaintOptions({ mixer: { mixing: m.id } }),
|
|
1107
|
+
children: m.label
|
|
1108
|
+
},
|
|
1109
|
+
m.id
|
|
1110
|
+
)) }),
|
|
1111
|
+
MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx6(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
|
|
1112
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap gap-3 text-slate-300", children: [
|
|
1113
|
+
/* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-1.5", children: [
|
|
1114
|
+
/* @__PURE__ */ jsx6(
|
|
1115
|
+
"input",
|
|
1116
|
+
{
|
|
1117
|
+
type: "checkbox",
|
|
1118
|
+
"aria-label": "Load the brush after each stroke",
|
|
1119
|
+
checked: mixer.loadEachStroke,
|
|
1120
|
+
onChange: (e) => controller.setPaintOptions({ mixer: { loadEachStroke: e.target.checked } }),
|
|
1121
|
+
className: "accent-indigo-500"
|
|
1122
|
+
}
|
|
1123
|
+
),
|
|
1124
|
+
"Load each stroke"
|
|
1125
|
+
] }),
|
|
1126
|
+
/* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-1.5", children: [
|
|
1127
|
+
/* @__PURE__ */ jsx6(
|
|
1128
|
+
"input",
|
|
1129
|
+
{
|
|
1130
|
+
type: "checkbox",
|
|
1131
|
+
"aria-label": "Clean the brush after each stroke",
|
|
1132
|
+
checked: mixer.cleanEachStroke,
|
|
1133
|
+
onChange: (e) => controller.setPaintOptions({ mixer: { cleanEachStroke: e.target.checked } }),
|
|
1134
|
+
className: "accent-indigo-500"
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
"Clean each stroke"
|
|
1138
|
+
] })
|
|
1139
|
+
] })
|
|
1140
|
+
] }),
|
|
1085
1141
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap gap-3 text-slate-300", role: "group", "aria-label": "Pressure", children: [
|
|
1086
1142
|
/* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-1.5", children: [
|
|
1087
1143
|
/* @__PURE__ */ jsx6(
|
|
@@ -2753,4 +2809,4 @@ export {
|
|
|
2753
2809
|
RefineEdgePanel,
|
|
2754
2810
|
ImageEditor
|
|
2755
2811
|
};
|
|
2756
|
-
//# sourceMappingURL=chunk-
|
|
2812
|
+
//# sourceMappingURL=chunk-QJSMW4CM.js.map
|