@nice2dev/ui-graphics 1.3.15 → 1.3.16

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 (294) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/animation/AnimatedPerson.js +470 -143
  3. package/dist/cjs/animation/AnimationEditor.js +289 -101
  4. package/dist/cjs/animation/Audience.js +83 -61
  5. package/dist/cjs/animation/BodyRenderer.js +69 -28
  6. package/dist/cjs/animation/animationHelper.js +281 -288
  7. package/dist/cjs/animation/characterTypes.js +200 -203
  8. package/dist/cjs/animation/choreoDSL.js +205 -219
  9. package/dist/cjs/animation/choreography.js +4 -32
  10. package/dist/cjs/animation/karaokeIntegration.js +68 -77
  11. package/dist/cjs/animation/lottieExport.js +108 -114
  12. package/dist/cjs/animation/motionPath.js +225 -248
  13. package/dist/cjs/animation/physics.js +227 -254
  14. package/dist/cjs/animation/rig/RigPlayer.js +53 -56
  15. package/dist/cjs/animation/rig/RiggedBody.js +71 -26
  16. package/dist/cjs/animation/rig/choreoRigBridge.js +72 -77
  17. package/dist/cjs/animation/rig/ik.js +13 -18
  18. package/dist/cjs/animation/rig/poseOps.js +34 -41
  19. package/dist/cjs/animation/rig/presets.js +64 -72
  20. package/dist/cjs/animation/rig/rigMath.js +25 -32
  21. package/dist/cjs/animation/rig/rigTypes.js +59 -63
  22. package/dist/cjs/animation/shapes/arms.js +31 -13
  23. package/dist/cjs/animation/shapes/eyes.js +129 -47
  24. package/dist/cjs/animation/shapes/hair.js +72 -45
  25. package/dist/cjs/animation/shapes/heads.js +131 -57
  26. package/dist/cjs/animation/shapes/headwear.js +47 -38
  27. package/dist/cjs/animation/shapes/legs.js +31 -13
  28. package/dist/cjs/animation/shapes/mouths.js +120 -44
  29. package/dist/cjs/animation/shapes/noses.js +80 -25
  30. package/dist/cjs/animation/shapes/outfits.js +101 -39
  31. package/dist/cjs/animation/shapes/torsos.js +15 -11
  32. package/dist/cjs/animation/spineExport.js +103 -121
  33. package/dist/cjs/core/LocalUI.js +108 -43
  34. package/dist/cjs/core/NiceBrushEngine.js +758 -552
  35. package/dist/cjs/core/collaboration.js +249 -251
  36. package/dist/cjs/core/colorBlindness.js +100 -115
  37. package/dist/cjs/core/dragDrop.js +155 -158
  38. package/dist/cjs/core/editorAsk.js +51 -41
  39. package/dist/cjs/core/fixes.js +140 -171
  40. package/dist/cjs/core/gridGuides.js +166 -201
  41. package/dist/cjs/core/historyVisual.js +156 -135
  42. package/dist/cjs/core/i18n.js +13 -14
  43. package/dist/cjs/core/integrations.js +238 -249
  44. package/dist/cjs/core/minimap.js +149 -151
  45. package/dist/cjs/core/plugins.js +98 -113
  46. package/dist/cjs/core/rtl.js +71 -83
  47. package/dist/cjs/core/shortcuts.js +196 -225
  48. package/dist/cjs/core/theme.js +142 -149
  49. package/dist/cjs/core/yjsCollaboration.js +232 -293
  50. package/dist/cjs/design/design-tools.js +12 -22
  51. package/dist/cjs/font/NiceFontEditor.js +877 -316
  52. package/dist/cjs/font/fontFormatUtils.js +388 -448
  53. package/dist/cjs/game/GameAsset2dEditor.js +1201 -392
  54. package/dist/cjs/game/GameAsset2dEditor.module.css.js +146 -5
  55. package/dist/cjs/game/gameAssetTypes.js +7 -16
  56. package/dist/cjs/game/gameAssetUtils.js +390 -413
  57. package/dist/cjs/game/useGameAssetEditor.js +820 -763
  58. package/dist/cjs/index.js +81 -84
  59. package/dist/cjs/nice2dev-ui-graphics.css +1 -1
  60. package/dist/cjs/node_modules/lib0/array.js +8 -70
  61. package/dist/cjs/node_modules/lib0/binary.js +3 -20
  62. package/dist/cjs/node_modules/lib0/broadcastchannel.js +24 -86
  63. package/dist/cjs/node_modules/lib0/buffer.js +15 -82
  64. package/dist/cjs/node_modules/lib0/conditions.js +3 -16
  65. package/dist/cjs/node_modules/lib0/decoding.js +108 -287
  66. package/dist/cjs/node_modules/lib0/dom.js +14 -44
  67. package/dist/cjs/node_modules/lib0/encoding.js +68 -418
  68. package/dist/cjs/node_modules/lib0/environment.js +26 -92
  69. package/dist/cjs/node_modules/lib0/error.js +5 -29
  70. package/dist/cjs/node_modules/lib0/function.js +27 -66
  71. package/dist/cjs/node_modules/lib0/iterator.js +8 -33
  72. package/dist/cjs/node_modules/lib0/logging.common.js +12 -22
  73. package/dist/cjs/node_modules/lib0/logging.js +32 -71
  74. package/dist/cjs/node_modules/lib0/map.js +16 -86
  75. package/dist/cjs/node_modules/lib0/math.js +3 -32
  76. package/dist/cjs/node_modules/lib0/number.js +4 -15
  77. package/dist/cjs/node_modules/lib0/object.js +14 -88
  78. package/dist/cjs/node_modules/lib0/observable.js +38 -78
  79. package/dist/cjs/node_modules/lib0/pair.js +3 -20
  80. package/dist/cjs/node_modules/lib0/prng.js +8 -77
  81. package/dist/cjs/node_modules/lib0/promise.js +6 -30
  82. package/dist/cjs/node_modules/lib0/random.js +8 -23
  83. package/dist/cjs/node_modules/lib0/schema.js +313 -687
  84. package/dist/cjs/node_modules/lib0/set.js +3 -10
  85. package/dist/cjs/node_modules/lib0/storage.js +20 -55
  86. package/dist/cjs/node_modules/lib0/string.js +17 -72
  87. package/dist/cjs/node_modules/lib0/symbol.js +2 -12
  88. package/dist/cjs/node_modules/lib0/time.js +2 -15
  89. package/dist/cjs/node_modules/lib0/trait/equality.js +3 -28
  90. package/dist/cjs/node_modules/lib0/url.js +4 -18
  91. package/dist/cjs/node_modules/lib0/webcrypto.js +2 -5
  92. package/dist/cjs/node_modules/y-protocols/auth.js +5 -19
  93. package/dist/cjs/node_modules/y-protocols/awareness.js +53 -116
  94. package/dist/cjs/node_modules/y-protocols/sync.js +16 -103
  95. package/dist/cjs/node_modules/y-websocket/src/y-websocket.js +77 -219
  96. package/dist/cjs/node_modules/yjs/dist/yjs.js +2128 -4868
  97. package/dist/cjs/photo/FilterThumb.js +37 -25
  98. package/dist/cjs/photo/NiceAITools.js +679 -467
  99. package/dist/cjs/photo/PhotoEditor.js +34 -20
  100. package/dist/cjs/photo/PhotoEditor.module.css.js +296 -5
  101. package/dist/cjs/photo/PhotoEditorCanvas.js +250 -91
  102. package/dist/cjs/photo/PhotoEditorLeftPanel.js +1086 -224
  103. package/dist/cjs/photo/PhotoEditorToolbar.js +135 -19
  104. package/dist/cjs/photo/photoEditorActions.js +89 -72
  105. package/dist/cjs/photo/photoEditorTypes.js +29 -32
  106. package/dist/cjs/photo/photoFilters.js +959 -985
  107. package/dist/cjs/photo/photoOverlays.js +899 -945
  108. package/dist/cjs/photo/photoSelection.js +427 -499
  109. package/dist/cjs/photo/usePhotoEditor.js +739 -741
  110. package/dist/cjs/pixel/HSVPicker.js +191 -175
  111. package/dist/cjs/pixel/PixelEditor.js +159 -48
  112. package/dist/cjs/pixel/PixelEditor.module.css.js +209 -5
  113. package/dist/cjs/pixel/PixelEditorCanvas.js +29 -16
  114. package/dist/cjs/pixel/PixelEditorMenuBar.js +160 -162
  115. package/dist/cjs/pixel/PixelEditorRightPanel.js +377 -45
  116. package/dist/cjs/pixel/PixelEditorStatusBar.js +47 -20
  117. package/dist/cjs/pixel/PixelEditorTimeline.js +106 -23
  118. package/dist/cjs/pixel/PixelEditorToolbar.js +99 -21
  119. package/dist/cjs/pixel/SpriteGeneratorPanel.js +483 -303
  120. package/dist/cjs/pixel/animalGeneratorPresets.js +776 -601
  121. package/dist/cjs/pixel/asepriteFormat.js +511 -560
  122. package/dist/cjs/pixel/buildingGeneratorPresets.js +693 -520
  123. package/dist/cjs/pixel/characterGeneratorPresets.js +644 -544
  124. package/dist/cjs/pixel/pixel-pro.js +52 -63
  125. package/dist/cjs/pixel/pixelEditorExports.js +388 -428
  126. package/dist/cjs/pixel/pixelEditorTypes.js +91 -108
  127. package/dist/cjs/pixel/pixelEditorUtils.js +519 -561
  128. package/dist/cjs/pixel/spriteGeneratorCore.js +206 -257
  129. package/dist/cjs/pixel/usePixelEditor.js +1321 -1343
  130. package/dist/cjs/texture/Nice3DTexturePainter.js +707 -440
  131. package/dist/cjs/ui/NiceUIDesigner.js +954 -527
  132. package/dist/cjs/vector/NiceSvgToCode.js +586 -446
  133. package/dist/cjs/vector/VectorEditor.js +290 -117
  134. package/dist/cjs/vector/VectorEditor.module.css.js +86 -5
  135. package/dist/cjs/vector/VectorEditorMenuBar.js +333 -275
  136. package/dist/cjs/vector/VectorEditorRightPanel.js +1094 -371
  137. package/dist/cjs/vector/VectorEditorShapeRenderer.js +198 -60
  138. package/dist/cjs/vector/VectorEditorStatusBar.js +39 -13
  139. package/dist/cjs/vector/useVectorEditor.js +848 -889
  140. package/dist/cjs/vector/vectorAnimation.js +110 -137
  141. package/dist/cjs/vector/vectorBooleanOps.js +398 -485
  142. package/dist/cjs/vector/vectorEditorExport.js +201 -203
  143. package/dist/cjs/vector/vectorEditorImport.js +173 -189
  144. package/dist/cjs/vector/vectorEditorTypes.js +42 -49
  145. package/dist/cjs/vector/vectorGradients.js +151 -174
  146. package/dist/cjs/vector/vectorIconExport.js +52 -59
  147. package/dist/cjs/vector/vectorIconImport.js +169 -219
  148. package/dist/esm/animation/AnimatedPerson.js +470 -141
  149. package/dist/esm/animation/AnimationEditor.js +290 -100
  150. package/dist/esm/animation/Audience.js +83 -59
  151. package/dist/esm/animation/BodyRenderer.js +71 -25
  152. package/dist/esm/animation/animationHelper.js +284 -287
  153. package/dist/esm/animation/characterTypes.js +204 -202
  154. package/dist/esm/animation/choreoDSL.js +212 -218
  155. package/dist/esm/animation/choreography.js +8 -31
  156. package/dist/esm/animation/karaokeIntegration.js +74 -76
  157. package/dist/esm/animation/lottieExport.js +112 -113
  158. package/dist/esm/animation/motionPath.js +235 -247
  159. package/dist/esm/animation/physics.js +235 -253
  160. package/dist/esm/animation/rig/RigPlayer.js +53 -54
  161. package/dist/esm/animation/rig/RiggedBody.js +71 -24
  162. package/dist/esm/animation/rig/choreoRigBridge.js +74 -76
  163. package/dist/esm/animation/rig/ik.js +14 -17
  164. package/dist/esm/animation/rig/poseOps.js +37 -40
  165. package/dist/esm/animation/rig/presets.js +70 -71
  166. package/dist/esm/animation/rig/rigMath.js +28 -31
  167. package/dist/esm/animation/rig/rigTypes.js +62 -62
  168. package/dist/esm/animation/shapes/arms.js +32 -12
  169. package/dist/esm/animation/shapes/eyes.js +135 -46
  170. package/dist/esm/animation/shapes/hair.js +80 -44
  171. package/dist/esm/animation/shapes/heads.js +140 -56
  172. package/dist/esm/animation/shapes/headwear.js +54 -37
  173. package/dist/esm/animation/shapes/legs.js +32 -12
  174. package/dist/esm/animation/shapes/mouths.js +127 -43
  175. package/dist/esm/animation/shapes/noses.js +87 -24
  176. package/dist/esm/animation/shapes/outfits.js +106 -38
  177. package/dist/esm/animation/shapes/torsos.js +16 -10
  178. package/dist/esm/animation/spineExport.js +106 -120
  179. package/dist/esm/core/LocalUI.js +111 -42
  180. package/dist/esm/core/NiceBrushEngine.js +761 -551
  181. package/dist/esm/core/collaboration.js +255 -250
  182. package/dist/esm/core/colorBlindness.js +106 -114
  183. package/dist/esm/core/dragDrop.js +157 -157
  184. package/dist/esm/core/editorAsk.js +53 -40
  185. package/dist/esm/core/fixes.js +145 -170
  186. package/dist/esm/core/gridGuides.js +178 -200
  187. package/dist/esm/core/historyVisual.js +158 -134
  188. package/dist/esm/core/i18n.js +15 -13
  189. package/dist/esm/core/integrations.js +244 -248
  190. package/dist/esm/core/minimap.js +151 -150
  191. package/dist/esm/core/plugins.js +102 -112
  192. package/dist/esm/core/rtl.js +77 -82
  193. package/dist/esm/core/shortcuts.js +200 -224
  194. package/dist/esm/core/theme.js +150 -148
  195. package/dist/esm/core/yjsCollaboration.js +240 -292
  196. package/dist/esm/design/design-tools.js +13 -21
  197. package/dist/esm/font/NiceFontEditor.js +880 -315
  198. package/dist/esm/font/fontFormatUtils.js +394 -447
  199. package/dist/esm/game/GameAsset2dEditor.js +1202 -391
  200. package/dist/esm/game/GameAsset2dEditor.module.css.js +146 -3
  201. package/dist/esm/game/gameAssetTypes.js +8 -15
  202. package/dist/esm/game/gameAssetUtils.js +408 -412
  203. package/dist/esm/game/useGameAssetEditor.js +821 -762
  204. package/dist/esm/index.js +332 -69
  205. package/dist/esm/nice2dev-ui-graphics.css +1 -1
  206. package/dist/esm/node_modules/lib0/array.js +15 -69
  207. package/dist/esm/node_modules/lib0/binary.js +14 -19
  208. package/dist/esm/node_modules/lib0/broadcastchannel.js +27 -85
  209. package/dist/esm/node_modules/lib0/buffer.js +20 -80
  210. package/dist/esm/node_modules/lib0/conditions.js +4 -15
  211. package/dist/esm/node_modules/lib0/decoding.js +128 -286
  212. package/dist/esm/node_modules/lib0/dom.js +20 -43
  213. package/dist/esm/node_modules/lib0/encoding.js +90 -415
  214. package/dist/esm/node_modules/lib0/environment.js +33 -91
  215. package/dist/esm/node_modules/lib0/error.js +8 -28
  216. package/dist/esm/node_modules/lib0/function.js +31 -65
  217. package/dist/esm/node_modules/lib0/iterator.js +11 -32
  218. package/dist/esm/node_modules/lib0/logging.common.js +22 -21
  219. package/dist/esm/node_modules/lib0/logging.js +44 -70
  220. package/dist/esm/node_modules/lib0/map.js +21 -85
  221. package/dist/esm/node_modules/lib0/math.js +9 -31
  222. package/dist/esm/node_modules/lib0/number.js +7 -14
  223. package/dist/esm/node_modules/lib0/object.js +26 -87
  224. package/dist/esm/node_modules/lib0/observable.js +40 -77
  225. package/dist/esm/node_modules/lib0/pair.js +5 -19
  226. package/dist/esm/node_modules/lib0/prng.js +15 -76
  227. package/dist/esm/node_modules/lib0/promise.js +7 -29
  228. package/dist/esm/node_modules/lib0/random.js +10 -22
  229. package/dist/esm/node_modules/lib0/schema.js +367 -686
  230. package/dist/esm/node_modules/lib0/set.js +4 -9
  231. package/dist/esm/node_modules/lib0/storage.js +23 -54
  232. package/dist/esm/node_modules/lib0/string.js +26 -71
  233. package/dist/esm/node_modules/lib0/symbol.js +3 -11
  234. package/dist/esm/node_modules/lib0/time.js +3 -14
  235. package/dist/esm/node_modules/lib0/trait/equality.js +5 -27
  236. package/dist/esm/node_modules/lib0/url.js +5 -17
  237. package/dist/esm/node_modules/lib0/webcrypto.js +3 -4
  238. package/dist/esm/node_modules/y-protocols/auth.js +7 -18
  239. package/dist/esm/node_modules/y-protocols/awareness.js +58 -115
  240. package/dist/esm/node_modules/y-protocols/sync.js +26 -102
  241. package/dist/esm/node_modules/y-websocket/src/y-websocket.js +82 -218
  242. package/dist/esm/node_modules/yjs/dist/yjs.js +2263 -4899
  243. package/dist/esm/photo/FilterThumb.js +37 -23
  244. package/dist/esm/photo/NiceAITools.js +685 -466
  245. package/dist/esm/photo/PhotoEditor.js +34 -18
  246. package/dist/esm/photo/PhotoEditor.module.css.js +296 -3
  247. package/dist/esm/photo/PhotoEditorCanvas.js +250 -89
  248. package/dist/esm/photo/PhotoEditorLeftPanel.js +1086 -222
  249. package/dist/esm/photo/PhotoEditorToolbar.js +135 -17
  250. package/dist/esm/photo/photoEditorActions.js +93 -71
  251. package/dist/esm/photo/photoEditorTypes.js +32 -31
  252. package/dist/esm/photo/photoFilters.js +967 -984
  253. package/dist/esm/photo/photoOverlays.js +913 -944
  254. package/dist/esm/photo/photoSelection.js +438 -498
  255. package/dist/esm/photo/usePhotoEditor.js +740 -740
  256. package/dist/esm/pixel/HSVPicker.js +192 -174
  257. package/dist/esm/pixel/PixelEditor.js +160 -47
  258. package/dist/esm/pixel/PixelEditor.module.css.js +209 -3
  259. package/dist/esm/pixel/PixelEditorCanvas.js +29 -14
  260. package/dist/esm/pixel/PixelEditorMenuBar.js +160 -160
  261. package/dist/esm/pixel/PixelEditorRightPanel.js +377 -43
  262. package/dist/esm/pixel/PixelEditorStatusBar.js +47 -18
  263. package/dist/esm/pixel/PixelEditorTimeline.js +106 -21
  264. package/dist/esm/pixel/PixelEditorToolbar.js +99 -19
  265. package/dist/esm/pixel/SpriteGeneratorPanel.js +483 -301
  266. package/dist/esm/pixel/animalGeneratorPresets.js +782 -600
  267. package/dist/esm/pixel/asepriteFormat.js +517 -559
  268. package/dist/esm/pixel/buildingGeneratorPresets.js +699 -519
  269. package/dist/esm/pixel/characterGeneratorPresets.js +650 -543
  270. package/dist/esm/pixel/pixel-pro.js +53 -62
  271. package/dist/esm/pixel/pixelEditorExports.js +397 -427
  272. package/dist/esm/pixel/pixelEditorTypes.js +103 -107
  273. package/dist/esm/pixel/pixelEditorUtils.js +551 -560
  274. package/dist/esm/pixel/spriteGeneratorCore.js +223 -256
  275. package/dist/esm/pixel/usePixelEditor.js +1322 -1342
  276. package/dist/esm/texture/Nice3DTexturePainter.js +709 -439
  277. package/dist/esm/ui/NiceUIDesigner.js +957 -526
  278. package/dist/esm/vector/NiceSvgToCode.js +589 -445
  279. package/dist/esm/vector/VectorEditor.js +291 -116
  280. package/dist/esm/vector/VectorEditor.module.css.js +86 -3
  281. package/dist/esm/vector/VectorEditorMenuBar.js +333 -273
  282. package/dist/esm/vector/VectorEditorRightPanel.js +1094 -369
  283. package/dist/esm/vector/VectorEditorShapeRenderer.js +199 -59
  284. package/dist/esm/vector/VectorEditorStatusBar.js +39 -11
  285. package/dist/esm/vector/useVectorEditor.js +849 -888
  286. package/dist/esm/vector/vectorAnimation.js +115 -136
  287. package/dist/esm/vector/vectorBooleanOps.js +401 -484
  288. package/dist/esm/vector/vectorEditorExport.js +207 -202
  289. package/dist/esm/vector/vectorEditorImport.js +174 -188
  290. package/dist/esm/vector/vectorEditorTypes.js +50 -48
  291. package/dist/esm/vector/vectorGradients.js +158 -173
  292. package/dist/esm/vector/vectorIconExport.js +53 -58
  293. package/dist/esm/vector/vectorIconImport.js +171 -218
  294. package/package.json +9 -15
