@nice2dev/ui-graphics 1.2.0 → 1.2.1

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/dist/cjs/animation/Audience.js +3 -1
  3. package/dist/cjs/animation/rig/RigPlayer.js +1 -1
  4. package/dist/cjs/animation/rig/presets.js +67 -55
  5. package/dist/cjs/animation/shapes/headwear.js +4 -1
  6. package/dist/cjs/core/NiceBrushEngine.js +5 -3
  7. package/dist/cjs/core/editorAsk.js +48 -0
  8. package/dist/cjs/core/i18n.js +7 -3
  9. package/dist/cjs/core/plugins.js +1 -1
  10. package/dist/cjs/core/rtl.js +1 -1
  11. package/dist/cjs/core/theme.js +1 -1
  12. package/dist/cjs/font/NiceFontEditor.js +13 -11
  13. package/dist/cjs/game/GameAsset2dEditor.js +28 -16
  14. package/dist/cjs/nice2dev-ui-graphics.css +1 -1
  15. package/dist/cjs/photo/FilterThumb.js +3 -3
  16. package/dist/cjs/photo/NiceAITools.js +5 -3
  17. package/dist/cjs/photo/PhotoEditor.js +3 -1
  18. package/dist/cjs/photo/PhotoEditorCanvas.js +8 -6
  19. package/dist/cjs/photo/PhotoEditorLeftPanel.js +19 -19
  20. package/dist/cjs/photo/PhotoEditorToolbar.js +4 -4
  21. package/dist/cjs/photo/photoFilters.js +1 -0
  22. package/dist/cjs/pixel/PixelEditor.js +6 -3
  23. package/dist/cjs/pixel/PixelEditorCanvas.js +10 -6
  24. package/dist/cjs/pixel/PixelEditorMenuBar.js +3 -3
  25. package/dist/cjs/pixel/PixelEditorRightPanel.js +28 -24
  26. package/dist/cjs/pixel/PixelEditorStatusBar.js +8 -4
  27. package/dist/cjs/pixel/PixelEditorTimeline.js +11 -2
  28. package/dist/cjs/pixel/PixelEditorToolbar.js +10 -6
  29. package/dist/cjs/pixel/SpriteGeneratorPanel.js +11 -7
  30. package/dist/cjs/pixel/animalGeneratorPresets.js +31 -31
  31. package/dist/cjs/pixel/buildingGeneratorPresets.js +24 -24
  32. package/dist/cjs/pixel/characterGeneratorPresets.js +25 -25
  33. package/dist/cjs/pixel/usePixelEditor.js +13 -10
  34. package/dist/cjs/texture/Nice3DTexturePainter.js +10 -8
  35. package/dist/cjs/ui/NiceUIDesigner.js +17 -13
  36. package/dist/cjs/vector/NiceSvgToCode.js +6 -4
  37. package/dist/cjs/vector/VectorEditor.js +3 -2
  38. package/dist/cjs/vector/VectorEditorShapeRenderer.js +3 -1
  39. package/dist/cjs/vector/useVectorEditor.js +38 -29
  40. package/dist/cjs/vector/vectorEditorImport.js +1 -0
  41. package/dist/cjs/vector/vectorIconImport.js +1 -0
  42. package/dist/esm/animation/Audience.js +3 -1
  43. package/dist/esm/animation/rig/RigPlayer.js +1 -1
  44. package/dist/esm/animation/rig/presets.js +68 -56
  45. package/dist/esm/animation/shapes/headwear.js +4 -1
  46. package/dist/esm/animation/spineExport.js +1 -1
  47. package/dist/esm/core/NiceBrushEngine.js +5 -3
  48. package/dist/esm/core/editorAsk.js +45 -0
  49. package/dist/esm/core/i18n.js +8 -4
  50. package/dist/esm/core/plugins.js +1 -1
  51. package/dist/esm/core/rtl.js +1 -1
  52. package/dist/esm/core/theme.js +1 -1
  53. package/dist/esm/font/NiceFontEditor.js +13 -11
  54. package/dist/esm/game/GameAsset2dEditor.js +28 -16
  55. package/dist/esm/nice2dev-ui-graphics.css +1 -1
  56. package/dist/esm/photo/FilterThumb.js +3 -3
  57. package/dist/esm/photo/NiceAITools.js +5 -3
  58. package/dist/esm/photo/PhotoEditor.js +3 -1
  59. package/dist/esm/photo/PhotoEditorCanvas.js +8 -6
  60. package/dist/esm/photo/PhotoEditorLeftPanel.js +19 -19
  61. package/dist/esm/photo/PhotoEditorToolbar.js +4 -4
  62. package/dist/esm/photo/photoFilters.js +1 -0
  63. package/dist/esm/pixel/PixelEditor.js +6 -3
  64. package/dist/esm/pixel/PixelEditorCanvas.js +10 -6
  65. package/dist/esm/pixel/PixelEditorMenuBar.js +3 -3
  66. package/dist/esm/pixel/PixelEditorRightPanel.js +28 -24
  67. package/dist/esm/pixel/PixelEditorStatusBar.js +8 -4
  68. package/dist/esm/pixel/PixelEditorTimeline.js +11 -2
  69. package/dist/esm/pixel/PixelEditorToolbar.js +10 -6
  70. package/dist/esm/pixel/SpriteGeneratorPanel.js +11 -7
  71. package/dist/esm/pixel/animalGeneratorPresets.js +32 -32
  72. package/dist/esm/pixel/buildingGeneratorPresets.js +25 -25
  73. package/dist/esm/pixel/characterGeneratorPresets.js +26 -26
  74. package/dist/esm/pixel/usePixelEditor.js +13 -10
  75. package/dist/esm/texture/Nice3DTexturePainter.js +10 -8
  76. package/dist/esm/ui/NiceUIDesigner.js +17 -13
  77. package/dist/esm/vector/NiceSvgToCode.js +6 -4
  78. package/dist/esm/vector/VectorEditor.js +3 -2
  79. package/dist/esm/vector/VectorEditorShapeRenderer.js +3 -1
  80. package/dist/esm/vector/useVectorEditor.js +38 -29
  81. package/dist/esm/vector/vectorEditorImport.js +1 -0
  82. package/dist/esm/vector/vectorIconImport.js +1 -0
  83. package/dist/types/core/LocalUI.d.ts +1 -2
  84. package/dist/types/core/editorAsk.d.ts +26 -0
  85. package/dist/types/core/i18n.d.ts +1 -17
  86. package/dist/types/pixel/usePixelEditor.d.ts +3 -0
  87. package/dist/types/vector/useVectorEditor.d.ts +2 -0
  88. package/package.json +5 -5
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var uiCore = require('@nice2dev/ui-core');
5
5
  var React = require('react');
6
+ var i18n = require('../core/i18n.js');
6
7
 
