@owp/core 2.5.14 → 2.5.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 (36) hide show
  1. package/dist/components/OwpDialog/OwpAlertDialog.js +46 -0
  2. package/dist/components/OwpDialog/OwpAlertDialog.js.map +1 -0
  3. package/dist/components/OwpDialog/OwpDialog.js +41 -38
  4. package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
  5. package/dist/components/OwpQuerySelector/OwpQuerySelector.js +184 -177
  6. package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
  7. package/dist/components/OwpTable/internal/treeGridTableStyle.js +16 -21
  8. package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
  9. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +145 -137
  10. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  11. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +265 -178
  12. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  13. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +141 -127
  14. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  15. package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js +7 -6
  16. package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js.map +1 -1
  17. package/dist/constants/treeGrid.js +32 -26
  18. package/dist/constants/treeGrid.js.map +1 -1
  19. package/dist/features/themePreview/components/ThemePreviewColorField.js +79 -75
  20. package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -1
  21. package/dist/hooks/useConfirm.js +55 -65
  22. package/dist/hooks/useConfirm.js.map +1 -1
  23. package/dist/index.js +69 -67
  24. package/dist/index.js.map +1 -1
  25. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  26. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  27. package/dist/owp-app.css +1 -1
  28. package/dist/types/components/OwpDialog/OwpAlertDialog.d.ts +25 -0
  29. package/dist/types/components/OwpDialog/OwpDialog.d.ts +2 -0
  30. package/dist/types/components/OwpDialog/index.d.ts +1 -0
  31. package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
  32. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +2 -1
  33. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +6 -2
  34. package/dist/types/constants/treeGrid.d.ts +3 -3
  35. package/dist/types/hooks/useConfirm.d.ts +7 -14
  36. package/package.json +1 -1
@@ -1,16 +1,18 @@
1
- var oe = Object.defineProperty;
2
- var l = (t, e) => oe(t, "name", { value: e, configurable: !0 });
3
- import { jsx as n, jsxs as d, Fragment as ae } from "../../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
1
+ var ne = Object.defineProperty;
2
+ var l = (t, e) => ne(t, "name", { value: e, configurable: !0 });
3
+ import { jsx as o, jsxs as d, Fragment as ae } from "../../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
4
  import { IconButton as ie, Typography as k, InputAdornment as ue, MenuItem as ce, TextField as Q, Box as g, Divider as se, Popover as pe, Button as de } from "@mui/material";
5
5
  import me from "../../../node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestartAltOutlined.js";
6
- import { blue as he, lightBlue as fe, cyan as xe, teal as ge, green as we, amber as be, orange as ve, deepOrange as Pe, red as ye, pink as Ce, purple as ke, deepPurple as Te, indigo as Ve, grey as Ie, blueGrey as Ee } from "@mui/material/colors";
6
+ import { blue as he, lightBlue as fe, cyan as xe, teal as ge, green as we, amber as be, orange as Pe, deepOrange as ve, red as ye, pink as Ce, purple as ke, deepPurple as Te, indigo as Ve, grey as Ie, blueGrey as Ee } from "@mui/material/colors";
7
7
  import { useState as w, useRef as T, useEffect as b } from "react";
8
8
  import { getThemePreviewPaletteValue as Ae } from "../utils/themePreviewSettings.js";
