@nice2dev/ui 1.3.18 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +27 -0
- package/dist/{NiceDataGrid-CFibAGHt.cjs → NiceDataGrid-BT6iCUgP.cjs} +1 -1
- package/dist/{NiceForm-ChRj4r3f.cjs → NiceForm-Bysp66Ef.cjs} +1 -1
- package/dist/{NiceMention-DNx3d9L7.cjs → NiceMention-sc8W-DwH.cjs} +1 -1
- package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +1 -0
- package/dist/{NiceSavedQueryPanel-BuRAgrBk.cjs → NiceSavedQueryPanel-BbznsXFd.cjs} +1 -1
- package/dist/{NiceScheduler-DAoo1eyo.cjs → NiceScheduler-3Ez0zSQJ.cjs} +1 -1
- package/dist/{core-lazy-DohJQ33c.cjs → core-lazy-CL4ZIxF-.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/editors/pickers/pickerCommons.mjs +284 -87
- package/dist/editors/pickers/themePickerHelpers.mjs +10 -8
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +166 -166
- package/dist/index.d.ts +142 -10
- package/dist/index.mjs +1517 -1488
- package/dist/navigation/sidebarColors.mjs +61 -50
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +7 -0
- package/dist/pickerCommons-CwcCc8Qi.cjs +1 -0
- package/dist/planning/NiceResourceAllocation.mjs +31 -31
- package/dist/style.css +4 -4
- package/dist/tools/NiceThemeDesigner.mjs +781 -708
- package/dist/tools/NiceThemePreview.mjs +344 -282
- package/dist/tools/themeCatalog.mjs +28 -44
- package/dist/tools/themeCatalogArchive.mjs +38 -0
- package/dist/tools/themeDesigner/ThemeSetEditors.mjs +400 -0
- package/dist/tools/themeDesigner/ThemeValueField.mjs +146 -0
- package/dist/tools/themeDesigner/themeDesignerPaths.mjs +105 -0
- package/package.json +4 -4
- package/dist/NiceModuleLifecyclePanel-D8Q081R6.cjs +0 -1
- package/dist/pickerCommons-BWglYl6J.cjs +0 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as n, Fragment as Ye } from "react/jsx-runtime";
|
|
2
2
|
import { useNiceTranslation as Ge } from "@nice2dev/i18n";
|
|
3
|
-
import { useControlId as
|
|
4
|
-
import { forwardRef as pt, useState as
|
|
3
|
+
import { useControlId as ot, niceThemeLight as Ke, NiceIcon as $, NiceTutorialButton as st, resolveTutorial as lt, deserializeTheme as ct, useRovingFocus as mt, NiceThemeContext as dt, applyTheme as ht, serializeTheme as Ue, themeToCssVars as We, NICE_DISPLAY_STYLES as ut } from "@nice2dev/ui-core";
|
|
4
|
+
import { forwardRef as pt, useState as O, useCallback as y, useRef as M, useMemo as G, useEffect as me, useContext as bt } from "react";
|
|
5
5
|
import { NiceTreeGrid as gt } from "../data/NiceTreeGrid.mjs";
|
|
6
|
-
import { NiceNumberInput as
|
|
7
|
-
import { NiceSelect as
|
|
8
|
-
import { NiceTextInput as
|
|
6
|
+
import { NiceNumberInput as ze } from "../editors/inputs/NiceNumberInput.mjs";
|
|
7
|
+
import { NiceSelect as Re } from "../editors/inputs/NiceSelect.mjs";
|
|
8
|
+
import { NiceTextInput as je } from "../editors/inputs/NiceTextInput.mjs";
|
|
9
9
|
import { NiceColorPalette as ft } from "../editors/pickers/NiceColorPalette.mjs";
|
|
10
|
-
import { NiceColorPicker as
|
|
10
|
+
import { NiceColorPicker as yt } from "../editors/pickers/NiceColorPicker.mjs";
|
|
11
|
+
import { ThemePreviewSwatch as vt } from "../editors/pickers/pickerCommons.mjs";
|
|
12
|
+
import { toThemeDescriptor as _t } from "../editors/pickers/themePickerHelpers.mjs";
|
|
11
13
|
import { NiceConfirmDialog as Ze } from "../feedback/NiceConfirmDialog.mjs";
|
|
12
|
-
import { downloadBlob as
|
|
14
|
+
import { downloadBlob as St } from "./NiceExport.mjs";
|
|
13
15
|
import { NiceThemePreview as Qe } from "./NiceThemePreview.mjs";
|
|
14
|
-
import { NICE_THEME_CATALOG as
|
|
16
|
+
import { NICE_THEME_CATALOG as Se } from "./themeCatalog.mjs";
|
|
17
|
+
import { setThemePath as Nt } from "./themeDesigner/themeDesignerPaths.mjs";
|
|
18
|
+
import { ThemeScrollbarEditor as wt, ThemeColorSetEditor as Xe, ThemePaletteEditor as Tt } from "./themeDesigner/ThemeSetEditors.mjs";
|
|
19
|
+
import { ThemeValueField as kt } from "./themeDesigner/ThemeValueField.mjs";
|
|
15
20
|
const et = {
|
|
16
21
|
target: ".nice-theme-builder",
|
|
17
22
|
titleKey: "tutorial.themeBuilder.intro.title",
|
|
@@ -19,7 +24,7 @@ const et = {
|
|
|
19
24
|
contentKey: "tutorial.themeBuilder.intro.content",
|
|
20
25
|
content: "Start from a preset, tweak colors, typography and other tokens by section, preview live, then apply or export the theme.",
|
|
21
26
|
placement: "auto"
|
|
22
|
-
},
|
|
27
|
+
}, xt = [
|
|
23
28
|
et,
|
|
24
29
|
{
|
|
25
30
|
target: ".nice-theme-builder__tree",
|
|
@@ -29,7 +34,7 @@ const et = {
|
|
|
29
34
|
content: "Start from a built-in preset, then customise — the fastest way to a coherent palette.",
|
|
30
35
|
placement: "right"
|
|
31
36
|
}
|
|
32
|
-
],
|
|
37
|
+
], Ct = [
|
|
33
38
|
et,
|
|
34
39
|
{
|
|
35
40
|
target: ".nice-theme-builder__tabs",
|
|
@@ -56,118 +61,118 @@ const et = {
|
|
|
56
61
|
placement: "bottom"
|
|
57
62
|
}
|
|
58
63
|
];
|
|
59
|
-
function
|
|
60
|
-
return s.startsWith("colors.") ? "colors" : s.startsWith("backgrounds.") ? "backgrounds" : s.startsWith("backgroundImage.") ? "background-image" : s.startsWith("text.") ? "text" : s.startsWith("borders.") ? "borders" : s.startsWith("spacing.") ? "spacing" : s.startsWith("typography.") ? "typography" : s.startsWith("shadows.") ? "shadows" : s.startsWith("transitions.") ? "transitions" : s === "name" || s === "darkMode" || s === "darkThemeName" || s === "recommendedDisplayStyle" ? "general" : null;
|
|
64
|
+
function $t(s) {
|
|
65
|
+
return s.startsWith("colors.") ? "colors" : s.startsWith("backgrounds.") ? "backgrounds" : s.startsWith("backgroundImage.") ? "background-image" : s.startsWith("text.") ? "text" : s.startsWith("borders.") ? "borders" : s.startsWith("spacing.") ? "spacing" : s.startsWith("typography.") ? "typography" : s.startsWith("shadows.") ? "shadows" : s.startsWith("transitions.") ? "transitions" : s.startsWith("palette.") || s.startsWith("gradients.") ? "palette" : s.startsWith("layout.") ? "layout" : s.startsWith("scrollbar.") ? "scrollbar" : s === "name" || s === "darkMode" || s === "darkThemeName" || s === "recommendedDisplayStyle" ? "general" : null;
|
|
61
66
|
}
|
|
62
|
-
function Je(s,
|
|
63
|
-
if (!
|
|
67
|
+
function Je(s, h) {
|
|
68
|
+
if (!h.has(s))
|
|
64
69
|
return s;
|
|
65
|
-
for (let
|
|
66
|
-
const T = `${s} ${
|
|
67
|
-
if (!
|
|
70
|
+
for (let p = 2; ; p++) {
|
|
71
|
+
const T = `${s} ${p}`;
|
|
72
|
+
if (!h.has(T))
|
|
68
73
|
return T;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
function tt(s) {
|
|
72
77
|
if (!s || typeof s != "object")
|
|
73
78
|
return null;
|
|
74
|
-
const
|
|
75
|
-
return typeof
|
|
79
|
+
const h = s;
|
|
80
|
+
return typeof h.name != "string" ? null : { ...Ke, ...h };
|
|
76
81
|
}
|
|
77
|
-
function nt(s,
|
|
82
|
+
function nt(s, h) {
|
|
78
83
|
if (s)
|
|
79
84
|
try {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
85
|
+
const p = window.localStorage.getItem(`${s}:${h}`);
|
|
86
|
+
return p ? JSON.parse(p) : void 0;
|
|
82
87
|
} catch {
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
function
|
|
91
|
+
function Ve(s, h, p) {
|
|
87
92
|
if (s)
|
|
88
93
|
try {
|
|
89
|
-
window.localStorage.setItem(`${s}:${
|
|
94
|
+
window.localStorage.setItem(`${s}:${h}`, JSON.stringify(p));
|
|
90
95
|
} catch {
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
return Array.isArray(
|
|
98
|
+
function Pt(s) {
|
|
99
|
+
const h = nt(s, "themes");
|
|
100
|
+
return Array.isArray(h) ? h.map(tt).filter((p) => p !== null) : [];
|
|
96
101
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
99
|
-
return Array.isArray(
|
|
102
|
+
function Ft(s) {
|
|
103
|
+
const h = nt(s, "favorites");
|
|
104
|
+
return Array.isArray(h) ? h.filter((p) => typeof p == "string") : [];
|
|
100
105
|
}
|
|
101
|
-
function rt(s,
|
|
102
|
-
const
|
|
103
|
-
|
|
106
|
+
function rt(s, h) {
|
|
107
|
+
const p = new FileReader();
|
|
108
|
+
p.onload = () => {
|
|
104
109
|
try {
|
|
105
|
-
const T = String(
|
|
106
|
-
let
|
|
110
|
+
const T = String(p.result ?? "");
|
|
111
|
+
let I;
|
|
107
112
|
try {
|
|
108
|
-
|
|
113
|
+
I = ct(T);
|
|
109
114
|
} catch {
|
|
110
|
-
|
|
115
|
+
I = JSON.parse(T);
|
|
111
116
|
}
|
|
112
|
-
const N = tt(
|
|
113
|
-
N &&
|
|
117
|
+
const N = tt(I);
|
|
118
|
+
N && h(N);
|
|
114
119
|
} catch {
|
|
115
120
|
}
|
|
116
|
-
},
|
|
121
|
+
}, p.readAsText(s);
|
|
117
122
|
}
|
|
118
|
-
function
|
|
123
|
+
function It(s) {
|
|
119
124
|
if (!s)
|
|
120
|
-
return
|
|
121
|
-
const
|
|
122
|
-
...
|
|
123
|
-
...
|
|
125
|
+
return Se;
|
|
126
|
+
const h = /* @__PURE__ */ new Map(), p = [
|
|
127
|
+
...Se.filter((N) => !N.entries.some((w) => w.pack)),
|
|
128
|
+
...Se.filter((N) => N.entries.some((w) => w.pack))
|
|
124
129
|
];
|
|
125
|
-
for (const N of
|
|
130
|
+
for (const N of p)
|
|
126
131
|
for (const w of N.entries)
|
|
127
|
-
|
|
132
|
+
h.has(w.name) || h.set(w.name, N.id);
|
|
128
133
|
const T = /* @__PURE__ */ new Map();
|
|
129
134
|
for (const N of s) {
|
|
130
|
-
const w =
|
|
135
|
+
const w = h.get(N.name) ?? "presets";
|
|
131
136
|
let g = T.get(w);
|
|
132
137
|
if (!g) {
|
|
133
|
-
const P =
|
|
138
|
+
const P = Se.find((L) => L.id === w);
|
|
134
139
|
g = { id: w, label: P?.label ?? "Presets", entries: [] }, T.set(w, g);
|
|
135
140
|
}
|
|
136
141
|
g.entries.push({ name: N.name, theme: N, category: w });
|
|
137
142
|
}
|
|
138
|
-
const
|
|
139
|
-
const w =
|
|
143
|
+
const I = (N) => {
|
|
144
|
+
const w = Se.findIndex((g) => g.id === N);
|
|
140
145
|
return w < 0 ? Number.MAX_SAFE_INTEGER : w;
|
|
141
146
|
};
|
|
142
|
-
return [...T.values()].sort((N, w) =>
|
|
147
|
+
return [...T.values()].sort((N, w) => I(N.id) - I(w.id));
|
|
143
148
|
}
|
|
144
|
-
const
|
|
145
|
-
function
|
|
146
|
-
const [
|
|
149
|
+
const Lt = 1e3;
|
|
150
|
+
function zt(s) {
|
|
151
|
+
const [h, p] = O(() => ({
|
|
147
152
|
past: [],
|
|
148
153
|
present: s,
|
|
149
154
|
future: [],
|
|
150
155
|
lastKey: null,
|
|
151
156
|
lastAt: 0
|
|
152
|
-
})), T =
|
|
157
|
+
})), T = y(
|
|
153
158
|
(g, P) => {
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
158
|
-
const
|
|
159
|
+
p((L) => {
|
|
160
|
+
const Y = typeof g == "function" ? g(L.present) : g;
|
|
161
|
+
if (Y === L.present)
|
|
162
|
+
return L;
|
|
163
|
+
const E = Date.now();
|
|
159
164
|
return {
|
|
160
|
-
past: P !== null && P ===
|
|
161
|
-
present:
|
|
165
|
+
past: P !== null && P === L.lastKey && E - L.lastAt < Lt ? L.past : [...L.past, L.present].slice(-100),
|
|
166
|
+
present: Y,
|
|
162
167
|
future: [],
|
|
163
168
|
lastKey: P,
|
|
164
|
-
lastAt:
|
|
169
|
+
lastAt: E
|
|
165
170
|
};
|
|
166
171
|
});
|
|
167
172
|
},
|
|
168
173
|
[]
|
|
169
|
-
),
|
|
170
|
-
|
|
174
|
+
), I = y(() => {
|
|
175
|
+
p(
|
|
171
176
|
(g) => g.past.length === 0 ? g : {
|
|
172
177
|
past: g.past.slice(0, -1),
|
|
173
178
|
present: g.past[g.past.length - 1],
|
|
@@ -176,8 +181,8 @@ function Ct(s) {
|
|
|
176
181
|
lastAt: 0
|
|
177
182
|
}
|
|
178
183
|
);
|
|
179
|
-
}, []), N =
|
|
180
|
-
|
|
184
|
+
}, []), N = y(() => {
|
|
185
|
+
p(
|
|
181
186
|
(g) => g.future.length === 0 ? g : {
|
|
182
187
|
past: [...g.past, g.present],
|
|
183
188
|
present: g.future[0],
|
|
@@ -186,273 +191,276 @@ function Ct(s) {
|
|
|
186
191
|
lastAt: 0
|
|
187
192
|
}
|
|
188
193
|
);
|
|
189
|
-
}, []), w =
|
|
190
|
-
|
|
194
|
+
}, []), w = y((g) => {
|
|
195
|
+
p((P) => ({ ...P, present: g, lastKey: null, lastAt: 0 }));
|
|
191
196
|
}, []);
|
|
192
197
|
return {
|
|
193
|
-
theme:
|
|
194
|
-
canUndo:
|
|
195
|
-
canRedo:
|
|
198
|
+
theme: h.present,
|
|
199
|
+
canUndo: h.past.length > 0,
|
|
200
|
+
canRedo: h.future.length > 0,
|
|
196
201
|
commit: T,
|
|
197
|
-
undo:
|
|
202
|
+
undo: I,
|
|
198
203
|
redo: N,
|
|
199
204
|
replace: w
|
|
200
205
|
};
|
|
201
206
|
}
|
|
202
|
-
function
|
|
207
|
+
function Rt({
|
|
203
208
|
controlId: s,
|
|
204
|
-
original:
|
|
205
|
-
own:
|
|
209
|
+
original: h,
|
|
210
|
+
own: p,
|
|
206
211
|
groupLabel: T,
|
|
207
|
-
allSections:
|
|
212
|
+
allSections: I,
|
|
208
213
|
showPreview: N,
|
|
209
214
|
onTogglePreview: w,
|
|
210
215
|
onBack: g,
|
|
211
216
|
onSave: P,
|
|
212
|
-
onSaveCopy:
|
|
213
|
-
onChange:
|
|
214
|
-
onApply:
|
|
215
|
-
onExport:
|
|
216
|
-
livePreview:
|
|
217
|
-
focusedToken:
|
|
217
|
+
onSaveCopy: L,
|
|
218
|
+
onChange: Y,
|
|
219
|
+
onApply: E,
|
|
220
|
+
onExport: Z,
|
|
221
|
+
livePreview: we,
|
|
222
|
+
focusedToken: de
|
|
218
223
|
}) {
|
|
219
|
-
const { t: e } = Ge(),
|
|
220
|
-
mt(
|
|
221
|
-
const { theme: m, canUndo: Be, canRedo:
|
|
222
|
-
() => m !==
|
|
223
|
-
[m,
|
|
224
|
-
),
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
const { t: e } = Ge(), Te = M(null);
|
|
225
|
+
mt(Te, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
226
|
+
const { theme: m, canUndo: Be, canRedo: De, commit: R, undo: te, redo: he, replace: ne } = zt(h), [ue, pe] = O("colors"), [b, U] = O(!1), be = M(null), ge = M(null), X = G(
|
|
227
|
+
() => m !== h && JSON.stringify(m) !== JSON.stringify(h),
|
|
228
|
+
[m, h]
|
|
229
|
+
), ke = M(Y);
|
|
230
|
+
me(() => {
|
|
231
|
+
ke.current = Y;
|
|
227
232
|
});
|
|
228
|
-
const xe =
|
|
229
|
-
|
|
230
|
-
m !== xe.current && (xe.current = m,
|
|
233
|
+
const xe = M(m);
|
|
234
|
+
me(() => {
|
|
235
|
+
m !== xe.current && (xe.current = m, ke.current?.(m));
|
|
231
236
|
}, [m]);
|
|
232
|
-
const J =
|
|
237
|
+
const J = M(null), k = M(null), B = y(
|
|
233
238
|
(i) => {
|
|
234
|
-
const
|
|
235
|
-
|
|
239
|
+
const r = $t(i);
|
|
240
|
+
r && I.includes(r) && (pe(r), requestAnimationFrame(() => {
|
|
236
241
|
requestAnimationFrame(() => {
|
|
237
|
-
if (!
|
|
242
|
+
if (!be.current)
|
|
238
243
|
return;
|
|
239
|
-
const
|
|
244
|
+
const o = be.current.querySelector(
|
|
240
245
|
`[data-token="${i}"]`
|
|
241
246
|
);
|
|
242
|
-
if (!
|
|
247
|
+
if (!o)
|
|
243
248
|
return;
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
o.scrollIntoView({ behavior: "smooth", block: "center" }), o.querySelector("input, select, textarea")?.focus(), k.current?.classList.remove("nice-theme-builder__field--targeted"), o.classList.add("nice-theme-builder__field--targeted"), k.current = o, J.current && clearTimeout(J.current), J.current = setTimeout(() => {
|
|
250
|
+
o.classList.remove("nice-theme-builder__field--targeted"), k.current = null, J.current = null;
|
|
246
251
|
}, 1500);
|
|
247
252
|
});
|
|
248
253
|
}));
|
|
249
254
|
},
|
|
250
|
-
[
|
|
255
|
+
[I]
|
|
251
256
|
);
|
|
252
|
-
|
|
257
|
+
me(
|
|
253
258
|
() => () => {
|
|
254
259
|
J.current && clearTimeout(J.current);
|
|
255
260
|
},
|
|
256
261
|
[]
|
|
257
|
-
),
|
|
258
|
-
|
|
259
|
-
}, [
|
|
260
|
-
const
|
|
261
|
-
(i) =>
|
|
262
|
-
[
|
|
263
|
-
),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}, [
|
|
267
|
-
const
|
|
262
|
+
), me(() => {
|
|
263
|
+
de && B(de);
|
|
264
|
+
}, [de, B]);
|
|
265
|
+
const fe = bt(dt)?.setTheme, re = y(
|
|
266
|
+
(i) => fe ? fe(i) : ht(i),
|
|
267
|
+
[fe]
|
|
268
|
+
), z = M(m);
|
|
269
|
+
me(() => {
|
|
270
|
+
we && m !== z.current && re(m);
|
|
271
|
+
}, [we, m, re]);
|
|
272
|
+
const W = y(
|
|
268
273
|
(i) => {
|
|
269
|
-
|
|
274
|
+
R((r) => ({ ...r, ...i }), Object.keys(i).join(","));
|
|
270
275
|
},
|
|
271
|
-
[
|
|
272
|
-
),
|
|
273
|
-
(i,
|
|
274
|
-
|
|
275
|
-
(
|
|
276
|
-
const
|
|
277
|
-
return { ...
|
|
276
|
+
[R]
|
|
277
|
+
), D = y(
|
|
278
|
+
(i, r, o) => {
|
|
279
|
+
R(
|
|
280
|
+
(t) => {
|
|
281
|
+
const a = t[i], l = typeof a == "object" && a !== null ? a : {};
|
|
282
|
+
return { ...t, [i]: { ...l, [r]: o } };
|
|
278
283
|
},
|
|
279
|
-
`${String(i)}.${
|
|
284
|
+
`${String(i)}.${r}`
|
|
280
285
|
);
|
|
281
286
|
},
|
|
282
|
-
[
|
|
283
|
-
),
|
|
287
|
+
[R]
|
|
288
|
+
), V = G(
|
|
289
|
+
() => ({
|
|
290
|
+
set: (i, r) => R((o) => Nt(o, i, r), i),
|
|
291
|
+
replace: (i) => R(i, null)
|
|
292
|
+
}),
|
|
293
|
+
[R]
|
|
294
|
+
), ae = y(
|
|
284
295
|
(i) => {
|
|
285
|
-
const
|
|
286
|
-
i.target.value = "",
|
|
296
|
+
const r = i.target.files?.[0];
|
|
297
|
+
i.target.value = "", r && rt(r, (o) => R(o, null));
|
|
287
298
|
},
|
|
288
|
-
[
|
|
289
|
-
), ie =
|
|
290
|
-
re(m),
|
|
291
|
-
}, [m,
|
|
299
|
+
[R]
|
|
300
|
+
), ie = y(() => {
|
|
301
|
+
re(m), E?.(m);
|
|
302
|
+
}, [m, E, re]), ye = y(() => {
|
|
292
303
|
const i = Ue(m);
|
|
293
|
-
if (
|
|
294
|
-
|
|
304
|
+
if (Z) {
|
|
305
|
+
Z(i, We(m));
|
|
295
306
|
return;
|
|
296
307
|
}
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
}, [m,
|
|
300
|
-
() => ne(
|
|
301
|
-
[
|
|
302
|
-
),
|
|
308
|
+
const r = (m.name ?? "").trim().replace(/[^\w.-]+/g, "-") || "theme";
|
|
309
|
+
St(new Blob([i], { type: "application/json;charset=utf-8" }), `${r}.json`);
|
|
310
|
+
}, [m, Z]), ve = y(() => ne(P(m)), [P, ne, m]), Ce = y(
|
|
311
|
+
() => ne(L(m)),
|
|
312
|
+
[L, ne, m]
|
|
313
|
+
), oe = y(() => R(h, null), [R, h]), C = y(
|
|
303
314
|
() => X ? U(!0) : g(),
|
|
304
315
|
[X, g]
|
|
305
|
-
),
|
|
306
|
-
|
|
307
|
-
const i =
|
|
316
|
+
), $e = M(null);
|
|
317
|
+
me(() => {
|
|
318
|
+
const i = $e.current;
|
|
308
319
|
if (!i)
|
|
309
320
|
return;
|
|
310
|
-
const
|
|
311
|
-
if (!(
|
|
321
|
+
const r = (o) => {
|
|
322
|
+
if (!(o.ctrlKey || o.metaKey) || o.altKey)
|
|
312
323
|
return;
|
|
313
|
-
const
|
|
314
|
-
|
|
324
|
+
const t = o.key.toLowerCase();
|
|
325
|
+
t === "z" && !o.shiftKey ? (o.preventDefault(), te()) : (t === "z" && o.shiftKey || t === "y") && (o.preventDefault(), he());
|
|
315
326
|
};
|
|
316
|
-
return i.addEventListener("keydown",
|
|
317
|
-
}, [te,
|
|
318
|
-
const
|
|
319
|
-
const i =
|
|
320
|
-
return Object.entries(i).map(([
|
|
327
|
+
return i.addEventListener("keydown", r), () => i.removeEventListener("keydown", r);
|
|
328
|
+
}, [te, he]);
|
|
329
|
+
const Pe = G(() => {
|
|
330
|
+
const i = We(m);
|
|
331
|
+
return Object.entries(i).map(([r, o]) => ` ${r}: ${o};`).join(`
|
|
321
332
|
`);
|
|
322
|
-
}, [m]),
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const _ = m[i] ?? {}, y = `${i}.${n}`;
|
|
346
|
-
return /* @__PURE__ */ r("div", { className: "nice-theme-builder__field", "data-token": y, children: /* @__PURE__ */ r(
|
|
347
|
-
We,
|
|
333
|
+
}, [m]), x = (i, r, o = "color") => /* @__PURE__ */ n(
|
|
334
|
+
"div",
|
|
335
|
+
{
|
|
336
|
+
className: "nice-theme-builder__field nice-theme-builder__field--color",
|
|
337
|
+
"data-token": i,
|
|
338
|
+
children: /* @__PURE__ */ n(
|
|
339
|
+
kt,
|
|
340
|
+
{
|
|
341
|
+
id: `${s}-${i.replace(/\./g, "-")}`,
|
|
342
|
+
label: r,
|
|
343
|
+
path: i,
|
|
344
|
+
theme: m,
|
|
345
|
+
kind: o,
|
|
346
|
+
onChange: (t, a) => V.set(t, a),
|
|
347
|
+
onGoTo: B
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
},
|
|
351
|
+
i
|
|
352
|
+
), d = (i, r, o) => x(`${String(i)}.${r}`, o), c = (i, r, o) => {
|
|
353
|
+
const t = m[i] ?? {}, a = `${i}.${r}`;
|
|
354
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": a, children: /* @__PURE__ */ n(
|
|
355
|
+
je,
|
|
348
356
|
{
|
|
349
|
-
id: `${s}-${i}-${
|
|
350
|
-
label:
|
|
357
|
+
id: `${s}-${i}-${r}`,
|
|
358
|
+
label: o,
|
|
351
359
|
labelPlacement: "left",
|
|
352
360
|
size: "sm",
|
|
353
|
-
value:
|
|
354
|
-
onChange: (
|
|
361
|
+
value: t[r] || "",
|
|
362
|
+
onChange: (l) => D(i, r, l)
|
|
355
363
|
}
|
|
356
|
-
) },
|
|
357
|
-
},
|
|
358
|
-
const
|
|
359
|
-
return /* @__PURE__ */
|
|
360
|
-
|
|
364
|
+
) }, r);
|
|
365
|
+
}, j = (i, r, o) => {
|
|
366
|
+
const t = m[i] ?? {}, a = `${i}.${r}`;
|
|
367
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": a, children: /* @__PURE__ */ n(
|
|
368
|
+
ze,
|
|
361
369
|
{
|
|
362
|
-
id: `${s}-${i}-${
|
|
363
|
-
label:
|
|
370
|
+
id: `${s}-${i}-${r}`,
|
|
371
|
+
label: o,
|
|
364
372
|
labelPlacement: "left",
|
|
365
373
|
size: "sm",
|
|
366
|
-
value:
|
|
367
|
-
onChange: (
|
|
374
|
+
value: t[r] ?? 0,
|
|
375
|
+
onChange: (l) => D(i, r, typeof l == "number" ? l : parseFloat(String(l)) || 0),
|
|
368
376
|
showStepper: !0
|
|
369
377
|
}
|
|
370
|
-
) },
|
|
371
|
-
},
|
|
372
|
-
const
|
|
373
|
-
return /* @__PURE__ */
|
|
374
|
-
|
|
378
|
+
) }, r);
|
|
379
|
+
}, q = (i, r, o, t) => {
|
|
380
|
+
const a = m[i], l = `${i}.${r}`, S = a?.[r] ?? "";
|
|
381
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": l, children: /* @__PURE__ */ n(
|
|
382
|
+
Re,
|
|
375
383
|
{
|
|
376
|
-
id: `${s}-${i}-${
|
|
377
|
-
label:
|
|
384
|
+
id: `${s}-${i}-${r}`,
|
|
385
|
+
label: o,
|
|
378
386
|
labelPlacement: "left",
|
|
379
387
|
size: "sm",
|
|
380
388
|
clearable: !0,
|
|
381
|
-
value:
|
|
382
|
-
onChange: (
|
|
383
|
-
options:
|
|
389
|
+
value: S,
|
|
390
|
+
onChange: (_) => D(i, r, Array.isArray(_) ? _[0] ?? "" : _),
|
|
391
|
+
options: t.map((_) => ({ value: _, label: _ }))
|
|
384
392
|
}
|
|
385
|
-
) },
|
|
386
|
-
},
|
|
387
|
-
const
|
|
388
|
-
return /* @__PURE__ */
|
|
389
|
-
|
|
393
|
+
) }, r);
|
|
394
|
+
}, _e = (i, r, o, t = !0) => {
|
|
395
|
+
const a = m[i] ?? "", l = String(i);
|
|
396
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": l, children: /* @__PURE__ */ n(
|
|
397
|
+
Re,
|
|
390
398
|
{
|
|
391
|
-
id: `${s}-${
|
|
392
|
-
label:
|
|
399
|
+
id: `${s}-${l}`,
|
|
400
|
+
label: r,
|
|
393
401
|
labelPlacement: "left",
|
|
394
402
|
size: "sm",
|
|
395
|
-
clearable:
|
|
396
|
-
value:
|
|
397
|
-
onChange: (
|
|
398
|
-
const
|
|
399
|
-
|
|
403
|
+
clearable: t,
|
|
404
|
+
value: a,
|
|
405
|
+
onChange: (S) => {
|
|
406
|
+
const _ = Array.isArray(S) ? S[0] ?? "" : S;
|
|
407
|
+
W({ [i]: _ || void 0 });
|
|
400
408
|
},
|
|
401
|
-
options:
|
|
409
|
+
options: o.map((S) => ({ value: S, label: S }))
|
|
402
410
|
}
|
|
403
|
-
) },
|
|
404
|
-
},
|
|
405
|
-
const
|
|
406
|
-
return /* @__PURE__ */
|
|
407
|
-
|
|
411
|
+
) }, l);
|
|
412
|
+
}, H = (i, r) => {
|
|
413
|
+
const o = m[i] ?? "", t = String(i);
|
|
414
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": t, children: /* @__PURE__ */ n(
|
|
415
|
+
je,
|
|
408
416
|
{
|
|
409
|
-
id: `${s}-${
|
|
410
|
-
label:
|
|
417
|
+
id: `${s}-${t}`,
|
|
418
|
+
label: r,
|
|
411
419
|
labelPlacement: "left",
|
|
412
420
|
size: "sm",
|
|
413
|
-
value:
|
|
414
|
-
onChange: (
|
|
421
|
+
value: o,
|
|
422
|
+
onChange: (a) => W({ [i]: a || void 0 })
|
|
415
423
|
}
|
|
416
|
-
) },
|
|
417
|
-
},
|
|
418
|
-
const
|
|
419
|
-
return /* @__PURE__ */
|
|
420
|
-
|
|
424
|
+
) }, t);
|
|
425
|
+
}, se = (i, r, o, t = 0, a = 1, l = 0.05) => {
|
|
426
|
+
const S = m[i], _ = `${i}.${r}`, f = S?.[r] ?? a;
|
|
427
|
+
return /* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": _, children: /* @__PURE__ */ n(
|
|
428
|
+
ze,
|
|
421
429
|
{
|
|
422
|
-
id: `${s}-${i}-${
|
|
423
|
-
label:
|
|
430
|
+
id: `${s}-${i}-${r}`,
|
|
431
|
+
label: o,
|
|
424
432
|
labelPlacement: "left",
|
|
425
433
|
size: "sm",
|
|
426
|
-
min:
|
|
427
|
-
max:
|
|
428
|
-
step:
|
|
434
|
+
min: t,
|
|
435
|
+
max: a,
|
|
436
|
+
step: l,
|
|
429
437
|
precision: 2,
|
|
430
|
-
value: Number(
|
|
431
|
-
onChange: (
|
|
438
|
+
value: Number(f),
|
|
439
|
+
onChange: (v) => D(i, r, typeof v == "number" ? v : parseFloat(String(v)) || 0),
|
|
432
440
|
showStepper: !0
|
|
433
441
|
}
|
|
434
|
-
) },
|
|
435
|
-
}, [F,
|
|
436
|
-
(i,
|
|
437
|
-
|
|
438
|
-
(
|
|
439
|
-
...
|
|
442
|
+
) }, r);
|
|
443
|
+
}, [F, Ae] = O("sidebar"), Q = m.nesting?.[F] ?? {}, Fe = Math.max(1, Math.min(10, Q.levels ?? 5)), A = y(
|
|
444
|
+
(i, r) => {
|
|
445
|
+
R(
|
|
446
|
+
(o) => ({
|
|
447
|
+
...o,
|
|
440
448
|
nesting: {
|
|
441
|
-
...
|
|
442
|
-
[i]: { ...(
|
|
449
|
+
...o.nesting ?? {},
|
|
450
|
+
[i]: { ...(o.nesting ?? {})[i] ?? {}, ...r }
|
|
443
451
|
}
|
|
444
452
|
}),
|
|
445
|
-
`nesting.${i}.${Object.keys(
|
|
453
|
+
`nesting.${i}.${Object.keys(r).join(",")}`
|
|
446
454
|
);
|
|
447
455
|
},
|
|
448
|
-
[
|
|
449
|
-
),
|
|
450
|
-
(i,
|
|
451
|
-
const
|
|
452
|
-
|
|
456
|
+
[R]
|
|
457
|
+
), le = y(
|
|
458
|
+
(i, r, o) => {
|
|
459
|
+
const a = { ...((m.nesting ?? {})[i] ?? {}).overrides ?? {} };
|
|
460
|
+
o === null ? delete a[r] : a[r] = { ...a[r] ?? {}, ...o }, A(i, { overrides: a });
|
|
453
461
|
},
|
|
454
|
-
[m.nesting,
|
|
455
|
-
),
|
|
462
|
+
[m.nesting, A]
|
|
463
|
+
), Me = () => {
|
|
456
464
|
const i = [
|
|
457
465
|
{ key: "background", label: e("theme.background", "Background") },
|
|
458
466
|
{ key: "text", label: e("theme.text", "Text") },
|
|
@@ -460,17 +468,17 @@ function xt({
|
|
|
460
468
|
{ key: "activeBackground", label: e("theme.activeBg", "Active bg") },
|
|
461
469
|
{ key: "border", label: e("theme.border", "Border") }
|
|
462
470
|
];
|
|
463
|
-
return /* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
|
|
471
|
+
return /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
472
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
|
|
473
|
+
Re,
|
|
466
474
|
{
|
|
467
475
|
label: e("theme.nestingSurface", "Surface"),
|
|
468
476
|
labelPlacement: "left",
|
|
469
477
|
size: "sm",
|
|
470
478
|
value: F,
|
|
471
|
-
onChange: (
|
|
472
|
-
const
|
|
473
|
-
(
|
|
479
|
+
onChange: (r) => {
|
|
480
|
+
const o = Array.isArray(r) ? r[0] : r;
|
|
481
|
+
(o === "sidebar" || o === "menu" || o === "tree") && Ae(o);
|
|
474
482
|
},
|
|
475
483
|
options: [
|
|
476
484
|
{ value: "sidebar", label: e("theme.sidebar", "Sidebar") },
|
|
@@ -479,8 +487,8 @@ function xt({
|
|
|
479
487
|
]
|
|
480
488
|
}
|
|
481
489
|
) }),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
|
|
490
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
|
|
491
|
+
ze,
|
|
484
492
|
{
|
|
485
493
|
label: e("theme.nestingLevels", "Levels"),
|
|
486
494
|
labelPlacement: "left",
|
|
@@ -490,23 +498,23 @@ function xt({
|
|
|
490
498
|
step: 1,
|
|
491
499
|
precision: 0,
|
|
492
500
|
value: Fe,
|
|
493
|
-
onChange: (
|
|
494
|
-
const
|
|
495
|
-
Number.isFinite(
|
|
501
|
+
onChange: (r) => {
|
|
502
|
+
const o = typeof r == "number" ? r : Number(r);
|
|
503
|
+
Number.isFinite(o) && A(F, { levels: Math.max(1, Math.min(10, Math.round(o))) });
|
|
496
504
|
},
|
|
497
505
|
showStepper: !0
|
|
498
506
|
}
|
|
499
507
|
) }),
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
|
|
508
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
|
|
509
|
+
Re,
|
|
502
510
|
{
|
|
503
511
|
label: e("theme.nestingDerivation", "Bg derivation"),
|
|
504
512
|
labelPlacement: "left",
|
|
505
513
|
size: "sm",
|
|
506
|
-
value:
|
|
507
|
-
onChange: (
|
|
508
|
-
const
|
|
509
|
-
(
|
|
514
|
+
value: Q.bgDerivation ?? "tint",
|
|
515
|
+
onChange: (r) => {
|
|
516
|
+
const o = Array.isArray(r) ? r[0] : r;
|
|
517
|
+
(o === "tint" || o === "shade" || o === "mix-surface" || o === "palette") && A(F, { bgDerivation: o });
|
|
510
518
|
},
|
|
511
519
|
options: [
|
|
512
520
|
{
|
|
@@ -522,8 +530,8 @@ function xt({
|
|
|
522
530
|
]
|
|
523
531
|
}
|
|
524
532
|
) }),
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
|
|
533
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__field", children: /* @__PURE__ */ n(
|
|
534
|
+
ze,
|
|
527
535
|
{
|
|
528
536
|
label: e("theme.nestingStep", "Step"),
|
|
529
537
|
labelPlacement: "left",
|
|
@@ -532,21 +540,21 @@ function xt({
|
|
|
532
540
|
max: 0.5,
|
|
533
541
|
step: 0.02,
|
|
534
542
|
precision: 2,
|
|
535
|
-
value:
|
|
536
|
-
onChange: (
|
|
537
|
-
const
|
|
538
|
-
Number.isFinite(
|
|
543
|
+
value: Q.bgStep ?? 0.06,
|
|
544
|
+
onChange: (r) => {
|
|
545
|
+
const o = typeof r == "number" ? r : Number(r);
|
|
546
|
+
Number.isFinite(o) && A(F, { bgStep: Math.max(0, Math.min(0.5, o)) });
|
|
539
547
|
},
|
|
540
548
|
showStepper: !0
|
|
541
549
|
}
|
|
542
550
|
) }),
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
|
|
552
|
+
/* @__PURE__ */ n("div", { style: { fontSize: 12, fontWeight: 600, marginBottom: 4 }, children: e("theme.nestingPalette", "Base palette") }),
|
|
553
|
+
/* @__PURE__ */ n(
|
|
546
554
|
ft,
|
|
547
555
|
{
|
|
548
|
-
value:
|
|
549
|
-
onChange: (
|
|
556
|
+
value: Q.palette ?? [],
|
|
557
|
+
onChange: (r) => A(F, { palette: r }),
|
|
550
558
|
minColors: 1,
|
|
551
559
|
maxColors: 10,
|
|
552
560
|
showWheel: !0,
|
|
@@ -557,8 +565,8 @@ function xt({
|
|
|
557
565
|
}
|
|
558
566
|
)
|
|
559
567
|
] }),
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ u("details", { className: "nice-theme-builder__field", style: { gridColumn: "1 / -1" }, children: [
|
|
569
|
+
/* @__PURE__ */ n(
|
|
562
570
|
"summary",
|
|
563
571
|
{
|
|
564
572
|
style: {
|
|
@@ -570,9 +578,9 @@ function xt({
|
|
|
570
578
|
children: e("theme.nestingOverrides", "Per-level overrides")
|
|
571
579
|
}
|
|
572
580
|
),
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
const
|
|
575
|
-
return /* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 8, marginTop: 8 }, children: Array.from({ length: Fe }, (r, o) => o + 1).map((r) => {
|
|
582
|
+
const o = Q.overrides?.[r] ?? {}, t = Object.keys(o).length > 0;
|
|
583
|
+
return /* @__PURE__ */ u(
|
|
576
584
|
"div",
|
|
577
585
|
{
|
|
578
586
|
style: {
|
|
@@ -584,220 +592,289 @@ function xt({
|
|
|
584
592
|
gap: 6
|
|
585
593
|
},
|
|
586
594
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
|
|
595
|
+
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
596
|
+
/* @__PURE__ */ n("strong", { style: { flex: 1 }, children: e("theme.level", "Level {level}").replace("{level}", String(r)) }),
|
|
597
|
+
t && /* @__PURE__ */ n(
|
|
590
598
|
"button",
|
|
591
599
|
{
|
|
592
600
|
type: "button",
|
|
593
601
|
className: "nice-btn nice-btn--outline nice-btn--xs",
|
|
594
|
-
onClick: () =>
|
|
602
|
+
onClick: () => le(F, r, null),
|
|
595
603
|
children: e("themeBuilder.resetToDerived", "Reset to derived")
|
|
596
604
|
}
|
|
597
605
|
)
|
|
598
606
|
] }),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
|
|
607
|
+
/* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: i.map((a) => /* @__PURE__ */ n(
|
|
608
|
+
yt,
|
|
601
609
|
{
|
|
602
|
-
label:
|
|
610
|
+
label: a.label,
|
|
603
611
|
labelPlacement: "left",
|
|
604
612
|
size: "sm",
|
|
605
|
-
value: a
|
|
606
|
-
onChange: (
|
|
613
|
+
value: o[a.key] ?? "",
|
|
614
|
+
onChange: (l) => le(F, r, { [a.key]: l })
|
|
607
615
|
},
|
|
608
|
-
|
|
616
|
+
a.key
|
|
609
617
|
)) })
|
|
610
618
|
]
|
|
611
619
|
},
|
|
612
|
-
|
|
620
|
+
r
|
|
613
621
|
);
|
|
614
622
|
}) })
|
|
615
623
|
] })
|
|
616
624
|
] });
|
|
617
|
-
},
|
|
618
|
-
general: () => /* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
625
|
+
}, Oe = {
|
|
626
|
+
general: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
627
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__field", "data-token": "name", children: /* @__PURE__ */ n(
|
|
628
|
+
je,
|
|
621
629
|
{
|
|
622
630
|
id: `${s}-name`,
|
|
623
631
|
label: e("theme.name", "Theme Name"),
|
|
624
632
|
labelPlacement: "left",
|
|
625
633
|
size: "sm",
|
|
626
634
|
value: m.name ?? "",
|
|
627
|
-
onChange: (i) =>
|
|
635
|
+
onChange: (i) => W({ name: i })
|
|
628
636
|
}
|
|
629
637
|
) }, "name"),
|
|
630
|
-
|
|
631
|
-
|
|
638
|
+
H("darkThemeName", e("theme.darkThemeName", "Paired Dark Theme Name")),
|
|
639
|
+
_e("darkMode", e("theme.darkMode", "Dark Mode"), [
|
|
632
640
|
"light",
|
|
633
641
|
"dark",
|
|
634
642
|
"auto"
|
|
635
643
|
]),
|
|
636
|
-
|
|
644
|
+
_e(
|
|
637
645
|
"recommendedDisplayStyle",
|
|
638
646
|
e("theme.recommendedDisplayStyle", "Recommended Display Style"),
|
|
639
647
|
ut
|
|
640
648
|
)
|
|
641
649
|
] }),
|
|
642
|
-
colors: () => /* @__PURE__ */
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
650
|
+
colors: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
651
|
+
d("colors", "primary", e("theme.primary", "Primary")),
|
|
652
|
+
d("colors", "primaryHover", e("theme.primaryHover", "Primary Hover")),
|
|
653
|
+
d("colors", "accent", e("theme.accent", "Accent")),
|
|
654
|
+
d("colors", "accentHover", e("theme.accentHover", "Accent Hover")),
|
|
655
|
+
d("colors", "success", e("theme.success", "Success")),
|
|
656
|
+
d("colors", "warning", e("theme.warning", "Warning")),
|
|
657
|
+
d("colors", "error", e("theme.error", "Error")),
|
|
658
|
+
d("colors", "info", e("theme.info", "Info")),
|
|
659
|
+
d("colors", "link", e("theme.link", "Link")),
|
|
660
|
+
d("colors", "linkHover", e("theme.linkHover", "Link Hover")),
|
|
661
|
+
d("colors", "focus", e("theme.focus", "Focus Ring")),
|
|
662
|
+
d("colors", "overlay", e("theme.overlay", "Overlay / Backdrop")),
|
|
663
|
+
d("colors", "surface", e("theme.surface", "Surface")),
|
|
664
|
+
d("colors", "surfaceHover", e("theme.surfaceHover", "Surface Hover")),
|
|
665
|
+
d("colors", "disabled", e("theme.disabled", "Disabled")),
|
|
666
|
+
d("colors", "disabledText", e("theme.disabledText", "Disabled Text"))
|
|
659
667
|
] }),
|
|
660
|
-
backgrounds: () => /* @__PURE__ */
|
|
661
|
-
|
|
662
|
-
|
|
668
|
+
backgrounds: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
669
|
+
d("backgrounds", "primary", e("theme.bgPrimary", "Primary Background")),
|
|
670
|
+
d(
|
|
663
671
|
"backgrounds",
|
|
664
672
|
"secondary",
|
|
665
673
|
e("theme.bgSecondary", "Secondary Background")
|
|
666
674
|
),
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
675
|
+
d("backgrounds", "tertiary", e("theme.bgTertiary", "Tertiary Background")),
|
|
676
|
+
d("backgrounds", "hover", e("theme.bgHover", "Hover Background")),
|
|
677
|
+
d("backgrounds", "elevated", e("theme.bgElevated", "Elevated Surface")),
|
|
678
|
+
d("backgrounds", "inset", e("theme.bgInset", "Inset Surface")),
|
|
679
|
+
d("backgrounds", "canvas", e("theme.bgCanvas", "Canvas / Body"))
|
|
672
680
|
] }),
|
|
673
|
-
"background-image": () => /* @__PURE__ */
|
|
674
|
-
|
|
681
|
+
"background-image": () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
682
|
+
q("backgroundImage", "type", e("theme.bgiType", "Background Type"), [
|
|
675
683
|
"none",
|
|
676
684
|
"solid",
|
|
677
685
|
"gradient",
|
|
678
686
|
"image",
|
|
679
687
|
"pattern"
|
|
680
688
|
]),
|
|
681
|
-
|
|
689
|
+
c(
|
|
682
690
|
"backgroundImage",
|
|
683
691
|
"gradient",
|
|
684
692
|
e("theme.bgiGradient", "CSS Gradient")
|
|
685
693
|
),
|
|
686
|
-
|
|
694
|
+
c(
|
|
687
695
|
"backgroundImage",
|
|
688
696
|
"imageUrl",
|
|
689
697
|
e("theme.bgiImageUrl", "Image URL")
|
|
690
698
|
),
|
|
691
|
-
|
|
699
|
+
c(
|
|
692
700
|
"backgroundImage",
|
|
693
701
|
"imageSize",
|
|
694
702
|
e("theme.bgiImageSize", "Image Size (cover/contain/…)")
|
|
695
703
|
),
|
|
696
|
-
|
|
704
|
+
c(
|
|
697
705
|
"backgroundImage",
|
|
698
706
|
"imagePosition",
|
|
699
707
|
e("theme.bgiImagePosition", "Image Position")
|
|
700
708
|
),
|
|
701
|
-
|
|
709
|
+
q(
|
|
702
710
|
"backgroundImage",
|
|
703
711
|
"imageAttachment",
|
|
704
712
|
e("theme.bgiImageAttachment", "Image Attachment"),
|
|
705
713
|
["scroll", "fixed", "local"]
|
|
706
714
|
),
|
|
707
|
-
|
|
715
|
+
q(
|
|
708
716
|
"backgroundImage",
|
|
709
717
|
"imageRepeat",
|
|
710
718
|
e("theme.bgiImageRepeat", "Image Repeat"),
|
|
711
719
|
["repeat", "no-repeat", "repeat-x", "repeat-y"]
|
|
712
720
|
),
|
|
713
|
-
|
|
721
|
+
c(
|
|
714
722
|
"backgroundImage",
|
|
715
723
|
"pattern",
|
|
716
724
|
e("theme.bgiPattern", "Named Pattern (dots/grid/…)")
|
|
717
725
|
),
|
|
718
|
-
|
|
719
|
-
|
|
726
|
+
se("backgroundImage", "opacity", e("theme.bgiOpacity", "Pattern Opacity")),
|
|
727
|
+
c(
|
|
720
728
|
"backgroundImage",
|
|
721
729
|
"blendMode",
|
|
722
730
|
e("theme.bgiBlendMode", "Blend Mode")
|
|
723
731
|
)
|
|
724
732
|
] }),
|
|
725
|
-
text: () => /* @__PURE__ */
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
733
|
+
text: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
734
|
+
d("text", "primary", e("theme.textPrimary", "Primary Text")),
|
|
735
|
+
d("text", "secondary", e("theme.textSecondary", "Secondary Text")),
|
|
736
|
+
d("text", "muted", e("theme.textMuted", "Muted Text")),
|
|
737
|
+
d("text", "inverse", e("theme.textInverse", "Inverse Text")),
|
|
738
|
+
d("text", "onPrimary", e("theme.textOnPrimary", "Text on Primary")),
|
|
739
|
+
d("text", "onAccent", e("theme.textOnAccent", "Text on Accent"))
|
|
732
740
|
] }),
|
|
733
|
-
borders: () => /* @__PURE__ */
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
borders: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
742
|
+
d("borders", "color", e("theme.borderColor", "Border Color")),
|
|
743
|
+
d("borders", "focusColor", e("theme.borderFocus", "Focus Border Color")),
|
|
744
|
+
d("borders", "divider", e("theme.borderDivider", "Divider Color")),
|
|
745
|
+
c("borders", "width", e("theme.borderWidth", "Border Width")),
|
|
746
|
+
c("borders", "radiusSm", e("theme.radiusSm", "Radius Small")),
|
|
747
|
+
c("borders", "radiusMd", e("theme.radiusMd", "Radius Medium")),
|
|
748
|
+
c("borders", "radiusLg", e("theme.radiusLg", "Radius Large")),
|
|
749
|
+
c("borders", "radiusXl", e("theme.radiusXl", "Radius XL")),
|
|
750
|
+
c("borders", "radiusFull", e("theme.radiusFull", "Radius Full"))
|
|
743
751
|
] }),
|
|
744
|
-
spacing: () => /* @__PURE__ */
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
752
|
+
spacing: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
753
|
+
c("spacing", "space1", "Space 1"),
|
|
754
|
+
c("spacing", "space2", "Space 2"),
|
|
755
|
+
c("spacing", "space3", "Space 3"),
|
|
756
|
+
c("spacing", "space4", "Space 4"),
|
|
757
|
+
c("spacing", "space5", "Space 5"),
|
|
758
|
+
c("spacing", "space6", "Space 6"),
|
|
759
|
+
c("spacing", "space8", "Space 8"),
|
|
760
|
+
c("spacing", "space10", "Space 10"),
|
|
761
|
+
c("spacing", "space12", "Space 12"),
|
|
762
|
+
c("spacing", "space16", "Space 16")
|
|
755
763
|
] }),
|
|
756
|
-
typography: () => /* @__PURE__ */
|
|
757
|
-
|
|
758
|
-
|
|
764
|
+
typography: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
765
|
+
c("typography", "fontFamily", e("theme.fontFamily", "Body Font Family")),
|
|
766
|
+
c(
|
|
759
767
|
"typography",
|
|
760
768
|
"headingFontFamily",
|
|
761
769
|
e("theme.headingFontFamily", "Heading Font Family")
|
|
762
770
|
),
|
|
763
|
-
|
|
771
|
+
c(
|
|
764
772
|
"typography",
|
|
765
773
|
"monoFontFamily",
|
|
766
774
|
e("theme.monoFontFamily", "Monospace Font Family")
|
|
767
775
|
),
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
776
|
+
c("typography", "fontSizeXs", "Font Size XS"),
|
|
777
|
+
c("typography", "fontSizeSm", "Font Size SM"),
|
|
778
|
+
c("typography", "fontSizeMd", "Font Size MD"),
|
|
779
|
+
c("typography", "fontSizeLg", "Font Size LG"),
|
|
780
|
+
c("typography", "fontSizeXl", "Font Size XL"),
|
|
781
|
+
c("typography", "fontSize2xl", "Font Size 2XL"),
|
|
782
|
+
c("typography", "fontSize3xl", "Font Size 3XL"),
|
|
783
|
+
j("typography", "fontWeightNormal", "Weight Normal"),
|
|
784
|
+
j("typography", "fontWeightMedium", "Weight Medium"),
|
|
785
|
+
j("typography", "fontWeightSemibold", "Weight Semibold"),
|
|
786
|
+
j("typography", "fontWeightBold", "Weight Bold"),
|
|
787
|
+
j("typography", "lineHeight", "Line Height"),
|
|
788
|
+
c("typography", "letterSpacing", e("theme.letterSpacing", "Letter Spacing")),
|
|
789
|
+
c(
|
|
782
790
|
"typography",
|
|
783
791
|
"headingLetterSpacing",
|
|
784
792
|
e("theme.headingLetterSpacing", "Heading Letter Spacing")
|
|
785
793
|
)
|
|
786
794
|
] }),
|
|
787
|
-
shadows: () => /* @__PURE__ */
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
795
|
+
shadows: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
796
|
+
c("shadows", "sm", "Shadow SM"),
|
|
797
|
+
c("shadows", "md", "Shadow MD"),
|
|
798
|
+
c("shadows", "lg", "Shadow LG"),
|
|
799
|
+
c("shadows", "xl", "Shadow XL"),
|
|
800
|
+
c("shadows", "inner", e("theme.shadowInner", "Inner Shadow")),
|
|
801
|
+
c("shadows", "glow", e("theme.shadowGlow", "Glow Shadow"))
|
|
794
802
|
] }),
|
|
795
|
-
transitions: () => /* @__PURE__ */
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
803
|
+
transitions: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
804
|
+
c("transitions", "fast", e("theme.transitionFast", "Transition Fast")),
|
|
805
|
+
c("transitions", "normal", e("theme.transitionNormal", "Transition Normal")),
|
|
806
|
+
c("transitions", "slow", e("theme.transitionSlow", "Transition Slow"))
|
|
807
|
+
] }),
|
|
808
|
+
nesting: () => Me(),
|
|
809
|
+
palette: () => /* @__PURE__ */ n(Tt, { id: `${s}-palette`, theme: m, edit: V }),
|
|
810
|
+
layout: () => /* @__PURE__ */ u("div", { className: "nice-theme-builder__layout", children: [
|
|
811
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__grid", children: [
|
|
812
|
+
x("layout.body.background", e("theme.layoutBody", "Body"), "surface"),
|
|
813
|
+
x("layout.body.text", e("theme.layoutBodyText", "Body text")),
|
|
814
|
+
x("layout.panel.background", e("theme.layoutPanel", "Panel"), "surface"),
|
|
815
|
+
x("layout.panel.text", e("theme.layoutPanelText", "Panel text")),
|
|
816
|
+
x("layout.panel.border", e("theme.layoutPanelBorder", "Panel border")),
|
|
817
|
+
x(
|
|
818
|
+
"layout.topNav.background",
|
|
819
|
+
e("theme.layoutTopNav", "Top bar"),
|
|
820
|
+
"surface"
|
|
821
|
+
),
|
|
822
|
+
x("layout.topNav.text", e("theme.layoutTopNavText", "Top bar text")),
|
|
823
|
+
x(
|
|
824
|
+
"layout.topNav.border",
|
|
825
|
+
e("theme.layoutTopNavBorder", "Top bar border")
|
|
826
|
+
),
|
|
827
|
+
x(
|
|
828
|
+
"layout.sideNav.background",
|
|
829
|
+
e("theme.layoutSideNav", "Sidebar"),
|
|
830
|
+
"surface"
|
|
831
|
+
),
|
|
832
|
+
x("layout.sideNav.text", e("theme.layoutSideNavText", "Sidebar text")),
|
|
833
|
+
x(
|
|
834
|
+
"layout.sideNav.border",
|
|
835
|
+
e("theme.layoutSideNavBorder", "Sidebar border")
|
|
836
|
+
),
|
|
837
|
+
x(
|
|
838
|
+
"layout.sideNav.items.background",
|
|
839
|
+
e("theme.layoutItems", "Sidebar items (leaves)")
|
|
840
|
+
),
|
|
841
|
+
x(
|
|
842
|
+
"layout.sideNav.items.text",
|
|
843
|
+
e("theme.layoutItemsText", "Sidebar items text")
|
|
844
|
+
)
|
|
845
|
+
] }),
|
|
846
|
+
/* @__PURE__ */ n(
|
|
847
|
+
Xe,
|
|
848
|
+
{
|
|
849
|
+
id: `${s}-headers`,
|
|
850
|
+
label: e("theme.layoutHeaders", "Sidebar header levels"),
|
|
851
|
+
which: "headers",
|
|
852
|
+
theme: m,
|
|
853
|
+
edit: V,
|
|
854
|
+
onGoTo: B
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
/* @__PURE__ */ n(
|
|
858
|
+
Xe,
|
|
859
|
+
{
|
|
860
|
+
id: `${s}-highlight`,
|
|
861
|
+
label: e("theme.layoutHighlight", "Active item and its branch"),
|
|
862
|
+
which: "highlight",
|
|
863
|
+
theme: m,
|
|
864
|
+
edit: V,
|
|
865
|
+
onGoTo: B
|
|
866
|
+
}
|
|
867
|
+
)
|
|
799
868
|
] }),
|
|
800
|
-
|
|
869
|
+
scrollbar: () => /* @__PURE__ */ n(
|
|
870
|
+
wt,
|
|
871
|
+
{
|
|
872
|
+
id: `${s}-scrollbar`,
|
|
873
|
+
theme: m,
|
|
874
|
+
edit: V,
|
|
875
|
+
onGoTo: B
|
|
876
|
+
}
|
|
877
|
+
)
|
|
801
878
|
}, Ee = {
|
|
802
879
|
general: e("theme.general", "General"),
|
|
803
880
|
colors: e("theme.colors", "Colors"),
|
|
@@ -809,56 +886,59 @@ function xt({
|
|
|
809
886
|
typography: e("theme.typography", "Typography"),
|
|
810
887
|
shadows: e("theme.shadows", "Shadows"),
|
|
811
888
|
transitions: e("theme.transitions", "Transitions"),
|
|
812
|
-
nesting: e("theme.nesting", "Nesting")
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
889
|
+
nesting: e("theme.nesting", "Nesting"),
|
|
890
|
+
palette: e("theme.paletteSection", "Palette"),
|
|
891
|
+
layout: e("theme.layoutSection", "Layout"),
|
|
892
|
+
scrollbar: e("theme.scrollbarSection", "Scrollbar")
|
|
893
|
+
}, Ie = e("theme.undo", "Undo"), Le = e("theme.redo", "Redo");
|
|
894
|
+
return /* @__PURE__ */ u(Ye, { children: [
|
|
895
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__main", ref: $e, children: [
|
|
896
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__header", children: /* @__PURE__ */ u("div", { className: "nice-theme-builder__header-row", children: [
|
|
897
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__crumbs", children: [
|
|
898
|
+
/* @__PURE__ */ u(
|
|
819
899
|
"button",
|
|
820
900
|
{
|
|
821
901
|
type: "button",
|
|
822
902
|
className: "nice-theme-builder__btn",
|
|
823
|
-
onClick:
|
|
903
|
+
onClick: C,
|
|
824
904
|
title: e("theme.back", "Back to themes"),
|
|
825
905
|
children: [
|
|
826
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ n($, { name: "arrow-left", size: "sm" }),
|
|
827
907
|
e("theme.themes", "Themes")
|
|
828
908
|
]
|
|
829
909
|
}
|
|
830
910
|
),
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
X && /* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ n("span", { className: "nice-theme-builder__crumb", children: T }),
|
|
912
|
+
/* @__PURE__ */ n($, { name: "chevron-right", size: "sm" }),
|
|
913
|
+
/* @__PURE__ */ n("strong", { className: "nice-theme-builder__crumb nice-theme-builder__crumb--current", children: m.name?.trim() || e("theme.untitled", "Untitled") }),
|
|
914
|
+
X && /* @__PURE__ */ n("span", { className: "nice-theme-builder__dirty", children: e("theme.unsaved", "Unsaved changes") })
|
|
835
915
|
] }),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__toolbar", children: [
|
|
917
|
+
/* @__PURE__ */ n(
|
|
838
918
|
"button",
|
|
839
919
|
{
|
|
840
920
|
type: "button",
|
|
841
921
|
className: "nice-theme-builder__btn",
|
|
842
922
|
onClick: te,
|
|
843
923
|
disabled: !Be,
|
|
844
|
-
"aria-label":
|
|
845
|
-
title: `${
|
|
846
|
-
children: /* @__PURE__ */
|
|
924
|
+
"aria-label": Ie,
|
|
925
|
+
title: `${Ie} (Ctrl+Z)`,
|
|
926
|
+
children: /* @__PURE__ */ n($, { name: "undo", size: "sm" })
|
|
847
927
|
}
|
|
848
928
|
),
|
|
849
|
-
/* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ n(
|
|
850
930
|
"button",
|
|
851
931
|
{
|
|
852
932
|
type: "button",
|
|
853
933
|
className: "nice-theme-builder__btn",
|
|
854
|
-
onClick:
|
|
855
|
-
disabled: !
|
|
856
|
-
"aria-label":
|
|
857
|
-
title: `${
|
|
858
|
-
children: /* @__PURE__ */
|
|
934
|
+
onClick: he,
|
|
935
|
+
disabled: !De,
|
|
936
|
+
"aria-label": Le,
|
|
937
|
+
title: `${Le} (Ctrl+Y)`,
|
|
938
|
+
children: /* @__PURE__ */ n($, { name: "redo", size: "sm" })
|
|
859
939
|
}
|
|
860
940
|
),
|
|
861
|
-
|
|
941
|
+
p && /* @__PURE__ */ u(
|
|
862
942
|
"button",
|
|
863
943
|
{
|
|
864
944
|
type: "button",
|
|
@@ -866,124 +946,124 @@ function xt({
|
|
|
866
946
|
onClick: ve,
|
|
867
947
|
disabled: !X,
|
|
868
948
|
children: [
|
|
869
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ n($, { name: "save", size: "sm" }),
|
|
870
950
|
e("theme.save", "Save")
|
|
871
951
|
]
|
|
872
952
|
}
|
|
873
953
|
),
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ u("button", { type: "button", className: "nice-theme-builder__btn", onClick: Ce, children: [
|
|
955
|
+
/* @__PURE__ */ n($, { name: "copy", size: "sm" }),
|
|
876
956
|
e("theme.saveCopy", "Save as copy")
|
|
877
957
|
] }),
|
|
878
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ n(
|
|
879
959
|
"button",
|
|
880
960
|
{
|
|
881
961
|
type: "button",
|
|
882
962
|
className: "nice-theme-builder__btn",
|
|
883
|
-
onClick:
|
|
963
|
+
onClick: oe,
|
|
884
964
|
disabled: !X,
|
|
885
965
|
children: e("theme.discard", "Discard changes")
|
|
886
966
|
}
|
|
887
967
|
),
|
|
888
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ u(
|
|
889
969
|
"button",
|
|
890
970
|
{
|
|
891
971
|
type: "button",
|
|
892
972
|
className: "nice-theme-builder__btn",
|
|
893
|
-
onClick: () =>
|
|
973
|
+
onClick: () => ge.current?.click(),
|
|
894
974
|
title: e("theme.import", "Import"),
|
|
895
975
|
children: [
|
|
896
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ n($, { name: "upload", size: "sm" }),
|
|
897
977
|
e("theme.import", "Import")
|
|
898
978
|
]
|
|
899
979
|
}
|
|
900
980
|
),
|
|
901
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ n(
|
|
902
982
|
"input",
|
|
903
983
|
{
|
|
904
|
-
ref:
|
|
984
|
+
ref: ge,
|
|
905
985
|
type: "file",
|
|
906
986
|
accept: "application/json,.json",
|
|
907
987
|
style: { display: "none" },
|
|
908
|
-
onChange:
|
|
988
|
+
onChange: ae
|
|
909
989
|
}
|
|
910
990
|
),
|
|
911
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ n(at, { showPreview: N, onToggle: w })
|
|
912
992
|
] })
|
|
913
993
|
] }) }),
|
|
914
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__tabs", ref: Te, role: "tablist", children: I.map((i) => /* @__PURE__ */ n(
|
|
915
995
|
"button",
|
|
916
996
|
{
|
|
917
997
|
type: "button",
|
|
918
998
|
role: "tab",
|
|
919
|
-
"aria-selected": i ===
|
|
920
|
-
className: `nice-theme-builder__tab${i ===
|
|
921
|
-
onClick: () =>
|
|
999
|
+
"aria-selected": i === ue,
|
|
1000
|
+
className: `nice-theme-builder__tab${i === ue ? " nice-theme-builder__tab--active" : ""}`,
|
|
1001
|
+
onClick: () => pe(i),
|
|
922
1002
|
children: Ee[i]
|
|
923
1003
|
},
|
|
924
1004
|
i
|
|
925
1005
|
)) }),
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
${
|
|
1006
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__body", role: "tabpanel", ref: be, children: Oe[ue]?.() }),
|
|
1007
|
+
/* @__PURE__ */ u("details", { className: "nice-theme-builder__preview", children: [
|
|
1008
|
+
/* @__PURE__ */ n("summary", { className: "nice-theme-builder__preview-toggle", children: e("theme.preview", "CSS Variables Preview") }),
|
|
1009
|
+
/* @__PURE__ */ n("pre", { className: "nice-theme-builder__preview-code", children: `:root {
|
|
1010
|
+
${Pe}
|
|
931
1011
|
}` })
|
|
932
1012
|
] }),
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
1013
|
+
/* @__PURE__ */ u("div", { className: "nice-theme-builder__actions", children: [
|
|
1014
|
+
/* @__PURE__ */ u(
|
|
935
1015
|
"button",
|
|
936
1016
|
{
|
|
937
1017
|
type: "button",
|
|
938
1018
|
className: "nice-theme-builder__btn nice-theme-builder__btn--apply",
|
|
939
1019
|
onClick: ie,
|
|
940
1020
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ n($, { name: "check", size: "sm" }),
|
|
942
1022
|
e("theme.apply", "Apply Theme")
|
|
943
1023
|
]
|
|
944
1024
|
}
|
|
945
1025
|
),
|
|
946
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ u(
|
|
947
1027
|
"button",
|
|
948
1028
|
{
|
|
949
1029
|
type: "button",
|
|
950
1030
|
className: "nice-theme-builder__btn nice-theme-builder__btn--export",
|
|
951
|
-
onClick:
|
|
1031
|
+
onClick: ye,
|
|
952
1032
|
children: [
|
|
953
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ n($, { name: "download", size: "sm" }),
|
|
954
1034
|
e("theme.export", "Export JSON")
|
|
955
1035
|
]
|
|
956
1036
|
}
|
|
957
1037
|
),
|
|
958
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ u(
|
|
959
1039
|
"button",
|
|
960
1040
|
{
|
|
961
1041
|
type: "button",
|
|
962
1042
|
className: "nice-theme-builder__btn",
|
|
963
1043
|
onClick: () => {
|
|
964
|
-
const i = Ue(m),
|
|
965
|
-
`),
|
|
1044
|
+
const i = Ue(m), r = Object.entries(We(m)).map(([t, a]) => ` ${t}: ${a};`).join(`
|
|
1045
|
+
`), o = `/* Nice2Dev Theme: ${m.name} */
|
|
966
1046
|
:root {
|
|
967
|
-
${
|
|
1047
|
+
${r}
|
|
968
1048
|
}
|
|
969
1049
|
|
|
970
1050
|
/* JSON */
|
|
971
1051
|
/* ${i} */`;
|
|
972
|
-
navigator.clipboard?.writeText(
|
|
1052
|
+
navigator.clipboard?.writeText(o);
|
|
973
1053
|
},
|
|
974
1054
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ n($, { name: "copy", size: "sm" }),
|
|
976
1056
|
e("theme.copy", "Copy to Clipboard")
|
|
977
1057
|
]
|
|
978
1058
|
}
|
|
979
1059
|
)
|
|
980
1060
|
] })
|
|
981
1061
|
] }),
|
|
982
|
-
N && /* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
1062
|
+
N && /* @__PURE__ */ n("div", { className: "nice-theme-builder__preview-pane", children: /* @__PURE__ */ n(Qe, { theme: m, onTokenClick: B }) }),
|
|
1063
|
+
/* @__PURE__ */ n(
|
|
984
1064
|
Ze,
|
|
985
1065
|
{
|
|
986
|
-
visible:
|
|
1066
|
+
visible: b,
|
|
987
1067
|
variant: "warning",
|
|
988
1068
|
header: e("theme.unsaved", "Unsaved changes"),
|
|
989
1069
|
message: e("theme.leaveConfirm", "Leave without saving? Your changes will be lost."),
|
|
@@ -997,253 +1077,246 @@ ${n}
|
|
|
997
1077
|
)
|
|
998
1078
|
] });
|
|
999
1079
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const { t:
|
|
1002
|
-
return /* @__PURE__ */
|
|
1080
|
+
function at({ showPreview: s, onToggle: h }) {
|
|
1081
|
+
const { t: p } = Ge(), T = s ? p("theme.hidePreview", "Hide preview") : p("theme.showPreview", "Show preview");
|
|
1082
|
+
return /* @__PURE__ */ u(
|
|
1003
1083
|
"button",
|
|
1004
1084
|
{
|
|
1005
1085
|
type: "button",
|
|
1006
1086
|
className: `nice-theme-builder__btn nice-theme-builder__btn--preview-toggle${s ? " nice-theme-builder__btn--active" : ""}`,
|
|
1007
|
-
onClick:
|
|
1087
|
+
onClick: h,
|
|
1008
1088
|
title: T,
|
|
1009
1089
|
"aria-pressed": s,
|
|
1010
1090
|
children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ n($, { name: s ? "eye-off" : "eye", size: "sm" }),
|
|
1012
1092
|
T
|
|
1013
1093
|
]
|
|
1014
1094
|
}
|
|
1015
1095
|
);
|
|
1016
1096
|
}
|
|
1017
|
-
const He = "favorites",
|
|
1018
|
-
function
|
|
1019
|
-
if (!
|
|
1097
|
+
const He = "favorites", ee = "mine", qe = (s) => `catalog:${s}`, Ne = (s, h) => `${s}::${h}`;
|
|
1098
|
+
function it(s, h) {
|
|
1099
|
+
if (!h)
|
|
1020
1100
|
return null;
|
|
1021
|
-
for (const
|
|
1022
|
-
if (
|
|
1023
|
-
return
|
|
1024
|
-
const T =
|
|
1101
|
+
for (const p of s) {
|
|
1102
|
+
if (p.id === h)
|
|
1103
|
+
return p;
|
|
1104
|
+
const T = p.children ? it(p.children, h) : null;
|
|
1025
1105
|
if (T)
|
|
1026
1106
|
return T;
|
|
1027
1107
|
}
|
|
1028
1108
|
return null;
|
|
1029
1109
|
}
|
|
1030
|
-
function
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
{
|
|
1034
|
-
className: "nice-theme-builder__swatch",
|
|
1035
|
-
style: { background: s.backgrounds?.primary, borderColor: s.borders?.color },
|
|
1036
|
-
"aria-hidden": "true",
|
|
1037
|
-
children: [
|
|
1038
|
-
/* @__PURE__ */ r("span", { style: { background: s.colors?.primary } }),
|
|
1039
|
-
/* @__PURE__ */ r("span", { style: { background: s.colors?.accent ?? s.text?.primary } })
|
|
1040
|
-
]
|
|
1041
|
-
}
|
|
1042
|
-
);
|
|
1110
|
+
function Bt({ theme: s }) {
|
|
1111
|
+
const h = G(() => _t(s).preview, [s]);
|
|
1112
|
+
return /* @__PURE__ */ n("span", { className: "nice-theme-builder__swatch", "aria-hidden": "true", children: /* @__PURE__ */ n(vt, { colors: h, shape: "columns", size: 44 }) });
|
|
1043
1113
|
}
|
|
1044
|
-
const
|
|
1045
|
-
/* @__PURE__ */ pt((s,
|
|
1114
|
+
const tn = /* @__PURE__ */ Object.assign(
|
|
1115
|
+
/* @__PURE__ */ pt((s, h) => {
|
|
1046
1116
|
const {
|
|
1047
|
-
theme:
|
|
1117
|
+
theme: p,
|
|
1048
1118
|
presets: T,
|
|
1049
|
-
themes:
|
|
1119
|
+
themes: I,
|
|
1050
1120
|
onThemesChange: N,
|
|
1051
1121
|
favorites: w,
|
|
1052
1122
|
onFavoritesChange: g,
|
|
1053
1123
|
storageKey: P = "nice-theme-designer",
|
|
1054
|
-
allowDelete:
|
|
1055
|
-
startScreen:
|
|
1056
|
-
onSave:
|
|
1057
|
-
sections:
|
|
1058
|
-
onChange:
|
|
1059
|
-
onApply:
|
|
1124
|
+
allowDelete: L = !1,
|
|
1125
|
+
startScreen: Y = "browser",
|
|
1126
|
+
onSave: E,
|
|
1127
|
+
sections: Z,
|
|
1128
|
+
onChange: we,
|
|
1129
|
+
onApply: de,
|
|
1060
1130
|
onExport: e,
|
|
1061
|
-
livePreview:
|
|
1131
|
+
livePreview: Te = !1,
|
|
1062
1132
|
focusedToken: m,
|
|
1063
1133
|
showPreview: Be = !0,
|
|
1064
|
-
previewPlacement:
|
|
1065
|
-
tutorial:
|
|
1134
|
+
previewPlacement: De = "right",
|
|
1135
|
+
tutorial: R,
|
|
1066
1136
|
className: te,
|
|
1067
|
-
style:
|
|
1137
|
+
style: he,
|
|
1068
1138
|
id: ne,
|
|
1069
|
-
...
|
|
1070
|
-
} = s,
|
|
1071
|
-
() =>
|
|
1139
|
+
...ue
|
|
1140
|
+
} = s, pe = ot(ne), { t: b } = Ge(), [U, be] = O(Be), ge = y(() => be((t) => !t), []), X = M(null), ke = G(
|
|
1141
|
+
() => Z ?? [
|
|
1072
1142
|
"general",
|
|
1143
|
+
"palette",
|
|
1073
1144
|
"colors",
|
|
1074
1145
|
"backgrounds",
|
|
1075
|
-
"
|
|
1146
|
+
"layout",
|
|
1076
1147
|
"text",
|
|
1077
1148
|
"borders",
|
|
1149
|
+
"scrollbar",
|
|
1150
|
+
"background-image",
|
|
1078
1151
|
"spacing",
|
|
1079
1152
|
"typography",
|
|
1080
1153
|
"shadows",
|
|
1081
1154
|
"transitions"
|
|
1082
1155
|
],
|
|
1083
|
-
[
|
|
1084
|
-
), [xe, J] =
|
|
1156
|
+
[Z]
|
|
1157
|
+
), [xe, J] = O(() => Pt(P)), k = I ?? xe, B = y(
|
|
1085
1158
|
(t) => {
|
|
1086
|
-
|
|
1159
|
+
I === void 0 && (J(t), Ve(P, "themes", t)), N?.(t);
|
|
1087
1160
|
},
|
|
1088
|
-
[
|
|
1089
|
-
), [
|
|
1090
|
-
() =>
|
|
1091
|
-
),
|
|
1161
|
+
[I, P, N]
|
|
1162
|
+
), [fe, re] = O(
|
|
1163
|
+
() => Ft(P)
|
|
1164
|
+
), z = w ?? fe, W = y(
|
|
1092
1165
|
(t) => {
|
|
1093
|
-
w === void 0 && (re(t),
|
|
1166
|
+
w === void 0 && (re(t), Ve(P, "favorites", t)), g?.(t);
|
|
1094
1167
|
},
|
|
1095
1168
|
[w, P, g]
|
|
1096
|
-
),
|
|
1097
|
-
(t) =>
|
|
1098
|
-
[
|
|
1099
|
-
),
|
|
1169
|
+
), D = G(() => It(T), [T]), V = y(
|
|
1170
|
+
(t) => b(`theme.category.${t.id}`, t.label),
|
|
1171
|
+
[b]
|
|
1172
|
+
), ae = G(() => {
|
|
1100
1173
|
const t = /* @__PURE__ */ new Map();
|
|
1101
|
-
for (const
|
|
1102
|
-
for (const
|
|
1103
|
-
t.has(
|
|
1174
|
+
for (const a of D)
|
|
1175
|
+
for (const l of a.entries)
|
|
1176
|
+
t.has(l.name) || t.set(l.name, l.theme);
|
|
1104
1177
|
return t;
|
|
1105
|
-
}, [
|
|
1106
|
-
const t = (
|
|
1107
|
-
id:
|
|
1108
|
-
label:
|
|
1178
|
+
}, [D]), ie = G(() => {
|
|
1179
|
+
const t = (f, v, K) => ({
|
|
1180
|
+
id: Ne(f, v.name),
|
|
1181
|
+
label: v.name,
|
|
1109
1182
|
kind: "theme",
|
|
1110
|
-
group:
|
|
1183
|
+
group: f,
|
|
1111
1184
|
depth: 1,
|
|
1112
|
-
theme:
|
|
1185
|
+
theme: v,
|
|
1113
1186
|
own: K
|
|
1114
|
-
}),
|
|
1115
|
-
id:
|
|
1116
|
-
label:
|
|
1187
|
+
}), a = (f, v, K) => ({
|
|
1188
|
+
id: f,
|
|
1189
|
+
label: v,
|
|
1117
1190
|
kind: "group",
|
|
1118
|
-
group:
|
|
1191
|
+
group: f,
|
|
1119
1192
|
depth: 0,
|
|
1120
1193
|
count: K.length,
|
|
1121
1194
|
children: K
|
|
1122
|
-
}),
|
|
1123
|
-
for (const
|
|
1124
|
-
const
|
|
1125
|
-
K &&
|
|
1195
|
+
}), l = [];
|
|
1196
|
+
for (const f of new Set(z)) {
|
|
1197
|
+
const v = k.find((ce) => ce.name === f), K = v ?? ae.get(f);
|
|
1198
|
+
K && l.push(t(He, K, !!v));
|
|
1126
1199
|
}
|
|
1127
|
-
const
|
|
1200
|
+
const S = /* @__PURE__ */ new Set(), _ = k.filter((f) => !S.has(f.name) && S.add(f.name)).map((f) => t(ee, f, !0));
|
|
1128
1201
|
return [
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
...
|
|
1132
|
-
const
|
|
1133
|
-
return
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1202
|
+
a(He, b("theme.favorites", "Favorites"), l),
|
|
1203
|
+
a(ee, b("theme.myThemes", "My themes"), _),
|
|
1204
|
+
...D.map((f) => {
|
|
1205
|
+
const v = qe(f.id), K = /* @__PURE__ */ new Set();
|
|
1206
|
+
return a(
|
|
1207
|
+
v,
|
|
1208
|
+
V(f),
|
|
1209
|
+
f.entries.filter((ce) => !K.has(ce.name) && K.add(ce.name)).map((ce) => t(v, ce.theme, !1))
|
|
1137
1210
|
);
|
|
1138
1211
|
})
|
|
1139
1212
|
];
|
|
1140
|
-
}, [
|
|
1141
|
-
(t) =>
|
|
1142
|
-
[
|
|
1143
|
-
),
|
|
1213
|
+
}, [z, k, ae, D, V, b]), ye = y(
|
|
1214
|
+
(t) => ie.find((a) => a.id === t)?.label ?? b("theme.themes", "Themes"),
|
|
1215
|
+
[ie, b]
|
|
1216
|
+
), ve = y(
|
|
1144
1217
|
(t) => {
|
|
1145
1218
|
if (!t)
|
|
1146
1219
|
return null;
|
|
1147
|
-
if (
|
|
1148
|
-
return
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
1220
|
+
if (k.some((l) => l.name === t.name))
|
|
1221
|
+
return Ne(ee, t.name);
|
|
1222
|
+
const a = D.find((l) => l.entries.some((S) => S.name === t.name));
|
|
1223
|
+
return a ? Ne(qe(a.id), t.name) : null;
|
|
1151
1224
|
},
|
|
1152
|
-
[
|
|
1153
|
-
), [
|
|
1154
|
-
const t = [He,
|
|
1155
|
-
return
|
|
1156
|
-
}),
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
}, []), [
|
|
1161
|
-
if (
|
|
1225
|
+
[k, D]
|
|
1226
|
+
), [Ce, oe] = O(() => ve(p)), C = it(ie, Ce), [$e, Pe] = O(() => {
|
|
1227
|
+
const t = [He, ee], l = ve(p)?.split("::")[0];
|
|
1228
|
+
return l && !t.includes(l) ? [...t, l] : t;
|
|
1229
|
+
}), x = y((t) => {
|
|
1230
|
+
oe(t);
|
|
1231
|
+
const a = t.split("::")[0];
|
|
1232
|
+
Pe((l) => l.includes(a) ? l : [...l, a]);
|
|
1233
|
+
}, []), [d, c] = O(() => {
|
|
1234
|
+
if (Y !== "edit")
|
|
1162
1235
|
return null;
|
|
1163
|
-
const t =
|
|
1236
|
+
const t = p ?? Ke, a = ve(t), l = a?.startsWith(`${ee}::`) ?? !1;
|
|
1164
1237
|
return {
|
|
1165
1238
|
original: t,
|
|
1166
|
-
ownName:
|
|
1167
|
-
groupLabel:
|
|
1239
|
+
ownName: l ? t.name : null,
|
|
1240
|
+
groupLabel: a ? ye(a.split("::")[0]) : b("theme.themes", "Themes"),
|
|
1168
1241
|
session: 0
|
|
1169
1242
|
};
|
|
1170
|
-
}),
|
|
1243
|
+
}), j = M(0), q = y(
|
|
1171
1244
|
(t) => {
|
|
1172
|
-
t.theme && (
|
|
1245
|
+
t.theme && (j.current += 1, oe(t.id), c({
|
|
1173
1246
|
original: t.theme,
|
|
1174
1247
|
ownName: t.own ? t.theme.name : null,
|
|
1175
|
-
groupLabel:
|
|
1176
|
-
session:
|
|
1248
|
+
groupLabel: ye(t.group),
|
|
1249
|
+
session: j.current
|
|
1177
1250
|
}));
|
|
1178
1251
|
},
|
|
1179
|
-
[
|
|
1180
|
-
),
|
|
1181
|
-
(t) =>
|
|
1182
|
-
|
|
1252
|
+
[ye]
|
|
1253
|
+
), _e = y(
|
|
1254
|
+
(t) => W(
|
|
1255
|
+
z.includes(t) ? z.filter((a) => a !== t) : [...z, t]
|
|
1183
1256
|
),
|
|
1184
|
-
[
|
|
1185
|
-
),
|
|
1186
|
-
(t,
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1257
|
+
[z, W]
|
|
1258
|
+
), H = b("theme.untitled", "Untitled"), se = b("theme.copySuffix", "copy"), F = y(
|
|
1259
|
+
(t, a) => {
|
|
1260
|
+
const l = Je(a, new Set(k.map((_) => _.name))), S = { ...t, name: l };
|
|
1261
|
+
return B([...k, S]), x(Ne(ee, l)), S;
|
|
1189
1262
|
},
|
|
1190
|
-
[
|
|
1191
|
-
),
|
|
1192
|
-
const t =
|
|
1193
|
-
|
|
1263
|
+
[k, B, x]
|
|
1264
|
+
), Ae = y(() => {
|
|
1265
|
+
const t = F(C?.theme ?? Ke, b("theme.myThemeName", "My theme"));
|
|
1266
|
+
j.current += 1, c({
|
|
1194
1267
|
original: t,
|
|
1195
1268
|
ownName: t.name,
|
|
1196
|
-
groupLabel:
|
|
1197
|
-
session:
|
|
1269
|
+
groupLabel: b("theme.myThemes", "My themes"),
|
|
1270
|
+
session: j.current
|
|
1198
1271
|
});
|
|
1199
|
-
}, [
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1272
|
+
}, [F, C, b]), Q = y(() => {
|
|
1273
|
+
C?.theme && F(C.theme, `${C.theme.name.trim() || H} ${se}`);
|
|
1274
|
+
}, [F, C, H, se]), Fe = y(
|
|
1202
1275
|
(t) => {
|
|
1203
|
-
const
|
|
1204
|
-
t.target.value = "",
|
|
1276
|
+
const a = t.target.files?.[0];
|
|
1277
|
+
t.target.value = "", a && rt(a, (l) => F(l, l.name.trim() || H));
|
|
1205
1278
|
},
|
|
1206
|
-
[
|
|
1207
|
-
), [
|
|
1208
|
-
const t =
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1279
|
+
[F, H]
|
|
1280
|
+
), [A, le] = O(null), Me = y(() => {
|
|
1281
|
+
const t = A;
|
|
1282
|
+
le(null), t !== null && (B(k.filter((a) => a.name !== t)), z.includes(t) && !ae.has(t) && W(z.filter((a) => a !== t)), oe(null));
|
|
1283
|
+
}, [A, k, B, z, W, ae]), Oe = y(
|
|
1211
1284
|
(t) => {
|
|
1212
|
-
const
|
|
1213
|
-
return
|
|
1214
|
-
|
|
1215
|
-
),
|
|
1285
|
+
const a = d?.ownName ?? t.name, l = k.some((v) => v.name === a), S = new Set(k.filter((v) => v.name !== a).map((v) => v.name)), _ = Je(t.name.trim() || H, S), f = _ === t.name ? t : { ...t, name: _ };
|
|
1286
|
+
return B(
|
|
1287
|
+
l ? k.map((v) => v.name === a ? f : v) : [...k, f]
|
|
1288
|
+
), _ !== a && z.includes(a) && W(z.map((v) => v === a ? _ : v)), c((v) => v && { ...v, original: f, ownName: _ }), x(Ne(ee, _)), E?.(f), f;
|
|
1216
1289
|
},
|
|
1217
|
-
[
|
|
1218
|
-
),
|
|
1290
|
+
[d, k, B, z, W, x, E, H]
|
|
1291
|
+
), Ee = y(
|
|
1219
1292
|
(t) => {
|
|
1220
|
-
const
|
|
1221
|
-
return
|
|
1222
|
-
(
|
|
1223
|
-
...
|
|
1224
|
-
original:
|
|
1225
|
-
ownName:
|
|
1226
|
-
groupLabel:
|
|
1293
|
+
const a = t.name.trim() || H, l = new Set(k.map((f) => f.name)), S = d && a !== d.original.name && !l.has(a), _ = F(t, S ? a : `${a} ${se}`);
|
|
1294
|
+
return c(
|
|
1295
|
+
(f) => f && {
|
|
1296
|
+
...f,
|
|
1297
|
+
original: _,
|
|
1298
|
+
ownName: _.name,
|
|
1299
|
+
groupLabel: b("theme.myThemes", "My themes")
|
|
1227
1300
|
}
|
|
1228
|
-
),
|
|
1301
|
+
), E?.(_), _;
|
|
1229
1302
|
},
|
|
1230
|
-
[
|
|
1231
|
-
),
|
|
1303
|
+
[d, k, F, E, H, se, b]
|
|
1304
|
+
), Ie = y(() => c(null), []), Le = G(
|
|
1232
1305
|
() => [
|
|
1233
1306
|
{
|
|
1234
1307
|
field: "label",
|
|
1235
|
-
header:
|
|
1236
|
-
render: (t,
|
|
1237
|
-
|
|
1238
|
-
/* @__PURE__ */
|
|
1239
|
-
] }) : /* @__PURE__ */
|
|
1308
|
+
header: b("theme.name", "Theme Name"),
|
|
1309
|
+
render: (t, a) => a.kind === "group" ? /* @__PURE__ */ u("span", { className: "nice-theme-builder__tree-group", children: [
|
|
1310
|
+
a.label,
|
|
1311
|
+
/* @__PURE__ */ n("span", { className: "nice-theme-builder__tree-count", children: a.count })
|
|
1312
|
+
] }) : /* @__PURE__ */ u(
|
|
1240
1313
|
"span",
|
|
1241
1314
|
{
|
|
1242
1315
|
className: "nice-theme-builder__tree-theme",
|
|
1243
|
-
onDoubleClick: () =>
|
|
1316
|
+
onDoubleClick: () => q(a),
|
|
1244
1317
|
children: [
|
|
1245
|
-
|
|
1246
|
-
/* @__PURE__ */
|
|
1318
|
+
a.theme && /* @__PURE__ */ n(Bt, { theme: a.theme }),
|
|
1319
|
+
/* @__PURE__ */ n("span", { className: "nice-theme-builder__tree-label", title: a.label, children: a.label })
|
|
1247
1320
|
]
|
|
1248
1321
|
}
|
|
1249
1322
|
)
|
|
@@ -1253,195 +1326,195 @@ const Ht = /* @__PURE__ */ Object.assign(
|
|
|
1253
1326
|
header: "",
|
|
1254
1327
|
width: 72,
|
|
1255
1328
|
align: "right",
|
|
1256
|
-
render: (t,
|
|
1257
|
-
if (
|
|
1329
|
+
render: (t, a) => {
|
|
1330
|
+
if (a.kind !== "theme" || !a.theme)
|
|
1258
1331
|
return null;
|
|
1259
|
-
const
|
|
1260
|
-
return /* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1332
|
+
const l = a.theme.name, S = z.includes(l), _ = S ? b("theme.removeFavorite", "Remove from favorites") : b("theme.addFavorite", "Add to favorites");
|
|
1333
|
+
return /* @__PURE__ */ u("span", { className: "nice-theme-builder__row-actions", children: [
|
|
1334
|
+
/* @__PURE__ */ n(
|
|
1262
1335
|
"button",
|
|
1263
1336
|
{
|
|
1264
1337
|
type: "button",
|
|
1265
|
-
className: `nice-theme-builder__icon-btn nice-theme-builder__star${
|
|
1266
|
-
"aria-pressed":
|
|
1267
|
-
"aria-label": `${
|
|
1268
|
-
title:
|
|
1269
|
-
onClick: (
|
|
1270
|
-
|
|
1338
|
+
className: `nice-theme-builder__icon-btn nice-theme-builder__star${S ? " nice-theme-builder__star--on" : ""}`,
|
|
1339
|
+
"aria-pressed": S,
|
|
1340
|
+
"aria-label": `${_}: ${l}`,
|
|
1341
|
+
title: _,
|
|
1342
|
+
onClick: (f) => {
|
|
1343
|
+
f.stopPropagation(), _e(l);
|
|
1271
1344
|
},
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1345
|
+
children: /* @__PURE__ */ n($, { name: "star", size: 14 })
|
|
1273
1346
|
}
|
|
1274
1347
|
),
|
|
1275
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ n(
|
|
1276
1349
|
"button",
|
|
1277
1350
|
{
|
|
1278
1351
|
type: "button",
|
|
1279
1352
|
className: "nice-theme-builder__icon-btn",
|
|
1280
|
-
"aria-label": `${
|
|
1281
|
-
title:
|
|
1282
|
-
onClick: (
|
|
1283
|
-
|
|
1353
|
+
"aria-label": `${b("theme.edit", "Edit")}: ${l}`,
|
|
1354
|
+
title: b("theme.edit", "Edit"),
|
|
1355
|
+
onClick: (f) => {
|
|
1356
|
+
f.stopPropagation(), q(a);
|
|
1284
1357
|
},
|
|
1285
|
-
children: /* @__PURE__ */
|
|
1358
|
+
children: /* @__PURE__ */ n($, { name: "edit", size: 14 })
|
|
1286
1359
|
}
|
|
1287
1360
|
)
|
|
1288
1361
|
] });
|
|
1289
1362
|
}
|
|
1290
1363
|
}
|
|
1291
1364
|
],
|
|
1292
|
-
[
|
|
1293
|
-
),
|
|
1294
|
-
/* @__PURE__ */
|
|
1365
|
+
[z, q, _e, b]
|
|
1366
|
+
), i = L && !!C?.own && !!C.theme, r = /* @__PURE__ */ u("div", { className: "nice-theme-builder__toolbar", children: [
|
|
1367
|
+
/* @__PURE__ */ u(
|
|
1295
1368
|
"button",
|
|
1296
1369
|
{
|
|
1297
1370
|
type: "button",
|
|
1298
1371
|
className: "nice-theme-builder__btn nice-theme-builder__btn--new",
|
|
1299
|
-
onClick:
|
|
1372
|
+
onClick: Ae,
|
|
1300
1373
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
|
|
1374
|
+
/* @__PURE__ */ n($, { name: "plus", size: "sm" }),
|
|
1375
|
+
b("theme.newTheme", "New")
|
|
1303
1376
|
]
|
|
1304
1377
|
}
|
|
1305
1378
|
),
|
|
1306
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ u(
|
|
1307
1380
|
"button",
|
|
1308
1381
|
{
|
|
1309
1382
|
type: "button",
|
|
1310
1383
|
className: "nice-theme-builder__btn",
|
|
1311
|
-
onClick:
|
|
1312
|
-
disabled: !
|
|
1384
|
+
onClick: Q,
|
|
1385
|
+
disabled: !C?.theme,
|
|
1313
1386
|
children: [
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
|
|
1387
|
+
/* @__PURE__ */ n($, { name: "copy", size: "sm" }),
|
|
1388
|
+
b("theme.duplicate", "Duplicate")
|
|
1316
1389
|
]
|
|
1317
1390
|
}
|
|
1318
1391
|
),
|
|
1319
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ u(
|
|
1320
1393
|
"button",
|
|
1321
1394
|
{
|
|
1322
1395
|
type: "button",
|
|
1323
1396
|
className: "nice-theme-builder__btn",
|
|
1324
|
-
onClick: () =>
|
|
1325
|
-
disabled: !
|
|
1397
|
+
onClick: () => C && q(C),
|
|
1398
|
+
disabled: !C?.theme,
|
|
1326
1399
|
children: [
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
|
|
1400
|
+
/* @__PURE__ */ n($, { name: "edit", size: "sm" }),
|
|
1401
|
+
b("theme.edit", "Edit")
|
|
1329
1402
|
]
|
|
1330
1403
|
}
|
|
1331
1404
|
),
|
|
1332
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ u(
|
|
1333
1406
|
"button",
|
|
1334
1407
|
{
|
|
1335
1408
|
type: "button",
|
|
1336
1409
|
className: "nice-theme-builder__btn",
|
|
1337
1410
|
onClick: () => X.current?.click(),
|
|
1338
1411
|
children: [
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
|
|
1412
|
+
/* @__PURE__ */ n($, { name: "upload", size: "sm" }),
|
|
1413
|
+
b("theme.import", "Import")
|
|
1341
1414
|
]
|
|
1342
1415
|
}
|
|
1343
1416
|
),
|
|
1344
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ n(
|
|
1345
1418
|
"input",
|
|
1346
1419
|
{
|
|
1347
1420
|
ref: X,
|
|
1348
1421
|
type: "file",
|
|
1349
1422
|
accept: "application/json,.json",
|
|
1350
1423
|
style: { display: "none" },
|
|
1351
|
-
onChange:
|
|
1424
|
+
onChange: Fe
|
|
1352
1425
|
}
|
|
1353
1426
|
),
|
|
1354
|
-
|
|
1427
|
+
L && /* @__PURE__ */ u(
|
|
1355
1428
|
"button",
|
|
1356
1429
|
{
|
|
1357
1430
|
type: "button",
|
|
1358
1431
|
className: "nice-theme-builder__btn nice-theme-builder__btn--danger",
|
|
1359
|
-
onClick: () =>
|
|
1360
|
-
disabled: !
|
|
1432
|
+
onClick: () => C?.theme && le(C.theme.name),
|
|
1433
|
+
disabled: !i,
|
|
1361
1434
|
children: [
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
|
|
1435
|
+
/* @__PURE__ */ n($, { name: "trash", size: "sm" }),
|
|
1436
|
+
b("theme.delete", "Delete")
|
|
1364
1437
|
]
|
|
1365
1438
|
}
|
|
1366
1439
|
),
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
] }),
|
|
1369
|
-
return /* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ n(at, { showPreview: U, onToggle: ge })
|
|
1441
|
+
] }), o = d ? "edit" : "browser";
|
|
1442
|
+
return /* @__PURE__ */ u(
|
|
1370
1443
|
"div",
|
|
1371
1444
|
{
|
|
1372
|
-
ref:
|
|
1373
|
-
id:
|
|
1374
|
-
className: `nice-theme-builder nice-theme-builder--${
|
|
1375
|
-
style: { position: "relative", ...
|
|
1376
|
-
"data-testid":
|
|
1377
|
-
"data-screen":
|
|
1445
|
+
ref: h,
|
|
1446
|
+
id: pe,
|
|
1447
|
+
className: `nice-theme-builder nice-theme-builder--${o}${U ? ` nice-theme-builder--with-preview nice-theme-builder--preview-${De}` : ""}${te ? ` ${te}` : ""}`,
|
|
1448
|
+
style: { position: "relative", ...he },
|
|
1449
|
+
"data-testid": ue["data-testid"] ?? "nice-theme-builder",
|
|
1450
|
+
"data-screen": o,
|
|
1378
1451
|
children: [
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
|
|
1452
|
+
/* @__PURE__ */ n("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ n(
|
|
1453
|
+
st,
|
|
1381
1454
|
{
|
|
1382
|
-
steps: lt(
|
|
1455
|
+
steps: lt(R, d ? Ct : xt)
|
|
1383
1456
|
}
|
|
1384
1457
|
) }),
|
|
1385
|
-
|
|
1386
|
-
|
|
1458
|
+
d ? /* @__PURE__ */ n(
|
|
1459
|
+
Rt,
|
|
1387
1460
|
{
|
|
1388
|
-
controlId:
|
|
1389
|
-
original:
|
|
1390
|
-
own:
|
|
1391
|
-
groupLabel:
|
|
1392
|
-
allSections:
|
|
1461
|
+
controlId: pe,
|
|
1462
|
+
original: d.original,
|
|
1463
|
+
own: d.ownName !== null,
|
|
1464
|
+
groupLabel: d.groupLabel,
|
|
1465
|
+
allSections: ke,
|
|
1393
1466
|
showPreview: U,
|
|
1394
|
-
onTogglePreview:
|
|
1395
|
-
onBack:
|
|
1396
|
-
onSave:
|
|
1397
|
-
onSaveCopy:
|
|
1398
|
-
onChange:
|
|
1399
|
-
onApply:
|
|
1467
|
+
onTogglePreview: ge,
|
|
1468
|
+
onBack: Ie,
|
|
1469
|
+
onSave: Oe,
|
|
1470
|
+
onSaveCopy: Ee,
|
|
1471
|
+
onChange: we,
|
|
1472
|
+
onApply: de,
|
|
1400
1473
|
onExport: e,
|
|
1401
|
-
livePreview:
|
|
1474
|
+
livePreview: Te,
|
|
1402
1475
|
focusedToken: m
|
|
1403
1476
|
},
|
|
1404
|
-
|
|
1405
|
-
) : /* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1477
|
+
d.session
|
|
1478
|
+
) : /* @__PURE__ */ u(Ye, { children: [
|
|
1479
|
+
/* @__PURE__ */ n("div", { className: "nice-theme-builder__main nice-theme-builder__browser", children: /* @__PURE__ */ n("div", { className: "nice-theme-builder__tree", children: /* @__PURE__ */ n(
|
|
1407
1480
|
gt,
|
|
1408
1481
|
{
|
|
1409
|
-
data:
|
|
1482
|
+
data: ie,
|
|
1410
1483
|
nested: !0,
|
|
1411
1484
|
keyField: "id",
|
|
1412
1485
|
childrenField: "children",
|
|
1413
|
-
columns:
|
|
1486
|
+
columns: Le,
|
|
1414
1487
|
sortable: !1,
|
|
1415
1488
|
compact: !0,
|
|
1416
1489
|
searchable: !0,
|
|
1417
1490
|
searchFields: ["label"],
|
|
1418
1491
|
searchKeepDescendants: !0,
|
|
1419
|
-
searchPlaceholder:
|
|
1420
|
-
toolbar:
|
|
1492
|
+
searchPlaceholder: b("theme.search", "Search themes"),
|
|
1493
|
+
toolbar: r,
|
|
1421
1494
|
toolbarActions: ["collapseAll"],
|
|
1422
|
-
expandedKeys:
|
|
1423
|
-
onExpandedChange:
|
|
1424
|
-
onRowClick: (t) => t.kind === "theme" &&
|
|
1425
|
-
rowClassName: (t) => t.kind === "group" ? "nice-theme-builder__tree-row--group" : t.id ===
|
|
1426
|
-
"aria-label":
|
|
1495
|
+
expandedKeys: $e,
|
|
1496
|
+
onExpandedChange: Pe,
|
|
1497
|
+
onRowClick: (t) => t.kind === "theme" && oe(t.id),
|
|
1498
|
+
rowClassName: (t) => t.kind === "group" ? "nice-theme-builder__tree-row--group" : t.id === Ce ? "nice-theme-builder__tree-row--selected" : void 0,
|
|
1499
|
+
"aria-label": b("theme.themes", "Themes"),
|
|
1427
1500
|
"data-testid": "nice-theme-designer-tree"
|
|
1428
1501
|
}
|
|
1429
1502
|
) }) }),
|
|
1430
|
-
U && /* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1503
|
+
U && /* @__PURE__ */ n("div", { className: "nice-theme-builder__preview-pane", children: C?.theme ? /* @__PURE__ */ n(Qe, { theme: C.theme }) : /* @__PURE__ */ n("div", { className: "nice-theme-builder__empty", children: b("theme.noSelection", "Select a theme to preview it") }) }),
|
|
1504
|
+
/* @__PURE__ */ n(
|
|
1432
1505
|
Ze,
|
|
1433
1506
|
{
|
|
1434
|
-
visible:
|
|
1507
|
+
visible: A !== null,
|
|
1435
1508
|
variant: "error",
|
|
1436
|
-
header:
|
|
1437
|
-
message:
|
|
1509
|
+
header: b("theme.delete", "Delete"),
|
|
1510
|
+
message: b(
|
|
1438
1511
|
"theme.deleteConfirm",
|
|
1439
1512
|
'Delete the theme "{name}"? This cannot be undone.'
|
|
1440
|
-
).replace("{name}",
|
|
1441
|
-
acceptLabel:
|
|
1442
|
-
rejectLabel:
|
|
1443
|
-
onAccept:
|
|
1444
|
-
onReject: () =>
|
|
1513
|
+
).replace("{name}", A ?? ""),
|
|
1514
|
+
acceptLabel: b("theme.delete", "Delete"),
|
|
1515
|
+
rejectLabel: b("theme.cancel", "Cancel"),
|
|
1516
|
+
onAccept: Me,
|
|
1517
|
+
onReject: () => le(null)
|
|
1445
1518
|
}
|
|
1446
1519
|
)
|
|
1447
1520
|
] })
|
|
@@ -1452,5 +1525,5 @@ const Ht = /* @__PURE__ */ Object.assign(
|
|
|
1452
1525
|
{ displayName: "NiceThemeDesigner" }
|
|
1453
1526
|
);
|
|
1454
1527
|
export {
|
|
1455
|
-
|
|
1528
|
+
tn as NiceThemeDesigner
|
|
1456
1529
|
};
|