@aivex/ui 1.2.0-dev.37 → 1.2.0-dev.39

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "./styles.css";
3
- import { Dt as e, Hr as t, Oi as n, Q as r, Zr as i, di as a, dr as o, jr as s, nt as c, rr as l, sa as u, t as d, tr as f } from "./Button-CuvXiYtX.js";
4
- import { a as p, c as m, i as h, n as g, r as _, s as v, t as y } from "./keyboard-DUqwZll5.js";
3
+ import { $r as e, Ai as t, Dt as n, Nr as r, Q as i, Wr as a, ar as o, la as s, nt as c, pi as l, pr as u, rr as d, t as f } from "./Button-BrPqDGyO.js";
4
+ import { a as p, c as m, i as h, n as g, r as _, s as v, t as y } from "./keyboard-BMCakKCv.js";
5
5
  import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
6
6
  import { memo as C, useCallback as w, useEffect as T, useId as E, useImperativeHandle as D, useLayoutEffect as O, useMemo as k, useReducer as A, useRef as j, useState as M } from "react";
7
7
  import N from "konva";
@@ -441,7 +441,7 @@ var K = {
441
441
  bringToFront: "맨 앞으로",
442
442
  sendToBack: "맨 뒤로",
443
443
  editVertices: "정점 편집",
444
- merge: "레이블 합치기",
444
+ merge: "라벨 합치기",
445
445
  assistExpand: "이 지점 포함하기",
446
446
  assistExclude: "이 지점 제외하기",
447
447
  undo: "실행 취소",
@@ -982,9 +982,9 @@ var ct = [
982
982
  "simplifyStrength",
983
983
  "zoomSensitivity"
984
984
  ]);