7
8
  function luminance(r, g, b) {
8
9
  return 0.299 * r + 0.587 * g + 0.114 * b;
@@ -460,6 +461,7 @@ const TOOL_ICONS = {
460
461
  };
461
462
  const NiceAITools = ({ sourceImage, onResult, className = '', }) => {
462
463
  var _a;
464
+ const { t } = i18n.useNiceTranslation();
463
465
  const ai = useAITools(sourceImage);
464
466
  const handleProcess = async () => {
465
467
  const result = await ai.process();
@@ -467,7 +469,7 @@ const NiceAITools = ({ sourceImage, onResult, className = '', }) => {
467
469
  onResult(result);
468
470
  }
469
471
  };
470
- return (jsxRuntime.jsxs("div", { className: `nice-ai-tools ${className}`, style: { display: 'grid', gap: 8, fontSize: 13 }, children: [jsxRuntime.jsxs("strong", { style: { display: 'inline-flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "wand", size: 16 }), " AI Tools"] }), jsxRuntime.jsx("div", { style: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: Object.entries(TOOL_LABELS).map(([key, label]) => (jsxRuntime.jsxs("button", { type: "button", onClick: () => ai.setActiveTool(key), style: {
472
+ return (jsxRuntime.jsxs("div", { className: `nice-ai-tools ${className}`, style: { display: 'grid', gap: 8, fontSize: 13 }, children: [jsxRuntime.jsxs("strong", { style: { display: 'inline-flex', alignItems: 'center', gap: 4 }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "wand", size: 16 }), " ", t('aiTools.aiTools', 'AI Tools')] }), jsxRuntime.jsx("div", { style: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: Object.entries(TOOL_LABELS).map(([key, label]) => (jsxRuntime.jsxs("button", { type: "button", onClick: () => ai.setActiveTool(key), style: {
471
473
  flex: 1,
472
474
  padding: '4px 6px',
473
475
  fontSize: 11,
@@ -484,7 +486,7 @@ const NiceAITools = ({ sourceImage, onResult, className = '', }) => {
484
486
  }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: TOOL_ICONS[key], size: 14 }), " ", label] }, key))) }), ai.activeTool === 'colorize' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Intensity: ", ai.colorizeOptions.intensity.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.colorizeOptions.intensity, onChange: (e) => ai.setColorizeOptions({ ...ai.colorizeOptions, intensity: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Saturation: ", ai.colorizeOptions.saturation.toFixed(1), jsxRuntime.jsx("input", { type: "range", min: 0, max: 2, step: 0.1, value: ai.colorizeOptions.saturation, onChange: (e) => ai.setColorizeOptions({ ...ai.colorizeOptions, saturation: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Temperature:", jsxRuntime.jsxs("select", { value: ai.colorizeOptions.temperature, onChange: (e) => ai.setColorizeOptions({
485
487
  ...ai.colorizeOptions,
486
488
  temperature: e.target.value,
487
- }), style: { width: '100%' }, children: [jsxRuntime.jsx("option", { value: "warm", children: "Warm" }), jsxRuntime.jsx("option", { value: "neutral", children: "Neutral" }), jsxRuntime.jsx("option", { value: "cool", children: "Cool" })] })] })] })), ai.activeTool === 'background-remove' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Threshold: ", ai.bgRemoveOptions.threshold.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0.1, max: 0.9, step: 0.05, value: ai.bgRemoveOptions.threshold, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, threshold: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Iterations: ", ai.bgRemoveOptions.iterations, jsxRuntime.jsx("input", { type: "range", min: 1, max: 20, step: 1, value: ai.bgRemoveOptions.iterations, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, iterations: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Feather: ", ai.bgRemoveOptions.featherRadius, "px", jsxRuntime.jsx("input", { type: "range", min: 0, max: 10, step: 1, value: ai.bgRemoveOptions.featherRadius, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, featherRadius: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { style: { display: 'flex', gap: 4, alignItems: 'center' }, children: ["Replace BG:", jsxRuntime.jsx("input", { type: "color", value: (_a = ai.bgRemoveOptions.replacementColor) !== null && _a !== void 0 ? _a : '#ffffff', onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, replacementColor: e.target.value }) }), jsxRuntime.jsx("button", { type: "button", onClick: () => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, replacementColor: null }), style: { fontSize: 10 }, children: "Transparent" })] })] })), ai.activeTool === 'upscale' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Scale:", jsxRuntime.jsxs("select", { value: ai.upscaleOptions.scale, onChange: (e) => ai.setUpscaleOptions({ ...ai.upscaleOptions, scale: +e.target.value }), style: { width: '100%' }, children: [jsxRuntime.jsx("option", { value: 2, children: "2x" }), jsxRuntime.jsx("option", { value: 3, children: "3x" }), jsxRuntime.jsx("option", { value: 4, children: "4x" })] })] }), jsxRuntime.jsxs("label", { children: ["Sharpen: ", ai.upscaleOptions.sharpen.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.upscaleOptions.sharpen, onChange: (e) => ai.setUpscaleOptions({ ...ai.upscaleOptions, sharpen: +e.target.value }), style: { width: '100%' } })] })] })), ai.activeTool === 'denoise' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Strength: ", ai.denoiseOptions.strength.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.denoiseOptions.strength, onChange: (e) => ai.setDenoiseOptions({ ...ai.denoiseOptions, strength: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Detail: ", ai.denoiseOptions.detailPreservation.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.denoiseOptions.detailPreservation, onChange: (e) => ai.setDenoiseOptions({ ...ai.denoiseOptions, detailPreservation: +e.target.value }), style: { width: '100%' } })] })] })), jsxRuntime.jsx("button", { type: "button", onClick: handleProcess, disabled: ai.isProcessing || !sourceImage, style: {
489
+ }), style: { width: '100%' }, children: [jsxRuntime.jsx("option", { value: "warm", children: t('aiTools.warm', 'Warm') }), jsxRuntime.jsx("option", { value: "neutral", children: t('aiTools.neutral', 'Neutral') }), jsxRuntime.jsx("option", { value: "cool", children: t('aiTools.cool', 'Cool') })] })] })] })), ai.activeTool === 'background-remove' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Threshold: ", ai.bgRemoveOptions.threshold.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0.1, max: 0.9, step: 0.05, value: ai.bgRemoveOptions.threshold, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, threshold: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Iterations: ", ai.bgRemoveOptions.iterations, jsxRuntime.jsx("input", { type: "range", min: 1, max: 20, step: 1, value: ai.bgRemoveOptions.iterations, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, iterations: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Feather: ", ai.bgRemoveOptions.featherRadius, "px", jsxRuntime.jsx("input", { type: "range", min: 0, max: 10, step: 1, value: ai.bgRemoveOptions.featherRadius, onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, featherRadius: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { style: { display: 'flex', gap: 4, alignItems: 'center' }, children: ["Replace BG:", jsxRuntime.jsx("input", { type: "color", value: (_a = ai.bgRemoveOptions.replacementColor) !== null && _a !== void 0 ? _a : '#ffffff', onChange: (e) => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, replacementColor: e.target.value }) }), jsxRuntime.jsx("button", { type: "button", onClick: () => ai.setBgRemoveOptions({ ...ai.bgRemoveOptions, replacementColor: null }), style: { fontSize: 10 }, children: t('aiTools.transparent', 'Transparent') })] })] })), ai.activeTool === 'upscale' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Scale:", jsxRuntime.jsxs("select", { value: ai.upscaleOptions.scale, onChange: (e) => ai.setUpscaleOptions({ ...ai.upscaleOptions, scale: +e.target.value }), style: { width: '100%' }, children: [jsxRuntime.jsx("option", { value: 2, children: "2x" }), jsxRuntime.jsx("option", { value: 3, children: "3x" }), jsxRuntime.jsx("option", { value: 4, children: "4x" })] })] }), jsxRuntime.jsxs("label", { children: ["Sharpen: ", ai.upscaleOptions.sharpen.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.upscaleOptions.sharpen, onChange: (e) => ai.setUpscaleOptions({ ...ai.upscaleOptions, sharpen: +e.target.value }), style: { width: '100%' } })] })] })), ai.activeTool === 'denoise' && (jsxRuntime.jsxs("div", { style: { display: 'grid', gap: 4 }, children: [jsxRuntime.jsxs("label", { children: ["Strength: ", ai.denoiseOptions.strength.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.denoiseOptions.strength, onChange: (e) => ai.setDenoiseOptions({ ...ai.denoiseOptions, strength: +e.target.value }), style: { width: '100%' } })] }), jsxRuntime.jsxs("label", { children: ["Detail: ", ai.denoiseOptions.detailPreservation.toFixed(2), jsxRuntime.jsx("input", { type: "range", min: 0, max: 1, step: 0.05, value: ai.denoiseOptions.detailPreservation, onChange: (e) => ai.setDenoiseOptions({ ...ai.denoiseOptions, detailPreservation: +e.target.value }), style: { width: '100%' } })] })] })), jsxRuntime.jsx("button", { type: "button", onClick: handleProcess, disabled: ai.isProcessing || !sourceImage, style: {
488
490
  background: ai.isProcessing
489
491
  ? 'var(--nice-bg-tertiary, #94a3b8)'
490
492
  : 'var(--nice-color-accent, #6366f1)',
@@ -497,7 +499,7 @@ const NiceAITools = ({ sourceImage, onResult, className = '', }) => {
497
499
  alignItems: 'center',
498
500
  justifyContent: 'center',
499
501
  gap: 4,
500
- }, children: ai.isProcessing ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14 }), " Processing\u2026"] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "play", size: 14 }), " ", TOOL_LABELS[ai.activeTool]] })) }), ai.lastResult && (jsxRuntime.jsxs("div", { style: { fontSize: 11, color: 'var(--nice-text-muted, #64748b)' }, children: ["Processed in ", ai.lastResult.processingTimeMs.toFixed(0), "ms", ai.activeTool === 'upscale' &&
502
+ }, children: ai.isProcessing ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14 }), " Processing\u2026"] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "play", size: 14 }), " ", TOOL_LABELS[ai.activeTool]] })) }), ai.lastResult && (jsxRuntime.jsxs("div", { style: { fontSize: 11, color: 'var(--nice-text-muted, #64748b)' }, children: [t('aiTools.processedInMs', 'Processed in {ms}ms').replace('{ms}', ai.lastResult.processingTimeMs.toFixed(0)), ai.activeTool === 'upscale' &&
501
503
  ` → ${ai.lastResult.imageData.width}×${ai.lastResult.imageData.height}`] }))] }));
502
504
  };
503
505
 
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var ui = require('@nice2dev/ui');
5
5
  var uiCore = require('@nice2dev/ui-core');
6
+ var i18n = require('../core/i18n.js');
6
7
  var PhotoEditor_module = require('./PhotoEditor.module.css.js');
7
8
  var PhotoEditorCanvas = require('./PhotoEditorCanvas.js');
8
9
  var PhotoEditorLeftPanel = require('./PhotoEditorLeftPanel.js');
@@ -11,9 +12,10 @@ var usePhotoEditor = require('./usePhotoEditor.js');
11
12
 
12
13
  // ── Component ──
13
14
  function NicePhotoEditor(props) {
15
+ const { t } = i18n.useNiceTranslation();
14
16
  const api = usePhotoEditor.usePhotoEditor(props);
15
17
  if (api.loading || !api.image) {
16
- return (jsxRuntime.jsx("div", { className: PhotoEditor_module.loadingWrap, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 32, className: PhotoEditor_module.loadingSpin, title: "Loading" }) }));
18
+ return (jsxRuntime.jsx("div", { className: PhotoEditor_module.loadingWrap, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 32, className: PhotoEditor_module.loadingSpin, title: t('photoEditor.loading', 'Loading') }) }));
17
19
  }
18
20
  return (jsxRuntime.jsx(ui.NiceAppShell, { className: PhotoEditor_module.wrapper, flush: true, toolbar: jsxRuntime.jsx(PhotoEditorToolbar, { api: api }), sidebar: jsxRuntime.jsx(PhotoEditorLeftPanel, { api: api }), children: jsxRuntime.jsx(PhotoEditorCanvas, { api: api }) }));
19
21
  }
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var uiCore = require('@nice2dev/ui-core');
5
5
  var React = require('react');
6
+ var i18n = require('../core/i18n.js');
6
7
  var PhotoEditor_module = require('./PhotoEditor.module.css.js');
7
8
 
8
9
  // ── Crop Overlay (rule-of-thirds + 8 handles + size indicator) ──
@@ -76,18 +77,19 @@ const CropOverlay = ({ api }) => {
76
77
  }, onMouseDown: (e) => handleCropMouseDown(e, 'e') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.cropSizeLabel, children: [Math.round(cropRect.w), " \u00D7 ", Math.round(cropRect.h)] })] })] }));
77
78
  };
78
79
  // ── Canvas Viewport ──
