canvu-react 0.4.72 → 0.4.73

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/react.cjs CHANGED
@@ -2260,6 +2260,7 @@ function ImagesMenu({
2260
2260
  onItemsChange,
2261
2261
  onFocusItem,
2262
2262
  labels,
2263
+ hiddenActions,
2263
2264
  defaultOpen = false,
2264
2265
  collapsedButtonClassName,
2265
2266
  collapsedButtonStyle,
@@ -2275,6 +2276,10 @@ function ImagesMenu({
2275
2276
  react.useEffect(() => {
2276
2277
  ensureOpenKeyframe();
2277
2278
  }, []);
2279
+ const hiddenActionSet = react.useMemo(
2280
+ () => new Set(hiddenActions ?? []),
2281
+ [hiddenActions]
2282
+ );
2278
2283
  if (managed.length === 0) {
2279
2284
  return null;
2280
2285
  }
@@ -2349,6 +2354,7 @@ function ImagesMenu({
2349
2354
  {
2350
2355
  item,
2351
2356
  labels: resolvedLabels,
2357
+ hiddenActionSet,
2352
2358
  onFocus: onFocusItem ? () => onFocusItem(item) : void 0,
2353
2359
  onCopy: () => onItemsChange(copyManagedImage(items, item.id)),
2354
2360
  onRotate: () => onItemsChange(rotateManagedImage(items, item.id)),
@@ -2365,6 +2371,7 @@ function ImagesMenu({
2365
2371
  function ImagesMenuRow({
2366
2372
  item,
2367
2373
  labels,
2374
+ hiddenActionSet,
2368
2375
  onFocus,
2369
2376
  onCopy,
2370
2377
  onRotate,
@@ -2404,9 +2411,9 @@ function ImagesMenuRow({
2404
2411
  ),
2405
2412
  /* @__PURE__ */ jsxRuntime.jsx(FocusTarget, { label: labels.focus, onFocus, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: thumbBoxStyle, children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt: "", style: thumbImgStyle, draggable: false }) : null }) }),
2406
2413
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: actionsColumnStyle, children: [
2407
- /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.duplicate, onClick: onCopy, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyPlus, { size: 18 }) }),
2408
- /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.rotate, onClick: onRotate, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { size: 18 }) }),
2409
- /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.delete, onClick: onDelete, danger: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 18 }) })
2414
+ !hiddenActionSet.has("duplicate") ? /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.duplicate, onClick: onCopy, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyPlus, { size: 18 }) }) : null,
2415
+ !hiddenActionSet.has("rotate") ? /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.rotate, onClick: onRotate, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { size: 18 }) }) : null,
2416
+ !hiddenActionSet.has("delete") ? /* @__PURE__ */ jsxRuntime.jsx(ImagesMenuAction, { label: labels.delete, onClick: onDelete, danger: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: 18 }) }) : null
2410
2417
  ] })
2411
2418
  ] });
2412
2419
  }