985
- function lt({ value: e, defaults: t, onChange: n, labels: r = K.viewSettings, items: a = ct, openDown: o = !1, alignEnd: s = !1 }) {
985
+ function lt({ value: t, defaults: n, onChange: r, labels: i = K.viewSettings, items: a = ct, openDown: o = !1, alignEnd: s = !1 }) {
986
986
  return /* @__PURE__ */ S(v.Content, {
987
- "aria-label": r.title,
987
+ "aria-label": i.title,
988
988
  side: o ? "bottom" : "top",
989
989
  align: s ? "end" : "start",
990
990
  sideOffset: 8,
@@ -992,33 +992,33 @@ function lt({ value: e, defaults: t, onChange: n, labels: r = K.viewSettings, it
992
992
  children: [
993
993
  /* @__PURE__ */ x("div", {
994
994
  className: "aivex:px-xs aivex:text-body-md",
995
- children: r.title
995
+ children: i.title
996
996
  }),
997
997
  /* @__PURE__ */ S("div", {
998
998
  className: "aivex:flex aivex:flex-col aivex:gap-md",
999
999
  children: [
1000
- a.filter((e) => Y.has(e)).map((t) => {
1001
- let i = dt[t];
1000
+ a.filter((e) => Y.has(e)).map((e) => {
1001
+ let n = dt[e];
1002
1002
  return /* @__PURE__ */ x(pt, {
1003
- icon: i.icon,
1004
- label: r[t],
1005
- value: i.format(e[t]),
1003
+ icon: n.icon,
1004
+ label: i[e],
1005
+ value: n.format(t[e]),
1006
1006
  children: /* @__PURE__ */ x(h, {
1007
- ...He[t],
1008
- value: [e[t]],
1009
- onValueChange: ([e]) => n({ [t]: e })
1007
+ ...He[e],
1008
+ value: [t[e]],
1009
+ onValueChange: ([t]) => r({ [e]: t })
1010
1010
  })
1011
- }, t);
1011
+ }, e);
1012
1012
  }),
1013
1013
  /* @__PURE__ */ x("div", {
1014
1014
  className: "aivex:flex aivex:flex-col aivex:gap-xs",
1015
- children: a.filter((e) => !Y.has(e)).map((t) => {
1016
- let i = ft[t];
1015
+ children: a.filter((e) => !Y.has(e)).map((e) => {
1016
+ let n = ft[e];
1017
1017
  return /* @__PURE__ */ x(mt, {
1018
- checked: i.checked(e),
1019
- label: r[t],
1020
- onChange: (e) => n(i.patch(e))
1021
- }, t);
1018
+ checked: n.checked(t),
1019
+ label: i[e],
1020
+ onChange: (e) => r(n.patch(e))
1021
+ }, e);
1022
1022
  })
1023
1023
  }),
1024
1024
  /* @__PURE__ */ x(p, {})
@@ -1026,12 +1026,12 @@ function lt({ value: e, defaults: t, onChange: n, labels: r = K.viewSettings, it
1026
1026
  }),
1027
1027
  /* @__PURE__ */ x("div", {
1028
1028
  className: "aivex:flex aivex:justify-end",
1029
- children: /* @__PURE__ */ S(d, {
1029
+ children: /* @__PURE__ */ S(f, {
1030
1030
  variant: "solid",
1031
1031
  color: "secondary",
1032
1032
  size: "md",
1033
- onClick: () => n({ ...t }),
1034
- children: [/* @__PURE__ */ x(i, { size: 20 }), r.reset]
1033
+ onClick: () => r({ ...n }),
1034
+ children: [/* @__PURE__ */ x(e, { size: 20 }), i.reset]
1035
1035
  })
1036
1036
  })
1037
1037
  ]
@@ -1042,23 +1042,23 @@ function ut(e) {
1042
1042
  }
1043
1043
  var dt = {
1044
1044
  brightness: {
1045
- icon: /* @__PURE__ */ x(r, { size: 16 }),
1045
+ icon: /* @__PURE__ */ x(i, { size: 16 }),
1046
1046
  format: ut
1047
1047
  },
1048
1048
  contrast: {
1049
- icon: /* @__PURE__ */ x(e, { size: 16 }),
1049
+ icon: /* @__PURE__ */ x(n, { size: 16 }),
1050
1050
  format: ut
1051
1051
  },
1052
1052
  strokeSize: {
1053
- icon: /* @__PURE__ */ x(n, { size: 16 }),
1053
+ icon: /* @__PURE__ */ x(t, { size: 16 }),
1054
1054
  format: String
1055
1055
  },
1056
1056
  simplifyStrength: {
1057
- icon: /* @__PURE__ */ x(s, { size: 16 }),
1057
+ icon: /* @__PURE__ */ x(r, { size: 16 }),
1058
1058
  format: String
1059
1059
  },
1060
1060
  zoomSensitivity: {
1061
- icon: /* @__PURE__ */ x(u, { size: 16 }),
1061
+ icon: /* @__PURE__ */ x(s, { size: 16 }),
1062
1062
  format: (e) => e.toFixed(1)
1063
1063
  }
1064
1064
  }, ft = {
@@ -1128,7 +1128,7 @@ var X = {
1128
1128
  "bottom-right": "aivex:bottom-2 aivex:right-2",
1129
1129
  "top-left": "aivex:top-2 aivex:left-2",
1130
1130
  "top-right": "aivex:top-2 aivex:right-2"
1131
- }, ht = C(function({ image: e, imageUrl: n, imageVisible: r = !0, loading: i = !1, region: s, roiMaskId: u, shapes: f, view: p, viewDefaults: m, onChangeView: h, nav: g, registerShape: _, rectRef: y, zoomLabelRef: b, onZoom100: C, open: w, onToggleOpen: T, position: E = "bottom-left", showSettings: D = !0, settingsOpen: O, onToggleSettings: k, onCloseSettings: A, labels: j = K.minimap, settingsLabels: M, settingsItems: N }) {
1131
+ }, ht = C(function({ image: e, imageUrl: t, imageVisible: n = !0, loading: r = !1, region: i, roiMaskId: s, shapes: d, view: p, viewDefaults: m, onChangeView: h, nav: g, registerShape: _, rectRef: y, zoomLabelRef: b, onZoom100: C, open: w, onToggleOpen: T, position: E = "bottom-left", showSettings: D = !0, settingsOpen: O, onToggleSettings: k, onCloseSettings: A, labels: j = K.minimap, settingsLabels: M, settingsItems: N }) {
1132
1132
  let { offX: P, offY: ee, dispW: F, dispH: I, zoomCentered: te } = g, ne = E.startsWith("top"), re = {
1133
1133
  position: "absolute",
1134
1134
  left: P,
@@ -1143,32 +1143,32 @@ var X = {
1143
1143
  width: 204,
1144
1144
  height: 204
1145
1145
  },
1146
- className: `aivex:relative aivex:touch-none aivex:overflow-hidden aivex:rounded-sm aivex:bg-static-gray ${i ? "aivex:cursor-default" : "aivex:cursor-grab aivex:active:cursor-grabbing"}`,
1147
- onPointerDown: i ? void 0 : g.handleMinimapPointerDown,
1148
- onPointerMove: i ? void 0 : g.handleMinimapPointerMove,
1149
- onPointerUp: i ? void 0 : g.endMinimapDrag,
1150
- onPointerCancel: i ? void 0 : g.endMinimapDrag,
1151
- onWheel: i ? void 0 : g.handleMinimapWheel,
1152
- "aria-busy": i,
1146
+ className: `aivex:relative aivex:touch-none aivex:overflow-hidden aivex:rounded-sm aivex:bg-static-gray ${r ? "aivex:cursor-default" : "aivex:cursor-grab aivex:active:cursor-grabbing"}`,
1147
+ onPointerDown: r ? void 0 : g.handleMinimapPointerDown,
1148
+ onPointerMove: r ? void 0 : g.handleMinimapPointerMove,
1149
+ onPointerUp: r ? void 0 : g.endMinimapDrag,
1150
+ onPointerCancel: r ? void 0 : g.endMinimapDrag,
1151
+ onWheel: r ? void 0 : g.handleMinimapWheel,
1152
+ "aria-busy": r,
1153
1153
  children: /* @__PURE__ */ S("div", {
1154
1154
  style: {
1155
1155
  position: "absolute",
1156
1156
  inset: 0,
1157
- opacity: +!!r,
1158
- transition: r ? "opacity 0.3s ease" : "none"
1157
+ opacity: +!!n,
1158
+ transition: n ? "opacity 0.3s ease" : "none"
1159
1159
  },
1160
1160
  children: [
1161
- n && /* @__PURE__ */ x("img", {
1162
- src: n,
1161
+ t && /* @__PURE__ */ x("img", {
1162
+ src: t,
1163
1163
  alt: "",
1164
1164
  crossOrigin: "anonymous",
1165
1165
  draggable: !1,
1166
1166
  style: re
1167
1167
  }),
1168
- p.showRegionMask && s && s.rects.length > 0 && /* @__PURE__ */ x(st, {
1168
+ p.showRegionMask && i && i.rects.length > 0 && /* @__PURE__ */ x(st, {
1169
1169
  image: e,
1170
- region: s,
1171
- maskId: u,
1170
+ region: i,
1171
+ maskId: s,
1172
1172
  width: F,
1173
1173
  height: I,
1174
1174
  strokeWidth: 1,
@@ -1191,7 +1191,7 @@ var X = {
1191
1191
  pointerEvents: "none"
1192
1192
  },
1193
1193
  "aria-hidden": !0,
1194
- children: ce(f).filter(R).map((e) => /* @__PURE__ */ x(J, {
1194
+ children: ce(d).filter(R).map((e) => /* @__PURE__ */ x(J, {
1195
1195
  shape: e,
1196
1196
  strokeSize: p.strokeSize,
1197
1197
  register: _
@@ -1213,45 +1213,45 @@ var X = {
1213
1213
  }), L = /* @__PURE__ */ S("div", {
1214
1214
  className: "aivex:relative aivex:flex aivex:items-center aivex:gap-xs",
1215
1215
  children: [
1216
- /* @__PURE__ */ x(d, {
1216
+ /* @__PURE__ */ x(f, {
1217
1217
  variant: "ghost",
1218
1218
  size: "icon-md",
1219
1219
  "aria-label": j.zoomOut,
1220
1220
  onClick: () => te(1 / 1.2),
1221
- disabled: i,
1222
- children: /* @__PURE__ */ x(o, { size: 20 })
1221
+ disabled: r,
1222
+ children: /* @__PURE__ */ x(u, { size: 20 })
1223
1223
  }),
1224
- /* @__PURE__ */ x(d, {
1224
+ /* @__PURE__ */ x(f, {
1225
1225
  variant: "ghost",
1226
1226
  size: "md",
1227
1227
  "aria-label": j.zoom100,
1228
1228
  onClick: C,
1229
- disabled: i,
1229
+ disabled: r,
1230
1230
  className: "aivex:w-[60px] aivex:tabular-nums",
1231
1231
  children: /* @__PURE__ */ x("span", {
1232
1232
  ref: b,
1233
1233
  children: "100%"
1234
1234
  })
1235
1235
  }),
1236
- /* @__PURE__ */ x(d, {
1236
+ /* @__PURE__ */ x(f, {
1237
1237
  variant: "ghost",
1238
1238
  size: "icon-md",
1239
1239
  "aria-label": j.zoomIn,
1240
1240
  onClick: () => te(1.2),
1241
- disabled: i,
1242
- children: /* @__PURE__ */ x(t, { size: 20 })
1241
+ disabled: r,
1242
+ children: /* @__PURE__ */ x(a, { size: 20 })
1243
1243
  }),
1244
1244
  D && /* @__PURE__ */ S(v, {
1245
1245
  open: O,
1246
1246
  onOpenChange: (e) => e ? k() : A(),
1247
1247
  children: [/* @__PURE__ */ x(v.Trigger, {
1248
1248
  asChild: !0,
1249
- children: /* @__PURE__ */ x(d, {
1249
+ children: /* @__PURE__ */ x(f, {
1250
1250
  variant: "ghost",
1251
1251
  size: "icon-md",
1252
1252
  "aria-label": j.viewSettings,
1253
1253
  className: O ? "aivex:text-text-brand" : void 0,
1254
- children: /* @__PURE__ */ x(a, { size: 20 })
1254
+ children: /* @__PURE__ */ x(l, { size: 20 })
1255
1255
  })
1256
1256
  }), /* @__PURE__ */ x(lt, {
1257
1257
  value: p,
@@ -1263,7 +1263,7 @@ var X = {
1263
1263
  alignEnd: E.endsWith("right")
1264
1264
  })]
1265
1265
  }),
1266
- /* @__PURE__ */ x(d, {
1266
+ /* @__PURE__ */ x(f, {
1267
1267
  variant: "ghost",
1268
1268
  size: "icon-md",
1269
1269
  "aria-label": j.toggleMinimap,
@@ -1272,7 +1272,7 @@ var X = {
1272
1272
  children: w ? /* @__PURE__ */ x(c, {
1273
1273
  size: 20,
1274
1274
  className: ne ? "aivex:rotate-180" : void 0
1275
- }) : /* @__PURE__ */ x(l, { size: 20 })
1275
+ }) : /* @__PURE__ */ x(o, { size: 20 })
1276
1276
  })
1277
1277
  ]
1278
1278
  });
@@ -5572,7 +5572,7 @@ var $r = "__draft_preview__", ei = new Set([
5572
5572
  function ti(e, t) {
5573
5573
  return e.length === t.length && e.every((e, n) => e === t[n]);
5574
5574
  }
5575
- function ni({ document: e, clipboardScope: t, renderImageState: n, dimmed: r = !1, selectedIds: i, activeTool: a, draftStyle: o, draftMeta: s, readOnly: c, disableMarquee: l, locked: u, onLockedInteraction: d, onDrawAttemptWithoutDraft: p, onIdleEscape: m, overrideShapeInteraction: h, defaultViewSettings: g, viewSettings: _, onViewSettingsChange: v, showMinimap: y = !0, minimapPosition: b = "bottom-left", showViewSettings: C = !0, getContextMenuItems: A, strings: N, viewSettingItems: P, canMergeSelection: ee, brushSize: F = 20, zoomBound: I, zoomAnimationDuration: te = 300, decorationShapes: ne, regionMask: re, overlayMarkers: ie, renderOverlayMarker: ae, onOverlayMarkerClick: se, renderImageOverlay: ce, getSelectionLabel: B, hideSelectionLabelDot: V, formatSelectionInfo: H, externalTools: ue, assistant: de, keymap: fe, handleRef: pe, backend: me = "pixi", onActiveToolChange: he, onSelectionChange: ge, onEditingChange: _e, onShapesCreated: ve, onShapesUpdated: ye, onShapesDeleted: be, onDrawSessionChange: xe, onDraftShapeChange: Se, onViewportChange: Ce, onShapesTransformPreview: we }) {
5575
+ function ni({ document: e, clipboardScope: t, renderImageState: n, dimmed: r = !1, selectedIds: i, activeTool: a, draftStyle: o, draftMeta: s, readOnly: c, disableMarquee: l, locked: u, onLockedInteraction: f, onDrawAttemptWithoutDraft: p, onIdleEscape: m, overrideShapeInteraction: h, defaultViewSettings: g, viewSettings: _, onViewSettingsChange: v, showMinimap: y = !0, minimapPosition: b = "bottom-left", showViewSettings: C = !0, getContextMenuItems: A, strings: N, viewSettingItems: P, canMergeSelection: ee, brushSize: F = 20, zoomBound: I, zoomAnimationDuration: te = 300, decorationShapes: ne, regionMask: re, overlayMarkers: ie, renderOverlayMarker: ae, onOverlayMarkerClick: se, renderImageOverlay: ce, getSelectionLabel: B, hideSelectionLabelDot: V, formatSelectionInfo: H, externalTools: ue, assistant: de, keymap: fe, handleRef: pe, backend: me = "pixi", onActiveToolChange: he, onSelectionChange: ge, onEditingChange: _e, onShapesCreated: ve, onShapesUpdated: ye, onShapesDeleted: be, onDrawSessionChange: xe, onDraftShapeChange: Se, onViewportChange: Ce, onShapesTransformPreview: we }) {
5576
5576
  let Te = j(null), U = j(null), Ee = j(null), De = j(null), Oe = j(null), ke = `${E()}-minimap`, [W, Ae] = M(null), [je, Me] = M(!1), [G, Ne] = M(!1), [Pe, Fe] = M(null), [Ie, Le] = M({
5577
5577
  active: !1,
5578
5578
  kind: "none",
@@ -5653,8 +5653,8 @@ function ni({ document: e, clipboardScope: t, renderImageState: n, dimmed: r = !
5653
5653
  Rt.current = l;
5654
5654
  let zt = j(u);
5655
5655
  zt.current = u;
5656
- let Bt = j(d);
5657
- Bt.current = d;
5656
+ let Bt = j(f);
5657
+ Bt.current = f;
5658
5658
  let Vt = j(p);
5659
5659
  Vt.current = p;
5660
5660
  let Ht = j(h);
@@ -6242,7 +6242,7 @@ function ni({ document: e, clipboardScope: t, renderImageState: n, dimmed: r = !
6242
6242
  ...Or ? [{
6243
6243
  id: "assistExpand",
6244
6244
  label: Z.contextMenu.assistExpand,
6245
- icon: /* @__PURE__ */ x(f, { size: 14 }),
6245
+ icon: /* @__PURE__ */ x(d, { size: 14 }),
6246
6246
  disabled: !kr,
6247
6247
  onClick: () => {
6248
6248
  Pe && kr && $.refineShape(kr, Pe.img, !0);
@@ -6250,7 +6250,7 @@ function ni({ document: e, clipboardScope: t, renderImageState: n, dimmed: r = !
6250
6250
  }, {
6251
6251
  id: "assistExclude",
6252
6252
  label: Z.contextMenu.assistExclude,
6253
- icon: /* @__PURE__ */ x(f, { size: 14 }),
6253
+ icon: /* @__PURE__ */ x(d, { size: 14 }),
6254
6254
  disabled: !kr,
6255
6255
  onClick: () => {
6256
6256
  Pe && kr && $.refineShape(kr, Pe.img, !1);