79
- const PhotoEditorCanvas = React.memo(({ api }) => {
80
+ const PhotoEditorCanvas = /* @__PURE__ */ Object.assign(
81
+ /* @__PURE__ */ React.memo(({ api }) => {
82
+ const { t } = i18n.useNiceTranslation();
80
83
  const { containerRef, activeTab, zoom, accent, showCompare, comparePosition, setCompareDragging, mainCanvasRef, compareCanvasRef, handleCanvasMouseDown, handleCanvasMouseMove, handleCanvasMouseUp, } = api;
81
84
  return (jsxRuntime.jsx("div", { ref: containerRef, className: PhotoEditor_module.canvasViewport, style: { cursor: activeTab === 'draw' ? 'crosshair' : undefined }, onMouseDown: handleCanvasMouseDown, onMouseMove: handleCanvasMouseMove, onMouseUp: handleCanvasMouseUp, onMouseLeave: handleCanvasMouseUp, children: jsxRuntime.jsx("div", { className: PhotoEditor_module.zoomWrap, style: { transform: `scale(${zoom})` }, children: showCompare ? (
82
85
  // ── Before / After comparison ──
83
- jsxRuntime.jsxs("div", { className: PhotoEditor_module.compareWrap, onMouseDown: () => setCompareDragging(true), children: [jsxRuntime.jsx("canvas", { ref: compareCanvasRef, className: PhotoEditor_module.canvasOriginal, role: "img", "aria-label": "Photo editor original preview canvas" }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareClip, style: { width: `${comparePosition}%` }, children: jsxRuntime.jsx("canvas", { ref: mainCanvasRef, className: PhotoEditor_module.canvasEdited, role: "img", "aria-label": "Photo editor edited preview canvas" }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareSlider, style: {
86
+ jsxRuntime.jsxs("div", { className: PhotoEditor_module.compareWrap, onMouseDown: () => setCompareDragging(true), children: [jsxRuntime.jsx("canvas", { ref: compareCanvasRef, className: PhotoEditor_module.canvasOriginal, role: "img", "aria-label": t('photoEditorCanvas.photoEditorOriginalPreviewCanvas', 'Photo editor original preview canvas') }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareClip, style: { width: `${comparePosition}%` }, children: jsxRuntime.jsx("canvas", { ref: mainCanvasRef, className: PhotoEditor_module.canvasEdited, role: "img", "aria-label": t('photoEditorCanvas.photoEditorEditedPreviewCanvas', 'Photo editor edited preview canvas') }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareSlider, style: {
84
87
  left: `${comparePosition}%`,
85
88
  background: accent,
86
89
  boxShadow: `0 0 8px ${accent}`,
87
- }, children: jsxRuntime.jsx("div", { className: PhotoEditor_module.compareSliderKnob, style: { background: accent }, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, className: PhotoEditor_module.compareSliderIcon }) }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareLabelOriginal, children: "Original" }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareLabelEdited, style: { background: `${accent}cc` }, children: "Edited" })] })) : (
90
+ }, children: jsxRuntime.jsx("div", { className: PhotoEditor_module.compareSliderKnob, style: { background: accent }, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, className: PhotoEditor_module.compareSliderIcon }) }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareLabelOriginal, children: t('photoEditorCanvas.original', 'Original') }), jsxRuntime.jsx("div", { className: PhotoEditor_module.compareLabelEdited, style: { background: `${accent}cc` }, children: t('photoEditorCanvas.edited', 'Edited') })] })) : (
88
91
  // ── Regular canvas view ──
89
- jsxRuntime.jsxs("div", { className: PhotoEditor_module.regularWrap, children: [jsxRuntime.jsx("canvas", { ref: mainCanvasRef, className: PhotoEditor_module.canvasRegular, role: "img", "aria-label": "Photo editor canvas" }), jsxRuntime.jsx(CropOverlay, { api: api })] })) }) }));
90
- });
91
- PhotoEditorCanvas.displayName = 'PhotoEditorCanvas';
92
+ jsxRuntime.jsxs("div", { className: PhotoEditor_module.regularWrap, children: [jsxRuntime.jsx("canvas", { ref: mainCanvasRef, className: PhotoEditor_module.canvasRegular, role: "img", "aria-label": t('photoEditorCanvas.photoEditorCanvas', 'Photo editor canvas') }), jsxRuntime.jsx(CropOverlay, { api: api })] })) }) }));
93
+ }), { displayName: 'PhotoEditorCanvas' });
92
94
 
93
95
  module.exports = PhotoEditorCanvas;
@@ -17,13 +17,14 @@ const OverlayToolbar = ({ api }) => {
17
17
  if (!selectedOverlay) {
18
18
  return null;
19
19
  }
20
- return (jsxRuntime.jsxs("div", { className: PhotoEditor_module.overlayToolbar, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.overlayToolbarLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "box", size: 14, style: { marginRight: 4 } }), "Warstwa"] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 0, max: 100, value: ((_a = selectedOverlay.opacity) !== null && _a !== void 0 ? _a : 1) * 100, onChange: (e) => updateOverlay(selectedOverlay.id, { opacity: Number(e.target.value) / 100 }), onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 70 }, title: t('photoEditor.opacity', 'Opacity') }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValueSm, style: { color: accent }, children: [Math.round(((_b = selectedOverlay.opacity) !== null && _b !== void 0 ? _b : 1) * 100), "%"] }), selectedOverlay.type !== 'drawing' && selectedOverlay.type !== 'frame' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LocalUI.RangeInput, { min: 20, max: 500, value: ((_c = selectedOverlay.scaleX) !== null && _c !== void 0 ? _c : 1) * 100, onChange: (e) => {
20
+ return (jsxRuntime.jsxs("div", { className: PhotoEditor_module.overlayToolbar, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.overlayToolbarLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "box", size: 14, style: { marginRight: 4 } }), t('photoEditor.layer', 'Layer')] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 0, max: 100, value: ((_a = selectedOverlay.opacity) !== null && _a !== void 0 ? _a : 1) * 100, onChange: (e) => updateOverlay(selectedOverlay.id, { opacity: Number(e.target.value) / 100 }), onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 70 }, title: t('photoEditor.opacity', 'Opacity') }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValueSm, style: { color: accent }, children: [Math.round(((_b = selectedOverlay.opacity) !== null && _b !== void 0 ? _b : 1) * 100), "%"] }), selectedOverlay.type !== 'drawing' && selectedOverlay.type !== 'frame' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LocalUI.RangeInput, { min: 20, max: 500, value: ((_c = selectedOverlay.scaleX) !== null && _c !== void 0 ? _c : 1) * 100, onChange: (e) => {
21
21
  const s = Number(e.target.value) / 100;
22
22
  updateOverlay(selectedOverlay.id, { scaleX: s, scaleY: s });
23
- }, onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 60 }, title: "Skala" }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValueSm, style: { color: 'var(--nice-text-muted, #aaa)' }, children: [Math.round(((_d = selectedOverlay.scaleX) !== null && _d !== void 0 ? _d : 1) * 100), "%"] })] })), selectedOverlay.type !== 'drawing' && selectedOverlay.type !== 'frame' && (jsxRuntime.jsx(LocalUI.RangeInput, { min: -180, max: 180, value: (_e = selectedOverlay.rotation) !== null && _e !== void 0 ? _e : 0, onChange: (e) => updateOverlay(selectedOverlay.id, { rotation: Number(e.target.value) }), onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 60 }, title: t('photoEditor.rotation', 'Rotation') })), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => moveOverlayBack(selectedOverlay.id), title: t('photoEditor.moveBack', 'Move back'), className: PhotoEditor_module.overlayToolbarBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => moveOverlayForward(selectedOverlay.id), title: t('photoEditor.moveForward', 'Move forward'), className: PhotoEditor_module.overlayToolbarBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-up", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "outline-danger", size: "sm", onClick: () => deleteOverlay(selectedOverlay.id), className: PhotoEditor_module.overlayToolbarBtn, title: t('photoEditor.deleteLayer', 'Delete layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "trash", size: 14 }) })] }));
23
+ }, onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 60 }, title: t('photoEditor.scale', 'Scale') }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValueSm, style: { color: 'var(--nice-text-muted, #aaa)' }, children: [Math.round(((_d = selectedOverlay.scaleX) !== null && _d !== void 0 ? _d : 1) * 100), "%"] })] })), selectedOverlay.type !== 'drawing' && selectedOverlay.type !== 'frame' && (jsxRuntime.jsx(LocalUI.RangeInput, { min: -180, max: 180, value: (_e = selectedOverlay.rotation) !== null && _e !== void 0 ? _e : 0, onChange: (e) => updateOverlay(selectedOverlay.id, { rotation: Number(e.target.value) }), onMouseUp: pushHistory, accentColor: accent, style: { maxWidth: 60 }, title: t('photoEditor.rotation', 'Rotation') })), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => moveOverlayBack(selectedOverlay.id), title: t('photoEditor.moveBack', 'Move back'), className: PhotoEditor_module.overlayToolbarBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => moveOverlayForward(selectedOverlay.id), title: t('photoEditor.moveForward', 'Move forward'), className: PhotoEditor_module.overlayToolbarBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-up", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "outline-danger", size: "sm", onClick: () => deleteOverlay(selectedOverlay.id), className: PhotoEditor_module.overlayToolbarBtn, title: t('photoEditor.deleteLayer', 'Delete layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "trash", size: 14 }) })] }));
24
24
  };
25
25
  // ── Left Panel ──
26
- const PhotoEditorLeftPanel = React.memo(({ api }) => {
26
+ const PhotoEditorLeftPanel = /* @__PURE__ */ Object.assign(
27
+ /* @__PURE__ */ React.memo(({ api }) => {
27
28
  var _a;
28
29
  const { t, accent, accentDim, activeTab, setActiveTab, setCropMode,
29
30
  // Filters
@@ -72,16 +73,16 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
72
73
  }, children: cat.label }, cat.key))) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.filterGrid, children: filteredList.map((filter) => (jsxRuntime.jsx(FilterThumb, { filter: filter, selected: selectedFilter === filter.id, accent: accent, onSelect: () => {
73
74
  setSelectedFilter(filter.id);
74
75
  pushHistory();
75
- }, generateThumbnail: generateThumbnail }, filter.id))) }), selectedFilter !== 'none' && (jsxRuntime.jsxs("div", { className: PhotoEditor_module.intensitySection, children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.intensityHeader, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "bar-chart", size: 14, style: { marginRight: 4 } }), "Intensity"] }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [Math.round(filterIntensity * 100), "%"] })] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 0, max: 100, value: filterIntensity * 100, onChange: (e) => setFilterIntensity(Number(e.target.value) / 100), onMouseUp: () => pushHistory(), accentColor: accent })] }))] })), activeTab === 'adjust' && (jsxRuntime.jsxs("div", { className: PhotoEditor_module.adjustColumn, children: [photoEditorTypes.ADJUSTMENT_SLIDERS.map((sl) => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.adjustHeader, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: sl.icon, size: 14, style: { marginRight: 4 } }), sl.label] }), jsxRuntime.jsx("span", { className: PhotoEditor_module.adjustValue, style: {
76
+ }, generateThumbnail: generateThumbnail }, filter.id))) }), selectedFilter !== 'none' && (jsxRuntime.jsxs("div", { className: PhotoEditor_module.intensitySection, children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.intensityHeader, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "bar-chart", size: 14, style: { marginRight: 4 } }), t('photoEditor.intensity', 'Intensity')] }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [Math.round(filterIntensity * 100), "%"] })] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 0, max: 100, value: filterIntensity * 100, onChange: (e) => setFilterIntensity(Number(e.target.value) / 100), onMouseUp: () => pushHistory(), accentColor: accent })] }))] })), activeTab === 'adjust' && (jsxRuntime.jsxs("div", { className: PhotoEditor_module.adjustColumn, children: [photoEditorTypes.ADJUSTMENT_SLIDERS.map((sl) => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.adjustHeader, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: sl.icon, size: 14, style: { marginRight: 4 } }), sl.label] }), jsxRuntime.jsx("span", { className: PhotoEditor_module.adjustValue, style: {
76
77
  color: adjustments[sl.key] !== 0 ? accent : 'var(--nice-text-secondary, #666)',
77
- }, onClick: () => handleAdjChange(sl.key, sl.key === 'blur' ? 0 : 0), title: "Reset", children: adjustments[sl.key] })] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: sl.min, max: sl.max, value: adjustments[sl.key], onChange: (e) => handleAdjChange(sl.key, Number(e.target.value)), onMouseUp: handleAdjChangeEnd, accentColor: accent })] }, sl.key))), jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-secondary", size: "sm", className: "mt-2", onClick: () => {
78
+ }, onClick: () => handleAdjChange(sl.key, sl.key === 'blur' ? 0 : 0), title: t('photoEditor.reset', 'Reset'), children: adjustments[sl.key] })] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: sl.min, max: sl.max, value: adjustments[sl.key], onChange: (e) => handleAdjChange(sl.key, Number(e.target.value)), onMouseUp: handleAdjChangeEnd, accentColor: accent })] }, sl.key))), jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-secondary", size: "sm", className: "mt-2", onClick: () => {
78
79
  handleAdjChange('brightness', 0);
