@pixerate/editor-react 0.172.1 → 0.173.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.
@@ -1169,7 +1169,7 @@ function VectorAppearancePanel({ controller, className }) {
1169
1169
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "space-y-1 rounded border border-border p-1", "data-vector-layer": `${l.kind}-${l.index}`, "data-vector-brushstroke": "", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1", children: [
1170
1170
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", "aria-label": `${name} visible`, title: "Show", checked: l.visible, onChange: (e) => update(l, { visible: e.target.checked }) }),
1171
1171
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "color", "aria-label": `${name} colour`, className: "h-7 w-10 cursor-pointer rounded border border-border bg-background", value: l.color ?? "#000000", onChange: (e) => controller.setBrushstroke(l.index, { color: e.target.value }, { ids, merge: true }), onBlur: end }),
1172
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("select", { "aria-label": `${name} brush`, className: selectClass2, value: l.brushstroke.brushId, onChange: (e) => controller.setBrushstroke(l.index, { brushId: e.target.value }, { ids }), children: (0, import_vector5.vectorBrushstrokeBrushes)().map((b) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: b.id, children: b.name }, b.id)) }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("select", { "aria-label": `${name} brush`, className: selectClass2, value: l.brushstroke.brushId, onChange: (e) => controller.setBrushstroke(l.index, { brushId: e.target.value }, { ids }), children: controller.listBrushstrokeBrushes().map((b) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: b.id, children: b.name }, b.id)) }),
1173
1173
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1174
1174
  "input",
1175
1175
  {
@@ -1298,7 +1298,7 @@ function VectorAppearancePanel({ controller, className }) {
1298
1298
  children: "+"
1299
1299
  }
1300
1300
  ),
1301
- kind === "stroke" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: buttonClass2, title: "Add a brushstroke (a natural-media brush along the path)", "aria-label": "Add brushstroke", "data-vector-add-brushstroke": "", disabled: !ids.length, onClick: () => controller.addBrushstroke({ brushId: (0, import_vector5.vectorBrushstrokeBrushes)()[0].id, seed: (0, import_vector5.randomVectorBrushstrokeSeed)() }, { ids }), children: "\u270E+" })
1301
+ kind === "stroke" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: buttonClass2, title: "Add a brushstroke (a natural-media brush along the path)", "aria-label": "Add brushstroke", "data-vector-add-brushstroke": "", disabled: !ids.length, onClick: () => controller.addBrushstroke({ brushId: controller.listBrushstrokeBrushes()[0].id, seed: (0, import_vector5.randomVectorBrushstrokeSeed)() }, { ids }), children: "\u270E+" })
1302
1302
  ] }),
1303
1303
  [...layers].reverse().map((l) => layerRow(l, layers.length))
1304
1304
  ] });
@@ -1054,8 +1054,7 @@ import {
1054
1054
  VECTOR_FILTER_MENU,
1055
1055
  VECTOR_STROKE_ALIGN_LABELS,
1056
1056
  getVectorAppearancePanel,
1057
- randomVectorBrushstrokeSeed,
1058
- vectorBrushstrokeBrushes
1057
+ randomVectorBrushstrokeSeed
1059
1058
  } from "@pixerate/editor/vector";
1060
1059
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1061
1060
  var buttonClass2 = "inline-flex h-7 min-w-7 items-center justify-center rounded-md border border-border bg-background px-1.5 text-xs font-medium text-foreground hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40";
