@pixerate/editor-react 0.164.0 → 0.165.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.
|
@@ -837,6 +837,10 @@ var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, clas
|
|
|
837
837
|
}
|
|
838
838
|
)
|
|
839
839
|
] }),
|
|
840
|
+
engine.light && brush.light.amount > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "flex items-center gap-2", title: "Pressure scales the light the brush lays", children: [
|
|
841
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", "aria-label": "Light follows pressure", checked: brush.light.pressure, onChange: (e) => controller.setBrush({ light: { pressure: e.target.checked } }) }),
|
|
842
|
+
" Light follows pressure"
|
|
843
|
+
] }),
|
|
840
844
|
engine.dirty && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "flex items-center gap-2", title: "Keep the colour the brush picked up for the next stroke (needs Pick-up above 0)", children: [
|
|
841
845
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", "aria-label": "Dirty brush", checked: brush.behavior.dirty, onChange: (e) => controller.setBrush({ behavior: { dirty: e.target.checked } }) }),
|
|
842
846
|
" Dirty brush"
|
|
@@ -1157,6 +1161,7 @@ var PaintLayersPanel = ({ controller, className }) => {
|
|
|
1157
1161
|
const [renaming, setRenaming] = (0, import_react9.useState)(null);
|
|
1158
1162
|
const layers = controller.listLayers();
|
|
1159
1163
|
const active = layers.find((l) => l.active) ?? null;
|
|
1164
|
+
const light = active?.type === "pixel" ? controller.lightOf(active.id) : null;
|
|
1160
1165
|
const move = (delta) => {
|
|
1161
1166
|
if (!active) return;
|
|
1162
1167
|
const { index, count } = siblingIndex(layers, active);
|
|
@@ -1253,6 +1258,20 @@ var PaintLayersPanel = ({ controller, className }) => {
|
|
|
1253
1258
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-1", children: [
|
|
1254
1259
|
["pixels", "transparency"].map((k) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "aria-pressed": Boolean(active.locks[k]), className: chip(Boolean(active.locks[k])), onClick: () => attempt(() => controller.updateLayer(active.id, { locks: { [k]: !active.locks[k] } })), children: k === "pixels" ? "Lock pixels" : "Lock transparency" }, k)),
|
|
1255
1260
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "aria-pressed": active.clipped, className: chip(active.clipped), onClick: () => attempt(() => controller.updateLayer(active.id, { clipped: !active.clipped })), children: "Clip" })
|
|
1261
|
+
] }),
|
|
1262
|
+
light?.hasLight && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-1.5 border-t border-slate-800 pt-1.5", "data-testid": "layer-light", children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-medium text-slate-300", title: "This layer's paint gives off light", children: "Light" }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: button, onClick: () => attempt(() => controller.clearLight(active.id)), children: "Clear light" })
|
|
1266
|
+
] }),
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex items-center gap-2", title: "How far the light spills onto the paint and paper around it (0 turns it off)", children: [
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w-14 text-slate-400", children: "Spill" }),
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "range", "aria-label": "Light spill radius", min: 0, max: 120, step: 1, value: light.spill.radius, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { radius: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
|
|
1270
|
+
] }),
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex items-center gap-2", children: [
|
|
1272
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w-14 text-slate-400", children: "Strength" }),
|
|
1273
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "range", "aria-label": "Light spill strength", min: 0, max: 2, step: 0.05, value: light.spill.strength, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { strength: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
|
|
1274
|
+
] })
|
|
1256
1275
|
] })
|
|
1257
1276
|
] }),
|
|
1258
1277
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ErrorLine, { error })
|
|
@@ -709,6 +709,10 @@ var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, clas
|
|
|
709
709
|
}
|
|
710
710
|
)
|
|
711
711
|
] }),
|
|
712
|
+
engine.light && brush.light.amount > 0 && /* @__PURE__ */ jsxs4("label", { className: "flex items-center gap-2", title: "Pressure scales the light the brush lays", children: [
|
|
713
|
+
/* @__PURE__ */ jsx5("input", { type: "checkbox", "aria-label": "Light follows pressure", checked: brush.light.pressure, onChange: (e) => controller.setBrush({ light: { pressure: e.target.checked } }) }),
|
|
714
|
+
" Light follows pressure"
|
|
715
|
+
] }),
|
|
712
716
|
engine.dirty && /* @__PURE__ */ jsxs4("label", { className: "flex items-center gap-2", title: "Keep the colour the brush picked up for the next stroke (needs Pick-up above 0)", children: [
|
|
713
717
|
/* @__PURE__ */ jsx5("input", { type: "checkbox", "aria-label": "Dirty brush", checked: brush.behavior.dirty, onChange: (e) => controller.setBrush({ behavior: { dirty: e.target.checked } }) }),
|
|
714
718
|
" Dirty brush"
|
|
@@ -1043,6 +1047,7 @@ var PaintLayersPanel = ({ controller, className }) => {
|
|
|
1043
1047
|
const [renaming, setRenaming] = useState7(null);
|
|
1044
1048
|
const layers = controller.listLayers();
|
|
1045
1049
|
const active = layers.find((l) => l.active) ?? null;
|
|
1050
|
+
const light = active?.type === "pixel" ? controller.lightOf(active.id) : null;
|
|
1046
1051
|
const move = (delta) => {
|
|
1047
1052
|
if (!active) return;
|
|
1048
1053
|
const { index, count } = siblingIndex(layers, active);
|
|
@@ -1139,6 +1144,20 @@ var PaintLayersPanel = ({ controller, className }) => {
|
|
|
1139
1144
|
/* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
|
|
1140
1145
|
["pixels", "transparency"].map((k) => /* @__PURE__ */ jsx8("button", { type: "button", "aria-pressed": Boolean(active.locks[k]), className: chip(Boolean(active.locks[k])), onClick: () => attempt(() => controller.updateLayer(active.id, { locks: { [k]: !active.locks[k] } })), children: k === "pixels" ? "Lock pixels" : "Lock transparency" }, k)),
|
|
1141
1146
|
/* @__PURE__ */ jsx8("button", { type: "button", "aria-pressed": active.clipped, className: chip(active.clipped), onClick: () => attempt(() => controller.updateLayer(active.id, { clipped: !active.clipped })), children: "Clip" })
|
|
1147
|
+
] }),
|
|
1148
|
+
light?.hasLight && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1.5 border-t border-slate-800 pt-1.5", "data-testid": "layer-light", children: [
|
|
1149
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
|
|
1150
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium text-slate-300", title: "This layer's paint gives off light", children: "Light" }),
|
|
1151
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: button, onClick: () => attempt(() => controller.clearLight(active.id)), children: "Clear light" })
|
|
1152
|
+
] }),
|
|
1153
|
+
/* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2", title: "How far the light spills onto the paint and paper around it (0 turns it off)", children: [
|
|
1154
|
+
/* @__PURE__ */ jsx8("span", { className: "w-14 text-slate-400", children: "Spill" }),
|
|
1155
|
+
/* @__PURE__ */ jsx8("input", { type: "range", "aria-label": "Light spill radius", min: 0, max: 120, step: 1, value: light.spill.radius, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { radius: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
|
|
1156
|
+
] }),
|
|
1157
|
+
/* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2", children: [
|
|
1158
|
+
/* @__PURE__ */ jsx8("span", { className: "w-14 text-slate-400", children: "Strength" }),
|
|
1159
|
+
/* @__PURE__ */ jsx8("input", { type: "range", "aria-label": "Light spill strength", min: 0, max: 2, step: 0.05, value: light.spill.strength, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { strength: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
|
|
1160
|
+
] })
|
|
1142
1161
|
] })
|
|
1143
1162
|
] }),
|
|
1144
1163
|
/* @__PURE__ */ jsx8(ErrorLine, { error })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.165.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"dependencies": {},
|
|
255
255
|
"peerDependencies": {
|
|
256
256
|
"@dagrejs/dagre": "^1.1.8",
|
|
257
|
-
"@pixerate/editor": ">=0.
|
|
257
|
+
"@pixerate/editor": ">=0.243.0 <1.0.0-0",
|
|
258
258
|
"@tiptap/core": "^2.27.3",
|
|
259
259
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
260
260
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"tsup": "^9.0.0",
|
|
306
306
|
"typescript": "^5.7.3",
|
|
307
307
|
"vitest": "^5.0.5",
|
|
308
|
-
"@pixerate/editor": "0.
|
|
308
|
+
"@pixerate/editor": "0.243.0"
|
|
309
309
|
},
|
|
310
310
|
"scripts": {
|
|
311
311
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|