79
80
  const defaults = { ...photoFilters.DEFAULT_ADJUSTMENTS };
80
81
  for (const key of Object.keys(defaults)) {
81
82
  handleAdjChange(key, defaults[key]);
82
83
  }
83
84
  pushHistory();
84
- }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14, style: { marginRight: 4 } }), t('photoEditor.resetAdjustments', 'Reset adjustments')] })] })), activeTab === 'crop' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.cropInfo, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "info", size: 14, style: { marginRight: 4 } }), "Drag corners or edges to crop the photo."] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.cropAspectLabel, children: "Aspect ratio" }), jsxRuntime.jsx("div", { className: PhotoEditor_module.cropAspectRow, children: photoEditorTypes.ASPECT_RATIOS.map((ar) => (jsxRuntime.jsx("button", { onClick: () => {
85
+ }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14, style: { marginRight: 4 } }), t('photoEditor.resetAdjustments', 'Reset adjustments')] })] })), activeTab === 'crop' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.cropInfo, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "info", size: 14, style: { marginRight: 4 } }), t('photoEditor.dragCornersOrEdgesTo', 'Drag corners or edges to crop the photo.')] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.cropAspectLabel, children: t('photoEditor.aspectRatio', 'Aspect ratio') }), jsxRuntime.jsx("div", { className: PhotoEditor_module.cropAspectRow, children: photoEditorTypes.ASPECT_RATIOS.map((ar) => (jsxRuntime.jsx("button", { onClick: () => {
85
86
  setCropAspect(ar.value);
86
87
  if (ar.value && cropRect && image) {
87
88
  let newW = cropRect.w;
@@ -106,7 +107,7 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
106
107
  setCropAspect(null);
107
108
  pushHistory();
108
109
  }
109
- }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "expand", size: 14, style: { marginRight: 4 } }), t('photoEditor.resetCrop', 'Reset crop')] })] })), activeTab === 'transform' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: "Rotation" }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformRow, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => {
110
+ }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "expand", size: 14, style: { marginRight: 4 } }), t('photoEditor.resetCrop', 'Reset crop')] })] })), activeTab === 'transform' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: t('photoEditor.rotation', 'Rotation') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformRow, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => {
110
111
  setRotation((rotation - 90 + 360) % 360);
111
112
  pushHistory();
112
113
  }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "reply", size: 14, style: { marginRight: 4 } }), " -90\u00B0"] }), jsxRuntime.jsxs(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => {
@@ -115,13 +116,13 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
115
116
  }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "forward", size: 14, style: { marginRight: 4 } }), " +90\u00B0"] }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: () => {
116
117
  setRotation(0);
117
118
  pushHistory();
118
- }, children: "0\u00B0" })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: "Flip" }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformRow, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: flipH ? 'outline-info' : 'dark', size: "sm", onClick: () => {
119
+ }, children: "0\u00B0" })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: t('photoEditor.flip', 'Flip') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformRow, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: flipH ? 'outline-info' : 'dark', size: "sm", onClick: () => {
119
120
  setFlipH(!flipH);
120
121
  pushHistory();
121
- }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, style: { marginRight: 4 } }), " Horizontal"] }), jsxRuntime.jsxs(LocalUI.Button, { variant: flipV ? 'outline-info' : 'dark', size: "sm", onClick: () => {
122
+ }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.horizontal', 'Horizontal')] }), jsxRuntime.jsxs(LocalUI.Button, { variant: flipV ? 'outline-info' : 'dark', size: "sm", onClick: () => {
122
123
  setFlipV(!flipV);
123
124
  pushHistory();
124
- }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, style: { marginRight: 4 } }), " Vertical"] })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: "Preview zoom" }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformZoomRow, children: [jsxRuntime.jsx(LocalUI.RangeInput, { min: 50, max: 300, value: zoom * 100, onChange: (e) => setZoom(Number(e.target.value) / 100), accentColor: accent }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.transformZoomValue, style: { color: accent }, children: [Math.round(zoom * 100), "%"] })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformInfo, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Rotation:" }), " ", rotation, "\u00B0"] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Flip H:" }), " ", flipH ? 'Yes' : 'No'] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Flip V:" }), " ", flipV ? 'Yes' : 'No'] }), cropRect && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Crop:" }), " ", Math.round(cropRect.w), " \u00D7 ", Math.round(cropRect.h), ' (', "x:", Math.round(cropRect.x), ", y:", Math.round(cropRect.y), ")"] }))] })] })), activeTab === 'stickers' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "circle", size: 14, style: { marginRight: 4 } }), " Stickers / Emoji"] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.pillRowGap3, children: photoOverlays.EMOJI_CATALOG.map((cat) => (jsxRuntime.jsxs("button", { onClick: () => setEmojiCat(cat.id), className: emojiCat === cat.id ? PhotoEditor_module.pillEmojiActive : PhotoEditor_module.pillEmoji, style: {
125
+ }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "move", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.vertical', 'Vertical')] })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.sectionTitleMb8, children: t('photoEditor.previewZoom', 'Preview zoom') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformZoomRow, children: [jsxRuntime.jsx(LocalUI.RangeInput, { min: 50, max: 300, value: zoom * 100, onChange: (e) => setZoom(Number(e.target.value) / 100), accentColor: accent }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.transformZoomValue, style: { color: accent }, children: [Math.round(zoom * 100), "%"] })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.transformInfo, children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Rotation:" }), " ", rotation, "\u00B0"] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Flip H:" }), " ", flipH ? 'Yes' : 'No'] }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Flip V:" }), " ", flipV ? 'Yes' : 'No'] }), cropRect && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("strong", { children: "Crop:" }), " ", Math.round(cropRect.w), " \u00D7 ", Math.round(cropRect.h), ' (', "x:", Math.round(cropRect.x), ", y:", Math.round(cropRect.y), ")"] }))] })] })), activeTab === 'stickers' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "circle", size: 14, style: { marginRight: 4 } }), " Stickers / Emoji"] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.pillRowGap3, children: photoOverlays.EMOJI_CATALOG.map((cat) => (jsxRuntime.jsxs("button", { onClick: () => setEmojiCat(cat.id), className: emojiCat === cat.id ? PhotoEditor_module.pillEmojiActive : PhotoEditor_module.pillEmoji, style: {
125
126
  borderColor: emojiCat === cat.id ? accent : undefined,
126
127
  background: emojiCat === cat.id ? accentDim : undefined,
127
128
  }, children: [cat.icon, " ", cat.label] }, cat.id))) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.emojiGrid, children: (_a = photoOverlays.EMOJI_CATALOG.find((c) => c.id === emojiCat)) === null || _a === void 0 ? void 0 : _a.emojis.map((em, idx) => (jsxRuntime.jsx("button", { onClick: () => {
@@ -142,7 +143,7 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
142
143
  : '' }), jsxRuntime.jsx("button", { onClick: (e) => {
143
144
  e.stopPropagation();
144
145
  deleteOverlay(ov.id);
145
- }, className: PhotoEditor_module.overlayDeleteBtn, "aria-label": t('photoEditor.deleteLayer', 'Delete layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14 }) })] }, ov.id)))] }))] })), activeTab === 'text' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitleMb8, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "type", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.addCaption', 'Add caption')] }), jsxRuntime.jsx(LocalUI.TextArea, { rows: 2, value: textDraft, onChange: (e) => setTextDraft(e.target.value), placeholder: t('photoEditor.textPlaceholder', 'Enter text…'), className: PhotoEditor_module.textArea }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.textBtnRow, children: [jsxRuntime.jsx(LocalUI.Button, { variant: textBold ? 'light' : 'dark', size: "sm", onClick: () => setTextBold(!textBold), title: "Bold", className: PhotoEditor_module.textFormatBtn, style: { fontWeight: 700 }, children: "B" }), jsxRuntime.jsx(LocalUI.Button, { variant: textItalic ? 'light' : 'dark', size: "sm", onClick: () => setTextItalic(!textItalic), title: "Italic", className: PhotoEditor_module.textFormatBtn, style: { fontStyle: 'italic' }, children: "I" }), jsxRuntime.jsx(LocalUI.Button, { variant: textOutline ? 'light' : 'dark', size: "sm", onClick: () => setTextOutline(!textOutline), title: "Kontur", className: PhotoEditor_module.textFormatBtn, children: "O" }), jsxRuntime.jsx(LocalUI.Button, { variant: textBg ? 'light' : 'dark', size: "sm", onClick: () => setTextBg(!textBg), title: t('photoEditor.background', 'Background'), className: PhotoEditor_module.textFormatBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "square", size: 14 }) }), jsxRuntime.jsx("input", { type: "color", value: textColor, onChange: (e) => setTextColor(e.target.value), className: PhotoEditor_module.colorInputLg, title: t('photoEditor.textColour', 'Text colour') })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sliderRow, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [t('photoEditor.size', 'Size'), ":"] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 12, max: 120, value: textFontSize, onChange: (e) => setTextFontSize(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [textFontSize, "px"] })] }), jsxRuntime.jsxs(LocalUI.Button, { size: "sm", className: PhotoEditor_module.accentBtn, style: { background: accent, borderColor: accent }, disabled: !textDraft.trim(), onClick: () => {
146
+ }, className: PhotoEditor_module.overlayDeleteBtn, "aria-label": t('photoEditor.deleteLayer', 'Delete layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14 }) })] }, ov.id)))] }))] })), activeTab === 'text' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitleMb8, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "type", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.addCaption', 'Add caption')] }), jsxRuntime.jsx(LocalUI.TextArea, { rows: 2, value: textDraft, onChange: (e) => setTextDraft(e.target.value), placeholder: t('photoEditor.textPlaceholder', 'Enter text…'), className: PhotoEditor_module.textArea }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.textBtnRow, children: [jsxRuntime.jsx(LocalUI.Button, { variant: textBold ? 'light' : 'dark', size: "sm", onClick: () => setTextBold(!textBold), title: t('photoEditor.bold', 'Bold'), className: PhotoEditor_module.textFormatBtn, style: { fontWeight: 700 }, children: "B" }), jsxRuntime.jsx(LocalUI.Button, { variant: textItalic ? 'light' : 'dark', size: "sm", onClick: () => setTextItalic(!textItalic), title: t('photoEditor.italic', 'Italic'), className: PhotoEditor_module.textFormatBtn, style: { fontStyle: 'italic' }, children: "I" }), jsxRuntime.jsx(LocalUI.Button, { variant: textOutline ? 'light' : 'dark', size: "sm", onClick: () => setTextOutline(!textOutline), title: t('photoEditor.outline', 'Outline'), className: PhotoEditor_module.textFormatBtn, children: "O" }), jsxRuntime.jsx(LocalUI.Button, { variant: textBg ? 'light' : 'dark', size: "sm", onClick: () => setTextBg(!textBg), title: t('photoEditor.background', 'Background'), className: PhotoEditor_module.textFormatBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "square", size: 14 }) }), jsxRuntime.jsx("input", { type: "color", value: textColor, onChange: (e) => setTextColor(e.target.value), className: PhotoEditor_module.colorInputLg, title: t('photoEditor.textColour', 'Text colour') })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sliderRow, children: [jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderLabel, children: [t('photoEditor.size', 'Size'), ":"] }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 12, max: 120, value: textFontSize, onChange: (e) => setTextFontSize(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [textFontSize, "px"] })] }), jsxRuntime.jsxs(LocalUI.Button, { size: "sm", className: PhotoEditor_module.accentBtn, style: { background: accent, borderColor: accent }, disabled: !textDraft.trim(), onClick: () => {
146
147
  const ov = createTextOverlay(textDraft);
147
148
  ov.color = textColor;
148
149
  ov.bold = textBold;
@@ -166,13 +167,13 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
166
167
  italic: !selectedOverlay.italic,
167
168
  });
168
169
  pushHistory();
169
- }, className: PhotoEditor_module.textFormatBtnSm, style: { fontStyle: 'italic' }, children: "I" })] })] }))] })), activeTab === 'shapes' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "star", size: 14, style: { marginRight: 4 } }), " Shapes"] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.shapeColorRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.shapeColorLabel, children: "Stroke:" }), jsxRuntime.jsx("input", { type: "color", value: shapeStroke, onChange: (e) => setShapeStroke(e.target.value), className: PhotoEditor_module.colorInput, title: "Stroke color" }), jsxRuntime.jsx("span", { className: PhotoEditor_module.shapeColorLabelMl, children: "Fill:" }), jsxRuntime.jsx("input", { type: "color", value: shapeFill || '#ffffff', onChange: (e) => setShapeFill(e.target.value), className: PhotoEditor_module.colorInput, title: t('photoEditor.fillColor', 'Fill color') }), jsxRuntime.jsx(LocalUI.Button, { variant: shapeFill ? 'light' : 'dark', size: "sm", onClick: () => setShapeFill(shapeFill ? '' : '#ffffff'), className: PhotoEditor_module.shapeFillToggle, children: shapeFill ? 'Off' : 'On' })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sliderRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Width:" }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 1, max: 20, value: shapeStrokeW, onChange: (e) => setShapeStrokeW(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [shapeStrokeW, "px"] })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.shapeGrid, children: photoOverlays.SHAPE_CATALOG.map((sh) => (jsxRuntime.jsx("button", { title: sh.label, onClick: () => {
170
+ }, className: PhotoEditor_module.textFormatBtnSm, style: { fontStyle: 'italic' }, children: "I" })] })] }))] })), activeTab === 'shapes' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "star", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.shapes', 'Shapes')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.shapeColorRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.shapeColorLabel, children: "Stroke:" }), jsxRuntime.jsx("input", { type: "color", value: shapeStroke, onChange: (e) => setShapeStroke(e.target.value), className: PhotoEditor_module.colorInput, title: t('photoEditor.strokeColor', 'Stroke color') }), jsxRuntime.jsx("span", { className: PhotoEditor_module.shapeColorLabelMl, children: "Fill:" }), jsxRuntime.jsx("input", { type: "color", value: shapeFill || '#ffffff', onChange: (e) => setShapeFill(e.target.value), className: PhotoEditor_module.colorInput, title: t('photoEditor.fillColor', 'Fill color') }), jsxRuntime.jsx(LocalUI.Button, { variant: shapeFill ? 'light' : 'dark', size: "sm", onClick: () => setShapeFill(shapeFill ? '' : '#ffffff'), className: PhotoEditor_module.shapeFillToggle, children: shapeFill ? 'Off' : 'On' })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sliderRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Width:" }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 1, max: 20, value: shapeStrokeW, onChange: (e) => setShapeStrokeW(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsxs("span", { className: PhotoEditor_module.sliderValue, style: { color: accent }, children: [shapeStrokeW, "px"] })] }), jsxRuntime.jsx("div", { className: PhotoEditor_module.shapeGrid, children: photoOverlays.SHAPE_CATALOG.map((sh) => (jsxRuntime.jsx("button", { title: sh.label, onClick: () => {
170
171
  const ov = createShapeOverlay(sh.id);