@@ -1,186 +1,202 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var uiCore = require('@nice2dev/ui-core');
5
- var React = require('react');
6
- var PixelEditor_module = require('./PixelEditor.module.css.js');
7
-
8
- // Convert hex to HSV
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const uiCore = require("@nice2dev/ui-core");
5
+ const React = require("react");
6
+ const PixelEditor_module = require("./PixelEditor.module.css.js");
9
7
  function hexToHSV(hex) {
10
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
11
- if (!result) {
12
- return [0, 0, 0];
8
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
9
+ if (!result) {
10
+ return [0, 0, 0];
11
+ }
12
+ const r = parseInt(result[1], 16) / 255;
13
+ const g = parseInt(result[2], 16) / 255;
14
+ const b = parseInt(result[3], 16) / 255;
15
+ const max = Math.max(r, g, b), min = Math.min(r, g, b);
16
+ const v = max;
17
+ const d = max - min;
18
+ const s = max === 0 ? 0 : d / max;
19
+ let h = 0;
20
+ if (max !== min) {
21
+ switch (max) {
22
+ case r:
23
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
24
+ break;
25
+ case g:
26
+ h = ((b - r) / d + 2) / 6;
27
+ break;
28
+ case b:
29
+ h = ((r - g) / d + 4) / 6;
30
+ break;
13
31
  }
14
- const r = parseInt(result[1], 16) / 255;
15
- const g = parseInt(result[2], 16) / 255;
16
- const b = parseInt(result[3], 16) / 255;
17
- const max = Math.max(r, g, b), min = Math.min(r, g, b);
18
- const v = max;
19
- const d = max - min;
20
- const s = max === 0 ? 0 : d / max;
21
- let h = 0;
22
- if (max !== min) {
23
- switch (max) {
24
- case r:
25
- h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
26
- break;
27
- case g:
28
- h = ((b - r) / d + 2) / 6;
29
- break;
30
- case b:
31
- h = ((r - g) / d + 4) / 6;
32
- break;
33
- }
34
- }
35
- return [h * 360, s, v];
32
+ }
33
+ return [h * 360, s, v];
36
34
  }
37
- // Convert HSV to hex
38
35
  function hsvToHex(h, s, v) {
39
- const c = v * s;
40
- const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
41
- const m = v - c;
42
- let r = 0, g = 0, b = 0;
43
- if (h < 60) {
44
- r = c;
45
- g = x;
46
- }
47
- else if (h < 120) {
48
- r = x;
49
- g = c;
36
+ const c = v * s;
37
+ const x = c * (1 - Math.abs(h / 60 % 2 - 1));
38
+ const m = v - c;
39
+ let r = 0, g = 0, b = 0;
40
+ if (h < 60) {
41
+ r = c;
42
+ g = x;
43
+ } else if (h < 120) {
44
+ r = x;
45
+ g = c;
46
+ } else if (h < 180) {
47
+ g = c;
48
+ b = x;
49
+ } else if (h < 240) {
50
+ g = x;
51
+ b = c;
52
+ } else if (h < 300) {
53
+ r = x;
54
+ b = c;
55
+ } else {
56
+ r = c;
57
+ b = x;
58
+ }
59
+ const toHex = (n) => Math.round((n + m) * 255).toString(16).padStart(2, "0");
60
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
61
+ }
62
+ const HSVPicker = ({ color, onChange }) => {
63
+ const svCanvasRef = React.useRef(null);
64
+ const hueCanvasRef = React.useRef(null);
65
+ const [hue, saturation, value] = React.useMemo(() => hexToHSV(color), [color]);
66
+ const [localHue, setLocalHue] = React.useState(hue);
67
+ const [localSat, setLocalSat] = React.useState(saturation);
68
+ const [localVal, setLocalVal] = React.useState(value);
69
+ React.useEffect(() => {
70
+ const [h, s, v] = hexToHSV(color);
71
+ setLocalHue(h);
72
+ setLocalSat(s);
73
+ setLocalVal(v);
74
+ }, [color]);
75
+ const drawSV = React.useCallback(() => {
76
+ const canvas = svCanvasRef.current;
77
+ if (!canvas) {
78
+ return;
50
79
  }
51
- else if (h < 180) {
52
- g = c;
53
- b = x;
80
+ const ctx = canvas.getContext("2d");
81
+ if (!ctx) {
82
+ return;
54
83
  }
55
- else if (h < 240) {
56
- g = x;
57
- b = c;
84
+ const w = canvas.width;
85
+ const h = canvas.height;
86
+ ctx.fillStyle = `hsl(${localHue}, 100%, 50%)`;
87
+ ctx.fillRect(0, 0, w, h);
88
+ const whiteGrad = ctx.createLinearGradient(0, 0, w, 0);
89
+ whiteGrad.addColorStop(
90
+ 0,
91
+ uiCore.resolveCssColor("var(--nice-overlay-light-95, rgba(255, 255, 255, 1))", ctx.canvas)
92
+ );
93
+ whiteGrad.addColorStop(1, "transparent");
94
+ ctx.fillStyle = whiteGrad;
95
+ ctx.fillRect(0, 0, w, h);
96
+ const blackGrad = ctx.createLinearGradient(0, 0, 0, h);
97
+ blackGrad.addColorStop(0, "transparent");
98
+ blackGrad.addColorStop(
99
+ 1,
100
+ uiCore.resolveCssColor("var(--nice-overlay-90, rgba(0, 0, 0, 1))", ctx.canvas)
101
+ );
102
+ ctx.fillStyle = blackGrad;
103
+ ctx.fillRect(0, 0, w, h);
104
+ const cx = localSat * w;
105
+ const cy = (1 - localVal) * h;
106
+ ctx.beginPath();
107
+ ctx.arc(cx, cy, 6, 0, Math.PI * 2);
108
+ ctx.strokeStyle = uiCore.resolveCssColor("var(--nice-bg, #fff)", ctx.canvas);
109
+ ctx.lineWidth = 2;
110
+ ctx.stroke();
111
+ ctx.strokeStyle = uiCore.resolveCssColor("var(--nice-text, #000)", ctx.canvas);
112
+ ctx.lineWidth = 1;
113
+ ctx.stroke();
114
+ }, [localHue, localSat, localVal]);
115
+ const drawHue = React.useCallback(() => {
116
+ const canvas = hueCanvasRef.current;
117
+ if (!canvas) {
118
+ return;
58
119
  }
59
- else if (h < 300) {
60
- r = x;
61
- b = c;
120
+ const ctx = canvas.getContext("2d");
121
+ if (!ctx) {
122
+ return;
62
123
  }
63
- else {
64
- r = c;
65
- b = x;
124
+ const w = canvas.width;
125
+ const h = canvas.height;
126
+ const grad = ctx.createLinearGradient(0, 0, w, 0);
127
+ for (let i = 0; i <= 360; i += 60) {
128
+ grad.addColorStop(i / 360, `hsl(${i}, 100%, 50%)`);
66
129
  }
67
- const toHex = (n) => Math.round((n + m) * 255)
68
- .toString(16)
69
- .padStart(2, '0');
70
- return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
71
- }
72
- const HSVPicker = ({ color, onChange }) => {
73
- const svCanvasRef = React.useRef(null);
74
- const hueCanvasRef = React.useRef(null);
75
- const [hue, saturation, value] = React.useMemo(() => hexToHSV(color), [color]);
76
- const [localHue, setLocalHue] = React.useState(hue);
77
- const [localSat, setLocalSat] = React.useState(saturation);
78
- const [localVal, setLocalVal] = React.useState(value);
79
- // Sync from prop when color changes externally
80
- React.useEffect(() => {
81
- const [h, s, v] = hexToHSV(color);
82
- setLocalHue(h);
83
- setLocalSat(s);
84
- setLocalVal(v);
85
- }, [color]);
86
- // Draw saturation-value gradient
87
- const drawSV = React.useCallback(() => {
88
- const canvas = svCanvasRef.current;
89
- if (!canvas) {
90
- return;
91
- }
92
- const ctx = canvas.getContext('2d');
93
- if (!ctx) {
94
- return;
95
- }
96
- const w = canvas.width;
97
- const h = canvas.height;
98
- // Base hue color
99
- ctx.fillStyle = `hsl(${localHue}, 100%, 50%)`;
100
- ctx.fillRect(0, 0, w, h);
101
- // White gradient (left to right)
102
- const whiteGrad = ctx.createLinearGradient(0, 0, w, 0);
103
- whiteGrad.addColorStop(0, uiCore.resolveCssColor('var(--nice-overlay-light-95, rgba(255, 255, 255, 1))', ctx.canvas));
104
- whiteGrad.addColorStop(1, 'transparent');
105
- ctx.fillStyle = whiteGrad;
106
- ctx.fillRect(0, 0, w, h);
107
- // Black gradient (top to bottom)
108
- const blackGrad = ctx.createLinearGradient(0, 0, 0, h);
109
- blackGrad.addColorStop(0, 'transparent');
110
- blackGrad.addColorStop(1, uiCore.resolveCssColor('var(--nice-overlay-90, rgba(0, 0, 0, 1))', ctx.canvas));
111
- ctx.fillStyle = blackGrad;
112
- ctx.fillRect(0, 0, w, h);
113
- // Draw cursor
114
- const cx = localSat * w;
115
- const cy = (1 - localVal) * h;
116
- ctx.beginPath();
117
- ctx.arc(cx, cy, 6, 0, Math.PI * 2);
118
- ctx.strokeStyle = uiCore.resolveCssColor('var(--nice-bg, #fff)', ctx.canvas);
119
- ctx.lineWidth = 2;
120
- ctx.stroke();
121
- ctx.strokeStyle = uiCore.resolveCssColor('var(--nice-text, #000)', ctx.canvas);
122
- ctx.lineWidth = 1;
123
- ctx.stroke();
124
- }, [localHue, localSat, localVal]);
125
- // Draw hue bar
126
- const drawHue = React.useCallback(() => {
127
- const canvas = hueCanvasRef.current;
128
- if (!canvas) {
129
- return;
130
- }
131
- const ctx = canvas.getContext('2d');
132
- if (!ctx) {
133
- return;
134
- }
135
- const w = canvas.width;
136
- const h = canvas.height;
137
- const grad = ctx.createLinearGradient(0, 0, w, 0);
138
- for (let i = 0; i <= 360; i += 60) {
139
- grad.addColorStop(i / 360, `hsl(${i}, 100%, 50%)`);
140
- }
141
- ctx.fillStyle = grad;
142
- ctx.fillRect(0, 0, w, h);
143
- // Draw cursor
144
- const cx = (localHue / 360) * w;
145
- ctx.beginPath();
146
- ctx.moveTo(cx, 0);
147
- ctx.lineTo(cx, h);
148
- ctx.strokeStyle = uiCore.resolveCssColor('var(--nice-bg, #fff)', ctx.canvas);
149
- ctx.lineWidth = 2;
150
- ctx.stroke();
151
- }, [localHue]);
152
- React.useEffect(() => {
153
- drawSV();
154
- }, [drawSV]);
155
- React.useEffect(() => {
156
- drawHue();
157
- }, [drawHue]);
158
- const handleSVClick = React.useCallback((e) => {
159
- const canvas = svCanvasRef.current;
160
- if (!canvas) {
161
- return;
162
- }
163
- const rect = canvas.getBoundingClientRect();
164
- const x = e.clientX - rect.left;
165
- const y = e.clientY - rect.top;
166
- const s = Math.max(0, Math.min(1, x / canvas.width));
167
- const v = Math.max(0, Math.min(1, 1 - y / canvas.height));
168
- setLocalSat(s);
169
- setLocalVal(v);
170
- onChange(hsvToHex(localHue, s, v));
171
- }, [localHue, onChange]);
172
- const handleHueClick = React.useCallback((e) => {
173
- const canvas = hueCanvasRef.current;
174
- if (!canvas) {
175
- return;
176
- }
177
- const rect = canvas.getBoundingClientRect();
178
- const x = e.clientX - rect.left;
179
- const h = Math.max(0, Math.min(360, (x / canvas.width) * 360));
180
- setLocalHue(h);
181
- onChange(hsvToHex(h, localSat, localVal));
182
- }, [localSat, localVal, onChange]);
183
- return (jsxRuntime.jsxs("div", { className: PixelEditor_module.hsvPicker, children: [jsxRuntime.jsx("canvas", { ref: svCanvasRef, width: 150, height: 150, onClick: handleSVClick, onMouseDown: handleSVClick, className: PixelEditor_module.hsvSVCanvas }), jsxRuntime.jsx("canvas", { ref: hueCanvasRef, width: 150, height: 16, onClick: handleHueClick, onMouseDown: handleHueClick, className: PixelEditor_module.hsvHueCanvas })] }));
130
+ ctx.fillStyle = grad;
131
+ ctx.fillRect(0, 0, w, h);
132
+ const cx = localHue / 360 * w;
133
+ ctx.beginPath();
134
+ ctx.moveTo(cx, 0);
135
+ ctx.lineTo(cx, h);
136
+ ctx.strokeStyle = uiCore.resolveCssColor("var(--nice-bg, #fff)", ctx.canvas);
137
+ ctx.lineWidth = 2;
138
+ ctx.stroke();
139
+ }, [localHue]);
140
+ React.useEffect(() => {
141
+ drawSV();
142
+ }, [drawSV]);
143
+ React.useEffect(() => {
144
+ drawHue();
145
+ }, [drawHue]);
146
+ const handleSVClick = React.useCallback(
147
+ (e) => {
148
+ const canvas = svCanvasRef.current;
149
+ if (!canvas) {
150
+ return;
151
+ }
152
+ const rect = canvas.getBoundingClientRect();
153
+ const x = e.clientX - rect.left;
154
+ const y = e.clientY - rect.top;
155
+ const s = Math.max(0, Math.min(1, x / canvas.width));
156
+ const v = Math.max(0, Math.min(1, 1 - y / canvas.height));
157
+ setLocalSat(s);
158
+ setLocalVal(v);
159
+ onChange(hsvToHex(localHue, s, v));
160
+ },
161
+ [localHue, onChange]
162
+ );
163
+ const handleHueClick = React.useCallback(
164
+ (e) => {
165
+ const canvas = hueCanvasRef.current;
166
+ if (!canvas) {
167
+ return;
168
+ }
169
+ const rect = canvas.getBoundingClientRect();
170
+ const x = e.clientX - rect.left;
171
+ const h = Math.max(0, Math.min(360, x / canvas.width * 360));
172
+ setLocalHue(h);
173
+ onChange(hsvToHex(h, localSat, localVal));
174
+ },
175
+ [localSat, localVal, onChange]
176
+ );
177
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PixelEditor_module.default.hsvPicker, children: [
178
+ /* @__PURE__ */ jsxRuntime.jsx(
179
+ "canvas",
180
+ {
181
+ ref: svCanvasRef,
182
+ width: 150,
183
+ height: 150,
184
+ onClick: handleSVClick,
185
+ onMouseDown: handleSVClick,
186
+ className: PixelEditor_module.default.hsvSVCanvas
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsxRuntime.jsx(
190
+ "canvas",
191
+ {
192
+ ref: hueCanvasRef,
193
+ width: 150,
194
+ height: 16,
195
+ onClick: handleHueClick,
196
+ onMouseDown: handleHueClick,
197
+ className: PixelEditor_module.default.hsvHueCanvas
198
+ }
199
+ )
200
+ ] });
184
201
  };
185
-
186
202
  exports.HSVPicker = HSVPicker;
@@ -1,50 +1,161 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var ui = require('@nice2dev/ui');
5
- var React = require('react');
6
- var editorAsk = require('../core/editorAsk.js');
7
- var i18n = require('../core/i18n.js');
8
- var PixelEditor_module = require('./PixelEditor.module.css.js');
9
- var PixelEditorCanvas = require('./PixelEditorCanvas.js');
10
- var PixelEditorMenuBar = require('./PixelEditorMenuBar.js');
11
- var PixelEditorRightPanel = require('./PixelEditorRightPanel.js');
12
- var PixelEditorStatusBar = require('./PixelEditorStatusBar.js');
13
- var PixelEditorTimeline = require('./PixelEditorTimeline.js');
14
- var PixelEditorToolbar = require('./PixelEditorToolbar.js');
15
- var SpriteGeneratorPanel = require('./SpriteGeneratorPanel.js');
16
- var usePixelEditor = require('./usePixelEditor.js');
17
-
18
- const NicePixelEditor = ({ initialWidth = 64, initialHeight = 64, className, onSaveToLibrary, }) => {
19
- const { t } = i18n.useNiceTranslation();
20
- const api = usePixelEditor.usePixelEditor({ initialWidth, initialHeight, onSaveToLibrary });
21
- const [showGenerator, setShowGenerator] = React.useState(false);
22
- const handleGeneratorSend = React.useCallback((imageData) => {
23
- var _a;
24
- (_a = api.importImageData) === null || _a === void 0 ? void 0 : _a.call(api, imageData);
25
- }, [api]);
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) => {
27
- var _a;
28
- const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
29
- if (f) {
30
- api.openFile(f);
31
- }
32
- e.target.value = '';
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: t('pixelEditor.widthPx', '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: t('pixelEditor.heightPx', '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: [
34
- [16, 16],
35
- [32, 32],
36
- [48, 48],
37
- [64, 64],
38
- [128, 128],
39
- [256, 256],
40
- [16, 32],
41
- [32, 64],
42
- [48, 16],
43
- [64, 32],
44
- ].map(([w, h]) => (jsxRuntime.jsxs(ui.NiceButton, { className: PixelEditor_module.btnSecondary, variant: "ghost", size: "sm", style: { fontSize: 10, padding: '2px 6px' }, onClick: () => {
45
- api.setNw(w);
46
- api.setNh(h);
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') })] })] })] }));
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const ui = require("@nice2dev/ui");
5
+ const React = require("react");
6
+ const editorAsk = require("../core/editorAsk.js");
7
+ const i18n = require("../core/i18n.js");
8
+ const PixelEditor_module = require("./PixelEditor.module.css.js");
9
+ const PixelEditorCanvas = require("./PixelEditorCanvas.js");
10
+ const PixelEditorMenuBar = require("./PixelEditorMenuBar.js");
11
+ const PixelEditorRightPanel = require("./PixelEditorRightPanel.js");
12
+ const PixelEditorStatusBar = require("./PixelEditorStatusBar.js");
13
+ const PixelEditorTimeline = require("./PixelEditorTimeline.js");
14
+ const PixelEditorToolbar = require("./PixelEditorToolbar.js");
15
+ const SpriteGeneratorPanel = require("./SpriteGeneratorPanel.js");
16
+ const usePixelEditor = require("./usePixelEditor.js");
17
+ const NicePixelEditor = ({
18
+ initialWidth = 64,
19
+ initialHeight = 64,
20
+ className,
21
+ onSaveToLibrary
22
+ }) => {
23
+ const { t } = i18n.useNiceTranslation();
24
+ const api = usePixelEditor.usePixelEditor({ initialWidth, initialHeight, onSaveToLibrary });
25
+ const [showGenerator, setShowGenerator] = React.useState(false);
26
+ const handleGeneratorSend = React.useCallback(
27
+ (imageData) => {
28
+ api.importImageData?.(imageData);
29
+ },
30
+ [api]
31
+ );
32
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
33
+ /* @__PURE__ */ jsxRuntime.jsx(editorAsk.EditorAskDialog, { ask: api.pendingAsk }),
34
+ /* @__PURE__ */ jsxRuntime.jsx(
35
+ "input",
36
+ {
37
+ ref: api.fInp,
38
+ type: "file",
39
+ accept: ".ase,.aseprite,.png,.jpg,.jpeg,.gif,.bmp,.webp,.svg,.tga,.ico,.tiff,.tif,.avif",
40
+ style: { display: "none" },
41
+ onChange: (e) => {
42
+ const f = e.target.files?.[0];
43
+ if (f) {
44
+ api.openFile(f);
45
+ }
46
+ e.target.value = "";
47
+ }
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ ui.NiceAppShell,
52
+ {
53
+ className,
54
+ flush: true,
55
+ menubar: /* @__PURE__ */ jsxRuntime.jsx(
56
+ PixelEditorMenuBar.default,
57
+ {
58
+ api,
59
+ hasOnSaveToLibrary: !!onSaveToLibrary,
60
+ onOpenGenerator: () => setShowGenerator(true)
61
+ }
62
+ ),
63
+ sidebar: /* @__PURE__ */ jsxRuntime.jsx(PixelEditorToolbar.default, { api }),
64
+ rightSidebar: /* @__PURE__ */ jsxRuntime.jsx(PixelEditorRightPanel.default, { api }),
65
+ bottomPanel: /* @__PURE__ */ jsxRuntime.jsx(PixelEditorTimeline.default, { api }),
66
+ statusBar: /* @__PURE__ */ jsxRuntime.jsx(PixelEditorStatusBar.default, { api }),
67
+ children: /* @__PURE__ */ jsxRuntime.jsx(PixelEditorCanvas.default, { api })
68
+ }
69
+ ),
70
+ showGenerator && /* @__PURE__ */ jsxRuntime.jsx(
71
+ SpriteGeneratorPanel.default,
72
+ {
73
+ onSendToCanvas: handleGeneratorSend,
74
+ onClose: () => setShowGenerator(false)
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsxRuntime.jsxs(
78
+ ui.NiceModal,
79
+ {
80
+ open: api.dlgNew,
81
+ onClose: () => api.setDlgNew(false),
82
+ title: t("pixelEditor.newDocument", "New Document"),
83
+ children: [
84
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: t("pixelEditor.widthPx", "Width (px)") }),
85
+ /* @__PURE__ */ jsxRuntime.jsx(
86
+ ui.NiceNumberInput,
87
+ {
88
+ min: 1,
89
+ max: 4096,
90
+ value: api.nw,
91
+ onChange: (val) => api.setNw(val ?? 64),
92
+ "aria-label": t("pixelEditor.documentWidth", "Document width")
93
+ }
94
+ ),
95
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: t("pixelEditor.heightPx", "Height (px)") }),
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
+ ui.NiceNumberInput,
98
+ {
99
+ min: 1,
100
+ max: 4096,
101
+ value: api.nh,
102
+ onChange: (val) => api.setNh(val ?? 64),
103
+ "aria-label": t("pixelEditor.documentHeight", "Document height")
104
+ }
105
+ ),
106
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 4, flexWrap: "wrap", marginTop: 8 }, children: [
107
+ [16, 16],
108
+ [32, 32],
109
+ [48, 48],
110
+ [64, 64],
111
+ [128, 128],
112
+ [256, 256],
113
+ [16, 32],
114
+ [32, 64],
115
+ [48, 16],
116
+ [64, 32]
117
+ ].map(([w, h]) => /* @__PURE__ */ jsxRuntime.jsxs(
118
+ ui.NiceButton,
119
+ {
120
+ className: PixelEditor_module.default.btnSecondary,
121
+ variant: "ghost",
122
+ size: "sm",
123
+ style: { fontSize: 10, padding: "2px 6px" },
124
+ onClick: () => {
125
+ api.setNw(w);
126
+ api.setNh(h);
127
+ },
128
+ children: [
129
+ w,
130
+ "x",
131
+ h
132
+ ]
133
+ },
134
+ `${w}x${h}`
135
+ )) }),
136
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: PixelEditor_module.default.dialogActions, children: [
137
+ /* @__PURE__ */ jsxRuntime.jsx(
138
+ ui.NiceButton,
139
+ {
140
+ className: PixelEditor_module.default.btnSecondary,
141
+ variant: "ghost",
142
+ onClick: () => api.setDlgNew(false),
143
+ children: t("pixelEditor.cancel", "Cancel")
144
+ }
145
+ ),
146
+ /* @__PURE__ */ jsxRuntime.jsx(
147
+ ui.NiceButton,
148
+ {
149
+ className: PixelEditor_module.default.btnPrimary,
150
+ variant: "primary",
151
+ onClick: () => api.newDoc(api.nw, api.nh),
152
+ children: t("pixelEditor.create", "Create")
153
+ }
154
+ )
155
+ ] })
156
+ ]
157
+ }
158
+ )
159
+ ] });
48
160
  };
49
-
50
161
  exports.NicePixelEditor = NicePixelEditor;