@pixerate/editor-react 0.190.0 → 0.191.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.
|
@@ -1926,6 +1926,7 @@ var WetPanel = ({ controller, className }) => {
|
|
|
1926
1926
|
const wet = state.wet;
|
|
1927
1927
|
const layerId = state.document.activeLayerId;
|
|
1928
1928
|
const info = layerId ? controller.wetLayerInfo(layerId) : null;
|
|
1929
|
+
const livePattern = layerId ? controller.getLivePatterns(layerId).layers[0] ?? null : null;
|
|
1929
1930
|
const backend = controller.wetState();
|
|
1930
1931
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: `${panel} ${className ?? ""}`, "data-testid": "wet-panel", children: [
|
|
1931
1932
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
@@ -1960,6 +1961,39 @@ var WetPanel = ({ controller, className }) => {
|
|
|
1960
1961
|
}
|
|
1961
1962
|
)
|
|
1962
1963
|
] }),
|
|
1964
|
+
livePattern && layerId && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-live-patterns", children: [
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-medium text-slate-300", children: "Live patterns" }),
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1968
|
+
"button",
|
|
1969
|
+
{
|
|
1970
|
+
type: "button",
|
|
1971
|
+
className: button,
|
|
1972
|
+
onClick: () => attempt(async () => {
|
|
1973
|
+
await controller.wetIdle();
|
|
1974
|
+
const cx = Math.round(state.document.canvas.width / 2);
|
|
1975
|
+
const cy = Math.round(state.document.canvas.height / 2);
|
|
1976
|
+
controller.seedLivePatterns({ layerId, points: [{ x: cx, y: cy }] });
|
|
1977
|
+
}),
|
|
1978
|
+
children: "Seed pattern"
|
|
1979
|
+
}
|
|
1980
|
+
)
|
|
1981
|
+
] }),
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "flex items-center justify-between gap-2", children: [
|
|
1983
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-slate-400", children: "Pattern" }),
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1985
|
+
"select",
|
|
1986
|
+
{
|
|
1987
|
+
"aria-label": "Live pattern",
|
|
1988
|
+
value: livePattern.settings.pattern,
|
|
1989
|
+
onChange: (e) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { pattern: e.target.value }))),
|
|
1990
|
+
className: "rounded bg-slate-800 px-1 py-0.5",
|
|
1991
|
+
children: import_paint_editor10.LIVE_PATTERN_KINDS.map((k) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: k, children: import_paint_editor10.LIVE_PATTERN_LABELS[k] }, k))
|
|
1992
|
+
}
|
|
1993
|
+
)
|
|
1994
|
+
] }),
|
|
1995
|
+
import_paint_editor10.LIVE_PATTERN_SLIDERS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PaintSlider, { control: c, value: (0, import_paint_editor10.readPath)(livePattern.settings, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { [c.path]: v }))) }, c.path))
|
|
1996
|
+
] }),
|
|
1963
1997
|
backend.message && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-[10px] text-amber-300", "data-testid": "wet-message", children: backend.message }),
|
|
1964
1998
|
backend.backend && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-[10px] text-slate-500", children: backend.backend.kind === "wasm-threads" ? `WebAssembly, ${backend.backend.threads} threads` : backend.backend.kind === "wasm" ? "WebAssembly, one thread" : "JavaScript" }),
|
|
1965
1999
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "flex items-center justify-between gap-2", children: [
|
|
@@ -1216,7 +1216,7 @@ var PaintLayersPanel = ({ controller, className }) => {
|
|
|
1216
1216
|
};
|
|
1217
1217
|
|
|
1218
1218
|
// src/paint-editor/WetPanel.tsx
|
|
1219
|
-
import { WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath as readPath2, wetEngineSummary } from "@pixerate/editor/paint-editor";
|
|
1219
|
+
import { LIVE_PATTERN_KINDS, LIVE_PATTERN_LABELS, LIVE_PATTERN_SLIDERS, WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath as readPath2, wetEngineSummary } from "@pixerate/editor/paint-editor";
|
|
1220
1220
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1221
1221
|
var FLOW_LABELS = { none: "None", linear: "One way", swirl: "Swirl", radial: "Outwards", turbulent: "Eddies" };
|
|
1222
1222
|
var WetPanel = ({ controller, className }) => {
|
|
@@ -1225,6 +1225,7 @@ var WetPanel = ({ controller, className }) => {
|
|
|
1225
1225
|
const wet = state.wet;
|
|
1226
1226
|
const layerId = state.document.activeLayerId;
|
|
1227
1227
|
const info = layerId ? controller.wetLayerInfo(layerId) : null;
|
|
1228
|
+
const livePattern = layerId ? controller.getLivePatterns(layerId).layers[0] ?? null : null;
|
|
1228
1229
|
const backend = controller.wetState();
|
|
1229
1230
|
return /* @__PURE__ */ jsxs8("div", { className: `${panel} ${className ?? ""}`, "data-testid": "wet-panel", children: [
|
|
1230
1231
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
@@ -1259,6 +1260,39 @@ var WetPanel = ({ controller, className }) => {
|
|
|
1259
1260
|
}
|
|
1260
1261
|
)
|
|
1261
1262
|
] }),
|
|
1263
|
+
livePattern && layerId && /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-live-patterns", children: [
|
|
1264
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
1265
|
+
/* @__PURE__ */ jsx9("span", { className: "font-medium text-slate-300", children: "Live patterns" }),
|
|
1266
|
+
/* @__PURE__ */ jsx9(
|
|
1267
|
+
"button",
|
|
1268
|
+
{
|
|
1269
|
+
type: "button",
|
|
1270
|
+
className: button,
|
|
1271
|
+
onClick: () => attempt(async () => {
|
|
1272
|
+
await controller.wetIdle();
|
|
1273
|
+
const cx = Math.round(state.document.canvas.width / 2);
|
|
1274
|
+
const cy = Math.round(state.document.canvas.height / 2);
|
|
1275
|
+
controller.seedLivePatterns({ layerId, points: [{ x: cx, y: cy }] });
|
|
1276
|
+
}),
|
|
1277
|
+
children: "Seed pattern"
|
|
1278
|
+
}
|
|
1279
|
+
)
|
|
1280
|
+
] }),
|
|
1281
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between gap-2", children: [
|
|
1282
|
+
/* @__PURE__ */ jsx9("span", { className: "text-slate-400", children: "Pattern" }),
|
|
1283
|
+
/* @__PURE__ */ jsx9(
|
|
1284
|
+
"select",
|
|
1285
|
+
{
|
|
1286
|
+
"aria-label": "Live pattern",
|
|
1287
|
+
value: livePattern.settings.pattern,
|
|
1288
|
+
onChange: (e) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { pattern: e.target.value }))),
|
|
1289
|
+
className: "rounded bg-slate-800 px-1 py-0.5",
|
|
1290
|
+
children: LIVE_PATTERN_KINDS.map((k) => /* @__PURE__ */ jsx9("option", { value: k, children: LIVE_PATTERN_LABELS[k] }, k))
|
|
1291
|
+
}
|
|
1292
|
+
)
|
|
1293
|
+
] }),
|
|
1294
|
+
LIVE_PATTERN_SLIDERS.map((c) => /* @__PURE__ */ jsx9(PaintSlider, { control: c, value: readPath2(livePattern.settings, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { [c.path]: v }))) }, c.path))
|
|
1295
|
+
] }),
|
|
1262
1296
|
backend.message && /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-amber-300", "data-testid": "wet-message", children: backend.message }),
|
|
1263
1297
|
backend.backend && /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-500", children: backend.backend.kind === "wasm-threads" ? `WebAssembly, ${backend.backend.threads} threads` : backend.backend.kind === "wasm" ? "WebAssembly, one thread" : "JavaScript" }),
|
|
1264
1298
|
/* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between gap-2", children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.191.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
"dependencies": {},
|
|
284
284
|
"peerDependencies": {
|
|
285
285
|
"@dagrejs/dagre": "^1.1.8",
|
|
286
|
-
"@pixerate/editor": ">=0.
|
|
286
|
+
"@pixerate/editor": ">=0.276.0 <1.0.0-0",
|
|
287
287
|
"@tiptap/core": "^2.27.3",
|
|
288
288
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
289
289
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
"tsup": "^9.0.0",
|
|
335
335
|
"typescript": "^5.7.3",
|
|
336
336
|
"vitest": "^5.0.5",
|
|
337
|
-
"@pixerate/editor": "0.
|
|
337
|
+
"@pixerate/editor": "0.276.0"
|
|
338
338
|
},
|
|
339
339
|
"scripts": {
|
|
340
340
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|