171
172
  ov.strokeColor = shapeStroke;
172
173
  ov.fillColor = shapeFill || null;
173
174
  ov.strokeWidth = shapeStrokeW;
174
175
  addOverlay(ov);
175
- }, className: PhotoEditor_module.shapeBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: sh.icon, size: 18 }) }, sh.id))) }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "image", size: 14, style: { marginRight: 4 } }), " Ramki"] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameColorRow, children: [jsxRuntime.jsx("input", { type: "color", value: frameColor, onChange: (e) => setFrameColor(e.target.value), className: PhotoEditor_module.colorInput, "aria-label": t('photoEditor.frameColor', 'Frame color') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameThicknessWrap, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Grub.:" }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 1, max: 10, value: frameThick, onChange: (e) => setFrameThick(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsx("span", { className: PhotoEditor_module.frameThicknessValue, style: { color: accent }, children: frameThick })] })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameGrid, children: [photoOverlays.FRAME_CATALOG.map((fr) => (jsxRuntime.jsx("button", { title: fr.label, onClick: () => {
176
+ }, className: PhotoEditor_module.shapeBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: sh.icon, size: 18 }) }, sh.id))) }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitle, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "image", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.frames', 'Frames')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameColorRow, children: [jsxRuntime.jsx("input", { type: "color", value: frameColor, onChange: (e) => setFrameColor(e.target.value), className: PhotoEditor_module.colorInput, "aria-label": t('photoEditor.frameColor', 'Frame color') }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameThicknessWrap, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Grub.:" }), jsxRuntime.jsx(LocalUI.RangeInput, { min: 1, max: 10, value: frameThick, onChange: (e) => setFrameThick(Number(e.target.value)), accentColor: accent, style: { flex: 1 } }), jsxRuntime.jsx("span", { className: PhotoEditor_module.frameThicknessValue, style: { color: accent }, children: frameThick })] })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.frameGrid, children: [photoOverlays.FRAME_CATALOG.map((fr) => (jsxRuntime.jsx("button", { title: fr.label, onClick: () => {
176
177
  setOverlays((prev) => prev.filter((o) => o.type !== 'frame'));
177
178
  const ov = createFrameOverlay(fr.id, frameColor);
178
179
  ov.thickness = frameThick / 100;
@@ -180,7 +181,7 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
180
181
  }, className: PhotoEditor_module.frameBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: fr.icon, size: 18 }) }, fr.id))), jsxRuntime.jsx("button", { title: t('photoEditor.removeFrame', 'Remove frame'), "aria-label": t('photoEditor.removeFrame', 'Remove frame'), onClick: () => {
181
182
  setOverlays((prev) => prev.filter((o) => o.type !== 'frame'));
182
183
  pushHistory();
183
- }, className: PhotoEditor_module.removeFrameBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14 }) })] })] })), activeTab === 'draw' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitleMb8, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "brush", size: 14, style: { marginRight: 4 } }), " Freehand drawing"] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionInfoMb, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "info", size: 14, style: { marginRight: 4 } }), "Draw directly on the photo by holding the left mouse button."] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.quickColorRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Color:" }), jsxRuntime.jsx("input", { type: "color", value: drawColor, onChange: (e) => setDrawColor(e.target.value), className: PhotoEditor_module.colorInputDraw, "aria-label": t('photoEditor.drawColor', 'Drawing color') }), [
184
+ }, className: PhotoEditor_module.removeFrameBtn, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14 }) })] })] })), activeTab === 'draw' && (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(OverlayToolbar, { api: api }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionTitleMb8, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "brush", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.freehandDrawing', 'Freehand drawing')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.sectionInfoMb, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "info", size: 14, style: { marginRight: 4 } }), t('photoEditor.drawDirectlyOnThePhoto', 'Draw directly on the photo by holding the left mouse button.')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.quickColorRow, children: [jsxRuntime.jsx("span", { className: PhotoEditor_module.sliderLabel, children: "Color:" }), jsxRuntime.jsx("input", { type: "color", value: drawColor, onChange: (e) => setDrawColor(e.target.value), className: PhotoEditor_module.colorInputDraw, "aria-label": t('photoEditor.drawColor', 'Drawing color') }), [
184
185
  '#ff0000',
185
186
  '#ff8800',
186
187
  '#ffff00',
@@ -214,15 +215,14 @@ const PhotoEditorLeftPanel = React.memo(({ api }) => {
214
215
  }));
215
216
  pushHistory();
216
217
  }
217
- }, className: PhotoEditor_module.drawActionBtn, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "reply", size: 14, style: { marginRight: 4 } }), " Undo stroke"] }), jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-danger", size: "sm", onClick: () => {
218
+ }, className: PhotoEditor_module.drawActionBtn, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "reply", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.undoStroke', 'Undo stroke')] }), jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-danger", size: "sm", onClick: () => {
218
219
  if (drawingOverlayRef.current) {
219
220
  deleteOverlay(drawingOverlayRef.current.id);
220
221
  drawingOverlayRef.current = null;
221
222
  }
222
- }, className: PhotoEditor_module.drawActionBtn, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "trash", size: 14, style: { marginRight: 4 } }), " Clear"] })] }), jsxRuntime.jsxs(LocalUI.Button, { variant: "dark", size: "sm", className: "mt-2 w-100", onClick: () => {
223
+ }, className: PhotoEditor_module.drawActionBtn, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "trash", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.clear', 'Clear')] })] }), jsxRuntime.jsxs(LocalUI.Button, { variant: "dark", size: "sm", className: "mt-2 w-100", onClick: () => {
223
224
  drawingOverlayRef.current = null;
224
- }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 14, style: { marginRight: 4 } }), " New drawing layer"] })] }))] })] }));
225
- });
226
- PhotoEditorLeftPanel.displayName = 'PhotoEditorLeftPanel';
225
+ }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.newDrawingLayer', 'New drawing layer')] })] }))] })] }));
226
+ }), { displayName: 'PhotoEditorLeftPanel' });
227
227
 
228
228
  module.exports = PhotoEditorLeftPanel;
