@pixerate/editor-react 0.199.0 → 0.201.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 +3 -3
- package/dist/animation-editor/index.js +1 -1
- package/dist/brushes/BrushEditor.d.cts +1 -1
- package/dist/brushes/BrushEditor.d.ts +1 -1
- package/dist/brushes/BrushLibraryBrowser.d.cts +1 -1
- package/dist/brushes/BrushLibraryBrowser.d.ts +1 -1
- package/dist/brushes/index.cjs +8 -5
- package/dist/brushes/index.js +2 -2
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-BICTULEJ.js → chunk-HOFRSMB6.js} +3 -3
- package/dist/{chunk-GUBRH2OO.js → chunk-IYYUBI3M.js} +8 -5
- package/dist/{chunk-2QXGKOVK.js → chunk-QYARM2FN.js} +1 -1
- package/dist/{chunk-W6UZ7PVT.js → chunk-WTW6HRFI.js} +3 -3
- package/dist/effects/EffectsBrowser.d.cts +3 -1
- package/dist/effects/EffectsBrowser.d.ts +3 -1
- package/dist/effects/index.cjs +3 -3
- package/dist/effects/index.js +1 -1
- package/dist/image-editor/index.cjs +11 -8
- package/dist/image-editor/index.js +4 -4
- package/dist/index.cjs +11 -8
- package/dist/index.js +4 -4
- package/dist/paint-editor/BrushPanel.d.cts +5 -1
- package/dist/paint-editor/BrushPanel.d.ts +5 -1
- package/dist/paint-editor/PaintEditor.d.cts +3 -2
- package/dist/paint-editor/PaintEditor.d.ts +3 -2
- package/dist/paint-editor/PaperPanel.d.cts +2 -1
- package/dist/paint-editor/PaperPanel.d.ts +2 -1
- package/dist/paint-editor/SpecialtyPanel.d.cts +24 -0
- package/dist/paint-editor/SpecialtyPanel.d.ts +24 -0
- package/dist/paint-editor/index.cjs +910 -838
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +557 -490
- package/dist/vector/index.cjs +11 -8
- package/dist/vector/index.js +3 -3
- package/dist/video-editor/index.cjs +3 -3
- package/dist/video-editor/index.js +1 -1
- package/package.json +3 -3
package/dist/vector/index.cjs
CHANGED
|
@@ -1178,10 +1178,12 @@ var BrushLibraryBrowser = ({ entries, activeId, onSelect, profile, thumbnail, th
|
|
|
1178
1178
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `flex flex-col gap-1 ${className ?? ""}`, "data-testid": "brush-library", children: [
|
|
1179
1179
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "search", value: text, placeholder: "Find a brush", "aria-label": "Find a brush", onChange: (e) => setText(e.target.value), className: "rounded bg-slate-800 px-1.5 py-0.5" }),
|
|
1180
1180
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-1.5", role: "listbox", "aria-label": "Brushes", children: [
|
|
1181
|
-
groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { role: "group", "aria-label": g.title, className:
|
|
1182
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className:
|
|
1183
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "grid grid-cols-2 gap-1", children: g.varieties.flatMap(
|
|
1184
|
-
|
|
1181
|
+
groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { role: "group", "aria-label": g.title, "data-group": g.id, className: `flex flex-col gap-0.5 ${g.id === "specialty" ? "mt-1 border-t border-indigo-500/40 pt-1" : ""}`, children: [
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `text-[10px] uppercase tracking-wide ${g.id === "specialty" ? "text-indigo-300" : "text-slate-500"}`, children: g.title }),
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "grid grid-cols-2 gap-1", children: g.varieties.flatMap((v) => [
|
|
1184
|
+
// Specialty paint is listed by kind (Ferrofluid, UV-fluorescent…).
|
|
1185
|
+
...g.id === "specialty" ? [/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "col-span-2 text-[10px] text-slate-400", children: v.title }, `kind-${v.variety}`)] : [],
|
|
1186
|
+
...v.entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1185
1187
|
"button",
|
|
1186
1188
|
{
|
|
1187
1189
|
type: "button",
|
|
@@ -1197,7 +1199,7 @@ var BrushLibraryBrowser = ({ entries, activeId, onSelect, profile, thumbnail, th
|
|
|
1197
1199
|
},
|
|
1198
1200
|
e.brush.id
|
|
1199
1201
|
))
|
|
1200
|
-
) })
|
|
1202
|
+
]) })
|
|
1201
1203
|
] }, g.id)),
|
|
1202
1204
|
!groups.length && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-slate-500", children: "No brush matches." })
|
|
1203
1205
|
] })
|
|
@@ -1310,6 +1312,7 @@ var BrushEditor = ({ brush, profile = import_brushes2.PAINT_PROFILE, onChange, p
|
|
|
1310
1312
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-medium text-slate-300", children: s.title }),
|
|
1311
1313
|
s.controls.map((c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.default.Fragment, { children: [
|
|
1312
1314
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(EditorControl, { control: c, onSet: set }),
|
|
1315
|
+
c.hint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-[10px] leading-snug text-slate-400", "data-hint": c.path, children: c.hint }),
|
|
1313
1316
|
addSource && (c.path === "tip.stamps" || c.path === "tip.grain.source") && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AddImage, { label: c.path === "tip.stamps" ? "Add image tip\u2026" : "Add grain image\u2026", onFile: (f) => addSource(f, c.path === "tip.stamps" ? "tip" : "grain") })
|
|
1314
1317
|
] }, c.path)),
|
|
1315
1318
|
renderExtra?.(s.id)
|
|
@@ -3622,7 +3625,7 @@ function EffectThumbnail({ provider, effect, width = 96, height = 54, className
|
|
|
3622
3625
|
var import_react23 = require("react");
|
|
3623
3626
|
var import_effects2 = require("@pixerate/editor/effects");
|
|
3624
3627
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3625
|
-
function EffectsBrowser({ provider, uses, kinds, onPick, thumbnails = true, title = "Effects", className = "" }) {
|
|
3628
|
+
function EffectsBrowser({ provider, uses, kinds, filter, onPick, thumbnails = true, title = "Effects", className = "" }) {
|
|
3626
3629
|
const [all, setAll] = (0, import_react23.useState)([]);
|
|
3627
3630
|
const [query, setQuery] = (0, import_react23.useState)("");
|
|
3628
3631
|
const [category, setCategory] = (0, import_react23.useState)("");
|
|
@@ -3648,8 +3651,8 @@ function EffectsBrowser({ provider, uses, kinds, onPick, thumbnails = true, titl
|
|
|
3648
3651
|
live = false;
|
|
3649
3652
|
};
|
|
3650
3653
|
}, [provider, query, category, use]);
|
|
3651
|
-
const allowed = (e) => (!kinds || kinds.includes(e.kind)) && (0, import_effects2.effectOffered)(e, uses);
|
|
3652
|
-
const categories = (0, import_react23.useMemo)(() => [...new Set(all.filter(allowed).map((e) => e.category))], [all, uses, kinds]);
|
|
3654
|
+
const allowed = (e) => (!kinds || kinds.includes(e.kind)) && (0, import_effects2.effectOffered)(e, uses) && (!filter || filter(e));
|
|
3655
|
+
const categories = (0, import_react23.useMemo)(() => [...new Set(all.filter(allowed).map((e) => e.category))], [all, uses, kinds, filter]);
|
|
3653
3656
|
const shown = found.filter(allowed);
|
|
3654
3657
|
if (!provider)
|
|
3655
3658
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: `rounded-md border border-dashed border-border p-3 text-xs text-muted-foreground ${className}`, "data-effects-browser": "", "data-effects-unavailable": "", children: "No effects provider is registered, so effects cannot be added. Effects already in the document are kept." });
|
package/dist/vector/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
EffectsBrowser,
|
|
4
4
|
useEffectDescription,
|
|
5
5
|
useEffects
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WTW6HRFI.js";
|
|
7
7
|
import "../chunk-5RPB4WGT.js";
|
|
8
8
|
import "../chunk-KIRIU53A.js";
|
|
9
9
|
import "../chunk-3I7FOSLF.js";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
BrushLibraryEditor,
|
|
17
17
|
useBrushLibrary
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-QYARM2FN.js";
|
|
19
19
|
import {
|
|
20
20
|
BrushLibraryBrowser
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-IYYUBI3M.js";
|
|
22
22
|
|
|
23
23
|
// src/vector/useVectorEditor.ts
|
|
24
24
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
@@ -845,7 +845,7 @@ function EffectThumbnail({ provider, effect, width = 96, height = 54, className
|
|
|
845
845
|
var import_react10 = require("react");
|
|
846
846
|
var import_effects2 = require("@pixerate/editor/effects");
|
|
847
847
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
848
|
-
function EffectsBrowser({ provider, uses, kinds, onPick, thumbnails = true, title = "Effects", className = "" }) {
|
|
848
|
+
function EffectsBrowser({ provider, uses, kinds, filter, onPick, thumbnails = true, title = "Effects", className = "" }) {
|
|
849
849
|
const [all, setAll] = (0, import_react10.useState)([]);
|
|
850
850
|
const [query, setQuery] = (0, import_react10.useState)("");
|
|
851
851
|
const [category, setCategory] = (0, import_react10.useState)("");
|
|
@@ -871,8 +871,8 @@ function EffectsBrowser({ provider, uses, kinds, onPick, thumbnails = true, titl
|
|
|
871
871
|
live = false;
|
|
872
872
|
};
|
|
873
873
|
}, [provider, query, category, use]);
|
|
874
|
-
const allowed = (e) => (!kinds || kinds.includes(e.kind)) && (0, import_effects2.effectOffered)(e, uses);
|
|
875
|
-
const categories = (0, import_react10.useMemo)(() => [...new Set(all.filter(allowed).map((e) => e.category))], [all, uses, kinds]);
|
|
874
|
+
const allowed = (e) => (!kinds || kinds.includes(e.kind)) && (0, import_effects2.effectOffered)(e, uses) && (!filter || filter(e));
|
|
875
|
+
const categories = (0, import_react10.useMemo)(() => [...new Set(all.filter(allowed).map((e) => e.category))], [all, uses, kinds, filter]);
|
|
876
876
|
const shown = found.filter(allowed);
|
|
877
877
|
if (!provider)
|
|
878
878
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `rounded-md border border-dashed border-border p-3 text-xs text-muted-foreground ${className}`, "data-effects-browser": "", "data-effects-unavailable": "", children: "No effects provider is registered, so effects cannot be added. Effects already in the document are kept." });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.201.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.293.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.1.0",
|
|
337
|
-
"@pixerate/editor": "0.
|
|
337
|
+
"@pixerate/editor": "0.293.0"
|
|
338
338
|
},
|
|
339
339
|
"scripts": {
|
|
340
340
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|