@pixerate/editor-react 0.124.0 → 0.126.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.
@@ -1655,6 +1655,8 @@ import {
1655
1655
  dropPlacement,
1656
1656
  dropZone,
1657
1657
  maskThumbnailClick,
1658
+ vectorMaskThumbnail,
1659
+ vectorMaskThumbnailClick,
1658
1660
  layerThumbnailClick,
1659
1661
  openPsdFile,
1660
1662
  layerBadge,
@@ -1756,6 +1758,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1756
1758
  };
1757
1759
  const thumb = (layer) => layerHasThumbnail(layer) ? controller.getLayerThumbnail(layer.id, { maxSide: 64 }) : null;
1758
1760
  const maskThumb = (layer) => layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
1761
+ const vectorThumb = (layer) => layer.vectorMask ? vectorMaskThumbnail(layer.vectorMask, state.imageDimensions.width, state.imageDimensions.height, 64) : null;
1759
1762
  const locked = (layer) => Boolean(layer.locks?.all || layer.locks?.pixels || layer.locks?.position || layer.locks?.transparency);
1760
1763
  return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
1761
1764
  /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
@@ -2022,6 +2025,20 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2022
2025
  }
2023
2026
  }
2024
2027
  ),
2028
+ layer.vectorMask && /* @__PURE__ */ jsx8(
2029
+ Thumbnail,
2030
+ {
2031
+ pixels: vectorThumb(layer),
2032
+ size: thumbnailSize,
2033
+ label: `${row.label} vector mask${layer.vectorMask.enabled === false ? " (disabled)" : ""}`,
2034
+ title: "Ctrl/\u2318-click: load the path as the selection \xB7 Shift-click: turn it off or on",
2035
+ testId: "layer-vector-mask-thumbnail",
2036
+ onClick: (e) => {
2037
+ e.stopPropagation();
2038
+ attempt(() => vectorMaskThumbnailClick(controller, layer, e));
2039
+ }
2040
+ }
2041
+ ),
2025
2042
  renaming === layer.id ? /* @__PURE__ */ jsx8(
2026
2043
  "input",
2027
2044
  {
@@ -1821,6 +1821,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1821
1821
  };
1822
1822
  const thumb = (layer) => (0, import_image_editor8.layerHasThumbnail)(layer) ? controller.getLayerThumbnail(layer.id, { maxSide: 64 }) : null;
1823
1823
  const maskThumb = (layer) => layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
1824
+ const vectorThumb = (layer) => layer.vectorMask ? (0, import_image_editor8.vectorMaskThumbnail)(layer.vectorMask, state.imageDimensions.width, state.imageDimensions.height, 64) : null;
1824
1825
  const locked = (layer) => Boolean(layer.locks?.all || layer.locks?.pixels || layer.locks?.position || layer.locks?.transparency);
1825
1826
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
1826
1827
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
@@ -2087,6 +2088,20 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2087
2088
  }
2088
2089
  }
2089
2090
  ),
2091
+ layer.vectorMask && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2092
+ Thumbnail,
2093
+ {
2094
+ pixels: vectorThumb(layer),
2095
+ size: thumbnailSize,
2096
+ label: `${row.label} vector mask${layer.vectorMask.enabled === false ? " (disabled)" : ""}`,
2097
+ title: "Ctrl/\u2318-click: load the path as the selection \xB7 Shift-click: turn it off or on",
2098
+ testId: "layer-vector-mask-thumbnail",
2099
+ onClick: (e) => {
2100
+ e.stopPropagation();
2101
+ attempt(() => (0, import_image_editor8.vectorMaskThumbnailClick)(controller, layer, e));
2102
+ }
2103
+ }
2104
+ ),
2090
2105
  renaming === layer.id ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2091
2106
  "input",
2092
2107
  {
@@ -27,7 +27,7 @@ import {
27
27
  useImageEditorControls,
28
28
  useImageEffectsTools,
29
29
  useImageHistogram
30
- } from "../chunk-Y7AFHOHY.js";
30
+ } from "../chunk-FS5J4CY3.js";
31
31
  import "../chunk-AJCWF6SN.js";
32
32
  import "../chunk-6BWTJ3EE.js";
33
33
  import "../chunk-5RPB4WGT.js";
package/dist/index.cjs CHANGED
@@ -5535,6 +5535,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
5535
5535
  };
5536
5536
  const thumb = (layer) => (0, import_image_editor8.layerHasThumbnail)(layer) ? controller.getLayerThumbnail(layer.id, { maxSide: 64 }) : null;
5537
5537
  const maskThumb = (layer) => layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
5538
+ const vectorThumb = (layer) => layer.vectorMask ? (0, import_image_editor8.vectorMaskThumbnail)(layer.vectorMask, state.imageDimensions.width, state.imageDimensions.height, 64) : null;
5538
5539
  const locked = (layer) => Boolean(layer.locks?.all || layer.locks?.pixels || layer.locks?.position || layer.locks?.transparency);
5539
5540
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
5540
5541
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
@@ -5801,6 +5802,20 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
5801
5802
  }
5802
5803
  }
5803
5804
  ),
5805
+ layer.vectorMask && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5806
+ Thumbnail,
5807
+ {
5808
+ pixels: vectorThumb(layer),
5809
+ size: thumbnailSize,
5810
+ label: `${row.label} vector mask${layer.vectorMask.enabled === false ? " (disabled)" : ""}`,
5811
+ title: "Ctrl/\u2318-click: load the path as the selection \xB7 Shift-click: turn it off or on",
5812
+ testId: "layer-vector-mask-thumbnail",
5813
+ onClick: (e) => {
5814
+ e.stopPropagation();
5815
+ attempt(() => (0, import_image_editor8.vectorMaskThumbnailClick)(controller, layer, e));
5816
+ }
5817
+ }
5818
+ ),
5804
5819
  renaming === layer.id ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5805
5820
  "input",
5806
5821
  {
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  useImageEditorControls,
52
52
  useImageEffectsTools,
53
53
  useImageHistogram
54
- } from "./chunk-Y7AFHOHY.js";
54
+ } from "./chunk-FS5J4CY3.js";
55
55
  import "./chunk-AJCWF6SN.js";
56
56
  import "./chunk-6BWTJ3EE.js";
57
57
  import "./chunk-5RPB4WGT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.124.0",
3
+ "version": "0.126.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.189.0 <1.0.0-0",
257
+ "@pixerate/editor": ">=0.191.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.189.0"
308
+ "@pixerate/editor": "0.191.0"
309
309
  },
310
310
  "scripts": {
311
311
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",