@@ -6,15 +6,15 @@ var React = require('react');
6
6
  var LocalUI = require('../core/LocalUI.js');
7
7
  var PhotoEditor_module = require('./PhotoEditor.module.css.js');
8
8
 
9
- const PhotoEditorToolbar = React.memo(({ api }) => {
9
+ const PhotoEditorToolbar = /* @__PURE__ */ Object.assign(
10
+ /* @__PURE__ */ React.memo(({ api }) => {
10
11
  const { t, accent, historyIdx, historyLength, undo, redo, handleReset, showCompare, setShowCompare, handleDownload, handleCopyToClipboard, handleShareNative, onCancel, handleSave, } = api;
11
- return (jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbar, children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarGroup, children: [jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: undo, disabled: historyIdx <= 0, title: `${t('photoEditor.undo', 'Undo')} (Ctrl+Z)`, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "reply", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: redo, disabled: historyIdx >= historyLength - 1, title: t('photoEditor.redo', 'Redo (Ctrl+Y)'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "forward", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleReset, title: "Reset", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14 }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.toolbarDivider }), jsxRuntime.jsx(LocalUI.Button, { variant: showCompare ? 'outline-info' : 'dark', size: "sm", onClick: () => setShowCompare(!showCompare), title: t('photoEditor.compareOriginal', 'Compare with original'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "columns", size: 14 }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.toolbarDivider }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleDownload, title: "Download", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "download", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleCopyToClipboard, title: "Copy to clipboard", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "clipboard", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleShareNative, title: t('common.share', 'Share'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "send", size: 14 }) })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarTitle, style: { color: accent }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "wand", size: 14, style: { marginRight: 8 } }), t('photoEditor.title', 'Photo Editor')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarGroup, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-secondary", size: "sm", onClick: onCancel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14, style: { marginRight: 4 } }), ' ', t('common.cancel', 'Cancel')] }), jsxRuntime.jsxs(LocalUI.Button, { size: "sm", style: {
12
+ return (jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbar, children: [jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarGroup, children: [jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: undo, disabled: historyIdx <= 0, title: `${t('photoEditor.undo', 'Undo')} (Ctrl+Z)`, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "reply", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: redo, disabled: historyIdx >= historyLength - 1, title: t('photoEditor.redo', 'Redo (Ctrl+Y)'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "forward", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleReset, title: t('photoEditor.reset', 'Reset'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "refresh", size: 14 }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.toolbarDivider }), jsxRuntime.jsx(LocalUI.Button, { variant: showCompare ? 'outline-info' : 'dark', size: "sm", onClick: () => setShowCompare(!showCompare), title: t('photoEditor.compareOriginal', 'Compare with original'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "columns", size: 14 }) }), jsxRuntime.jsx("div", { className: PhotoEditor_module.toolbarDivider }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleDownload, title: t('photoEditor.download', 'Download'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "download", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleCopyToClipboard, title: t('photoEditor.copyToClipboard', 'Copy to clipboard'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "clipboard", size: 14 }) }), jsxRuntime.jsx(LocalUI.Button, { variant: "dark", size: "sm", onClick: handleShareNative, title: t('common.share', 'Share'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "send", size: 14 }) })] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarTitle, style: { color: accent }, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "wand", size: 14, style: { marginRight: 8 } }), t('photoEditor.title', 'Photo Editor')] }), jsxRuntime.jsxs("div", { className: PhotoEditor_module.toolbarGroup, children: [jsxRuntime.jsxs(LocalUI.Button, { variant: "outline-secondary", size: "sm", onClick: onCancel, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "close", size: 14, style: { marginRight: 4 } }), ' ', t('common.cancel', 'Cancel')] }), jsxRuntime.jsxs(LocalUI.Button, { size: "sm", style: {
12
13
  background: accent,
13
14
  borderColor: accent,
14
15
  color: 'var(--nice-color-white, #fff)',
15
16
  fontWeight: 600,
16
17
  }, onClick: handleSave, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "check", size: 14, style: { marginRight: 4 } }), ' ', t('photoEditor.apply', 'Apply')] })] })] }));
17
- });
18
- PhotoEditorToolbar.displayName = 'PhotoEditorToolbar';
18
+ }), { displayName: 'PhotoEditorToolbar' });
19
19
 
20
20
  module.exports = PhotoEditorToolbar;
@@ -287,6 +287,7 @@ function brownie(data) {
287
287
  function duotone(data, params) {
288
288
  const out = cloneImageData(data);
289
289
  const d = out.data;
290
+ // audit-allow: literal-color +2 — the duotone filter's default inks, written into the photo
290
291
  const dark = hexToRgb((params === null || params === void 0 ? void 0 : params.darkColor) || '#001f3f');
291
292
  const light = hexToRgb((params === null || params === void 0 ? void 0 : params.lightColor) || '#ff851b');
292
293
  for (let i = 0; i < d.length; i += 4) {
@@ -3,6 +3,8 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var ui = require('@nice2dev/ui');
5
5
  var React = require('react');
6
+ var editorAsk = require('../core/editorAsk.js');
7
+ var i18n = require('../core/i18n.js');
6
8
  var PixelEditor_module = require('./PixelEditor.module.css.js');
7
9
  var PixelEditorCanvas = require('./PixelEditorCanvas.js');
8
10
  var PixelEditorMenuBar = require('./PixelEditorMenuBar.js');
@@ -14,20 +16,21 @@ var SpriteGeneratorPanel = require('./SpriteGeneratorPanel.js');
14
16
  var usePixelEditor = require('./usePixelEditor.js');
15
17
 
16
18
  const NicePixelEditor = ({ initialWidth = 64, initialHeight = 64, className, onSaveToLibrary, }) => {
19
+ const { t } = i18n.useNiceTranslation();
17
20
  const api = usePixelEditor.usePixelEditor({ initialWidth, initialHeight, onSaveToLibrary });
18
21
  const [showGenerator, setShowGenerator] = React.useState(false);
19
22
  const handleGeneratorSend = React.useCallback((imageData) => {
20
23
  var _a;
21
24
  (_a = api.importImageData) === null || _a === void 0 ? void 0 : _a.call(api, imageData);
22
25
  }, [api]);
23
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: api.fInp, type: "file", accept: ".ase,.aseprite,.png,.jpg,.jpeg,.gif,.bmp,.webp,.svg,.tga,.ico,.tiff,.tif,.avif", style: { display: 'none' }, onChange: (e) => {
26
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(editorAsk.EditorAskDialog, { ask: api.pendingAsk }), jsxRuntime.jsx("input", { ref: api.fInp, type: "file", accept: ".ase,.aseprite,.png,.jpg,.jpeg,.gif,.bmp,.webp,.svg,.tga,.ico,.tiff,.tif,.avif", style: { display: 'none' }, onChange: (e) => {
24
27
  var _a;
25
28
  const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
26
29
  if (f) {
27
30
  api.openFile(f);
28
31
  }
29
32
  e.target.value = '';
30
- } }), jsxRuntime.jsx(ui.NiceAppShell, { className: className, flush: true, menubar: jsxRuntime.jsx(PixelEditorMenuBar, { api: api, hasOnSaveToLibrary: !!onSaveToLibrary, onOpenGenerator: () => setShowGenerator(true) }), sidebar: jsxRuntime.jsx(PixelEditorToolbar, { api: api }), rightSidebar: jsxRuntime.jsx(PixelEditorRightPanel, { api: api }), bottomPanel: jsxRuntime.jsx(PixelEditorTimeline, { api: api }), statusBar: jsxRuntime.jsx(PixelEditorStatusBar, { api: api }), children: jsxRuntime.jsx(PixelEditorCanvas, { api: api }) }), showGenerator && (jsxRuntime.jsx(SpriteGeneratorPanel, { onSendToCanvas: handleGeneratorSend, onClose: () => setShowGenerator(false) })), jsxRuntime.jsxs(ui.NiceModal, { open: api.dlgNew, onClose: () => api.setDlgNew(false), title: "New Document", children: [jsxRuntime.jsx("label", { children: "Width (px)" }), jsxRuntime.jsx(ui.NiceNumberInput, { min: 1, max: 4096, value: api.nw, onChange: (val) => api.setNw(val !== null && val !== void 0 ? val : 64), "aria-label": "Document width" }), jsxRuntime.jsx("label", { children: "Height (px)" }), jsxRuntime.jsx(ui.NiceNumberInput, { min: 1, max: 4096, value: api.nh, onChange: (val) => api.setNh(val !== null && val !== void 0 ? val : 64), "aria-label": "Document height" }), jsxRuntime.jsx("div", { style: { display: 'flex', gap: 4, flexWrap: 'wrap', marginTop: 8 }, children: [
33
+ } }), jsxRuntime.jsx(ui.NiceAppShell, { className: className, flush: true, menubar: jsxRuntime.jsx(PixelEditorMenuBar, { api: api, hasOnSaveToLibrary: !!onSaveToLibrary, onOpenGenerator: () => setShowGenerator(true) }), sidebar: jsxRuntime.jsx(PixelEditorToolbar, { api: api }), rightSidebar: jsxRuntime.jsx(PixelEditorRightPanel, { api: api }), bottomPanel: jsxRuntime.jsx(PixelEditorTimeline, { api: api }), statusBar: jsxRuntime.jsx(PixelEditorStatusBar, { api: api }), children: jsxRuntime.jsx(PixelEditorCanvas, { api: api }) }), showGenerator && (jsxRuntime.jsx(SpriteGeneratorPanel, { onSendToCanvas: handleGeneratorSend, onClose: () => setShowGenerator(false) })), jsxRuntime.jsxs(ui.NiceModal, { open: api.dlgNew, onClose: () => api.setDlgNew(false), title: t('pixelEditor.newDocument', 'New Document'), children: [jsxRuntime.jsx("label", { children: "Width (px)" }), jsxRuntime.jsx(ui.NiceNumberInput, { min: 1, max: 4096, value: api.nw, onChange: (val) => api.setNw(val !== null && val !== void 0 ? val : 64), "aria-label": t('pixelEditor.documentWidth', 'Document width') }), jsxRuntime.jsx("label", { children: "Height (px)" }), jsxRuntime.jsx(ui.NiceNumberInput, { min: 1, max: 4096, value: api.nh, onChange: (val) => api.setNh(val !== null && val !== void 0 ? val : 64), "aria-label": t('pixelEditor.documentHeight', 'Document height') }), jsxRuntime.jsx("div", { style: { display: 'flex', gap: 4, flexWrap: 'wrap', marginTop: 8 }, children: [
31
34
  [16, 16],
32
35
  [32, 32],
33
36
  [48, 48],
@@ -41,7 +44,7 @@ const NicePixelEditor = ({ initialWidth = 64, initialHeight = 64, className, onS
41
44
  ].map(([w, h]) => (jsxRuntime.jsxs(ui.NiceButton, { className: PixelEditor_module.btnSecondary, variant: "ghost", size: "sm", style: { fontSize: 10, padding: '2px 6px' }, onClick: () => {
42
45
  api.setNw(w);
43
46
  api.setNh(h);
44
- }, children: [w, "x", h] }, `${w}x${h}`))) }), jsxRuntime.jsxs("div", { className: PixelEditor_module.dialogActions, children: [jsxRuntime.jsx(ui.NiceButton, { className: PixelEditor_module.btnSecondary, variant: "ghost", onClick: () => api.setDlgNew(false), children: "Cancel" }), jsxRuntime.jsx(ui.NiceButton, { className: PixelEditor_module.btnPrimary, variant: "primary", onClick: () => api.newDoc(api.nw, api.nh), children: "Create" })] })] })] }));
47
+ }, children: [w, "x", h] }, `${w}x${h}`))) }), jsxRuntime.jsxs("div", { className: PixelEditor_module.dialogActions, children: [jsxRuntime.jsx(ui.NiceButton, { className: PixelEditor_module.btnSecondary, variant: "ghost", onClick: () => api.setDlgNew(false), children: t('pixelEditor.cancel', 'Cancel') }), jsxRuntime.jsx(ui.NiceButton, { className: PixelEditor_module.btnPrimary, variant: "primary", onClick: () => api.newDoc(api.nw, api.nh), children: t('pixelEditor.create', 'Create') })] })] })] }));
45
48
  };