@@ -1076,7 +1075,7 @@ function VectorAppearancePanel({ controller, className }) {
1076
1075
  return /* @__PURE__ */ jsx4("div", { className: "space-y-1 rounded border border-border p-1", "data-vector-layer": `${l.kind}-${l.index}`, "data-vector-brushstroke": "", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
1077
1076
  /* @__PURE__ */ jsx4("input", { type: "checkbox", "aria-label": `${name} visible`, title: "Show", checked: l.visible, onChange: (e) => update(l, { visible: e.target.checked }) }),
1078
1077
  /* @__PURE__ */ jsx4("input", { type: "color", "aria-label": `${name} colour`, className: "h-7 w-10 cursor-pointer rounded border border-border bg-background", value: l.color ?? "#000000", onChange: (e) => controller.setBrushstroke(l.index, { color: e.target.value }, { ids, merge: true }), onBlur: end }),
1079
- /* @__PURE__ */ jsx4("select", { "aria-label": `${name} brush`, className: selectClass2, value: l.brushstroke.brushId, onChange: (e) => controller.setBrushstroke(l.index, { brushId: e.target.value }, { ids }), children: vectorBrushstrokeBrushes().map((b) => /* @__PURE__ */ jsx4("option", { value: b.id, children: b.name }, b.id)) }),
1078
+ /* @__PURE__ */ jsx4("select", { "aria-label": `${name} brush`, className: selectClass2, value: l.brushstroke.brushId, onChange: (e) => controller.setBrushstroke(l.index, { brushId: e.target.value }, { ids }), children: controller.listBrushstrokeBrushes().map((b) => /* @__PURE__ */ jsx4("option", { value: b.id, children: b.name }, b.id)) }),
1080
1079
  /* @__PURE__ */ jsx4(
1081
1080
  "input",
1082
1081
  {
@@ -1205,7 +1204,7 @@ function VectorAppearancePanel({ controller, className }) {
1205
1204
  children: "+"
1206
1205
  }
1207
1206
  ),
1208
- kind === "stroke" && /* @__PURE__ */ jsx4("button", { type: "button", className: buttonClass2, title: "Add a brushstroke (a natural-media brush along the path)", "aria-label": "Add brushstroke", "data-vector-add-brushstroke": "", disabled: !ids.length, onClick: () => controller.addBrushstroke({ brushId: vectorBrushstrokeBrushes()[0].id, seed: randomVectorBrushstrokeSeed() }, { ids }), children: "\u270E+" })
1207
+ kind === "stroke" && /* @__PURE__ */ jsx4("button", { type: "button", className: buttonClass2, title: "Add a brushstroke (a natural-media brush along the path)", "aria-label": "Add brushstroke", "data-vector-add-brushstroke": "", disabled: !ids.length, onClick: () => controller.addBrushstroke({ brushId: controller.listBrushstrokeBrushes()[0].id, seed: randomVectorBrushstrokeSeed() }, { ids }), children: "\u270E+" })
1209
1208
  ] }),
1210
1209
  [...layers].reverse().map((l) => layerRow(l, layers.length))
1211
1210
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.172.1",
3
+ "version": "0.173.0",
4
4
  "description": "React bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -84,6 +84,16 @@
84
84
  "default": "./dist/paint-editor/index.cjs"
85
85
  }
86
86
  },
87
+ "./brushes": {
88
+ "import": {
89
+ "types": "./dist/brushes/index.d.ts",
90
+ "default": "./dist/brushes/index.js"
91
+ },
92
+ "require": {
93
+ "types": "./dist/brushes/index.d.cts",
94
+ "default": "./dist/brushes/index.cjs"
95
+ }
96
+ },
87
97
  "./commands": {
88
98
  "import": {
89
99
  "types": "./dist/commands/index.d.ts",
@@ -219,6 +229,9 @@
219
229
  "paint-editor": [
220
230
  "./dist/paint-editor/index.d.ts"
221
231
  ],
232
+ "brushes": [
233
+ "./dist/brushes/index.d.ts"
234
+ ],
222
235
  "commands": [
223
236
  "./dist/commands/index.d.ts"
224
237
  ],
@@ -264,7 +277,7 @@
264
277
  "dependencies": {},
265
278
  "peerDependencies": {
266
279
  "@dagrejs/dagre": "^1.1.8",
267
- "@pixerate/editor": ">=0.254.0 <1.0.0-0",
280
+ "@pixerate/editor": ">=0.255.0 <1.0.0-0",
268
281
  "@tiptap/core": "^2.27.3",
269
282
  "@tiptap/extension-bubble-menu": "^2.27.3",
270
283
  "@tiptap/extension-placeholder": "^2.27.3",
@@ -315,7 +328,7 @@
315
328
  "tsup": "^9.0.0",
316
329
  "typescript": "^5.7.3",
317
330
  "vitest": "^5.0.5",
318
- "@pixerate/editor": "0.254.0"
331
+ "@pixerate/editor": "0.255.0"
319
332
  },
320
333
  "scripts": {
321
334
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",