9
- import { getColorAlphaValue as Me, toColorPickerValue as V, applyColorPickerValue as X } from "../utils/color.js";
10
- const Be = {
9
+ import { getColorAlphaValue as Be, toColorPickerValue as V, applyColorPickerValue as X } from "../utils/color.js";
10
+ import { owpDark as Me } from "../../../colors/palettes/dark.js";
11
+ import { skyBlue as De } from "../../../colors/palettes/skyBlue.js";
12
+ const Re = {
11
13
  "px-number": "px",
12
14
  "rem-number": "rem"
13
- }, Re = [
15
+ }, ze = [
14
16
  "50",
15
17
  "100",
16
18
  "200",
@@ -25,15 +27,17 @@ const Be = {
25
27
  "A200",
26
28
  "A400",
27
29
  "A700"
28
- ], ze = [
30
+ ], Se = [
31
+ ["OWP Dark", Me],
32
+ ["OWP Sky Blue", De],
29
33
  ["Blue", he],
30
34
  ["Light Blue", fe],
31
35
  ["Cyan", xe],
32
36
  ["Teal", ge],
33
37
  ["Green", we],
34
38
  ["Amber", be],
35
- ["Orange", ve],
36
- ["Deep Orange", Pe],
39
+ ["Orange", Pe],
40
+ ["Deep Orange", ve],
37
41
  ["Red", ye],
38
42
  ["Pink", Ce],
39
43
  ["Purple", ke],
@@ -41,74 +45,74 @@ const Be = {
41
45
  ["Indigo", Ve],
42
46
  ["Grey", Ie],
43
47
  ["Blue Grey", Ee]
44
- ], re = ze.map(([t, e]) => ({
48
+ ], re = Se.map(([t, e]) => ({
45
49
  label: t,
46
- colors: Re.reduce((o, m) => {
50
+ colors: ze.reduce((n, m) => {
47
51
  const f = e[m];
48
- return f && o.push({
52
+ return f && n.push({
49
53
  key: `${t}-${m}`,
50
54
  shade: m,
51
55
  value: f
52
- }), o;
56
+ }), n;
53
57
  }, [])
54
- })), De = new Set(
58
+ })), We = new Set(
55
59
  re.flatMap(
56
60
  (t) => t.colors.map((e) => e.value.toLowerCase())
57
61
  )
58
- ), Se = 500, Z = 32, ee = 20;
62
+ ), Oe = 500, Z = 32, ee = 20;
59
63
  function _e(t, e) {
60
64
  return t.replace(new RegExp(`${e}$`, "i"), "");
61
65
  }
62
66
  l(_e, "getUnitInputDisplayValue");
63
67
  function te(t) {
64
- const e = t.replace(/[^0-9.,]/g, "").replace(/,/g, "."), o = e.indexOf(".");
65
- if (o < 0)
68
+ const e = t.replace(/[^0-9.,]/g, "").replace(/,/g, "."), n = e.indexOf(".");
69
+ if (n < 0)
66
70
  return e;
67
- const m = e.slice(0, o), f = e.slice(o + 1).replace(/\./g, "");
71
+ const m = e.slice(0, n), f = e.slice(n + 1).replace(/\./g, "");
68
72
  return `${m}.${f}`;
69
73
  }
70
74
  l(te, "normalizeUnitInputDisplayValue");
71
- function We(t) {
75
+ function $e(t) {
72
76
  const e = te(t);
73
77
  return !e || e === "." ? "" : e.startsWith(".") ? `0${e}` : e.endsWith(".") ? e.slice(0, -1) : e;
74
78
  }
75
- l(We, "normalizeCommittedUnitInputDisplayValue");
76
- function Oe(t, e) {
77
- const o = We(t);
78
- return o ? `${o}${e}` : "";
79
+ l($e, "normalizeCommittedUnitInputDisplayValue");
80
+ function Fe(t, e) {
81
+ const n = $e(t);
82
+ return n ? `${n}${e}` : "";
79
83
  }
80
- l(Oe, "normalizeUnitInputValue");
81
- function $e(t) {
82
- return (t ? Be[t] : null) ?? null;
84
+ l(Fe, "normalizeUnitInputValue");
85
+ function He(t) {
86
+ return (t ? Re[t] : null) ?? null;
83
87
  }
84
- l($e, "getUnitValueFormat");
85
- function qe({
88
+ l(He, "getUnitValueFormat");
89
+ function Xe({
86
90
  disabled: t = !1,
87
91
  definition: e,
88
- resetVersion: o,
92
+ resetVersion: n,
89
93
  sectionKey: m,
90
94
  settings: f,
91
- onChange: v,
95
+ onChange: P,
92
96
  onReset: I
93
97
  }) {
94
98
  var Y, J;
95
- const [P, E] = w(null), W = T(null), a = Ae(f, m, e.path), c = $e(e.valueFormat), O = e.showColorPicker !== !1, $ = e.allowAlpha ? Me(a) : null, F = [e.description];
99
+ const [v, E] = w(null), O = T(null), a = Ae(f, m, e.path), c = He(e.valueFormat), _ = e.showColorPicker !== !1, $ = e.allowAlpha ? Be(a) : null, F = [e.description];
96
100
  e.allowAlpha && F.push(
97
101
  $ ? `알파값은 ${$}로 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.` : "알파값은 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다."
98
102
  );
99
- const le = F.filter(Boolean).join(" "), A = !!((Y = e.options) != null && Y.length), M = !!(e.allowAlpha && O && !A && !c), x = c ? _e(a, c) : a, H = O, B = H ? V(a).toLowerCase() : null, y = B && De.has(B) ? B : null, h = !A && !M, [R, z] = w(x), [L, C] = w(!1), [U, D] = w(V(a)), [S, _] = w(!1), i = T(null), N = T(x), G = T(a);
103
+ const le = F.filter(Boolean).join(" "), A = !!((Y = e.options) != null && Y.length), B = !!(e.allowAlpha && _ && !A && !c), x = c ? _e(a, c) : a, H = _, M = H ? V(a).toLowerCase() : null, y = M && We.has(M) ? M : null, h = !A && !B, [D, R] = w(x), [L, C] = w(!1), [U, z] = w(V(a)), [S, W] = w(!1), i = T(null), N = T(x), G = T(a);
100
104
  N.current = x, G.current = a, b(() => {
101
- !h || L || z(x);
105
+ !h || L || R(x);
102
106
  }, [h, x, L]), b(() => {
103
- S || D(V(a));
107
+ S || z(V(a));
104
108
  }, [S, a]), b(() => () => {
105
109
  i.current && window.clearTimeout(i.current);
106
110
  }, []), b(() => {
107
- if (!P || !y)
111
+ if (!v || !y)
108
112
  return;
109
113
  const r = window.requestAnimationFrame(() => {
110
114
  var s;
111
- const u = (s = W.current) == null ? void 0 : s.querySelector(
115
+ const u = (s = O.current) == null ? void 0 : s.querySelector(
112
116
  `[data-mui-palette-value="${y}"]`
113
117
  );
114
118
  u == null || u.scrollIntoView({
@@ -119,18 +123,18 @@ function qe({
119
123
  return () => {
120
124
  window.cancelAnimationFrame(r);
121
125
  };
122
- }, [y, P]), b(() => {
123
- typeof o > "u" || (i.current && (window.clearTimeout(i.current), i.current = null), z(N.current), C(!1), D(V(G.current)), _(!1));
124
- }, [o]);
126
+ }, [y, v]), b(() => {
127
+ typeof n > "u" || (i.current && (window.clearTimeout(i.current), i.current = null), R(N.current), C(!1), z(V(G.current)), W(!1));
128
+ }, [n]);
125
129
  const j = /* @__PURE__ */ l((r) => {
126
- v(
130
+ P(
127
131
  e.path,
128
- c ? Oe(r, c) : r
132
+ c ? Fe(r, c) : r
129
133
  );
130
134
  }, "commitBufferedTextValue"), K = /* @__PURE__ */ l((r) => {
131
- i.current && (window.clearTimeout(i.current), i.current = null), _(!1), v(e.path, X(a, r));
132
- }, "commitBufferedPickerValue"), q = I || c ? /* @__PURE__ */ n(ue, { position: "end", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-6 pr-2", children: [
133
- I ? /* @__PURE__ */ n(
135
+ i.current && (window.clearTimeout(i.current), i.current = null), W(!1), P(e.path, X(a, r));
136
+ }, "commitBufferedPickerValue"), q = I || c ? /* @__PURE__ */ o(ue, { position: "end", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-6 pr-2", children: [
137
+ I ? /* @__PURE__ */ o(
134
138
  ie,
135
139
  {
136
140
  size: "small",
@@ -148,38 +152,38 @@ function qe({
148
152
  color: "#6b7280",
149
153
  p: 0.25
150
154
  },
151
- children: /* @__PURE__ */ n(me, { sx: { fontSize: 16 } })
155
+ children: /* @__PURE__ */ o(me, { sx: { fontSize: 16 } })
152
156
  }
153
157
  ) : null,
154
- c ? /* @__PURE__ */ n(k, { variant: "body2", sx: { whiteSpace: "nowrap" }, children: c }) : null
158
+ c ? /* @__PURE__ */ o(k, { variant: "body2", sx: { whiteSpace: "nowrap" }, children: c }) : null
155
159
  ] }) }) : void 0;
156
160
  return /* @__PURE__ */ d("div", { className: "grid grid-cols-[minmax(0,1fr)_144px] items-start gap-12", children: [
157
- /* @__PURE__ */ n(
161
+ /* @__PURE__ */ o(
158
162
  Q,
159
163
  {
160
164
  select: A,
161
165
  label: e.label,
162
166
  size: "small",
163
- value: h ? R : x,
167
+ value: h ? D : x,
164
168
  disabled: t,
165
169
  onChange: /* @__PURE__ */ l((r) => {
166
- if (M)
170
+ if (B)
167
171
  return;
168
172
  const u = c ? te(r.target.value) : r.target.value;
169
173
  if (h) {
170
- z(u);
174
+ R(u);
171
175
  return;
172
176
  }
173
- v(e.path, u);
177
+ P(e.path, u);
174
178
  }, "onChange"),
175
179
  onFocus: /* @__PURE__ */ l(() => {
176
180
  h && C(!0);
177
181
  }, "onFocus"),
178
182
  onBlur: /* @__PURE__ */ l(() => {
179
- h && (C(!1), j(R));
183
+ h && (C(!1), j(D));
180
184
  }, "onBlur"),
181
185
  onKeyDown: /* @__PURE__ */ l((r) => {
182
- !h || r.key !== "Enter" || (r.preventDefault(), C(!1), j(R), r.currentTarget.blur());
186
+ !h || r.key !== "Enter" || (r.preventDefault(), C(!1), j(D), r.currentTarget.blur());
183
187
  }, "onKeyDown"),
184
188
  helperText: le,
185
189
  slotProps: {
@@ -187,7 +191,7 @@ function qe({
187
191
  ...c ? {
188
192
  inputMode: "decimal"
189
193
  } : {},
190
- ...M ? {
194
+ ...B ? {
191
195
  readOnly: !0
192
196
  } : {}
193
197
  },
@@ -197,12 +201,12 @@ function qe({
197
201
  } : {}
198
202
  }
199
203
  },
200
- children: (J = e.options) == null ? void 0 : J.map((r) => /* @__PURE__ */ n(ce, { value: r.value, children: r.label }, r.value))
204
+ children: (J = e.options) == null ? void 0 : J.map((r) => /* @__PURE__ */ o(ce, { value: r.value, children: r.label }, r.value))
201
205
  }
202
206
  ),
203
207
  H ? /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-6", children: [
204
208
  /* @__PURE__ */ d(ae, { children: [
205
- /* @__PURE__ */ n(
209
+ /* @__PURE__ */ o(
206
210
  de,
207
211
  {
208
212
  size: "small",
@@ -220,7 +224,7 @@ function qe({
220
224
  children: "MUI"
221
225
  }
222
226
  ),
223
- /* @__PURE__ */ n(
227
+ /* @__PURE__ */ o(
224
228
  Q,
225
229
  {
226
230
  hiddenLabel: !0,
@@ -230,9 +234,9 @@ function qe({
230
234
  disabled: t,
231
235
  onChange: /* @__PURE__ */ l((r) => {
232
236
  const u = r.target.value;
233
- D(u), _(!0), i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => {
237
+ z(u), W(!0), i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => {
234
238
  K(u);
235
- }, Se);
239
+ }, Oe);
236
240
  }, "onChange"),
237
241
  onBlur: /* @__PURE__ */ l(() => {
238
242
  S && K(U);
@@ -276,11 +280,11 @@ function qe({
276
280
  }
277
281
  }
278
282
  ),
279
- P ? /* @__PURE__ */ n(
283
+ v ? /* @__PURE__ */ o(
280
284
  pe,
281
285
  {
282
286
  open: !0,
283
- anchorEl: P,
287
+ anchorEl: v,
284
288
  transitionDuration: 0,
285
289
  onClose: /* @__PURE__ */ l(() => {
286
290
  E(null);
@@ -305,8 +309,8 @@ function qe({
305
309
  }
306
310
  }
307
311
  },
308
- children: /* @__PURE__ */ n("div", { ref: W, className: "flex min-w-0 flex-col gap-10", children: re.map((r, u) => /* @__PURE__ */ d(g, { className: "flex flex-col gap-10", children: [
309
- u > 0 ? /* @__PURE__ */ n(se, { flexItem: !0 }) : null,
312
+ children: /* @__PURE__ */ o("div", { ref: O, className: "flex min-w-0 flex-col gap-10", children: re.map((r, u) => /* @__PURE__ */ d(g, { className: "flex flex-col gap-10", children: [
313
+ u > 0 ? /* @__PURE__ */ o(se, { flexItem: !0 }) : null,
310
314
  /* @__PURE__ */ d(
311
315
  g,
312
316
  {
@@ -319,8 +323,8 @@ function qe({
319
323
  }
320
324
  },
321
325
  children: [
322
- /* @__PURE__ */ n(k, { variant: "caption", color: "text.secondary", children: r.label }),
323
- /* @__PURE__ */ n(
326
+ /* @__PURE__ */ o(k, { variant: "caption", color: "text.secondary", children: r.label }),
327
+ /* @__PURE__ */ o(
324
328
  g,
325
329
  {
326
330
  sx: {
@@ -339,7 +343,7 @@ function qe({
339
343
  "data-mui-palette-value": s.value.toLowerCase(),
340
344
  "aria-current": p ? "true" : void 0,
341
345
  onClick: /* @__PURE__ */ l(() => {
342
- v(
346
+ P(
343
347
  e.path,
344
348
  X(a, s.value)
345
349
  ), E(null);
@@ -350,7 +354,7 @@ function qe({
350
354
  border: "1px solid",
351
355
  borderColor: p ? "primary.main" : "divider",
352
356
  borderRadius: 1,
353
- boxShadow: p ? (ne) => `0 0 0 1px ${ne.palette.primary.main}` : "none",
357
+ boxShadow: p ? (oe) => `0 0 0 1px ${oe.palette.primary.main}` : "none",
354
358
  color: p ? "text.primary" : "text.secondary",
355
359
  cursor: "pointer",
356
360
  display: "flex",
@@ -367,7 +371,7 @@ function qe({
367
371
  }
368
372
  },
369
373
  children: [
370
- /* @__PURE__ */ n(
374
+ /* @__PURE__ */ o(
371
375
  g,
372
376
  {
373
377
  sx: {
@@ -380,7 +384,7 @@ function qe({
380
384
  }
381
385
  }
382
386
  ),
383
- /* @__PURE__ */ n(
387
+ /* @__PURE__ */ o(
384
388
  g,
385
389
  {
386
390
  component: "span",
@@ -407,8 +411,8 @@ function qe({
407
411
  ) : null
408
412
  ] }),
409
413
  e.allowAlpha ? /* @__PURE__ */ d("div", { className: "col-span-2 flex flex-col gap-2", children: [
410
- /* @__PURE__ */ n(k, { variant: "caption", color: "text.secondary", children: "Current" }),
411
- /* @__PURE__ */ n(
414
+ /* @__PURE__ */ o(k, { variant: "caption", color: "text.secondary", children: "Current" }),
415
+ /* @__PURE__ */ o(
412
416
  k,
413
417
  {
414
418
  variant: "caption",
@@ -418,11 +422,11 @@ function qe({
418
422
  }
419
423
  )
420
424
  ] }) : null
421
- ] }) : /* @__PURE__ */ n("div", {})
425
+ ] }) : /* @__PURE__ */ o("div", {})
422
426
  ] });
423
427
  }
424
- l(qe, "ThemePreviewColorField");
428
+ l(Xe, "ThemePreviewColorField");
425
429
  export {
426
- qe as ThemePreviewColorField
430
+ Xe as ThemePreviewColorField
427
431
  };
428
432
  //# sourceMappingURL=ThemePreviewColorField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemePreviewColorField.js","sources":["../../../../src/features/themePreview/components/ThemePreviewColorField.tsx"],"sourcesContent":["import {\n Box,\n Button,\n Divider,\n IconButton,\n InputAdornment,\n MenuItem,\n Popover,\n TextField,\n Typography,\n} from '@mui/material';\nimport RestartAltOutlinedIcon from '@mui/icons-material/RestartAltOutlined';\nimport {\n amber,\n blue,\n blueGrey,\n cyan,\n deepOrange,\n deepPurple,\n green,\n grey,\n indigo,\n lightBlue,\n orange,\n pink,\n purple,\n red,\n teal,\n} from '@mui/material/colors';\nimport type {\n ThemePreviewFieldDefinition,\n ThemePreviewSectionKey,\n ThemePreviewSettings,\n} from '../types';\nimport {\n applyColorPickerValue,\n getColorAlphaValue,\n getThemePreviewPaletteValue,\n toColorPickerValue,\n} from '../utils';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface ThemePreviewColorFieldProps {\n disabled?: boolean;\n definition: ThemePreviewFieldDefinition;\n resetVersion?: number;\n sectionKey: ThemePreviewSectionKey;\n settings: ThemePreviewSettings;\n onChange: (path: string, value: string) => void;\n onReset?: (path: string) => void;\n}\n\nconst themePreviewInputUnits = {\n 'px-number': 'px',\n 'rem-number': 'rem',\n} as const;\n\ntype ThemePreviewInputUnit = (typeof themePreviewInputUnits)[keyof typeof themePreviewInputUnits];\n\nconst themePreviewMuiColorShades = [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n 'A100',\n 'A200',\n 'A400',\n 'A700',\n] as const;\nconst themePreviewMuiColorPalettes = [\n ['Blue', blue],\n ['Light Blue', lightBlue],\n ['Cyan', cyan],\n ['Teal', teal],\n ['Green', green],\n ['Amber', amber],\n ['Orange', orange],\n ['Deep Orange', deepOrange],\n ['Red', red],\n ['Pink', pink],\n ['Purple', purple],\n ['Deep Purple', deepPurple],\n ['Indigo', indigo],\n ['Grey', grey],\n ['Blue Grey', blueGrey],\n] as const;\nconst themePreviewMuiPaletteColorRows = themePreviewMuiColorPalettes.map(([label, palette]) => ({\n label,\n colors: themePreviewMuiColorShades.reduce<Array<{\n key: string;\n shade: string;\n value: string;\n }>>((acc, shade) => {\n const paletteValue = (palette as Record<string, string>)[shade];\n\n if (!paletteValue) {\n return acc;\n }\n\n acc.push({\n key: `${label}-${shade}`,\n shade,\n value: paletteValue,\n });\n\n return acc;\n }, []),\n}));\nconst themePreviewMuiPaletteColorValueSet = new Set(\n themePreviewMuiPaletteColorRows.flatMap((paletteRow) =>\n paletteRow.colors.map((colorItem) => colorItem.value.toLowerCase()),\n ),\n);\nconst THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS = 500;\nconst THEME_PREVIEW_SMALL_FIELD_HEIGHT = 32;\nconst THEME_PREVIEW_PICKER_SWATCH_HEIGHT = 20;\n\nfunction getUnitInputDisplayValue(value: string, unit: ThemePreviewInputUnit) {\n return value.replace(new RegExp(`${unit}$`, 'i'), '');\n}\n\nfunction normalizeUnitInputDisplayValue(value: string) {\n const sanitizedValue = value.replace(/[^0-9.,]/g, '').replace(/,/g, '.');\n const decimalPointIndex = sanitizedValue.indexOf('.');\n\n if (decimalPointIndex < 0) {\n return sanitizedValue;\n }\n\n const integerPart = sanitizedValue.slice(0, decimalPointIndex);\n const decimalPart = sanitizedValue.slice(decimalPointIndex + 1).replace(/\\./g, '');\n\n return `${integerPart}.${decimalPart}`;\n}\n\nfunction normalizeCommittedUnitInputDisplayValue(value: string) {\n const normalizedValue = normalizeUnitInputDisplayValue(value);\n\n if (!normalizedValue || normalizedValue === '.') {\n return '';\n }\n\n if (normalizedValue.startsWith('.')) {\n return `0${normalizedValue}`;\n }\n\n if (normalizedValue.endsWith('.')) {\n return normalizedValue.slice(0, -1);\n }\n\n return normalizedValue;\n}\n\nfunction normalizeUnitInputValue(value: string, unit: ThemePreviewInputUnit) {\n const normalizedValue = normalizeCommittedUnitInputDisplayValue(value);\n\n return normalizedValue ? `${normalizedValue}${unit}` : '';\n}\n\nfunction getUnitValueFormat(valueFormat?: ThemePreviewFieldDefinition['valueFormat']) {\n return (valueFormat ? themePreviewInputUnits[valueFormat] : null) ?? null;\n}\n\nexport function ThemePreviewColorField({\n disabled = false,\n definition,\n resetVersion,\n sectionKey,\n settings,\n onChange,\n onReset,\n}: ThemePreviewColorFieldProps) {\n const [muiPaletteAnchorElement, setMuiPaletteAnchorElement] = useState<HTMLElement | null>(null);\n const muiPaletteContentRef = useRef<HTMLDivElement | null>(null);\n const value = getThemePreviewPaletteValue(settings, sectionKey, definition.path);\n const unitValueFormat = getUnitValueFormat(definition.valueFormat);\n const showColorPicker = definition.showColorPicker !== false;\n const alphaValue = definition.allowAlpha ? getColorAlphaValue(value) : null;\n const helperText = [definition.description];\n\n if (definition.allowAlpha) {\n helperText.push(\n alphaValue\n ? `알파값은 ${alphaValue}로 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.`\n : '알파값은 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.',\n );\n }\n\n const resolvedHelperText = helperText.filter(Boolean).join(' ');\n const hasOptions = Boolean(definition.options?.length);\n const isReadOnlyColorTextInput = Boolean(\n definition.allowAlpha && showColorPicker && !hasOptions && !unitValueFormat,\n );\n const displayValue =\n unitValueFormat ? getUnitInputDisplayValue(value, unitValueFormat) : value;\n const hasPickerControls = showColorPicker;\n const normalizedMuiPaletteValue = hasPickerControls ? toColorPickerValue(value).toLowerCase() : null;\n const matchedMuiPaletteValue =\n normalizedMuiPaletteValue && themePreviewMuiPaletteColorValueSet.has(normalizedMuiPaletteValue)\n ? normalizedMuiPaletteValue\n : null;\n const canBufferTextInput = !hasOptions && !isReadOnlyColorTextInput;\n const [bufferedTextValue, setBufferedTextValue] = useState(displayValue);\n const [isBufferedTextInputFocused, setIsBufferedTextInputFocused] = useState(false);\n const [bufferedPickerValue, setBufferedPickerValue] = useState(toColorPickerValue(value));\n const [isBufferedPickerDirty, setIsBufferedPickerDirty] = useState(false);\n const colorPickerApplyTimeoutRef = useRef<number | null>(null);\n const latestDisplayValueRef = useRef(displayValue);\n const latestValueRef = useRef(value);\n\n latestDisplayValueRef.current = displayValue;\n latestValueRef.current = value;\n\n useEffect(() => {\n if (!canBufferTextInput || isBufferedTextInputFocused) {\n return;\n }\n\n setBufferedTextValue(displayValue);\n }, [canBufferTextInput, displayValue, isBufferedTextInputFocused]);\n\n useEffect(() => {\n if (isBufferedPickerDirty) {\n return;\n }\n\n setBufferedPickerValue(toColorPickerValue(value));\n }, [isBufferedPickerDirty, value]);\n\n useEffect(() => {\n return () => {\n if (!colorPickerApplyTimeoutRef.current) {\n return;\n }\n\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n };\n }, []);\n\n useEffect(() => {\n if (!muiPaletteAnchorElement || !matchedMuiPaletteValue) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const matchedColorButton = muiPaletteContentRef.current?.querySelector<HTMLElement>(\n `[data-mui-palette-value=\"${matchedMuiPaletteValue}\"]`,\n );\n\n matchedColorButton?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [matchedMuiPaletteValue, muiPaletteAnchorElement]);\n\n useEffect(() => {\n if (typeof resetVersion === 'undefined') {\n return;\n }\n\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n colorPickerApplyTimeoutRef.current = null;\n }\n\n setBufferedTextValue(latestDisplayValueRef.current);\n setIsBufferedTextInputFocused(false);\n setBufferedPickerValue(toColorPickerValue(latestValueRef.current));\n setIsBufferedPickerDirty(false);\n }, [resetVersion]);\n\n const commitBufferedTextValue = (nextValue: string) => {\n onChange(\n definition.path,\n unitValueFormat ? normalizeUnitInputValue(nextValue, unitValueFormat) : nextValue,\n );\n };\n const commitBufferedPickerValue = (nextPickerValue: string) => {\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n colorPickerApplyTimeoutRef.current = null;\n }\n\n setIsBufferedPickerDirty(false);\n onChange(definition.path, applyColorPickerValue(value, nextPickerValue));\n };\n const inputEndAdornment = onReset || unitValueFormat ? (\n <InputAdornment position=\"end\">\n <div className=\"flex items-center gap-6 pr-2\">\n {onReset ? (\n <IconButton\n size=\"small\"\n aria-label={`${definition.label} reset`}\n disabled={disabled}\n onMouseDown={(event) => {\n event.preventDefault();\n }}\n onClick={() => {\n onReset(definition.path);\n }}\n sx={{\n border: '1px solid #cbd5e1',\n borderRadius: 1,\n color: '#6b7280',\n p: 0.25,\n }}\n >\n <RestartAltOutlinedIcon sx={{ fontSize: 16 }} />\n </IconButton>\n ) : null}\n {unitValueFormat ? (\n <Typography variant=\"body2\" sx={{ whiteSpace: 'nowrap' }}>\n {unitValueFormat}\n </Typography>\n ) : null}\n </div>\n </InputAdornment>\n ) : undefined;\n\n return (\n <div className=\"grid grid-cols-[minmax(0,1fr)_144px] items-start gap-12\">\n <TextField\n select={hasOptions}\n label={definition.label}\n size=\"small\"\n value={canBufferTextInput ? bufferedTextValue : displayValue}\n disabled={disabled}\n onChange={(event) => {\n if (isReadOnlyColorTextInput) {\n return;\n }\n\n const nextValue = unitValueFormat\n ? normalizeUnitInputDisplayValue(event.target.value)\n : event.target.value;\n\n if (canBufferTextInput) {\n setBufferedTextValue(nextValue);\n return;\n }\n\n onChange(definition.path, nextValue);\n }}\n onFocus={() => {\n if (!canBufferTextInput) {\n return;\n }\n\n setIsBufferedTextInputFocused(true);\n }}\n onBlur={() => {\n if (!canBufferTextInput) {\n return;\n }\n\n setIsBufferedTextInputFocused(false);\n commitBufferedTextValue(bufferedTextValue);\n }}\n onKeyDown={(event) => {\n if (!canBufferTextInput || event.key !== 'Enter') {\n return;\n }\n\n event.preventDefault();\n setIsBufferedTextInputFocused(false);\n commitBufferedTextValue(bufferedTextValue);\n event.currentTarget.blur();\n }}\n helperText={resolvedHelperText}\n slotProps={{\n htmlInput:\n {\n ...(unitValueFormat\n ? {\n inputMode: 'decimal',\n }\n : {}),\n ...(isReadOnlyColorTextInput\n ? {\n readOnly: true,\n }\n : {}),\n },\n input:\n {\n ...(inputEndAdornment\n ? {\n endAdornment: inputEndAdornment,\n }\n : {}),\n },\n }}\n >\n {definition.options?.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n\n {hasPickerControls ? (\n <div className=\"grid grid-cols-2 gap-6\">\n <>\n <Button\n size=\"small\"\n fullWidth\n variant=\"outlined\"\n disabled={disabled}\n sx={{\n fontSize: '1.2rem',\n height: THEME_PREVIEW_SMALL_FIELD_HEIGHT,\n minWidth: 0,\n }}\n onClick={(event) => {\n setMuiPaletteAnchorElement(event.currentTarget);\n }}\n >\n MUI\n </Button>\n <TextField\n hiddenLabel\n type=\"color\"\n size=\"small\"\n value={bufferedPickerValue}\n disabled={disabled}\n onChange={(event) => {\n const nextPickerValue = event.target.value;\n\n setBufferedPickerValue(nextPickerValue);\n setIsBufferedPickerDirty(true);\n\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n }\n\n colorPickerApplyTimeoutRef.current = window.setTimeout(() => {\n commitBufferedPickerValue(nextPickerValue);\n }, THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS);\n }}\n onBlur={() => {\n if (!isBufferedPickerDirty) {\n return;\n }\n\n commitBufferedPickerValue(bufferedPickerValue);\n }}\n slotProps={{\n htmlInput: {\n 'aria-label': 'Pick color',\n },\n }}\n sx={{\n '& .MuiOutlinedInput-root': {\n height: THEME_PREVIEW_SMALL_FIELD_HEIGHT,\n px: 0.5,\n },\n '& input[type=\"color\"]': {\n WebkitAppearance: 'none',\n alignSelf: 'center',\n boxSizing: 'border-box',\n border: 0,\n borderRadius: 0,\n display: 'block',\n height: THEME_PREVIEW_PICKER_SWATCH_HEIGHT,\n minHeight: THEME_PREVIEW_PICKER_SWATCH_HEIGHT,\n overflow: 'hidden',\n padding: 0,\n p: 0,\n width: '100%',\n },\n '& input[type=\"color\"]::-webkit-color-swatch-wrapper': {\n borderRadius: 0,\n p: 0,\n },\n '& input[type=\"color\"]::-webkit-color-swatch': {\n borderColor: '#94a3b8',\n borderRadius: 0,\n },\n '& input[type=\"color\"]::-moz-color-swatch': {\n borderColor: '#94a3b8',\n borderRadius: 0,\n },\n }}\n />\n {muiPaletteAnchorElement ? (\n <Popover\n open\n anchorEl={muiPaletteAnchorElement}\n transitionDuration={0}\n onClose={() => {\n setMuiPaletteAnchorElement(null);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n slotProps={{\n paper: {\n sx: {\n maxHeight: 'calc(100vh - 32px)',\n maxWidth: 'calc(100vw - 32px)',\n minWidth: 320,\n overflow: 'auto',\n p: 1.5,\n width: 'min(760px, calc(100vw - 32px))',\n },\n },\n }}\n >\n <div ref={muiPaletteContentRef} className=\"flex min-w-0 flex-col gap-10\">\n {themePreviewMuiPaletteColorRows.map((paletteRow, paletteRowIndex) => (\n <Box key={paletteRow.label} className=\"flex flex-col gap-10\">\n {paletteRowIndex > 0 ? <Divider flexItem /> : null}\n <Box\n sx={{\n display: 'grid',\n gap: 1,\n gridTemplateColumns: {\n xs: 'minmax(0, 1fr)',\n sm: '84px minmax(0, 1fr)',\n },\n }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {paletteRow.label}\n </Typography>\n <Box\n sx={{\n display: 'grid',\n gap: 0.75,\n gridTemplateColumns: 'repeat(auto-fit, minmax(68px, 1fr))',\n minWidth: 0,\n }}\n >\n {paletteRow.colors.map((colorItem) => {\n const isMatchedMuiPaletteColor =\n matchedMuiPaletteValue === colorItem.value.toLowerCase();\n\n return (\n <Box\n key={colorItem.key}\n component=\"button\"\n type=\"button\"\n data-mui-palette-value={colorItem.value.toLowerCase()}\n aria-current={isMatchedMuiPaletteColor ? 'true' : undefined}\n onClick={() => {\n onChange(\n definition.path,\n applyColorPickerValue(value, colorItem.value),\n );\n setMuiPaletteAnchorElement(null);\n }}\n sx={{\n alignItems: 'center',\n backgroundColor: isMatchedMuiPaletteColor\n ? 'action.selected'\n : 'background.paper',\n border: '1px solid',\n borderColor: isMatchedMuiPaletteColor ? 'primary.main' : 'divider',\n borderRadius: 1,\n boxShadow: isMatchedMuiPaletteColor\n ? (theme) => `0 0 0 1px ${theme.palette.primary.main}`\n : 'none',\n color: isMatchedMuiPaletteColor ? 'text.primary' : 'text.secondary',\n cursor: 'pointer',\n display: 'flex',\n flexDirection: 'column',\n gap: 0.5,\n justifyContent: 'center',\n minWidth: 0,\n p: 0.5,\n transition:\n 'background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease',\n width: '100%',\n '&:hover': {\n backgroundColor: 'action.hover',\n borderColor: isMatchedMuiPaletteColor\n ? 'primary.main'\n : 'text.secondary',\n },\n }}\n >\n <Box\n sx={{\n width: 30,\n height: 30,\n borderRadius: 1,\n backgroundColor: colorItem.value,\n border: '1px solid',\n borderColor: isMatchedMuiPaletteColor\n ? 'primary.main'\n : 'divider',\n }}\n />\n <Box\n component=\"span\"\n sx={{\n fontSize: '0.75rem',\n fontWeight: isMatchedMuiPaletteColor ? 700 : 600,\n lineHeight: 1,\n }}\n >\n {colorItem.shade}\n </Box>\n </Box>\n );\n })}\n </Box>\n </Box>\n </Box>\n ))}\n </div>\n </Popover>\n ) : null}\n </>\n {definition.allowAlpha ? (\n <div className=\"col-span-2 flex flex-col gap-2\">\n <Typography variant=\"caption\" color=\"text.secondary\">\n Current\n </Typography>\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n className=\"truncate whitespace-nowrap\"\n >\n {value || '-'}\n </Typography>\n </div>\n ) : null}\n </div>\n ) : (\n <div />\n )}\n </div>\n );\n}\n"],"names":["themePreviewInputUnits","themePreviewMuiColorShades","themePreviewMuiColorPalettes","blue","lightBlue","cyan","teal","green","amber","orange","deepOrange","red","pink","purple","deepPurple","indigo","grey","blueGrey","themePreviewMuiPaletteColorRows","label","palette","acc","shade","paletteValue","themePreviewMuiPaletteColorValueSet","paletteRow","colorItem","THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS","THEME_PREVIEW_SMALL_FIELD_HEIGHT","THEME_PREVIEW_PICKER_SWATCH_HEIGHT","getUnitInputDisplayValue","value","unit","__name","normalizeUnitInputDisplayValue","sanitizedValue","decimalPointIndex","integerPart","decimalPart","normalizeCommittedUnitInputDisplayValue","normalizedValue","normalizeUnitInputValue","getUnitValueFormat","valueFormat","ThemePreviewColorField","disabled","definition","resetVersion","sectionKey","settings","onChange","onReset","muiPaletteAnchorElement","setMuiPaletteAnchorElement","useState","muiPaletteContentRef","useRef","getThemePreviewPaletteValue","unitValueFormat","showColorPicker","alphaValue","getColorAlphaValue","helperText","resolvedHelperText","hasOptions","_a","isReadOnlyColorTextInput","displayValue","hasPickerControls","normalizedMuiPaletteValue","toColorPickerValue","matchedMuiPaletteValue","canBufferTextInput","bufferedTextValue","setBufferedTextValue","isBufferedTextInputFocused","setIsBufferedTextInputFocused","bufferedPickerValue","setBufferedPickerValue","isBufferedPickerDirty","setIsBufferedPickerDirty","colorPickerApplyTimeoutRef","latestDisplayValueRef","latestValueRef","useEffect","animationFrameId","matchedColorButton","commitBufferedTextValue","nextValue","commitBufferedPickerValue","nextPickerValue","applyColorPickerValue","inputEndAdornment","jsx","InputAdornment","jsxs","IconButton","event","RestartAltOutlinedIcon","Typography","TextField","_b","option","MenuItem","Fragment","Button","Popover","paletteRowIndex","Box","Divider","isMatchedMuiPaletteColor","theme"],"mappings":";;;;;;;;;AAoDA,MAA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AAAA,sCACR,aAAaoF,IACT,iBACA;AAAA,oCAAA;AAAA,kCACN;AAAA,gCAAA;AAAA,gCAEF,gBAAAjB;AAAA,kCAACe;AAAA,kCAAA;AAAA,oCACC,WAAU;AAAA,oCACV,IAAI;AAAA,sCACF,UAAU;AAAA,sCACV,YAAYE,IAA2B,MAAM;AAAA,sCAC7C,YAAY;AAAA,oCAAA;AAAA,oCAGb,UAAApF,EAAU;AAAA,kCAAA;AAAA,gCAAA;AAAA,8BACb;AAAA,4BAAA;AAAA,4BA/DKA,EAAU;AAAA,0BAAA;AAAA,wBAkErB,CAAC;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACH;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF,KAjGQD,EAAW,KAkGrB,CACD,EAAA,CACH;AAAA,UAAA;AAAA,QAAA,IAEA;AAAA,MAAA,GACN;AAAA,MACCqB,EAAW,aACV,gBAAAiD,EAAC,OAAA,EAAI,WAAU,kCACb,UAAA;AAAA,QAAA,gBAAAF,EAACM,GAAA,EAAW,SAAQ,WAAU,OAAM,kBAAiB,UAAA,WAErD;AAAA,QACA,gBAAAN;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YAET,UAAApE,KAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,EAAA,CACF,IACE;AAAA,IAAA,GACN,sBAEC,OAAA,CAAA,CAAI;AAAA,EAAA,GAET;AAEJ;AAjegBE,EAAAW,IAAA;"}
1
+ {"version":3,"file":"ThemePreviewColorField.js","sources":["../../../../src/features/themePreview/components/ThemePreviewColorField.tsx"],"sourcesContent":["import {\n Box,\n Button,\n Divider,\n IconButton,\n InputAdornment,\n MenuItem,\n Popover,\n TextField,\n Typography,\n} from '@mui/material';\nimport RestartAltOutlinedIcon from '@mui/icons-material/RestartAltOutlined';\nimport { owpDark, skyBlue } from '@/colors';\nimport {\n amber,\n blue,\n blueGrey,\n cyan,\n deepOrange,\n deepPurple,\n green,\n grey,\n indigo,\n lightBlue,\n orange,\n pink,\n purple,\n red,\n teal,\n} from '@mui/material/colors';\nimport type {\n ThemePreviewFieldDefinition,\n ThemePreviewSectionKey,\n ThemePreviewSettings,\n} from '../types';\nimport {\n applyColorPickerValue,\n getColorAlphaValue,\n getThemePreviewPaletteValue,\n toColorPickerValue,\n} from '../utils';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface ThemePreviewColorFieldProps {\n disabled?: boolean;\n definition: ThemePreviewFieldDefinition;\n resetVersion?: number;\n sectionKey: ThemePreviewSectionKey;\n settings: ThemePreviewSettings;\n onChange: (path: string, value: string) => void;\n onReset?: (path: string) => void;\n}\n\nconst themePreviewInputUnits = {\n 'px-number': 'px',\n 'rem-number': 'rem',\n} as const;\n\ntype ThemePreviewInputUnit = (typeof themePreviewInputUnits)[keyof typeof themePreviewInputUnits];\n\nconst themePreviewMuiColorShades = [\n '50',\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n 'A100',\n 'A200',\n 'A400',\n 'A700',\n] as const;\nconst themePreviewMuiColorPalettes = [\n ['OWP Dark', owpDark],\n ['OWP Sky Blue', skyBlue],\n ['Blue', blue],\n ['Light Blue', lightBlue],\n ['Cyan', cyan],\n ['Teal', teal],\n ['Green', green],\n ['Amber', amber],\n ['Orange', orange],\n ['Deep Orange', deepOrange],\n ['Red', red],\n ['Pink', pink],\n ['Purple', purple],\n ['Deep Purple', deepPurple],\n ['Indigo', indigo],\n ['Grey', grey],\n ['Blue Grey', blueGrey],\n] as const;\nconst themePreviewMuiPaletteColorRows = themePreviewMuiColorPalettes.map(([label, palette]) => ({\n label,\n colors: themePreviewMuiColorShades.reduce<Array<{\n key: string;\n shade: string;\n value: string;\n }>>((acc, shade) => {\n const paletteValue = (palette as Record<string, string>)[shade];\n\n if (!paletteValue) {\n return acc;\n }\n\n acc.push({\n key: `${label}-${shade}`,\n shade,\n value: paletteValue,\n });\n\n return acc;\n }, []),\n}));\nconst themePreviewMuiPaletteColorValueSet = new Set(\n themePreviewMuiPaletteColorRows.flatMap((paletteRow) =>\n paletteRow.colors.map((colorItem) => colorItem.value.toLowerCase()),\n ),\n);\nconst THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS = 500;\nconst THEME_PREVIEW_SMALL_FIELD_HEIGHT = 32;\nconst THEME_PREVIEW_PICKER_SWATCH_HEIGHT = 20;\n\nfunction getUnitInputDisplayValue(value: string, unit: ThemePreviewInputUnit) {\n return value.replace(new RegExp(`${unit}$`, 'i'), '');\n}\n\nfunction normalizeUnitInputDisplayValue(value: string) {\n const sanitizedValue = value.replace(/[^0-9.,]/g, '').replace(/,/g, '.');\n const decimalPointIndex = sanitizedValue.indexOf('.');\n\n if (decimalPointIndex < 0) {\n return sanitizedValue;\n }\n\n const integerPart = sanitizedValue.slice(0, decimalPointIndex);\n const decimalPart = sanitizedValue.slice(decimalPointIndex + 1).replace(/\\./g, '');\n\n return `${integerPart}.${decimalPart}`;\n}\n\nfunction normalizeCommittedUnitInputDisplayValue(value: string) {\n const normalizedValue = normalizeUnitInputDisplayValue(value);\n\n if (!normalizedValue || normalizedValue === '.') {\n return '';\n }\n\n if (normalizedValue.startsWith('.')) {\n return `0${normalizedValue}`;\n }\n\n if (normalizedValue.endsWith('.')) {\n return normalizedValue.slice(0, -1);\n }\n\n return normalizedValue;\n}\n\nfunction normalizeUnitInputValue(value: string, unit: ThemePreviewInputUnit) {\n const normalizedValue = normalizeCommittedUnitInputDisplayValue(value);\n\n return normalizedValue ? `${normalizedValue}${unit}` : '';\n}\n\nfunction getUnitValueFormat(valueFormat?: ThemePreviewFieldDefinition['valueFormat']) {\n return (valueFormat ? themePreviewInputUnits[valueFormat] : null) ?? null;\n}\n\nexport function ThemePreviewColorField({\n disabled = false,\n definition,\n resetVersion,\n sectionKey,\n settings,\n onChange,\n onReset,\n}: ThemePreviewColorFieldProps) {\n const [muiPaletteAnchorElement, setMuiPaletteAnchorElement] = useState<HTMLElement | null>(null);\n const muiPaletteContentRef = useRef<HTMLDivElement | null>(null);\n const value = getThemePreviewPaletteValue(settings, sectionKey, definition.path);\n const unitValueFormat = getUnitValueFormat(definition.valueFormat);\n const showColorPicker = definition.showColorPicker !== false;\n const alphaValue = definition.allowAlpha ? getColorAlphaValue(value) : null;\n const helperText = [definition.description];\n\n if (definition.allowAlpha) {\n helperText.push(\n alphaValue\n ? `알파값은 ${alphaValue}로 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.`\n : '알파값은 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.',\n );\n }\n\n const resolvedHelperText = helperText.filter(Boolean).join(' ');\n const hasOptions = Boolean(definition.options?.length);\n const isReadOnlyColorTextInput = Boolean(\n definition.allowAlpha && showColorPicker && !hasOptions && !unitValueFormat,\n );\n const displayValue =\n unitValueFormat ? getUnitInputDisplayValue(value, unitValueFormat) : value;\n const hasPickerControls = showColorPicker;\n const normalizedMuiPaletteValue = hasPickerControls ? toColorPickerValue(value).toLowerCase() : null;\n const matchedMuiPaletteValue =\n normalizedMuiPaletteValue && themePreviewMuiPaletteColorValueSet.has(normalizedMuiPaletteValue)\n ? normalizedMuiPaletteValue\n : null;\n const canBufferTextInput = !hasOptions && !isReadOnlyColorTextInput;\n const [bufferedTextValue, setBufferedTextValue] = useState(displayValue);\n const [isBufferedTextInputFocused, setIsBufferedTextInputFocused] = useState(false);\n const [bufferedPickerValue, setBufferedPickerValue] = useState(toColorPickerValue(value));\n const [isBufferedPickerDirty, setIsBufferedPickerDirty] = useState(false);\n const colorPickerApplyTimeoutRef = useRef<number | null>(null);\n const latestDisplayValueRef = useRef(displayValue);\n const latestValueRef = useRef(value);\n\n latestDisplayValueRef.current = displayValue;\n latestValueRef.current = value;\n\n useEffect(() => {\n if (!canBufferTextInput || isBufferedTextInputFocused) {\n return;\n }\n\n setBufferedTextValue(displayValue);\n }, [canBufferTextInput, displayValue, isBufferedTextInputFocused]);\n\n useEffect(() => {\n if (isBufferedPickerDirty) {\n return;\n }\n\n setBufferedPickerValue(toColorPickerValue(value));\n }, [isBufferedPickerDirty, value]);\n\n useEffect(() => {\n return () => {\n if (!colorPickerApplyTimeoutRef.current) {\n return;\n }\n\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n };\n }, []);\n\n useEffect(() => {\n if (!muiPaletteAnchorElement || !matchedMuiPaletteValue) {\n return;\n }\n\n const animationFrameId = window.requestAnimationFrame(() => {\n const matchedColorButton = muiPaletteContentRef.current?.querySelector<HTMLElement>(\n `[data-mui-palette-value=\"${matchedMuiPaletteValue}\"]`,\n );\n\n matchedColorButton?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n });\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [matchedMuiPaletteValue, muiPaletteAnchorElement]);\n\n useEffect(() => {\n if (typeof resetVersion === 'undefined') {\n return;\n }\n\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n colorPickerApplyTimeoutRef.current = null;\n }\n\n setBufferedTextValue(latestDisplayValueRef.current);\n setIsBufferedTextInputFocused(false);\n setBufferedPickerValue(toColorPickerValue(latestValueRef.current));\n setIsBufferedPickerDirty(false);\n }, [resetVersion]);\n\n const commitBufferedTextValue = (nextValue: string) => {\n onChange(\n definition.path,\n unitValueFormat ? normalizeUnitInputValue(nextValue, unitValueFormat) : nextValue,\n );\n };\n const commitBufferedPickerValue = (nextPickerValue: string) => {\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n colorPickerApplyTimeoutRef.current = null;\n }\n\n setIsBufferedPickerDirty(false);\n onChange(definition.path, applyColorPickerValue(value, nextPickerValue));\n };\n const inputEndAdornment = onReset || unitValueFormat ? (\n <InputAdornment position=\"end\">\n <div className=\"flex items-center gap-6 pr-2\">\n {onReset ? (\n <IconButton\n size=\"small\"\n aria-label={`${definition.label} reset`}\n disabled={disabled}\n onMouseDown={(event) => {\n event.preventDefault();\n }}\n onClick={() => {\n onReset(definition.path);\n }}\n sx={{\n border: '1px solid #cbd5e1',\n borderRadius: 1,\n color: '#6b7280',\n p: 0.25,\n }}\n >\n <RestartAltOutlinedIcon sx={{ fontSize: 16 }} />\n </IconButton>\n ) : null}\n {unitValueFormat ? (\n <Typography variant=\"body2\" sx={{ whiteSpace: 'nowrap' }}>\n {unitValueFormat}\n </Typography>\n ) : null}\n </div>\n </InputAdornment>\n ) : undefined;\n\n return (\n <div className=\"grid grid-cols-[minmax(0,1fr)_144px] items-start gap-12\">\n <TextField\n select={hasOptions}\n label={definition.label}\n size=\"small\"\n value={canBufferTextInput ? bufferedTextValue : displayValue}\n disabled={disabled}\n onChange={(event) => {\n if (isReadOnlyColorTextInput) {\n return;\n }\n\n const nextValue = unitValueFormat\n ? normalizeUnitInputDisplayValue(event.target.value)\n : event.target.value;\n\n if (canBufferTextInput) {\n setBufferedTextValue(nextValue);\n return;\n }\n\n onChange(definition.path, nextValue);\n }}\n onFocus={() => {\n if (!canBufferTextInput) {\n return;\n }\n\n setIsBufferedTextInputFocused(true);\n }}\n onBlur={() => {\n if (!canBufferTextInput) {\n return;\n }\n\n setIsBufferedTextInputFocused(false);\n commitBufferedTextValue(bufferedTextValue);\n }}\n onKeyDown={(event) => {\n if (!canBufferTextInput || event.key !== 'Enter') {\n return;\n }\n\n event.preventDefault();\n setIsBufferedTextInputFocused(false);\n commitBufferedTextValue(bufferedTextValue);\n event.currentTarget.blur();\n }}\n helperText={resolvedHelperText}\n slotProps={{\n htmlInput:\n {\n ...(unitValueFormat\n ? {\n inputMode: 'decimal',\n }\n : {}),\n ...(isReadOnlyColorTextInput\n ? {\n readOnly: true,\n }\n : {}),\n },\n input:\n {\n ...(inputEndAdornment\n ? {\n endAdornment: inputEndAdornment,\n }\n : {}),\n },\n }}\n >\n {definition.options?.map((option) => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n\n {hasPickerControls ? (\n <div className=\"grid grid-cols-2 gap-6\">\n <>\n <Button\n size=\"small\"\n fullWidth\n variant=\"outlined\"\n disabled={disabled}\n sx={{\n fontSize: '1.2rem',\n height: THEME_PREVIEW_SMALL_FIELD_HEIGHT,\n minWidth: 0,\n }}\n onClick={(event) => {\n setMuiPaletteAnchorElement(event.currentTarget);\n }}\n >\n MUI\n </Button>\n <TextField\n hiddenLabel\n type=\"color\"\n size=\"small\"\n value={bufferedPickerValue}\n disabled={disabled}\n onChange={(event) => {\n const nextPickerValue = event.target.value;\n\n setBufferedPickerValue(nextPickerValue);\n setIsBufferedPickerDirty(true);\n\n if (colorPickerApplyTimeoutRef.current) {\n window.clearTimeout(colorPickerApplyTimeoutRef.current);\n }\n\n colorPickerApplyTimeoutRef.current = window.setTimeout(() => {\n commitBufferedPickerValue(nextPickerValue);\n }, THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS);\n }}\n onBlur={() => {\n if (!isBufferedPickerDirty) {\n return;\n }\n\n commitBufferedPickerValue(bufferedPickerValue);\n }}\n slotProps={{\n htmlInput: {\n 'aria-label': 'Pick color',\n },\n }}\n sx={{\n '& .MuiOutlinedInput-root': {\n height: THEME_PREVIEW_SMALL_FIELD_HEIGHT,\n px: 0.5,\n },\n '& input[type=\"color\"]': {\n WebkitAppearance: 'none',\n alignSelf: 'center',\n boxSizing: 'border-box',\n border: 0,\n borderRadius: 0,\n display: 'block',\n height: THEME_PREVIEW_PICKER_SWATCH_HEIGHT,\n minHeight: THEME_PREVIEW_PICKER_SWATCH_HEIGHT,\n overflow: 'hidden',\n padding: 0,\n p: 0,\n width: '100%',\n },\n '& input[type=\"color\"]::-webkit-color-swatch-wrapper': {\n borderRadius: 0,\n p: 0,\n },\n '& input[type=\"color\"]::-webkit-color-swatch': {\n borderColor: '#94a3b8',\n borderRadius: 0,\n },\n '& input[type=\"color\"]::-moz-color-swatch': {\n borderColor: '#94a3b8',\n borderRadius: 0,\n },\n }}\n />\n {muiPaletteAnchorElement ? (\n <Popover\n open\n anchorEl={muiPaletteAnchorElement}\n transitionDuration={0}\n onClose={() => {\n setMuiPaletteAnchorElement(null);\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n slotProps={{\n paper: {\n sx: {\n maxHeight: 'calc(100vh - 32px)',\n maxWidth: 'calc(100vw - 32px)',\n minWidth: 320,\n overflow: 'auto',\n p: 1.5,\n width: 'min(760px, calc(100vw - 32px))',\n },\n },\n }}\n >\n <div ref={muiPaletteContentRef} className=\"flex min-w-0 flex-col gap-10\">\n {themePreviewMuiPaletteColorRows.map((paletteRow, paletteRowIndex) => (\n <Box key={paletteRow.label} className=\"flex flex-col gap-10\">\n {paletteRowIndex > 0 ? <Divider flexItem /> : null}\n <Box\n sx={{\n display: 'grid',\n gap: 1,\n gridTemplateColumns: {\n xs: 'minmax(0, 1fr)',\n sm: '84px minmax(0, 1fr)',\n },\n }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {paletteRow.label}\n </Typography>\n <Box\n sx={{\n display: 'grid',\n gap: 0.75,\n gridTemplateColumns: 'repeat(auto-fit, minmax(68px, 1fr))',\n minWidth: 0,\n }}\n >\n {paletteRow.colors.map((colorItem) => {\n const isMatchedMuiPaletteColor =\n matchedMuiPaletteValue === colorItem.value.toLowerCase();\n\n return (\n <Box\n key={colorItem.key}\n component=\"button\"\n type=\"button\"\n data-mui-palette-value={colorItem.value.toLowerCase()}\n aria-current={isMatchedMuiPaletteColor ? 'true' : undefined}\n onClick={() => {\n onChange(\n definition.path,\n applyColorPickerValue(value, colorItem.value),\n );\n setMuiPaletteAnchorElement(null);\n }}\n sx={{\n alignItems: 'center',\n backgroundColor: isMatchedMuiPaletteColor\n ? 'action.selected'\n : 'background.paper',\n border: '1px solid',\n borderColor: isMatchedMuiPaletteColor ? 'primary.main' : 'divider',\n borderRadius: 1,\n boxShadow: isMatchedMuiPaletteColor\n ? (theme) => `0 0 0 1px ${theme.palette.primary.main}`\n : 'none',\n color: isMatchedMuiPaletteColor ? 'text.primary' : 'text.secondary',\n cursor: 'pointer',\n display: 'flex',\n flexDirection: 'column',\n gap: 0.5,\n justifyContent: 'center',\n minWidth: 0,\n p: 0.5,\n transition:\n 'background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease',\n width: '100%',\n '&:hover': {\n backgroundColor: 'action.hover',\n borderColor: isMatchedMuiPaletteColor\n ? 'primary.main'\n : 'text.secondary',\n },\n }}\n >\n <Box\n sx={{\n width: 30,\n height: 30,\n borderRadius: 1,\n backgroundColor: colorItem.value,\n border: '1px solid',\n borderColor: isMatchedMuiPaletteColor\n ? 'primary.main'\n : 'divider',\n }}\n />\n <Box\n component=\"span\"\n sx={{\n fontSize: '0.75rem',\n fontWeight: isMatchedMuiPaletteColor ? 700 : 600,\n lineHeight: 1,\n }}\n >\n {colorItem.shade}\n </Box>\n </Box>\n );\n })}\n </Box>\n </Box>\n </Box>\n ))}\n </div>\n </Popover>\n ) : null}\n </>\n {definition.allowAlpha ? (\n <div className=\"col-span-2 flex flex-col gap-2\">\n <Typography variant=\"caption\" color=\"text.secondary\">\n Current\n </Typography>\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n className=\"truncate whitespace-nowrap\"\n >\n {value || '-'}\n </Typography>\n </div>\n ) : null}\n </div>\n ) : (\n <div />\n )}\n </div>\n );\n}\n"],"names":["themePreviewInputUnits","themePreviewMuiColorShades","themePreviewMuiColorPalettes","owpDark","skyBlue","blue","lightBlue","cyan","teal","green","amber","orange","deepOrange","red","pink","purple","deepPurple","indigo","grey","blueGrey","themePreviewMuiPaletteColorRows","label","palette","acc","shade","paletteValue","themePreviewMuiPaletteColorValueSet","paletteRow","colorItem","THEME_PREVIEW_COLOR_PICKER_APPLY_DELAY_MS","THEME_PREVIEW_SMALL_FIELD_HEIGHT","THEME_PREVIEW_PICKER_SWATCH_HEIGHT","getUnitInputDisplayValue","value","unit","__name","normalizeUnitInputDisplayValue","sanitizedValue","decimalPointIndex","integerPart","decimalPart","normalizeCommittedUnitInputDisplayValue","normalizedValue","normalizeUnitInputValue","getUnitValueFormat","valueFormat","ThemePreviewColorField","disabled","definition","resetVersion","sectionKey","settings","onChange","onReset","muiPaletteAnchorElement","setMuiPaletteAnchorElement","useState","muiPaletteContentRef","useRef","getThemePreviewPaletteValue","unitValueFormat","showColorPicker","alphaValue","getColorAlphaValue","helperText","resolvedHelperText","hasOptions","_a","isReadOnlyColorTextInput","displayValue","hasPickerControls","normalizedMuiPaletteValue","toColorPickerValue","matchedMuiPaletteValue","canBufferTextInput","bufferedTextValue","setBufferedTextValue","isBufferedTextInputFocused","setIsBufferedTextInputFocused","bufferedPickerValue","setBufferedPickerValue","isBufferedPickerDirty","setIsBufferedPickerDirty","colorPickerApplyTimeoutRef","latestDisplayValueRef","latestValueRef","useEffect","animationFrameId","matchedColorButton","commitBufferedTextValue","nextValue","commitBufferedPickerValue","nextPickerValue","applyColorPickerValue","inputEndAdornment","jsx","InputAdornment","jsxs","IconButton","event","RestartAltOutlinedIcon","Typography","TextField","_b","option","MenuItem","Fragment","Button","Popover","paletteRowIndex","Box","Divider","isMatchedMuiPaletteColor","theme"],"mappings":";;;;;;;;;;;AAqDA,MAAMA,KAAyB;AAAA,EAC7B,aAAa;AAAA,EACb,cAAc;AAChB,GAIMC,KAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACMC,KAA+B;AAAA,EACnC,CAAC,YAAYC,EAAO;AAAA,EACpB,CAAC,gBAAgBC,EAAO;AAAA,EACxB,CAAC,QAAQC,EAAI;AAAA,EACb,CAAC,cAAcC,EAAS;AAAA,EACxB,CAAC,QAAQC,EAAI;AAAA,EACb,CAAC,QAAQC,EAAI;AAAA,EACb,CA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