46
49
 
47
50
  exports.NicePixelEditor = NicePixelEditor;
@@ -2,13 +2,17 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
+ var i18n = require('../core/i18n.js');
5
6
  var PixelEditor_module = require('./PixelEditor.module.css.js');
6
7
 
7
- const PixelEditorCanvas = React.memo(({ api }) => (jsxRuntime.jsx("div", { ref: api.boxRef, className: PixelEditor_module.canvasContainer, children: jsxRuntime.jsx("canvas", { ref: api.cvRef, onPointerDown: api.onDown, onPointerMove: api.onMove, onPointerUp: api.onUp, onPointerLeave: () => {
8
- api.drawing.current = false;
9
- api.panning.current = false;
10
- api.setCursor(null);
11
- }, onWheel: api.onWheel, onContextMenu: (e) => e.preventDefault(), style: { inset: 0, width: '100%', height: '100%', touchAction: 'none' }, "aria-label": "Pixel editor canvas" }) })));
12
- PixelEditorCanvas.displayName = 'PixelEditorCanvas';
8
+ const PixelEditorCanvas = /* @__PURE__ */ Object.assign(
9
+ /* @__PURE__ */ React.memo(({ api }) => {
10
+ const { t } = i18n.useNiceTranslation();
11
+ return (jsxRuntime.jsx("div", { ref: api.boxRef, className: PixelEditor_module.canvasContainer, children: jsxRuntime.jsx("canvas", { ref: api.cvRef, onPointerDown: api.onDown, onPointerMove: api.onMove, onPointerUp: api.onUp, onPointerLeave: () => {
12
+ api.drawing.current = false;
13
+ api.panning.current = false;
14
+ api.setCursor(null);
15
+ }, onWheel: api.onWheel, onContextMenu: (e) => e.preventDefault(), style: { inset: 0, width: '100%', height: '100%', touchAction: 'none' }, "aria-label": t('pixelEditorCanvas.pixelEditorCanvas', 'Pixel editor canvas') }) }));
16
+ }), { displayName: 'PixelEditorCanvas' });
13
17
 
14
18
  module.exports = PixelEditorCanvas;
@@ -6,7 +6,8 @@ var uiCore = require('@nice2dev/ui-core');
6
6
  var React = require('react');
7
7
  var PixelEditor_module = require('./PixelEditor.module.css.js');
8
8
 
9
- const PixelEditorMenuBar = React.memo(({ api, hasOnSaveToLibrary, onOpenGenerator }) => {
9
+ const PixelEditorMenuBar = /* @__PURE__ */ Object.assign(
10
+ /* @__PURE__ */ React.memo(({ api, hasOnSaveToLibrary, onOpenGenerator }) => {
10
11
  const items = [
11
12
  {
12
13
  id: 'file',
@@ -95,7 +96,6 @@ const PixelEditorMenuBar = React.memo(({ api, hasOnSaveToLibrary, onOpenGenerato
95
96
  },
96
97
  ];
97
98
  return (jsxRuntime.jsx("div", { className: PixelEditor_module.menuBar, children: jsxRuntime.jsx(ui.NiceMenu, { items: items, orientation: "horizontal", variant: "ghost", density: "compact" }) }));
98
- });
99
- PixelEditorMenuBar.displayName = 'PixelEditorMenuBar';
99
+ }), { displayName: 'PixelEditorMenuBar' });
100
100
 
101
101
  module.exports = PixelEditorMenuBar;
@@ -4,36 +4,40 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var ui = require('@nice2dev/ui');
5
5
  var uiCore = require('@nice2dev/ui-core');
6
6
  var React = require('react');
7
+ var i18n = require('../core/i18n.js');
7
8
  var HSVPicker = require('./HSVPicker.js');
8
9
  var PixelEditor_module = require('./PixelEditor.module.css.js');
9
10
  var pixelEditorTypes = require('./pixelEditorTypes.js');
10
11
 
11
12
  /** A collapsible section header: rotating chevron + title. */
12
13
  const sectionTrigger = (title) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: PixelEditor_module.collapseChevron, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "chevron-right", size: 12 }) }), jsxRuntime.jsx("span", { children: title })] }));
13
- const PixelEditorRightPanel = React.memo(({ api }) => (jsxRuntime.jsxs("div", { className: PixelEditor_module.rightPanel, children: [jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Brush'), children: [jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: "Size" }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 64, value: api.brush.size, onChange: (val) => api.setBrush((b) => ({ ...b, size: val })), "aria-label": "Brush size" }), jsxRuntime.jsx("span", { children: api.brush.size })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: "Opacity" }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.opacity, onChange: (val) => api.setBrush((b) => ({ ...b, opacity: val })), "aria-label": "Brush opacity" }), jsxRuntime.jsxs("span", { children: [api.brush.opacity, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: "Flow" }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.flow, onChange: (val) => api.setBrush((b) => ({ ...b, flow: val })), "aria-label": "Brush flow" }), jsxRuntime.jsxs("span", { children: [api.brush.flow, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: "Hard" }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 100, value: api.brush.hardness, onChange: (val) => api.setBrush((b) => ({ ...b, hardness: val })), "aria-label": "Brush hardness" }), jsxRuntime.jsxs("span", { children: [api.brush.hardness, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: "Space" }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.spacing, onChange: (val) => api.setBrush((b) => ({ ...b, spacing: val })), "aria-label": "Brush spacing" }), jsxRuntime.jsxs("span", { children: [api.brush.spacing, "%"] })] }), jsxRuntime.jsx("div", { className: PixelEditor_module.brushShapes, children: pixelEditorTypes.BRUSH_SHAPES.map((s) => (jsxRuntime.jsx(ui.NiceButton, { className: `${PixelEditor_module.miniBtn} ${api.brush.shape === s.id ? PixelEditor_module.miniBtnActive : ''}`, variant: api.brush.shape === s.id ? 'primary' : 'ghost', size: "sm", onClick: () => api.setBrush((b) => ({ ...b, shape: s.id })), title: s.label, "aria-label": s.label, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: s.icon, size: 16 }) }, s.id))) }), jsxRuntime.jsxs("div", { className: PixelEditor_module.pressureToggles, children: [jsxRuntime.jsx(ui.NiceCheckbox, { checked: api.brush.pressureSize, onChange: (checked) => api.setBrush((b) => ({ ...b, pressureSize: checked })), label: "Pressure\u2192Size", className: PixelEditor_module.checkLabel }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: api.brush.pressureOpacity, onChange: (checked) => api.setBrush((b) => ({ ...b, pressureOpacity: checked })), label: "Pressure\u2192Opacity", className: PixelEditor_module.checkLabel })] })] }), jsxRuntime.jsx(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Colour'), children: jsxRuntime.jsx(HSVPicker.HSVPicker, { color: api.col1, onChange: api.setCol1 }) }), jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Layers'), children: [jsxRuntime.jsxs("div", { className: PixelEditor_module.layerActions, children: [jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.addLayer, title: "Add Layer", "aria-label": "Add Layer", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.dupLayer, title: "Duplicate Layer", "aria-label": "Duplicate Layer", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "copy", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.rmLayer, title: "Remove Layer", "aria-label": "Remove Layer", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "minus", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.mergeDown, title: "Merge Down", "aria-label": "Merge Down", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.moveLayerUp, title: "Move Up", "aria-label": "Move Up", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-up", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.moveLayerDown, title: "Move Down", "aria-label": "Move Down", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 16 }) })] }), [...api.layers]
14
- .map((l, i) => ({ l, i }))
15
- .reverse()
16
- .map(({ l, i }) => (jsxRuntime.jsxs("div", { className: `${PixelEditor_module.layerItem} ${i === api.aLi ? PixelEditor_module.layerItemActive : ''}`, onClick: () => api.setALi(i), children: [jsxRuntime.jsx("span", { className: PixelEditor_module.layerVis, onClick: (e) => {
17
- e.stopPropagation();
18
- api.toggleVis(i);
19
- }, title: l.visible ? 'Visible' : 'Hidden', children: jsxRuntime.jsx(uiCore.NiceIcon, { name: l.visible ? 'eye' : 'eye-off', size: 14 }) }), jsxRuntime.jsx("span", { className: PixelEditor_module.layerLock, onClick: (e) => {
20
- e.stopPropagation();
21
- api.toggleLock(i);
22
- }, title: l.locked ? 'Locked' : 'Unlocked', children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "lock", size: 14 }) }), api.editingLayerName === l.id ? (jsxRuntime.jsx(ui.NiceTextInput, { className: PixelEditor_module.layerNameInput, value: l.name, onChange: (val) => api.renameLayer(i, val), onBlur: () => api.setEditingLayerName(null), onKeyDown: (e) => {
23
- if (e.key === 'Enter') {
24
- api.setEditingLayerName(null);
14
+ const PixelEditorRightPanel = /* @__PURE__ */ Object.assign(
15
+ /* @__PURE__ */ React.memo(({ api }) => {
16
+ const { t } = i18n.useNiceTranslation();
17
+ return (jsxRuntime.jsxs("div", { className: PixelEditor_module.rightPanel, children: [jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Brush'), children: [jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: t('pixelEditorRightPanel.size', 'Size') }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 64, value: api.brush.size, onChange: (val) => api.setBrush((b) => ({ ...b, size: val })), "aria-label": t('pixelEditorRightPanel.brushSize', 'Brush size') }), jsxRuntime.jsx("span", { children: api.brush.size })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: t('pixelEditorRightPanel.opacity', 'Opacity') }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.opacity, onChange: (val) => api.setBrush((b) => ({ ...b, opacity: val })), "aria-label": t('pixelEditorRightPanel.brushOpacity', 'Brush opacity') }), jsxRuntime.jsxs("span", { children: [api.brush.opacity, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: t('pixelEditorRightPanel.flow', 'Flow') }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.flow, onChange: (val) => api.setBrush((b) => ({ ...b, flow: val })), "aria-label": t('pixelEditorRightPanel.brushFlow', 'Brush flow') }), jsxRuntime.jsxs("span", { children: [api.brush.flow, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: t('pixelEditorRightPanel.hard', 'Hard') }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 100, value: api.brush.hardness, onChange: (val) => api.setBrush((b) => ({ ...b, hardness: val })), "aria-label": t('pixelEditorRightPanel.brushHardness', 'Brush hardness') }), jsxRuntime.jsxs("span", { children: [api.brush.hardness, "%"] })] }), jsxRuntime.jsxs("div", { className: PixelEditor_module.brushSlider, children: [jsxRuntime.jsx("label", { children: t('pixelEditorRightPanel.space', 'Space') }), jsxRuntime.jsx(ui.NiceSlider, { min: 1, max: 100, value: api.brush.spacing, onChange: (val) => api.setBrush((b) => ({ ...b, spacing: val })), "aria-label": t('pixelEditorRightPanel.brushSpacing', 'Brush spacing') }), jsxRuntime.jsxs("span", { children: [api.brush.spacing, "%"] })] }), jsxRuntime.jsx("div", { className: PixelEditor_module.brushShapes, children: pixelEditorTypes.BRUSH_SHAPES.map((s) => (jsxRuntime.jsx(ui.NiceButton, { className: `${PixelEditor_module.miniBtn} ${api.brush.shape === s.id ? PixelEditor_module.miniBtnActive : ''}`, variant: api.brush.shape === s.id ? 'primary' : 'ghost', size: "sm", onClick: () => api.setBrush((b) => ({ ...b, shape: s.id })), title: s.label, "aria-label": s.label, children: jsxRuntime.jsx(uiCore.NiceIcon, { name: s.icon, size: 16 }) }, s.id))) }), jsxRuntime.jsxs("div", { className: PixelEditor_module.pressureToggles, children: [jsxRuntime.jsx(ui.NiceCheckbox, { checked: api.brush.pressureSize, onChange: (checked) => api.setBrush((b) => ({ ...b, pressureSize: checked })), label: t('pixelEditorRightPanel.pressureSize', 'Pressure→Size'), className: PixelEditor_module.checkLabel }), jsxRuntime.jsx(ui.NiceCheckbox, { checked: api.brush.pressureOpacity, onChange: (checked) => api.setBrush((b) => ({ ...b, pressureOpacity: checked })), label: t('pixelEditorRightPanel.pressureOpacity', 'Pressure→Opacity'), className: PixelEditor_module.checkLabel })] })] }), jsxRuntime.jsx(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Colour'), children: jsxRuntime.jsx(HSVPicker.HSVPicker, { color: api.col1, onChange: api.setCol1 }) }), jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Layers'), children: [jsxRuntime.jsxs("div", { className: PixelEditor_module.layerActions, children: [jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.addLayer, title: t('pixelEditorRightPanel.addLayer', 'Add Layer'), "aria-label": t('pixelEditorRightPanel.addLayer', 'Add Layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.dupLayer, title: t('pixelEditorRightPanel.duplicateLayer', 'Duplicate Layer'), "aria-label": t('pixelEditorRightPanel.duplicateLayer', 'Duplicate Layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "copy", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.rmLayer, title: t('pixelEditorRightPanel.removeLayer', 'Remove Layer'), "aria-label": t('pixelEditorRightPanel.removeLayer', 'Remove Layer'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "minus", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.mergeDown, title: t('pixelEditorRightPanel.mergeDown', 'Merge Down'), "aria-label": t('pixelEditorRightPanel.mergeDown', 'Merge Down'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.moveLayerUp, title: t('pixelEditorRightPanel.moveUp', 'Move Up'), "aria-label": t('pixelEditorRightPanel.moveUp', 'Move Up'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-up", size: 16 }) }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: api.moveLayerDown, title: t('pixelEditorRightPanel.moveDown', 'Move Down'), "aria-label": t('pixelEditorRightPanel.moveDown', 'Move Down'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "arrow-down", size: 16 }) })] }), [...api.layers]
18
+ .map((l, i) => ({ l, i }))
19
+ .reverse()
20
+ .map(({ l, i }) => (jsxRuntime.jsxs("div", { className: `${PixelEditor_module.layerItem} ${i === api.aLi ? PixelEditor_module.layerItemActive : ''}`, onClick: () => api.setALi(i), children: [jsxRuntime.jsx("span", { className: PixelEditor_module.layerVis, onClick: (e) => {
21
+ e.stopPropagation();
22
+ api.toggleVis(i);
23
+ }, title: l.visible ? 'Visible' : 'Hidden', children: jsxRuntime.jsx(uiCore.NiceIcon, { name: l.visible ? 'eye' : 'eye-off', size: 14 }) }), jsxRuntime.jsx("span", { className: PixelEditor_module.layerLock, onClick: (e) => {
24
+ e.stopPropagation();
25
+ api.toggleLock(i);
26
+ }, title: l.locked ? 'Locked' : 'Unlocked', children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "lock", size: 14 }) }), api.editingLayerName === l.id ? (jsxRuntime.jsx(ui.NiceTextInput, { className: PixelEditor_module.layerNameInput, value: l.name, onChange: (val) => api.renameLayer(i, val), onBlur: () => api.setEditingLayerName(null), onKeyDown: (e) => {
27
+ if (e.key === 'Enter') {
28
+ api.setEditingLayerName(null);
29
+ }
30
+ }, autoFocus: true, "aria-label": t('pixelEditorRightPanel.layerName', 'Layer name') })) : (jsxRuntime.jsx("span", { className: PixelEditor_module.layerName, onDoubleClick: (e) => {
31
+ e.stopPropagation();
32
+ api.setEditingLayerName(l.id);
33
+ }, children: l.name })), jsxRuntime.jsxs("span", { className: PixelEditor_module.layerOpacity, children: [Math.round((l.opacity / 255) * 100), "%"] })] }, l.id))), api.layers[api.aLi] && (jsxRuntime.jsxs("div", { className: PixelEditor_module.layerControls, children: [jsxRuntime.jsx(ui.NiceSelect, { value: api.layers[api.aLi].blendMode, onChange: (val) => api.setLayerBlendMode(api.aLi, val), className: PixelEditor_module.blendSelect, "aria-label": t('pixelEditorRightPanel.blendMode', 'Blend mode'), options: pixelEditorTypes.BLEND_MODES.map((m) => ({ value: m, label: m })) }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 255, value: api.layers[api.aLi].opacity, onChange: (val) => api.setLayerOpacity(api.aLi, val), className: PixelEditor_module.layerOpSlider, title: `Opacity: ${Math.round((api.layers[api.aLi].opacity / 255) * 100)}%` })] }))] }), jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Palette'), children: [jsxRuntime.jsx("div", { className: PixelEditor_module.layerActions, children: jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: () => {
34
+ if (!api.pal.includes(api.col1)) {
35
+ api.setPal((p) => [...p, api.col1]);
25
36
  }
26
- }, autoFocus: true, "aria-label": "Layer name" })) : (jsxRuntime.jsx("span", { className: PixelEditor_module.layerName, onDoubleClick: (e) => {
27
- e.stopPropagation();
28
- api.setEditingLayerName(l.id);
29
- }, children: l.name })), jsxRuntime.jsxs("span", { className: PixelEditor_module.layerOpacity, children: [Math.round((l.opacity / 255) * 100), "%"] })] }, l.id))), api.layers[api.aLi] && (jsxRuntime.jsxs("div", { className: PixelEditor_module.layerControls, children: [jsxRuntime.jsx(ui.NiceSelect, { value: api.layers[api.aLi].blendMode, onChange: (val) => api.setLayerBlendMode(api.aLi, val), className: PixelEditor_module.blendSelect, "aria-label": "Blend mode", options: pixelEditorTypes.BLEND_MODES.map((m) => ({ value: m, label: m })) }), jsxRuntime.jsx(ui.NiceSlider, { min: 0, max: 255, value: api.layers[api.aLi].opacity, onChange: (val) => api.setLayerOpacity(api.aLi, val), className: PixelEditor_module.layerOpSlider, title: `Opacity: ${Math.round((api.layers[api.aLi].opacity / 255) * 100)}%` })] }))] }), jsxRuntime.jsxs(ui.NiceCollapse, { className: PixelEditor_module.panelSection, defaultExpanded: true, trigger: sectionTrigger('Palette'), children: [jsxRuntime.jsx("div", { className: PixelEditor_module.layerActions, children: jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: () => {
30
- if (!api.pal.includes(api.col1)) {
31
- api.setPal((p) => [...p, api.col1]);
32
- }
33
- }, title: "Add current colour", "aria-label": "Add current colour", children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 16 }) }) }), jsxRuntime.jsx("div", { className: PixelEditor_module.paletteGrid, children: api.pal.map((c, i) => (jsxRuntime.jsx("div", { className: `${PixelEditor_module.paletteSwatch} ${c === api.col1 ? PixelEditor_module.paletteSwatchActive : ''}`, style: { backgroundColor: c }, onClick: () => api.setCol1(c), onContextMenu: (e) => {
34
- e.preventDefault();
35
- api.setCol2(c);
36
- }, title: c }, i))) })] })] })));
37
- PixelEditorRightPanel.displayName = 'PixelEditorRightPanel';
37
+ }, title: t('pixelEditorRightPanel.addCurrentColour', 'Add current colour'), "aria-label": t('pixelEditorRightPanel.addCurrentColour', 'Add current colour'), children: jsxRuntime.jsx(uiCore.NiceIcon, { name: "plus", size: 16 }) }) }), jsxRuntime.jsx("div", { className: PixelEditor_module.paletteGrid, children: api.pal.map((c, i) => (jsxRuntime.jsx("div", { className: `${PixelEditor_module.paletteSwatch} ${c === api.col1 ? PixelEditor_module.paletteSwatchActive : ''}`, style: { backgroundColor: c }, onClick: () => api.setCol1(c), onContextMenu: (e) => {
38
+ e.preventDefault();
39
+ api.setCol2(c);
40
+ }, title: c }, i))) })] })] }));
41
+ }), { displayName: 'PixelEditorRightPanel' });
38
42
 
39
43
  module.exports = PixelEditorRightPanel;