ikoneme-lib 0.1.0
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/README.md +252 -0
- package/dist/Ikon.d.ts +13 -0
- package/dist/IkonEditor.d.ts +9 -0
- package/dist/IkonZoomView.d.ts +6 -0
- package/dist/Ikoneme.d.ts +32 -0
- package/dist/ikonDb.d.ts +13 -0
- package/dist/ikonSchema.d.ts +101 -0
- package/dist/ikoneme-lib.cjs +41 -0
- package/dist/ikoneme-lib.cjs.map +1 -0
- package/dist/ikoneme-lib.js +1884 -0
- package/dist/ikoneme-lib.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/theme.d.ts +11 -0
- package/package.json +53 -0
|
@@ -0,0 +1,1884 @@
|
|
|
1
|
+
import { jsxs as f, Fragment as U, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as xe, createElement as ne, useState as F, useEffect as le, useCallback as fe } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @license lucide-react v0.294.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the ISC license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
var ke = {
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
width: 24,
|
|
12
|
+
height: 24,
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
fill: "none",
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeWidth: 2,
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @license lucide-react v0.294.0 - ISC
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the ISC license.
|
|
24
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const be = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(), H = (e, o) => {
|
|
27
|
+
const l = xe(
|
|
28
|
+
({ color: r = "currentColor", size: i = 24, strokeWidth: p = 2, absoluteStrokeWidth: c, className: I = "", children: k, ...N }, T) => ne(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
ref: T,
|
|
32
|
+
...ke,
|
|
33
|
+
width: i,
|
|
34
|
+
height: i,
|
|
35
|
+
stroke: r,
|
|
36
|
+
strokeWidth: c ? Number(p) * 24 / Number(i) : p,
|
|
37
|
+
className: ["lucide", `lucide-${be(e)}`, I].join(" "),
|
|
38
|
+
...N
|
|
39
|
+
},
|
|
40
|
+
[
|
|
41
|
+
...o.map(([_, y]) => ne(_, y)),
|
|
42
|
+
...Array.isArray(k) ? k : [k]
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
return l.displayName = `${e}`, l;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @license lucide-react v0.294.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/
|
|
54
|
+
const ye = H("ArrowLeft", [
|
|
55
|
+
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
56
|
+
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
57
|
+
]);
|
|
58
|
+
/**
|
|
59
|
+
* @license lucide-react v0.294.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/
|
|
64
|
+
const ve = H("Pen", [
|
|
65
|
+
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }]
|
|
66
|
+
]);
|
|
67
|
+
/**
|
|
68
|
+
* @license lucide-react v0.294.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/
|
|
73
|
+
const we = H("Search", [
|
|
74
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
75
|
+
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
76
|
+
]);
|
|
77
|
+
/**
|
|
78
|
+
* @license lucide-react v0.294.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/
|
|
83
|
+
const Ie = H("Trash2", [
|
|
84
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
85
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
86
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
87
|
+
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
88
|
+
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
89
|
+
]);
|
|
90
|
+
/**
|
|
91
|
+
* @license lucide-react v0.294.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/
|
|
96
|
+
const _e = H("X", [
|
|
97
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
98
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
99
|
+
]), h = {
|
|
100
|
+
context: [
|
|
101
|
+
{ tooltip: "Male", url: "https://text2ikon.komunikon.com/gender-assets/KomunIKON_Male.svg" },
|
|
102
|
+
{
|
|
103
|
+
tooltip: "Female",
|
|
104
|
+
url: "https://text2ikon.komunikon.com/gender-assets/KomunIKON_Female.svg"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
tooltip: "Non Binary",
|
|
108
|
+
url: "https://text2ikon.komunikon.com/gender-assets/KomunIKON_Non-Binary.png"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
reference: [
|
|
112
|
+
{
|
|
113
|
+
tooltip: "Asterisk",
|
|
114
|
+
url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_asterisk.svg"
|
|
115
|
+
},
|
|
116
|
+
{ tooltip: "Zero", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Zero.svg" },
|
|
117
|
+
{ tooltip: "One", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_One.svg" },
|
|
118
|
+
{ tooltip: "Two", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Two.svg" },
|
|
119
|
+
{
|
|
120
|
+
tooltip: "Three",
|
|
121
|
+
url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Three.svg"
|
|
122
|
+
},
|
|
123
|
+
{ tooltip: "Four", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Four.svg" },
|
|
124
|
+
{ tooltip: "Five", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Five.svg" },
|
|
125
|
+
{ tooltip: "Six", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Six.svg" },
|
|
126
|
+
{
|
|
127
|
+
tooltip: "Seven",
|
|
128
|
+
url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Seven.svg"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
tooltip: "Eight",
|
|
132
|
+
url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Eight.svg"
|
|
133
|
+
},
|
|
134
|
+
{ tooltip: "Nine", url: "https://text2ikon.komunikon.com/reference-assets/KomunIKON_Nine.svg" }
|
|
135
|
+
],
|
|
136
|
+
role: [
|
|
137
|
+
{ tooltip: "agent", url: "https://text2ikon.komunikon.com/case-assets/KomunIKON_agent.svg" },
|
|
138
|
+
{
|
|
139
|
+
tooltip: "patient",
|
|
140
|
+
url: "https://text2ikon.komunikon.com/case-assets/KomunIKON_patient.svg"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
tooltip: "reflexive",
|
|
144
|
+
url: "https://text2ikon.komunikon.com/case-assets/KomunIKON_reflexive.svg"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
tooltip: "recipricol",
|
|
148
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=%2Fcase-assets%2Frecipricol.jpg&w=48&q=75"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
modes: [
|
|
152
|
+
{ tooltip: "Exclam", url: "https://text2ikon.komunikon.com/mode-assets/KomunIKON_Exclam.svg" },
|
|
153
|
+
{ tooltip: "Which", url: "https://text2ikon.komunikon.com/mode-assets/KomunIKON_Which.svg" }
|
|
154
|
+
],
|
|
155
|
+
root: [
|
|
156
|
+
{
|
|
157
|
+
tooltip: "Love/Passion",
|
|
158
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2FZFcaar88AP.png&w=128&q=75"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
tooltip: "Star/Excellence",
|
|
162
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2FM0ADaSXzWe.png&w=128&q=75"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
tooltip: "Value/Precious",
|
|
166
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2F6ghAUKbdIs.png&w=128&q=75"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
tooltip: "Fire/Hot",
|
|
170
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2Fzq0n4vHSQW.png&w=128&q=75"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
tooltip: "Water/Fluid",
|
|
174
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2FDVhDIm6KqB.png&w=128&q=75"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
tooltip: "Flower/Beauty",
|
|
178
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2FUnpCfhHsUa.png&w=128&q=75"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
tooltip: "Leaf/Nature",
|
|
182
|
+
url: "https://text2ikon.komunikon.com/_next/image?url=https%3A%2F%2Fikondb.komunikon.com%2Fuploads%2Fimages%2Ficons%2F5Ex6my6BI7.png&w=128&q=75"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
tenses: [
|
|
186
|
+
{
|
|
187
|
+
tooltip: "adas",
|
|
188
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_adas.svg"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
tooltip: "adis",
|
|
192
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_adis.svg"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
tooltip: "ados",
|
|
196
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ados.svg"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
tooltip: "antas",
|
|
200
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_antas.svg"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
tooltip: "antis",
|
|
204
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_antis.svg"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
tooltip: "antos",
|
|
208
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_antos.svg"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
tooltip: "as",
|
|
212
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_as.svg"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
tooltip: "intas",
|
|
216
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_intas.svg"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
tooltip: "intis",
|
|
220
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_intis.svg"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
tooltip: "intis2",
|
|
224
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_intis2.svg"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
tooltip: "intos",
|
|
228
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_intos.svg"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
tooltip: "intos2",
|
|
232
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_intos2.svg"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
tooltip: "is",
|
|
236
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_is.svg"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
tooltip: "ontas",
|
|
240
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ontas.svg"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
tooltip: "ontis",
|
|
244
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ontis.svg"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
tooltip: "ontis2",
|
|
248
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ontis2.svg"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
tooltip: "ontos",
|
|
252
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ontos.svg"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
tooltip: "ontos2",
|
|
256
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_ontos2.svg"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
tooltip: "os",
|
|
260
|
+
url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_os.svg"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
}, W = [
|
|
264
|
+
{ id: "name", label: "Name", color: "#60a5fa", plural: !1 },
|
|
265
|
+
{ id: "verb", label: "Verb", color: "#f87171", plural: !1 },
|
|
266
|
+
{ id: "adjective", label: "Adjective", color: "#4ade80", plural: !1 },
|
|
267
|
+
{ id: "adverb", label: "Adverb", color: "#fb923c", plural: !1 },
|
|
268
|
+
{ id: "conjunction", label: "Conjunction", color: "#a78bfa", plural: !1 },
|
|
269
|
+
{ id: "neutral", label: "Neutral", color: "#94a3b8", plural: !1 },
|
|
270
|
+
{ id: "name_plural", label: "Name (plural)", color: "#60a5fa", plural: !0 },
|
|
271
|
+
{ id: "verb_plural", label: "Verb (plural)", color: "#f87171", plural: !0 },
|
|
272
|
+
{ id: "adjective_plural", label: "Adjective (plural)", color: "#4ade80", plural: !0 },
|
|
273
|
+
{ id: "adverb_plural", label: "Adverb (plural)", color: "#fb923c", plural: !0 },
|
|
274
|
+
{ id: "conjunction_plural", label: "Conjunction (plural)", color: "#a78bfa", plural: !0 },
|
|
275
|
+
{ id: "neutral_plural", label: "Neutral (plural)", color: "#94a3b8", plural: !0 }
|
|
276
|
+
], Se = W.map((e) => e.id), Ne = new Set(Se);
|
|
277
|
+
function Te(e) {
|
|
278
|
+
return W.find((o) => o.id === e) ?? null;
|
|
279
|
+
}
|
|
280
|
+
function C(e, o) {
|
|
281
|
+
var l;
|
|
282
|
+
return (l = h[e]) == null ? void 0 : l.find((r) => r.url === o);
|
|
283
|
+
}
|
|
284
|
+
function Qe(e, o) {
|
|
285
|
+
var l, r;
|
|
286
|
+
return (r = (l = h[e]) == null ? void 0 : l[o]) == null ? void 0 : r.url;
|
|
287
|
+
}
|
|
288
|
+
function K(e) {
|
|
289
|
+
return e == null ? null : typeof e == "object" && "url" in e ? e.url : e;
|
|
290
|
+
}
|
|
291
|
+
function Ke(e) {
|
|
292
|
+
return e == null ? null : typeof e == "object" ? e.svg || e.url || null : e;
|
|
293
|
+
}
|
|
294
|
+
function b(e) {
|
|
295
|
+
return { name: e.tooltip, url: e.url };
|
|
296
|
+
}
|
|
297
|
+
function re() {
|
|
298
|
+
return {
|
|
299
|
+
context: b(h.context[0]),
|
|
300
|
+
reference: {
|
|
301
|
+
left: null,
|
|
302
|
+
right: null
|
|
303
|
+
},
|
|
304
|
+
role: b(h.role[0]),
|
|
305
|
+
modes: b(h.modes[0]),
|
|
306
|
+
root: b(h.root[0]),
|
|
307
|
+
rootName: null,
|
|
308
|
+
tenses: b(h.tenses[0]),
|
|
309
|
+
border: null
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function $e(e) {
|
|
313
|
+
var k, N, T, _, y, m, S;
|
|
314
|
+
if (!e) return e;
|
|
315
|
+
const o = e.reference || { left: null, right: null }, l = typeof e.context == "string" ? C("context", e.context) : null, r = typeof e.role == "string" ? C("role", e.role) : null, i = typeof e.modes == "string" ? C("modes", e.modes) : null, p = typeof e.root == "string" ? C("root", e.root) : null, c = typeof e.tenses == "string" ? C("tenses", e.tenses) : null, I = e.border != null && Ne.has(e.border) ? e.border : null;
|
|
316
|
+
return {
|
|
317
|
+
...e,
|
|
318
|
+
context: typeof e.context == "object" && ((k = e.context) == null ? void 0 : k.url) != null ? e.context : l ? b(l) : { name: "", url: e.context || "" },
|
|
319
|
+
reference: {
|
|
320
|
+
left: o.left == null ? null : typeof o.left == "object" && ((N = o.left) == null ? void 0 : N.url) != null ? o.left : C("reference", o.left) ? b(C("reference", o.left)) : { name: "", url: o.left },
|
|
321
|
+
right: o.right == null ? null : typeof o.right == "object" && ((T = o.right) == null ? void 0 : T.url) != null ? o.right : C("reference", o.right) ? b(C("reference", o.right)) : { name: "", url: o.right }
|
|
322
|
+
},
|
|
323
|
+
role: typeof e.role == "object" && ((_ = e.role) == null ? void 0 : _.url) != null ? e.role : r ? b(r) : { name: "", url: e.role || "" },
|
|
324
|
+
modes: typeof e.modes == "object" && ((y = e.modes) == null ? void 0 : y.url) != null ? e.modes : i ? b(i) : { name: "", url: e.modes || "" },
|
|
325
|
+
root: typeof e.root == "object" && ((m = e.root) == null ? void 0 : m.url) != null ? { ...e.root, name: e.rootName ?? e.root.name } : p ? { name: e.rootName ?? p.tooltip, url: p.url } : { name: e.rootName ?? "", url: e.root || "" },
|
|
326
|
+
tenses: typeof e.tenses == "object" && ((S = e.tenses) == null ? void 0 : S.url) != null ? e.tenses : c ? b(c) : { name: "", url: e.tenses || "" },
|
|
327
|
+
border: I
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function Ye(e) {
|
|
331
|
+
return (e || []).map($e);
|
|
332
|
+
}
|
|
333
|
+
function Re(e) {
|
|
334
|
+
let o = 0;
|
|
335
|
+
for (let l = 0; l < e.length; l++) {
|
|
336
|
+
const r = e.charCodeAt(l);
|
|
337
|
+
o = (o << 5) - o + r, o = o & o;
|
|
338
|
+
}
|
|
339
|
+
return Math.abs(o);
|
|
340
|
+
}
|
|
341
|
+
class Ce {
|
|
342
|
+
constructor(o) {
|
|
343
|
+
this.seed = o;
|
|
344
|
+
}
|
|
345
|
+
next() {
|
|
346
|
+
const r = Math.pow(2, 32);
|
|
347
|
+
return this.seed = (1664525 * this.seed + 1013904223) % r, this.seed / r;
|
|
348
|
+
}
|
|
349
|
+
nextInt(o, l) {
|
|
350
|
+
return Math.floor(this.next() * (l - o)) + o;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function Je(e) {
|
|
354
|
+
const o = e.toLowerCase().split(/\s+/).filter(Boolean), l = [];
|
|
355
|
+
for (const r of o) {
|
|
356
|
+
const i = { ...re() }, p = Re(r), c = new Ce(p);
|
|
357
|
+
i.context = b(h.context[c.nextInt(0, h.context.length)]);
|
|
358
|
+
const I = c.next() > 0.5, k = c.nextInt(1, h.reference.length);
|
|
359
|
+
i.reference = {
|
|
360
|
+
left: I ? b(h.reference[0]) : null,
|
|
361
|
+
right: b(h.reference[k])
|
|
362
|
+
}, i.role = b(h.role[c.nextInt(0, h.role.length)]), i.modes = b(h.modes[c.nextInt(0, h.modes.length)]), i.root = b(h.root[c.nextInt(0, h.root.length)]), i.tenses = b(h.tenses[c.nextInt(0, h.tenses.length)]);
|
|
363
|
+
const N = W.filter((T) => !T.plural);
|
|
364
|
+
i.border = N[c.nextInt(0, N.length)].id, l.push(i);
|
|
365
|
+
}
|
|
366
|
+
return l.length > 0 ? l : [re()];
|
|
367
|
+
}
|
|
368
|
+
const q = {
|
|
369
|
+
maxWidth: "100%",
|
|
370
|
+
maxHeight: "100%",
|
|
371
|
+
width: "100%",
|
|
372
|
+
height: "100%",
|
|
373
|
+
objectFit: "contain",
|
|
374
|
+
display: "block",
|
|
375
|
+
boxSizing: "border-box"
|
|
376
|
+
}, ie = (e) => ({
|
|
377
|
+
display: "flex",
|
|
378
|
+
alignItems: "center",
|
|
379
|
+
justifyContent: "center",
|
|
380
|
+
minWidth: 0,
|
|
381
|
+
minHeight: 0,
|
|
382
|
+
overflow: "hidden",
|
|
383
|
+
boxSizing: "border-box",
|
|
384
|
+
padding: `${e}px`
|
|
385
|
+
});
|
|
386
|
+
function Me(e = 768) {
|
|
387
|
+
const [o, l] = F(
|
|
388
|
+
() => typeof window < "u" && window.innerWidth < e
|
|
389
|
+
);
|
|
390
|
+
return le(() => {
|
|
391
|
+
const r = window.matchMedia(`(max-width: ${e - 1}px)`), i = () => l(r.matches);
|
|
392
|
+
return r.addEventListener("change", i), () => r.removeEventListener("change", i);
|
|
393
|
+
}, [e]), o;
|
|
394
|
+
}
|
|
395
|
+
function P({
|
|
396
|
+
ikon: e,
|
|
397
|
+
onClick: o,
|
|
398
|
+
size: l = 64,
|
|
399
|
+
onZoneClick: r,
|
|
400
|
+
selectedZone: i,
|
|
401
|
+
isSelected: p = !1,
|
|
402
|
+
isPaired: c = !1,
|
|
403
|
+
onEdit: I,
|
|
404
|
+
onDelete: k,
|
|
405
|
+
hideActionOverlay: N = !1
|
|
406
|
+
}) {
|
|
407
|
+
var te, oe;
|
|
408
|
+
const [T, _] = F(!1), y = Me(), m = e != null && e.border ? Te(e.border) : null, S = (a, R) => {
|
|
409
|
+
r ? (R.stopPropagation(), r(a)) : o && o(R);
|
|
410
|
+
}, $ = (a) => {
|
|
411
|
+
r && (a.currentTarget.style.filter = "brightness(1.3)");
|
|
412
|
+
}, v = (a) => {
|
|
413
|
+
r && (a.currentTarget.style.filter = "brightness(1)");
|
|
414
|
+
}, M = (a, R) => {
|
|
415
|
+
const z = i === a;
|
|
416
|
+
return {
|
|
417
|
+
// A selected zone draws a 2px inset outline; border-box keeps that
|
|
418
|
+
// outline (and every zone's padding) inside the slot the grid gave it,
|
|
419
|
+
// so it can't nudge a neighbour or the card edge.
|
|
420
|
+
boxSizing: "border-box",
|
|
421
|
+
...R,
|
|
422
|
+
cursor: r || o ? "pointer" : "default",
|
|
423
|
+
transition: "all 0.2s, filter 0.2s",
|
|
424
|
+
border: z ? "2px solid var(--ikoneme-primary)" : R.border || "none",
|
|
425
|
+
boxShadow: z ? "0 0 8px var(--ikoneme-primary)" : "none",
|
|
426
|
+
position: "relative"
|
|
427
|
+
};
|
|
428
|
+
}, E = (a, R) => {
|
|
429
|
+
const z = Ke(R);
|
|
430
|
+
if (!z) return null;
|
|
431
|
+
const V = C(a, K(R)), ge = R && typeof R == "object" && R.name || (V == null ? void 0 : V.tooltip) || a;
|
|
432
|
+
return /* @__PURE__ */ n(
|
|
433
|
+
"img",
|
|
434
|
+
{
|
|
435
|
+
src: z,
|
|
436
|
+
alt: ge,
|
|
437
|
+
style: q,
|
|
438
|
+
onError: (he) => {
|
|
439
|
+
he.target.style.display = "none";
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
}, t = !N && !r && (I || k), s = y ? 28 : 24, u = 4, d = 3 * s + 2 * u, g = t ? d : l, x = y || T, w = g, O = Math.max(2, Math.round(w / 40)), se = Math.max(2, Math.round(w / 44)), j = Math.max(2, Math.round(w / 72)), ae = Math.max(2, Math.round(w / 40)), X = 1.18, Z = `minmax(0, ${X}fr) repeat(4, minmax(0, ${0.95}fr)) minmax(0, ${X}fr)`, ce = "minmax(0, 0.6fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 0.6fr)", de = m ? { border: `${O}px solid ${m.color}` } : {
|
|
444
|
+
border: p && !c ? "2px solid rgba(0, 168, 132, 0.8)" : "1px solid rgba(255, 255, 255, 0.1)"
|
|
445
|
+
}, Q = m != null && m.plural ? {
|
|
446
|
+
boxShadow: [
|
|
447
|
+
`inset -${O}px 0 0 ${m.color}`,
|
|
448
|
+
`inset -${O * 2}px 0 0 ${m.color}`,
|
|
449
|
+
`inset -${O * 3}px 0 0 ${m.color}`,
|
|
450
|
+
`inset 0 -${O}px 0 ${m.color}`,
|
|
451
|
+
`inset 0 -${O * 2}px 0 ${m.color}`,
|
|
452
|
+
`inset 0 -${O * 3}px 0 ${m.color}`
|
|
453
|
+
].join(", ")
|
|
454
|
+
} : {}, ue = p && !c ? "rgba(0, 168, 132, 0.15)" : "white", Y = m && !m.plural ? Q.boxShadow : null, J = [
|
|
455
|
+
p && !c ? "0 0 12px rgba(0, 168, 132, 0.4)" : null,
|
|
456
|
+
i === "border" ? "0 0 0 3px var(--ikoneme-primary)" : null,
|
|
457
|
+
Y
|
|
458
|
+
].filter(Boolean).join(", "), pe = ["0 0 10px rgba(0, 168, 132, 0.5)", Y].filter(Boolean).join(", "), ee = /* @__PURE__ */ f(U, { children: [
|
|
459
|
+
/* @__PURE__ */ f(
|
|
460
|
+
"div",
|
|
461
|
+
{
|
|
462
|
+
onClick: r ? () => r("border") : o ? (a) => o(a) : void 0,
|
|
463
|
+
style: {
|
|
464
|
+
width: `${w}px`,
|
|
465
|
+
height: `${w}px`,
|
|
466
|
+
// border-box: the coloured border is drawn *inside* renderSize, so a
|
|
467
|
+
// card always occupies exactly the box its parent reserved for it and
|
|
468
|
+
// the grid tracks are sized within `renderSize - 2*borderWidth`.
|
|
469
|
+
// With content-box the border sat outside and every card overflowed
|
|
470
|
+
// its slot by `borderWidth` on the right and bottom.
|
|
471
|
+
boxSizing: "border-box",
|
|
472
|
+
display: "grid",
|
|
473
|
+
// Inset ring so the slot layout never sits flush against the border.
|
|
474
|
+
padding: `${se}px`,
|
|
475
|
+
// See `edgeFr`/`midFr` above. `minmax(0, …fr)` on every track is what
|
|
476
|
+
// stops a large-intrinsic icon from inflating its track and shoving
|
|
477
|
+
// the neighbouring slots (and the whole layout) past the card border.
|
|
478
|
+
gridTemplateColumns: Z,
|
|
479
|
+
gridTemplateRows: Z,
|
|
480
|
+
cursor: o || r ? "pointer" : "default",
|
|
481
|
+
borderRadius: "4px",
|
|
482
|
+
// Absolute clip boundary: nothing rendered by any slot can be seen
|
|
483
|
+
// outside the card outline, whatever its content or the card size.
|
|
484
|
+
overflow: "hidden",
|
|
485
|
+
flexShrink: 0,
|
|
486
|
+
transition: "transform 0.2s, box-shadow 0.2s, border 0.2s",
|
|
487
|
+
background: ue,
|
|
488
|
+
boxShadow: J,
|
|
489
|
+
...de
|
|
490
|
+
},
|
|
491
|
+
onMouseEnter: (a) => {
|
|
492
|
+
o && !r && !c && (a.currentTarget.style.transform = "scale(1.05)", p || (a.currentTarget.style.boxShadow = pe));
|
|
493
|
+
},
|
|
494
|
+
onMouseLeave: (a) => {
|
|
495
|
+
o && !r && !c && (a.currentTarget.style.transform = "scale(1)", p || (a.currentTarget.style.boxShadow = J));
|
|
496
|
+
},
|
|
497
|
+
children: [
|
|
498
|
+
/* @__PURE__ */ n(
|
|
499
|
+
"div",
|
|
500
|
+
{
|
|
501
|
+
onClick: (a) => S("context", a),
|
|
502
|
+
onMouseEnter: $,
|
|
503
|
+
onMouseLeave: v,
|
|
504
|
+
style: M("context", {
|
|
505
|
+
gridColumn: "1 / 2",
|
|
506
|
+
gridRow: "1 / 2",
|
|
507
|
+
display: "flex",
|
|
508
|
+
alignItems: "center",
|
|
509
|
+
justifyContent: "center",
|
|
510
|
+
background: "rgba(100, 50, 150, 0.1)",
|
|
511
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)",
|
|
512
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
513
|
+
minWidth: 0,
|
|
514
|
+
minHeight: 0,
|
|
515
|
+
overflow: "hidden",
|
|
516
|
+
padding: `${j}px`
|
|
517
|
+
}),
|
|
518
|
+
className: "ikoneme-zone",
|
|
519
|
+
children: E("context", e.context)
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ f(
|
|
523
|
+
"div",
|
|
524
|
+
{
|
|
525
|
+
onClick: (a) => S("reference", a),
|
|
526
|
+
onMouseEnter: $,
|
|
527
|
+
onMouseLeave: v,
|
|
528
|
+
style: M("reference", {
|
|
529
|
+
gridColumn: "2 / 6",
|
|
530
|
+
gridRow: "1 / 2",
|
|
531
|
+
display: "grid",
|
|
532
|
+
// Same treatment as the outer grid: bounded tracks + a single full-
|
|
533
|
+
// height row so each reference sub-slot has a definite size and its
|
|
534
|
+
// icon (sized against it) stays put.
|
|
535
|
+
gridTemplateColumns: ce,
|
|
536
|
+
gridTemplateRows: "minmax(0, 1fr)",
|
|
537
|
+
background: "rgba(50, 100, 200, 0.1)",
|
|
538
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)",
|
|
539
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
540
|
+
minWidth: 0,
|
|
541
|
+
minHeight: 0,
|
|
542
|
+
overflow: "hidden"
|
|
543
|
+
}),
|
|
544
|
+
className: "ikoneme-zone",
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ n(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
style: {
|
|
550
|
+
minWidth: 0,
|
|
551
|
+
minHeight: 0,
|
|
552
|
+
overflow: "hidden",
|
|
553
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
/* @__PURE__ */ n(
|
|
558
|
+
"div",
|
|
559
|
+
{
|
|
560
|
+
style: {
|
|
561
|
+
...ie(j),
|
|
562
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)"
|
|
563
|
+
},
|
|
564
|
+
children: K((te = e.reference) == null ? void 0 : te.left) && /* @__PURE__ */ n(
|
|
565
|
+
"img",
|
|
566
|
+
{
|
|
567
|
+
src: K(e.reference.left),
|
|
568
|
+
alt: "Asterisk",
|
|
569
|
+
style: q,
|
|
570
|
+
onError: (a) => {
|
|
571
|
+
a.target.style.display = "none";
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
)
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
/* @__PURE__ */ n(
|
|
578
|
+
"div",
|
|
579
|
+
{
|
|
580
|
+
style: {
|
|
581
|
+
...ie(j),
|
|
582
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)"
|
|
583
|
+
},
|
|
584
|
+
children: K((oe = e.reference) == null ? void 0 : oe.right) && /* @__PURE__ */ n(
|
|
585
|
+
"img",
|
|
586
|
+
{
|
|
587
|
+
src: K(e.reference.right),
|
|
588
|
+
alt: "Number",
|
|
589
|
+
style: q,
|
|
590
|
+
onError: (a) => {
|
|
591
|
+
a.target.style.display = "none";
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
}
|
|
596
|
+
),
|
|
597
|
+
/* @__PURE__ */ n("div", { style: { minWidth: 0, minHeight: 0, overflow: "hidden" } })
|
|
598
|
+
]
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
/* @__PURE__ */ n(
|
|
602
|
+
"div",
|
|
603
|
+
{
|
|
604
|
+
onClick: (a) => S("role", a),
|
|
605
|
+
onMouseEnter: $,
|
|
606
|
+
onMouseLeave: v,
|
|
607
|
+
style: M("role", {
|
|
608
|
+
gridColumn: "6 / 7",
|
|
609
|
+
gridRow: "1 / 2",
|
|
610
|
+
display: "flex",
|
|
611
|
+
alignItems: "center",
|
|
612
|
+
justifyContent: "center",
|
|
613
|
+
background: "rgba(200, 50, 50, 0.1)",
|
|
614
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
615
|
+
minWidth: 0,
|
|
616
|
+
minHeight: 0,
|
|
617
|
+
overflow: "hidden",
|
|
618
|
+
padding: `${j}px`
|
|
619
|
+
}),
|
|
620
|
+
className: "ikoneme-zone",
|
|
621
|
+
children: E("role", e.role)
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ n(
|
|
625
|
+
"div",
|
|
626
|
+
{
|
|
627
|
+
onClick: (a) => S("modes", a),
|
|
628
|
+
onMouseEnter: $,
|
|
629
|
+
onMouseLeave: v,
|
|
630
|
+
style: M("modes", {
|
|
631
|
+
gridColumn: "1 / 2",
|
|
632
|
+
gridRow: "2 / 6",
|
|
633
|
+
display: "flex",
|
|
634
|
+
alignItems: "center",
|
|
635
|
+
justifyContent: "center",
|
|
636
|
+
background: "rgba(50, 150, 100, 0.1)",
|
|
637
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)",
|
|
638
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
639
|
+
minWidth: 0,
|
|
640
|
+
minHeight: 0,
|
|
641
|
+
overflow: "hidden",
|
|
642
|
+
padding: `${j}px`
|
|
643
|
+
}),
|
|
644
|
+
className: "ikoneme-zone",
|
|
645
|
+
children: E("modes", e.modes)
|
|
646
|
+
}
|
|
647
|
+
),
|
|
648
|
+
/* @__PURE__ */ n(
|
|
649
|
+
"div",
|
|
650
|
+
{
|
|
651
|
+
onClick: (a) => S("root", a),
|
|
652
|
+
onMouseEnter: $,
|
|
653
|
+
onMouseLeave: v,
|
|
654
|
+
style: M("root", {
|
|
655
|
+
// Kept at 4 columns (not spanning into column 6) so root — and the
|
|
656
|
+
// whole icon — stays horizontally centered: column 1 (modes) and
|
|
657
|
+
// column 6 (below) are the same width on both sides of root.
|
|
658
|
+
gridColumn: "2 / 6",
|
|
659
|
+
gridRow: "2 / 6",
|
|
660
|
+
display: "flex",
|
|
661
|
+
alignItems: "center",
|
|
662
|
+
justifyContent: "center",
|
|
663
|
+
background: "rgba(150, 150, 50, 0.1)",
|
|
664
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.14)",
|
|
665
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
666
|
+
minWidth: 0,
|
|
667
|
+
minHeight: 0,
|
|
668
|
+
overflow: "hidden",
|
|
669
|
+
padding: `${ae}px`
|
|
670
|
+
}),
|
|
671
|
+
className: "ikoneme-zone",
|
|
672
|
+
children: E("root", e.root)
|
|
673
|
+
}
|
|
674
|
+
),
|
|
675
|
+
/* @__PURE__ */ n(
|
|
676
|
+
"div",
|
|
677
|
+
{
|
|
678
|
+
onClick: (a) => {
|
|
679
|
+
r && (a.stopPropagation(), r("border"));
|
|
680
|
+
},
|
|
681
|
+
style: {
|
|
682
|
+
gridColumn: "6 / 7",
|
|
683
|
+
gridRow: "2 / 6",
|
|
684
|
+
background: "rgba(0, 0, 0, 0.05)",
|
|
685
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.14)",
|
|
686
|
+
minWidth: 0,
|
|
687
|
+
minHeight: 0,
|
|
688
|
+
overflow: "hidden",
|
|
689
|
+
boxSizing: "border-box",
|
|
690
|
+
cursor: r ? "pointer" : "default"
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ n(
|
|
695
|
+
"div",
|
|
696
|
+
{
|
|
697
|
+
onClick: (a) => S("tenses", a),
|
|
698
|
+
onMouseEnter: $,
|
|
699
|
+
onMouseLeave: v,
|
|
700
|
+
style: M("tenses", {
|
|
701
|
+
gridColumn: "1 / 7",
|
|
702
|
+
gridRow: "6 / 7",
|
|
703
|
+
display: "flex",
|
|
704
|
+
alignItems: "center",
|
|
705
|
+
justifyContent: "center",
|
|
706
|
+
background: "rgba(100, 100, 200, 0.1)",
|
|
707
|
+
minWidth: 0,
|
|
708
|
+
minHeight: 0,
|
|
709
|
+
overflow: "hidden",
|
|
710
|
+
padding: `${j}px`
|
|
711
|
+
}),
|
|
712
|
+
className: "ikoneme-zone",
|
|
713
|
+
children: E("tenses", e.tenses)
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
]
|
|
717
|
+
}
|
|
718
|
+
),
|
|
719
|
+
(m == null ? void 0 : m.plural) && /* @__PURE__ */ n(
|
|
720
|
+
"div",
|
|
721
|
+
{
|
|
722
|
+
"aria-hidden": !0,
|
|
723
|
+
style: {
|
|
724
|
+
position: "absolute",
|
|
725
|
+
top: 0,
|
|
726
|
+
left: 0,
|
|
727
|
+
right: 0,
|
|
728
|
+
bottom: 0,
|
|
729
|
+
width: `${w}px`,
|
|
730
|
+
height: `${w}px`,
|
|
731
|
+
borderRadius: "4px",
|
|
732
|
+
pointerEvents: "none",
|
|
733
|
+
...Q
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
)
|
|
737
|
+
] }), me = /* @__PURE__ */ n(
|
|
738
|
+
"div",
|
|
739
|
+
{
|
|
740
|
+
style: {
|
|
741
|
+
minHeight: `${s}px`,
|
|
742
|
+
flexShrink: 0,
|
|
743
|
+
display: "flex",
|
|
744
|
+
alignItems: "center",
|
|
745
|
+
justifyContent: "center"
|
|
746
|
+
},
|
|
747
|
+
"aria-hidden": !x,
|
|
748
|
+
children: /* @__PURE__ */ f(
|
|
749
|
+
"div",
|
|
750
|
+
{
|
|
751
|
+
style: {
|
|
752
|
+
display: "flex",
|
|
753
|
+
gap: `${u}px`,
|
|
754
|
+
flexWrap: "nowrap",
|
|
755
|
+
width: `${d}px`,
|
|
756
|
+
justifyContent: "center",
|
|
757
|
+
opacity: x ? 1 : 0,
|
|
758
|
+
pointerEvents: x ? "auto" : "none",
|
|
759
|
+
transition: "opacity 0.15s ease"
|
|
760
|
+
},
|
|
761
|
+
children: [
|
|
762
|
+
I && /* @__PURE__ */ n(
|
|
763
|
+
"button",
|
|
764
|
+
{
|
|
765
|
+
onClick: (a) => {
|
|
766
|
+
a.stopPropagation(), I();
|
|
767
|
+
},
|
|
768
|
+
style: {
|
|
769
|
+
width: `${s}px`,
|
|
770
|
+
height: `${s}px`,
|
|
771
|
+
borderRadius: "6px",
|
|
772
|
+
border: "none",
|
|
773
|
+
background: "rgba(0, 168, 132, 0.95)",
|
|
774
|
+
cursor: "pointer",
|
|
775
|
+
display: "flex",
|
|
776
|
+
alignItems: "center",
|
|
777
|
+
justifyContent: "center",
|
|
778
|
+
transition: "background 0.2s",
|
|
779
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.3)"
|
|
780
|
+
},
|
|
781
|
+
onMouseEnter: (a) => a.currentTarget.style.background = "rgba(0, 168, 132, 1)",
|
|
782
|
+
onMouseLeave: (a) => a.currentTarget.style.background = "rgba(0, 168, 132, 0.95)",
|
|
783
|
+
title: "Edit",
|
|
784
|
+
children: /* @__PURE__ */ n(ve, { size: y ? 16 : 14, color: "white" })
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
k && /* @__PURE__ */ n(
|
|
788
|
+
"button",
|
|
789
|
+
{
|
|
790
|
+
onClick: (a) => {
|
|
791
|
+
a.stopPropagation(), k();
|
|
792
|
+
},
|
|
793
|
+
style: {
|
|
794
|
+
width: `${s}px`,
|
|
795
|
+
height: `${s}px`,
|
|
796
|
+
borderRadius: "6px",
|
|
797
|
+
border: "none",
|
|
798
|
+
background: "rgba(220, 38, 38, 0.95)",
|
|
799
|
+
cursor: "pointer",
|
|
800
|
+
display: "flex",
|
|
801
|
+
alignItems: "center",
|
|
802
|
+
justifyContent: "center",
|
|
803
|
+
transition: "background 0.2s",
|
|
804
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.3)"
|
|
805
|
+
},
|
|
806
|
+
onMouseEnter: (a) => a.currentTarget.style.background = "rgba(220, 38, 38, 1)",
|
|
807
|
+
onMouseLeave: (a) => a.currentTarget.style.background = "rgba(220, 38, 38, 0.95)",
|
|
808
|
+
title: "Delete",
|
|
809
|
+
children: /* @__PURE__ */ n(Ie, { size: y ? 16 : 14, color: "white" })
|
|
810
|
+
}
|
|
811
|
+
)
|
|
812
|
+
]
|
|
813
|
+
}
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
return t ? /* @__PURE__ */ f(
|
|
818
|
+
"div",
|
|
819
|
+
{
|
|
820
|
+
style: {
|
|
821
|
+
display: "flex",
|
|
822
|
+
flexDirection: "column",
|
|
823
|
+
alignItems: "center",
|
|
824
|
+
width: `${d}px`,
|
|
825
|
+
flexShrink: 0,
|
|
826
|
+
gap: "6px"
|
|
827
|
+
},
|
|
828
|
+
onMouseEnter: () => _(!0),
|
|
829
|
+
onMouseLeave: () => _(!1),
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ n("div", { style: { position: "relative", width: `${w}px`, height: `${w}px` }, children: ee }),
|
|
832
|
+
me
|
|
833
|
+
]
|
|
834
|
+
}
|
|
835
|
+
) : /* @__PURE__ */ n(
|
|
836
|
+
"div",
|
|
837
|
+
{
|
|
838
|
+
style: {
|
|
839
|
+
position: "relative",
|
|
840
|
+
width: `${l}px`,
|
|
841
|
+
height: `${l}px`,
|
|
842
|
+
flexShrink: 0
|
|
843
|
+
},
|
|
844
|
+
onMouseEnter: () => _(!0),
|
|
845
|
+
onMouseLeave: () => _(!1),
|
|
846
|
+
children: ee
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
const G = "https://ikondb.iigap.com", Fe = 60 * 60 * 1e3;
|
|
851
|
+
let L = null, B = null;
|
|
852
|
+
const A = /* @__PURE__ */ new Map();
|
|
853
|
+
function Ee(e) {
|
|
854
|
+
return !e || Array.isArray(e) ? null : e.origin || e.preview || e.thumb || e.svg || null;
|
|
855
|
+
}
|
|
856
|
+
function Oe(e) {
|
|
857
|
+
if (!e || Array.isArray(e)) return {};
|
|
858
|
+
const { origin: o = null, preview: l = null, thumb: r = null, svg: i = null } = e;
|
|
859
|
+
return { origin: o, preview: l, thumb: r, svg: i };
|
|
860
|
+
}
|
|
861
|
+
async function je(e) {
|
|
862
|
+
const o = await fetch(`${e}/api/ikons`);
|
|
863
|
+
if (!o.ok) throw new Error(`IkonDB GET /api/ikons -> ${o.status}`);
|
|
864
|
+
const l = await o.json();
|
|
865
|
+
return (Array.isArray(l == null ? void 0 : l.data) ? l.data : []).map((i) => ({
|
|
866
|
+
id: i.id,
|
|
867
|
+
name: i.description || "",
|
|
868
|
+
url: Ee(i.media)
|
|
869
|
+
})).filter((i) => i.url);
|
|
870
|
+
}
|
|
871
|
+
async function Be({ baseUrl: e = G } = {}) {
|
|
872
|
+
return L && Date.now() - L.at < Fe ? L.list : B || (B = je(e).then((o) => (L = { at: Date.now(), list: o }, o)).finally(() => {
|
|
873
|
+
B = null;
|
|
874
|
+
}), B);
|
|
875
|
+
}
|
|
876
|
+
async function ze(e, { baseUrl: o = G, limit: l = 20 } = {}) {
|
|
877
|
+
const r = (e || "").trim().toLowerCase();
|
|
878
|
+
if (!r) return [];
|
|
879
|
+
const i = await Be({ baseUrl: o }), p = [];
|
|
880
|
+
for (const c of i)
|
|
881
|
+
if (c.name.toLowerCase().includes(r) && (p.push(c), p.length >= l))
|
|
882
|
+
break;
|
|
883
|
+
return p;
|
|
884
|
+
}
|
|
885
|
+
async function Le(e, { baseUrl: o = G } = {}) {
|
|
886
|
+
if (e == null) return null;
|
|
887
|
+
if (A.has(e)) return A.get(e);
|
|
888
|
+
const l = await fetch(`${o}/api/ikons/${encodeURIComponent(e)}`);
|
|
889
|
+
if (!l.ok) throw new Error(`IkonDB GET /api/ikons/${e} -> ${l.status}`);
|
|
890
|
+
const r = await l.json();
|
|
891
|
+
if ((r == null ? void 0 : r.status) !== "success" || !(r != null && r.data))
|
|
892
|
+
return A.set(e, null), null;
|
|
893
|
+
const i = Oe(r.data.media), p = {
|
|
894
|
+
id: r.data.id,
|
|
895
|
+
name: r.data.description || "",
|
|
896
|
+
url: i.origin || i.preview || i.thumb || i.svg || null,
|
|
897
|
+
...i
|
|
898
|
+
};
|
|
899
|
+
return A.set(e, p), p;
|
|
900
|
+
}
|
|
901
|
+
async function Ae(e) {
|
|
902
|
+
try {
|
|
903
|
+
return await ze(e);
|
|
904
|
+
} catch {
|
|
905
|
+
return [];
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
function et() {
|
|
909
|
+
L = null, B = null, A.clear();
|
|
910
|
+
}
|
|
911
|
+
const D = {
|
|
912
|
+
context: { name: "Context", description: "Northwest - Contextual information" },
|
|
913
|
+
reference: { name: "Reference", description: "North - Reference point" },
|
|
914
|
+
role: { name: "Role", description: "Northeast - Role indicator" },
|
|
915
|
+
modes: { name: "Modes", description: "West - Mode settings" },
|
|
916
|
+
root: { name: "Root", description: "Center - Core meaning" },
|
|
917
|
+
tenses: { name: "Tenses", description: "South - Time/tense indicator" },
|
|
918
|
+
border: {
|
|
919
|
+
name: "Border",
|
|
920
|
+
description: "Grammatical category — singular (one border) or plural (stacked borders)"
|
|
921
|
+
}
|
|
922
|
+
}, We = 1, He = 300, De = 10, Ve = 5;
|
|
923
|
+
function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
|
|
924
|
+
const [i, p] = F({
|
|
925
|
+
...e,
|
|
926
|
+
reference: e.reference ? { ...e.reference } : { left: null, right: null },
|
|
927
|
+
rootName: e.rootName ?? null
|
|
928
|
+
}), [c, I] = F("root"), [k, N] = F(""), [T, _] = F([]), [y, m] = F(!1), S = (t, s) => {
|
|
929
|
+
const u = C(t === "reference" ? "reference" : t, s), d = u ? { name: u.tooltip, url: u.url } : { name: "", url: s };
|
|
930
|
+
if (t === "reference") {
|
|
931
|
+
const g = h.reference[0].url;
|
|
932
|
+
p(s === g ? (x) => {
|
|
933
|
+
var w;
|
|
934
|
+
return {
|
|
935
|
+
...x,
|
|
936
|
+
reference: {
|
|
937
|
+
...x.reference,
|
|
938
|
+
left: K((w = x.reference) == null ? void 0 : w.left) === g ? null : { name: h.reference[0].tooltip, url: g }
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
} : (x) => {
|
|
942
|
+
var w;
|
|
943
|
+
return {
|
|
944
|
+
...x,
|
|
945
|
+
reference: {
|
|
946
|
+
...x.reference,
|
|
947
|
+
right: K((w = x.reference) == null ? void 0 : w.right) === s ? null : d
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
});
|
|
951
|
+
} else
|
|
952
|
+
p((g) => ({
|
|
953
|
+
...g,
|
|
954
|
+
[t]: K(g[t]) === s ? null : d
|
|
955
|
+
}));
|
|
956
|
+
}, $ = (t) => {
|
|
957
|
+
I(t);
|
|
958
|
+
}, v = (t) => {
|
|
959
|
+
p((s) => ({
|
|
960
|
+
...s,
|
|
961
|
+
border: t == null || s.border === t ? null : t
|
|
962
|
+
}));
|
|
963
|
+
};
|
|
964
|
+
le(() => {
|
|
965
|
+
if (c !== "root" || k.length < We) {
|
|
966
|
+
_([]);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const t = setTimeout(async () => {
|
|
970
|
+
m(!0);
|
|
971
|
+
try {
|
|
972
|
+
const s = await r(k.trim());
|
|
973
|
+
_((s || []).slice(0, De));
|
|
974
|
+
} catch {
|
|
975
|
+
_([]);
|
|
976
|
+
} finally {
|
|
977
|
+
m(!1);
|
|
978
|
+
}
|
|
979
|
+
}, He);
|
|
980
|
+
return () => clearTimeout(t);
|
|
981
|
+
}, [c, k, r]);
|
|
982
|
+
const M = fe(async (t) => {
|
|
983
|
+
if (p((s) => ({
|
|
984
|
+
...s,
|
|
985
|
+
root: { id: t.id ?? null, name: t.name, url: t.url },
|
|
986
|
+
rootName: t.name
|
|
987
|
+
})), t.id != null)
|
|
988
|
+
try {
|
|
989
|
+
const s = await Le(t.id);
|
|
990
|
+
if (!s) return;
|
|
991
|
+
p((u) => {
|
|
992
|
+
var d;
|
|
993
|
+
return ((d = u.root) == null ? void 0 : d.id) !== t.id ? u : {
|
|
994
|
+
...u,
|
|
995
|
+
root: {
|
|
996
|
+
id: s.id,
|
|
997
|
+
name: t.name,
|
|
998
|
+
url: s.origin || t.url,
|
|
999
|
+
svg: s.svg || void 0,
|
|
1000
|
+
thumb: s.thumb || void 0,
|
|
1001
|
+
preview: s.preview || void 0
|
|
1002
|
+
},
|
|
1003
|
+
rootName: t.name
|
|
1004
|
+
};
|
|
1005
|
+
});
|
|
1006
|
+
} catch {
|
|
1007
|
+
}
|
|
1008
|
+
}, []);
|
|
1009
|
+
return /* @__PURE__ */ f(
|
|
1010
|
+
"div",
|
|
1011
|
+
{
|
|
1012
|
+
style: {
|
|
1013
|
+
position: "fixed",
|
|
1014
|
+
top: 0,
|
|
1015
|
+
left: 0,
|
|
1016
|
+
right: 0,
|
|
1017
|
+
bottom: 0,
|
|
1018
|
+
background: "var(--ikoneme-background)",
|
|
1019
|
+
display: "flex",
|
|
1020
|
+
flexDirection: "column",
|
|
1021
|
+
zIndex: 1e3,
|
|
1022
|
+
overflow: "hidden"
|
|
1023
|
+
},
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ f(
|
|
1026
|
+
"div",
|
|
1027
|
+
{
|
|
1028
|
+
style: {
|
|
1029
|
+
padding: "16px 20px",
|
|
1030
|
+
background: "var(--ikoneme-panel-bg)",
|
|
1031
|
+
display: "flex",
|
|
1032
|
+
alignItems: "center",
|
|
1033
|
+
justifyContent: "space-between",
|
|
1034
|
+
gap: "12px"
|
|
1035
|
+
},
|
|
1036
|
+
children: [
|
|
1037
|
+
/* @__PURE__ */ f(
|
|
1038
|
+
"div",
|
|
1039
|
+
{
|
|
1040
|
+
style: {
|
|
1041
|
+
display: "flex",
|
|
1042
|
+
alignItems: "center",
|
|
1043
|
+
gap: "12px",
|
|
1044
|
+
flex: 1
|
|
1045
|
+
},
|
|
1046
|
+
children: [
|
|
1047
|
+
/* @__PURE__ */ n(
|
|
1048
|
+
"button",
|
|
1049
|
+
{
|
|
1050
|
+
onClick: l,
|
|
1051
|
+
style: {
|
|
1052
|
+
background: "transparent",
|
|
1053
|
+
border: "none",
|
|
1054
|
+
cursor: "pointer",
|
|
1055
|
+
padding: "4px",
|
|
1056
|
+
display: "flex",
|
|
1057
|
+
alignItems: "center",
|
|
1058
|
+
justifyContent: "center"
|
|
1059
|
+
},
|
|
1060
|
+
title: "Back",
|
|
1061
|
+
children: /* @__PURE__ */ n(ye, { color: "var(--ikoneme-text-primary)", size: 24 })
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1064
|
+
/* @__PURE__ */ n(
|
|
1065
|
+
"h2",
|
|
1066
|
+
{
|
|
1067
|
+
style: {
|
|
1068
|
+
color: "var(--ikoneme-text-primary)",
|
|
1069
|
+
fontSize: "clamp(18px, 4vw, 20px)",
|
|
1070
|
+
fontWeight: "600",
|
|
1071
|
+
margin: 0
|
|
1072
|
+
},
|
|
1073
|
+
children: "Edit Ikon"
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
]
|
|
1077
|
+
}
|
|
1078
|
+
),
|
|
1079
|
+
/* @__PURE__ */ n(
|
|
1080
|
+
"button",
|
|
1081
|
+
{
|
|
1082
|
+
onClick: () => {
|
|
1083
|
+
o(i), l();
|
|
1084
|
+
},
|
|
1085
|
+
style: {
|
|
1086
|
+
padding: "10px 24px",
|
|
1087
|
+
background: "var(--ikoneme-primary)",
|
|
1088
|
+
border: "none",
|
|
1089
|
+
borderRadius: "8px",
|
|
1090
|
+
color: "white",
|
|
1091
|
+
cursor: "pointer",
|
|
1092
|
+
fontSize: "clamp(13px, 3vw, 14px)",
|
|
1093
|
+
fontWeight: "500",
|
|
1094
|
+
transition: "background 0.2s",
|
|
1095
|
+
whiteSpace: "nowrap"
|
|
1096
|
+
},
|
|
1097
|
+
onMouseEnter: (t) => t.currentTarget.style.background = "var(--ikoneme-primary-dark)",
|
|
1098
|
+
onMouseLeave: (t) => t.currentTarget.style.background = "var(--ikoneme-primary)",
|
|
1099
|
+
children: "Save"
|
|
1100
|
+
}
|
|
1101
|
+
)
|
|
1102
|
+
]
|
|
1103
|
+
}
|
|
1104
|
+
),
|
|
1105
|
+
/* @__PURE__ */ f(
|
|
1106
|
+
"div",
|
|
1107
|
+
{
|
|
1108
|
+
style: {
|
|
1109
|
+
flex: 1,
|
|
1110
|
+
overflowY: "auto",
|
|
1111
|
+
padding: "20px",
|
|
1112
|
+
maxWidth: "800px",
|
|
1113
|
+
width: "100%",
|
|
1114
|
+
margin: "0 auto",
|
|
1115
|
+
WebkitOverflowScrolling: "touch"
|
|
1116
|
+
},
|
|
1117
|
+
children: [
|
|
1118
|
+
/* @__PURE__ */ f(
|
|
1119
|
+
"div",
|
|
1120
|
+
{
|
|
1121
|
+
style: {
|
|
1122
|
+
display: "flex",
|
|
1123
|
+
flexDirection: "column",
|
|
1124
|
+
alignItems: "center",
|
|
1125
|
+
marginBottom: "24px",
|
|
1126
|
+
gap: "12px"
|
|
1127
|
+
},
|
|
1128
|
+
children: [
|
|
1129
|
+
/* @__PURE__ */ n(
|
|
1130
|
+
"p",
|
|
1131
|
+
{
|
|
1132
|
+
style: {
|
|
1133
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1134
|
+
fontSize: "clamp(12px, 3vw, 13px)",
|
|
1135
|
+
textAlign: "center"
|
|
1136
|
+
},
|
|
1137
|
+
children: "Click on a zone or the border area to edit it"
|
|
1138
|
+
}
|
|
1139
|
+
),
|
|
1140
|
+
/* @__PURE__ */ n(
|
|
1141
|
+
P,
|
|
1142
|
+
{
|
|
1143
|
+
ikon: i,
|
|
1144
|
+
size: 280,
|
|
1145
|
+
onZoneClick: $,
|
|
1146
|
+
selectedZone: c
|
|
1147
|
+
}
|
|
1148
|
+
),
|
|
1149
|
+
/* @__PURE__ */ n(
|
|
1150
|
+
"div",
|
|
1151
|
+
{
|
|
1152
|
+
style: {
|
|
1153
|
+
color: "var(--ikoneme-text-primary)",
|
|
1154
|
+
fontSize: "clamp(14px, 3.5vw, 16px)",
|
|
1155
|
+
fontWeight: "500",
|
|
1156
|
+
textAlign: "center",
|
|
1157
|
+
padding: "8px 16px",
|
|
1158
|
+
background: "var(--ikoneme-primary)",
|
|
1159
|
+
borderRadius: "20px"
|
|
1160
|
+
},
|
|
1161
|
+
children: D[c].name
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
]
|
|
1165
|
+
}
|
|
1166
|
+
),
|
|
1167
|
+
/* @__PURE__ */ f("div", { style: { marginBottom: "20px" }, children: [
|
|
1168
|
+
/* @__PURE__ */ n(
|
|
1169
|
+
"h3",
|
|
1170
|
+
{
|
|
1171
|
+
style: {
|
|
1172
|
+
color: "var(--ikoneme-text-primary)",
|
|
1173
|
+
fontSize: "clamp(14px, 3.5vw, 16px)",
|
|
1174
|
+
marginBottom: "8px",
|
|
1175
|
+
fontWeight: "500"
|
|
1176
|
+
},
|
|
1177
|
+
children: c === "border" ? "Select Border Type" : "Choose Icon for: " + D[c].name
|
|
1178
|
+
}
|
|
1179
|
+
),
|
|
1180
|
+
c === "border" ? /* @__PURE__ */ f(
|
|
1181
|
+
"p",
|
|
1182
|
+
{
|
|
1183
|
+
style: {
|
|
1184
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1185
|
+
fontSize: "clamp(11px, 2.5vw, 12px)",
|
|
1186
|
+
marginBottom: "12px"
|
|
1187
|
+
},
|
|
1188
|
+
children: [
|
|
1189
|
+
D.border.description,
|
|
1190
|
+
". Click the same border again to clear."
|
|
1191
|
+
]
|
|
1192
|
+
}
|
|
1193
|
+
) : c === "reference" ? /* @__PURE__ */ f(
|
|
1194
|
+
"p",
|
|
1195
|
+
{
|
|
1196
|
+
style: {
|
|
1197
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1198
|
+
fontSize: "clamp(11px, 2.5vw, 12px)",
|
|
1199
|
+
marginBottom: "12px"
|
|
1200
|
+
},
|
|
1201
|
+
children: [
|
|
1202
|
+
"Click ",
|
|
1203
|
+
/* @__PURE__ */ n("strong", { children: "Asterisk" }),
|
|
1204
|
+
" to toggle left cell. Click any ",
|
|
1205
|
+
/* @__PURE__ */ n("strong", { children: "number" }),
|
|
1206
|
+
" ",
|
|
1207
|
+
"to toggle right cell."
|
|
1208
|
+
]
|
|
1209
|
+
}
|
|
1210
|
+
) : c === "root" ? /* @__PURE__ */ n(
|
|
1211
|
+
"p",
|
|
1212
|
+
{
|
|
1213
|
+
style: {
|
|
1214
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1215
|
+
fontSize: "clamp(11px, 2.5vw, 12px)",
|
|
1216
|
+
marginBottom: "12px"
|
|
1217
|
+
},
|
|
1218
|
+
children: "Search for an icon below. The icon's name is stored with the ikon."
|
|
1219
|
+
}
|
|
1220
|
+
) : /* @__PURE__ */ f(
|
|
1221
|
+
"p",
|
|
1222
|
+
{
|
|
1223
|
+
style: {
|
|
1224
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1225
|
+
fontSize: "clamp(11px, 2.5vw, 12px)",
|
|
1226
|
+
marginBottom: "12px"
|
|
1227
|
+
},
|
|
1228
|
+
children: [
|
|
1229
|
+
D[c].description,
|
|
1230
|
+
". Click the same icon again to clear."
|
|
1231
|
+
]
|
|
1232
|
+
}
|
|
1233
|
+
),
|
|
1234
|
+
c === "border" ? /* @__PURE__ */ f(U, { children: [
|
|
1235
|
+
/* @__PURE__ */ n("div", { style: { marginBottom: "12px" }, children: /* @__PURE__ */ n(
|
|
1236
|
+
"button",
|
|
1237
|
+
{
|
|
1238
|
+
onClick: () => v(null),
|
|
1239
|
+
style: {
|
|
1240
|
+
width: "100%",
|
|
1241
|
+
padding: "10px 14px",
|
|
1242
|
+
background: i.border == null ? "var(--ikoneme-primary)" : "var(--ikoneme-surface)",
|
|
1243
|
+
border: `2px solid ${i.border == null ? "var(--ikoneme-primary-dark)" : "var(--ikoneme-border)"}`,
|
|
1244
|
+
borderRadius: "8px",
|
|
1245
|
+
color: i.border == null ? "white" : "var(--ikoneme-text-primary)",
|
|
1246
|
+
fontSize: "14px",
|
|
1247
|
+
cursor: "pointer",
|
|
1248
|
+
textAlign: "left",
|
|
1249
|
+
fontWeight: i.border == null ? "600" : "400",
|
|
1250
|
+
transition: "all 0.2s"
|
|
1251
|
+
},
|
|
1252
|
+
children: "No border"
|
|
1253
|
+
}
|
|
1254
|
+
) }),
|
|
1255
|
+
/* @__PURE__ */ n("div", { style: { marginBottom: "8px" }, children: /* @__PURE__ */ n(
|
|
1256
|
+
"span",
|
|
1257
|
+
{
|
|
1258
|
+
style: {
|
|
1259
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1260
|
+
fontSize: "12px",
|
|
1261
|
+
fontWeight: "600"
|
|
1262
|
+
},
|
|
1263
|
+
children: "Singular"
|
|
1264
|
+
}
|
|
1265
|
+
) }),
|
|
1266
|
+
/* @__PURE__ */ n(
|
|
1267
|
+
"div",
|
|
1268
|
+
{
|
|
1269
|
+
style: {
|
|
1270
|
+
display: "grid",
|
|
1271
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
1272
|
+
gap: "10px",
|
|
1273
|
+
marginBottom: "16px"
|
|
1274
|
+
},
|
|
1275
|
+
children: W.filter((t) => !t.plural).map((t) => {
|
|
1276
|
+
const s = i.border === t.id;
|
|
1277
|
+
return /* @__PURE__ */ f(
|
|
1278
|
+
"button",
|
|
1279
|
+
{
|
|
1280
|
+
onClick: () => v(t.id),
|
|
1281
|
+
title: t.label,
|
|
1282
|
+
style: {
|
|
1283
|
+
padding: "8px",
|
|
1284
|
+
background: s ? "var(--ikoneme-primary)" : "var(--ikoneme-surface)",
|
|
1285
|
+
border: `2px solid ${s ? "var(--ikoneme-primary-dark)" : "var(--ikoneme-border)"}`,
|
|
1286
|
+
borderRadius: "8px",
|
|
1287
|
+
cursor: "pointer",
|
|
1288
|
+
display: "flex",
|
|
1289
|
+
flexDirection: "column",
|
|
1290
|
+
alignItems: "center",
|
|
1291
|
+
gap: "6px",
|
|
1292
|
+
transition: "all 0.2s",
|
|
1293
|
+
position: "relative"
|
|
1294
|
+
},
|
|
1295
|
+
onMouseEnter: (d) => {
|
|
1296
|
+
s || (d.currentTarget.style.background = "var(--ikoneme-hover)");
|
|
1297
|
+
},
|
|
1298
|
+
onMouseLeave: (d) => {
|
|
1299
|
+
s || (d.currentTarget.style.background = "var(--ikoneme-surface)");
|
|
1300
|
+
},
|
|
1301
|
+
children: [
|
|
1302
|
+
/* @__PURE__ */ n(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
style: {
|
|
1306
|
+
border: `5px solid ${t.color}`,
|
|
1307
|
+
borderRadius: "4px",
|
|
1308
|
+
width: "64px",
|
|
1309
|
+
height: "64px",
|
|
1310
|
+
flexShrink: 0
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
),
|
|
1314
|
+
/* @__PURE__ */ n(
|
|
1315
|
+
"span",
|
|
1316
|
+
{
|
|
1317
|
+
style: {
|
|
1318
|
+
fontSize: "11px",
|
|
1319
|
+
color: s ? "white" : "var(--ikoneme-text-primary)",
|
|
1320
|
+
fontWeight: s ? "600" : "400"
|
|
1321
|
+
},
|
|
1322
|
+
children: t.label
|
|
1323
|
+
}
|
|
1324
|
+
),
|
|
1325
|
+
/* @__PURE__ */ n(
|
|
1326
|
+
"div",
|
|
1327
|
+
{
|
|
1328
|
+
className: "ikon-tooltip",
|
|
1329
|
+
style: {
|
|
1330
|
+
position: "absolute",
|
|
1331
|
+
bottom: "100%",
|
|
1332
|
+
left: "50%",
|
|
1333
|
+
transform: "translateX(-50%)",
|
|
1334
|
+
background: "rgba(0,0,0,0.95)",
|
|
1335
|
+
color: "white",
|
|
1336
|
+
padding: "6px 10px",
|
|
1337
|
+
borderRadius: "6px",
|
|
1338
|
+
fontSize: "11px",
|
|
1339
|
+
whiteSpace: "nowrap",
|
|
1340
|
+
opacity: 0,
|
|
1341
|
+
pointerEvents: "none",
|
|
1342
|
+
transition: "opacity 0.2s",
|
|
1343
|
+
marginBottom: "8px",
|
|
1344
|
+
zIndex: 100
|
|
1345
|
+
},
|
|
1346
|
+
children: t.label
|
|
1347
|
+
}
|
|
1348
|
+
)
|
|
1349
|
+
]
|
|
1350
|
+
},
|
|
1351
|
+
t.id
|
|
1352
|
+
);
|
|
1353
|
+
})
|
|
1354
|
+
}
|
|
1355
|
+
),
|
|
1356
|
+
/* @__PURE__ */ n("div", { style: { marginBottom: "8px" }, children: /* @__PURE__ */ n(
|
|
1357
|
+
"span",
|
|
1358
|
+
{
|
|
1359
|
+
style: {
|
|
1360
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1361
|
+
fontSize: "12px",
|
|
1362
|
+
fontWeight: "600"
|
|
1363
|
+
},
|
|
1364
|
+
children: "Plural"
|
|
1365
|
+
}
|
|
1366
|
+
) }),
|
|
1367
|
+
/* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "10px" }, children: W.filter((t) => t.plural).map((t) => {
|
|
1368
|
+
const s = i.border === t.id, u = 5, d = {
|
|
1369
|
+
boxShadow: [
|
|
1370
|
+
`inset -${u}px 0 0 ${t.color}`,
|
|
1371
|
+
`inset -${u * 2}px 0 0 ${t.color}`,
|
|
1372
|
+
`inset -${u * 3}px 0 0 ${t.color}`,
|
|
1373
|
+
`inset 0 -${u}px 0 ${t.color}`,
|
|
1374
|
+
`inset 0 -${u * 2}px 0 ${t.color}`,
|
|
1375
|
+
`inset 0 -${u * 3}px 0 ${t.color}`
|
|
1376
|
+
].join(", ")
|
|
1377
|
+
};
|
|
1378
|
+
return /* @__PURE__ */ f(
|
|
1379
|
+
"button",
|
|
1380
|
+
{
|
|
1381
|
+
onClick: () => v(t.id),
|
|
1382
|
+
title: t.label,
|
|
1383
|
+
style: {
|
|
1384
|
+
padding: "8px",
|
|
1385
|
+
background: s ? "var(--ikoneme-primary)" : "var(--ikoneme-surface)",
|
|
1386
|
+
border: `2px solid ${s ? "var(--ikoneme-primary-dark)" : "var(--ikoneme-border)"}`,
|
|
1387
|
+
borderRadius: "8px",
|
|
1388
|
+
cursor: "pointer",
|
|
1389
|
+
display: "flex",
|
|
1390
|
+
flexDirection: "column",
|
|
1391
|
+
alignItems: "center",
|
|
1392
|
+
gap: "6px",
|
|
1393
|
+
transition: "all 0.2s",
|
|
1394
|
+
position: "relative"
|
|
1395
|
+
},
|
|
1396
|
+
onMouseEnter: (g) => {
|
|
1397
|
+
s || (g.currentTarget.style.background = "var(--ikoneme-hover)");
|
|
1398
|
+
},
|
|
1399
|
+
onMouseLeave: (g) => {
|
|
1400
|
+
s || (g.currentTarget.style.background = "var(--ikoneme-surface)");
|
|
1401
|
+
},
|
|
1402
|
+
children: [
|
|
1403
|
+
/* @__PURE__ */ n(
|
|
1404
|
+
"div",
|
|
1405
|
+
{
|
|
1406
|
+
style: {
|
|
1407
|
+
border: `${u}px solid ${t.color}`,
|
|
1408
|
+
borderRadius: "4px",
|
|
1409
|
+
width: "64px",
|
|
1410
|
+
height: "64px",
|
|
1411
|
+
flexShrink: 0,
|
|
1412
|
+
...d
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
),
|
|
1416
|
+
/* @__PURE__ */ n(
|
|
1417
|
+
"span",
|
|
1418
|
+
{
|
|
1419
|
+
style: {
|
|
1420
|
+
fontSize: "11px",
|
|
1421
|
+
color: s ? "white" : "var(--ikoneme-text-primary)",
|
|
1422
|
+
fontWeight: s ? "600" : "400"
|
|
1423
|
+
},
|
|
1424
|
+
children: t.label
|
|
1425
|
+
}
|
|
1426
|
+
),
|
|
1427
|
+
/* @__PURE__ */ n(
|
|
1428
|
+
"div",
|
|
1429
|
+
{
|
|
1430
|
+
className: "ikon-tooltip",
|
|
1431
|
+
style: {
|
|
1432
|
+
position: "absolute",
|
|
1433
|
+
bottom: "100%",
|
|
1434
|
+
left: "50%",
|
|
1435
|
+
transform: "translateX(-50%)",
|
|
1436
|
+
background: "rgba(0,0,0,0.95)",
|
|
1437
|
+
color: "white",
|
|
1438
|
+
padding: "6px 10px",
|
|
1439
|
+
borderRadius: "6px",
|
|
1440
|
+
fontSize: "11px",
|
|
1441
|
+
whiteSpace: "nowrap",
|
|
1442
|
+
opacity: 0,
|
|
1443
|
+
pointerEvents: "none",
|
|
1444
|
+
transition: "opacity 0.2s",
|
|
1445
|
+
marginBottom: "8px",
|
|
1446
|
+
zIndex: 100
|
|
1447
|
+
},
|
|
1448
|
+
children: t.label
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
]
|
|
1452
|
+
},
|
|
1453
|
+
t.id
|
|
1454
|
+
);
|
|
1455
|
+
}) })
|
|
1456
|
+
] }) : c === "root" ? /* @__PURE__ */ f(U, { children: [
|
|
1457
|
+
/* @__PURE__ */ f(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
style: {
|
|
1461
|
+
display: "flex",
|
|
1462
|
+
alignItems: "center",
|
|
1463
|
+
gap: "8px",
|
|
1464
|
+
marginBottom: "16px",
|
|
1465
|
+
padding: "10px 12px",
|
|
1466
|
+
background: "var(--ikoneme-surface)",
|
|
1467
|
+
borderRadius: "8px",
|
|
1468
|
+
border: "1px solid var(--ikoneme-border)"
|
|
1469
|
+
},
|
|
1470
|
+
children: [
|
|
1471
|
+
/* @__PURE__ */ n(we, { size: 18, color: "var(--ikoneme-text-secondary)" }),
|
|
1472
|
+
/* @__PURE__ */ n(
|
|
1473
|
+
"input",
|
|
1474
|
+
{
|
|
1475
|
+
type: "text",
|
|
1476
|
+
value: k,
|
|
1477
|
+
onChange: (t) => N(t.target.value),
|
|
1478
|
+
placeholder: "Search icons...",
|
|
1479
|
+
style: {
|
|
1480
|
+
flex: 1,
|
|
1481
|
+
border: "none",
|
|
1482
|
+
background: "transparent",
|
|
1483
|
+
color: "var(--ikoneme-text-primary)",
|
|
1484
|
+
fontSize: "14px",
|
|
1485
|
+
outline: "none"
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
)
|
|
1489
|
+
]
|
|
1490
|
+
}
|
|
1491
|
+
),
|
|
1492
|
+
y && /* @__PURE__ */ n(
|
|
1493
|
+
"p",
|
|
1494
|
+
{
|
|
1495
|
+
style: {
|
|
1496
|
+
color: "var(--ikoneme-text-secondary)",
|
|
1497
|
+
fontSize: "13px",
|
|
1498
|
+
marginBottom: "12px"
|
|
1499
|
+
},
|
|
1500
|
+
children: "Searching…"
|
|
1501
|
+
}
|
|
1502
|
+
),
|
|
1503
|
+
/* @__PURE__ */ n(
|
|
1504
|
+
"div",
|
|
1505
|
+
{
|
|
1506
|
+
style: {
|
|
1507
|
+
display: "grid",
|
|
1508
|
+
gridTemplateColumns: `repeat(${Ve}, 1fr)`,
|
|
1509
|
+
gap: "10px"
|
|
1510
|
+
},
|
|
1511
|
+
children: T.map((t, s) => {
|
|
1512
|
+
const u = K(i.root) === t.url;
|
|
1513
|
+
return /* @__PURE__ */ f(
|
|
1514
|
+
"button",
|
|
1515
|
+
{
|
|
1516
|
+
onClick: () => M(t),
|
|
1517
|
+
title: t.name,
|
|
1518
|
+
style: {
|
|
1519
|
+
padding: "12px",
|
|
1520
|
+
background: u ? "var(--ikoneme-primary)" : "var(--ikoneme-surface)",
|
|
1521
|
+
border: "2px solid",
|
|
1522
|
+
borderColor: u ? "var(--ikoneme-primary-dark)" : "var(--ikoneme-border)",
|
|
1523
|
+
borderRadius: "8px",
|
|
1524
|
+
cursor: "pointer",
|
|
1525
|
+
transition: "all 0.2s",
|
|
1526
|
+
display: "flex",
|
|
1527
|
+
flexDirection: "column",
|
|
1528
|
+
alignItems: "center",
|
|
1529
|
+
justifyContent: "center",
|
|
1530
|
+
aspectRatio: "1",
|
|
1531
|
+
position: "relative",
|
|
1532
|
+
minHeight: "70px",
|
|
1533
|
+
minWidth: "70px"
|
|
1534
|
+
},
|
|
1535
|
+
onMouseEnter: (d) => {
|
|
1536
|
+
d.currentTarget.style.transform = "scale(1.05)", u || (d.currentTarget.style.background = "var(--ikoneme-hover)");
|
|
1537
|
+
},
|
|
1538
|
+
onMouseLeave: (d) => {
|
|
1539
|
+
d.currentTarget.style.transform = "scale(1)", u || (d.currentTarget.style.background = "var(--ikoneme-surface)");
|
|
1540
|
+
},
|
|
1541
|
+
children: [
|
|
1542
|
+
/* @__PURE__ */ n(
|
|
1543
|
+
"div",
|
|
1544
|
+
{
|
|
1545
|
+
style: {
|
|
1546
|
+
width: "100%",
|
|
1547
|
+
height: "100%",
|
|
1548
|
+
background: "white",
|
|
1549
|
+
borderRadius: "4px",
|
|
1550
|
+
display: "flex",
|
|
1551
|
+
alignItems: "center",
|
|
1552
|
+
justifyContent: "center",
|
|
1553
|
+
padding: "4px"
|
|
1554
|
+
},
|
|
1555
|
+
children: /* @__PURE__ */ n(
|
|
1556
|
+
"img",
|
|
1557
|
+
{
|
|
1558
|
+
src: t.url,
|
|
1559
|
+
alt: t.name,
|
|
1560
|
+
style: {
|
|
1561
|
+
maxWidth: "100%",
|
|
1562
|
+
maxHeight: "100%",
|
|
1563
|
+
width: "100%",
|
|
1564
|
+
height: "100%",
|
|
1565
|
+
objectFit: "contain"
|
|
1566
|
+
},
|
|
1567
|
+
onError: (d) => {
|
|
1568
|
+
d.target.style.display = "none";
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
)
|
|
1572
|
+
}
|
|
1573
|
+
),
|
|
1574
|
+
/* @__PURE__ */ n(
|
|
1575
|
+
"div",
|
|
1576
|
+
{
|
|
1577
|
+
className: "ikon-tooltip",
|
|
1578
|
+
style: {
|
|
1579
|
+
position: "absolute",
|
|
1580
|
+
bottom: "100%",
|
|
1581
|
+
left: "50%",
|
|
1582
|
+
transform: "translateX(-50%)",
|
|
1583
|
+
background: "rgba(0, 0, 0, 0.95)",
|
|
1584
|
+
color: "white",
|
|
1585
|
+
padding: "6px 10px",
|
|
1586
|
+
borderRadius: "6px",
|
|
1587
|
+
fontSize: "11px",
|
|
1588
|
+
whiteSpace: "nowrap",
|
|
1589
|
+
opacity: 0,
|
|
1590
|
+
pointerEvents: "none",
|
|
1591
|
+
transition: "opacity 0.2s",
|
|
1592
|
+
marginBottom: "8px",
|
|
1593
|
+
zIndex: 100
|
|
1594
|
+
},
|
|
1595
|
+
children: t.name
|
|
1596
|
+
}
|
|
1597
|
+
)
|
|
1598
|
+
]
|
|
1599
|
+
},
|
|
1600
|
+
`${t.url}-${s}`
|
|
1601
|
+
);
|
|
1602
|
+
})
|
|
1603
|
+
}
|
|
1604
|
+
)
|
|
1605
|
+
] }) : /* @__PURE__ */ n(
|
|
1606
|
+
"div",
|
|
1607
|
+
{
|
|
1608
|
+
style: {
|
|
1609
|
+
display: "grid",
|
|
1610
|
+
gridTemplateColumns: h[c].length <= 3 ? "repeat(3, 1fr)" : "repeat(auto-fit, minmax(90px, 1fr))",
|
|
1611
|
+
gap: "10px"
|
|
1612
|
+
},
|
|
1613
|
+
children: h[c].map((t, s) => {
|
|
1614
|
+
var d, g;
|
|
1615
|
+
let u = !1;
|
|
1616
|
+
if (c === "reference") {
|
|
1617
|
+
const x = h.reference[0].url;
|
|
1618
|
+
t.url === x ? u = K((d = i.reference) == null ? void 0 : d.left) === x : u = K((g = i.reference) == null ? void 0 : g.right) === t.url;
|
|
1619
|
+
} else
|
|
1620
|
+
u = K(i[c]) === t.url;
|
|
1621
|
+
return /* @__PURE__ */ f(
|
|
1622
|
+
"button",
|
|
1623
|
+
{
|
|
1624
|
+
onClick: () => S(c, t.url),
|
|
1625
|
+
title: t.tooltip,
|
|
1626
|
+
style: {
|
|
1627
|
+
padding: "12px",
|
|
1628
|
+
background: u ? "var(--ikoneme-primary)" : "var(--ikoneme-surface)",
|
|
1629
|
+
border: "2px solid",
|
|
1630
|
+
borderColor: u ? "var(--ikoneme-primary-dark)" : "var(--ikoneme-border)",
|
|
1631
|
+
borderRadius: "8px",
|
|
1632
|
+
cursor: "pointer",
|
|
1633
|
+
transition: "all 0.2s",
|
|
1634
|
+
display: "flex",
|
|
1635
|
+
flexDirection: "column",
|
|
1636
|
+
alignItems: "center",
|
|
1637
|
+
justifyContent: "center",
|
|
1638
|
+
aspectRatio: "1",
|
|
1639
|
+
position: "relative",
|
|
1640
|
+
minHeight: "70px",
|
|
1641
|
+
minWidth: "70px"
|
|
1642
|
+
},
|
|
1643
|
+
onMouseEnter: (x) => {
|
|
1644
|
+
x.currentTarget.style.transform = "scale(1.05)", u || (x.currentTarget.style.background = "var(--ikoneme-hover)");
|
|
1645
|
+
},
|
|
1646
|
+
onMouseLeave: (x) => {
|
|
1647
|
+
x.currentTarget.style.transform = "scale(1)", u || (x.currentTarget.style.background = "var(--ikoneme-surface)");
|
|
1648
|
+
},
|
|
1649
|
+
children: [
|
|
1650
|
+
/* @__PURE__ */ n(
|
|
1651
|
+
"div",
|
|
1652
|
+
{
|
|
1653
|
+
style: {
|
|
1654
|
+
width: "100%",
|
|
1655
|
+
height: "100%",
|
|
1656
|
+
background: "white",
|
|
1657
|
+
borderRadius: "4px",
|
|
1658
|
+
display: "flex",
|
|
1659
|
+
alignItems: "center",
|
|
1660
|
+
justifyContent: "center",
|
|
1661
|
+
padding: "4px"
|
|
1662
|
+
},
|
|
1663
|
+
children: /* @__PURE__ */ n(
|
|
1664
|
+
"img",
|
|
1665
|
+
{
|
|
1666
|
+
src: t.url,
|
|
1667
|
+
alt: t.tooltip,
|
|
1668
|
+
style: {
|
|
1669
|
+
maxWidth: "100%",
|
|
1670
|
+
maxHeight: "100%",
|
|
1671
|
+
width: "100%",
|
|
1672
|
+
height: "100%",
|
|
1673
|
+
objectFit: "contain"
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
)
|
|
1677
|
+
}
|
|
1678
|
+
),
|
|
1679
|
+
/* @__PURE__ */ n(
|
|
1680
|
+
"div",
|
|
1681
|
+
{
|
|
1682
|
+
style: {
|
|
1683
|
+
position: "absolute",
|
|
1684
|
+
bottom: "100%",
|
|
1685
|
+
left: "50%",
|
|
1686
|
+
transform: "translateX(-50%)",
|
|
1687
|
+
background: "rgba(0, 0, 0, 0.95)",
|
|
1688
|
+
color: "white",
|
|
1689
|
+
padding: "6px 10px",
|
|
1690
|
+
borderRadius: "6px",
|
|
1691
|
+
fontSize: "11px",
|
|
1692
|
+
whiteSpace: "nowrap",
|
|
1693
|
+
opacity: 0,
|
|
1694
|
+
pointerEvents: "none",
|
|
1695
|
+
transition: "opacity 0.2s",
|
|
1696
|
+
marginBottom: "8px",
|
|
1697
|
+
zIndex: 100
|
|
1698
|
+
},
|
|
1699
|
+
className: "ikon-tooltip",
|
|
1700
|
+
children: t.tooltip
|
|
1701
|
+
}
|
|
1702
|
+
)
|
|
1703
|
+
]
|
|
1704
|
+
},
|
|
1705
|
+
s
|
|
1706
|
+
);
|
|
1707
|
+
})
|
|
1708
|
+
}
|
|
1709
|
+
)
|
|
1710
|
+
] }),
|
|
1711
|
+
/* @__PURE__ */ n("style", { children: `
|
|
1712
|
+
button:hover .ikon-tooltip {
|
|
1713
|
+
opacity: 1 !important;
|
|
1714
|
+
}
|
|
1715
|
+
` })
|
|
1716
|
+
]
|
|
1717
|
+
}
|
|
1718
|
+
)
|
|
1719
|
+
]
|
|
1720
|
+
}
|
|
1721
|
+
);
|
|
1722
|
+
}
|
|
1723
|
+
function Ue({ ikon: e, size: o = 320, onClose: l }) {
|
|
1724
|
+
const r = typeof window < "u" ? Math.max(120, Math.min(o, window.innerWidth - 48, window.innerHeight - 156)) : o;
|
|
1725
|
+
return /* @__PURE__ */ n(
|
|
1726
|
+
"div",
|
|
1727
|
+
{
|
|
1728
|
+
role: "dialog",
|
|
1729
|
+
"aria-modal": "true",
|
|
1730
|
+
"aria-label": "Zoomed ikon",
|
|
1731
|
+
onClick: l,
|
|
1732
|
+
style: {
|
|
1733
|
+
position: "fixed",
|
|
1734
|
+
inset: 0,
|
|
1735
|
+
background: "rgba(0, 0, 0, 0.75)",
|
|
1736
|
+
display: "flex",
|
|
1737
|
+
alignItems: "center",
|
|
1738
|
+
justifyContent: "center",
|
|
1739
|
+
zIndex: 1e3,
|
|
1740
|
+
padding: "24px"
|
|
1741
|
+
},
|
|
1742
|
+
children: /* @__PURE__ */ f(
|
|
1743
|
+
"div",
|
|
1744
|
+
{
|
|
1745
|
+
onClick: (i) => i.stopPropagation(),
|
|
1746
|
+
style: {
|
|
1747
|
+
display: "flex",
|
|
1748
|
+
flexDirection: "column",
|
|
1749
|
+
alignItems: "center",
|
|
1750
|
+
gap: "32px",
|
|
1751
|
+
maxWidth: "100%"
|
|
1752
|
+
},
|
|
1753
|
+
children: [
|
|
1754
|
+
/* @__PURE__ */ n(P, { ikon: e, size: r }),
|
|
1755
|
+
/* @__PURE__ */ n(
|
|
1756
|
+
"button",
|
|
1757
|
+
{
|
|
1758
|
+
onClick: l,
|
|
1759
|
+
style: {
|
|
1760
|
+
width: "40px",
|
|
1761
|
+
height: "40px",
|
|
1762
|
+
borderRadius: "50%",
|
|
1763
|
+
border: "none",
|
|
1764
|
+
background: "var(--ikoneme-panel-bg)",
|
|
1765
|
+
color: "var(--ikoneme-text-primary)",
|
|
1766
|
+
display: "flex",
|
|
1767
|
+
alignItems: "center",
|
|
1768
|
+
justifyContent: "center",
|
|
1769
|
+
cursor: "pointer"
|
|
1770
|
+
},
|
|
1771
|
+
title: "Close",
|
|
1772
|
+
"aria-label": "Close",
|
|
1773
|
+
children: /* @__PURE__ */ n(_e, { size: 20 })
|
|
1774
|
+
}
|
|
1775
|
+
)
|
|
1776
|
+
]
|
|
1777
|
+
}
|
|
1778
|
+
)
|
|
1779
|
+
}
|
|
1780
|
+
);
|
|
1781
|
+
}
|
|
1782
|
+
const Pe = {
|
|
1783
|
+
"--ikoneme-primary": "#00a884",
|
|
1784
|
+
"--ikoneme-primary-dark": "#008069",
|
|
1785
|
+
"--ikoneme-background": "#0c0e12",
|
|
1786
|
+
"--ikoneme-panel-bg": "#181b20",
|
|
1787
|
+
"--ikoneme-surface": "#080a0e",
|
|
1788
|
+
"--ikoneme-border": "#2a2e36",
|
|
1789
|
+
"--ikoneme-text-primary": "#e9edef",
|
|
1790
|
+
"--ikoneme-text-secondary": "#8696a0",
|
|
1791
|
+
"--ikoneme-hover": "#2a2e36"
|
|
1792
|
+
};
|
|
1793
|
+
function tt({
|
|
1794
|
+
ikons: e = [],
|
|
1795
|
+
mode: o = "view",
|
|
1796
|
+
size: l = 64,
|
|
1797
|
+
gap: r = 6,
|
|
1798
|
+
zoom: i = !0,
|
|
1799
|
+
zoomSize: p = 320,
|
|
1800
|
+
onChange: c,
|
|
1801
|
+
onIkonClick: I,
|
|
1802
|
+
searchRoot: k,
|
|
1803
|
+
theme: N,
|
|
1804
|
+
className: T,
|
|
1805
|
+
style: _
|
|
1806
|
+
}) {
|
|
1807
|
+
const [y, m] = F(null), [S, $] = F(null), v = o === "edit", M = (d) => {
|
|
1808
|
+
c && c(e.filter((g, x) => x !== d));
|
|
1809
|
+
}, E = (d) => {
|
|
1810
|
+
y != null && c && c(e.map((g, x) => x === y ? d : g)), m(null);
|
|
1811
|
+
}, t = (d, g) => {
|
|
1812
|
+
!v && I && I(d, g), i && $(g);
|
|
1813
|
+
}, s = { ...Pe, ...N }, u = i || !v && !!I;
|
|
1814
|
+
return /* @__PURE__ */ f(
|
|
1815
|
+
"div",
|
|
1816
|
+
{
|
|
1817
|
+
className: ["ikoneme", T].filter(Boolean).join(" "),
|
|
1818
|
+
style: {
|
|
1819
|
+
display: "flex",
|
|
1820
|
+
flexWrap: "wrap",
|
|
1821
|
+
alignItems: "center",
|
|
1822
|
+
gap: `${r}px`,
|
|
1823
|
+
...s,
|
|
1824
|
+
..._
|
|
1825
|
+
},
|
|
1826
|
+
children: [
|
|
1827
|
+
e.map((d, g) => /* @__PURE__ */ n(
|
|
1828
|
+
P,
|
|
1829
|
+
{
|
|
1830
|
+
ikon: d,
|
|
1831
|
+
size: l,
|
|
1832
|
+
onClick: u ? () => t(d, g) : void 0,
|
|
1833
|
+
onEdit: v ? () => m(g) : void 0,
|
|
1834
|
+
onDelete: v && c ? () => M(g) : void 0
|
|
1835
|
+
},
|
|
1836
|
+
g
|
|
1837
|
+
)),
|
|
1838
|
+
v && y != null && e[y] && /* @__PURE__ */ n("div", { style: s, children: /* @__PURE__ */ n(
|
|
1839
|
+
qe,
|
|
1840
|
+
{
|
|
1841
|
+
ikon: e[y],
|
|
1842
|
+
searchRoot: k,
|
|
1843
|
+
onSave: E,
|
|
1844
|
+
onClose: () => m(null)
|
|
1845
|
+
}
|
|
1846
|
+
) }),
|
|
1847
|
+
i && S != null && e[S] && /* @__PURE__ */ n("div", { style: s, children: /* @__PURE__ */ n(
|
|
1848
|
+
Ue,
|
|
1849
|
+
{
|
|
1850
|
+
ikon: e[S],
|
|
1851
|
+
size: p,
|
|
1852
|
+
onClose: () => $(null)
|
|
1853
|
+
}
|
|
1854
|
+
) })
|
|
1855
|
+
]
|
|
1856
|
+
}
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
export {
|
|
1860
|
+
W as BORDER_CONFIG,
|
|
1861
|
+
Se as BORDER_IDS,
|
|
1862
|
+
Pe as DEFAULT_THEME,
|
|
1863
|
+
G as IKONDB_BASE_URL,
|
|
1864
|
+
P as Ikon,
|
|
1865
|
+
qe as IkonEditor,
|
|
1866
|
+
Ue as IkonZoomView,
|
|
1867
|
+
tt as Ikoneme,
|
|
1868
|
+
h as ZONE_CONFIG,
|
|
1869
|
+
et as clearIkonDbCache,
|
|
1870
|
+
re as createDefaultIkon,
|
|
1871
|
+
Ae as defaultSearchRoot,
|
|
1872
|
+
Je as generateIkonemeFromText,
|
|
1873
|
+
Te as getBorderConfig,
|
|
1874
|
+
C as getIconConfig,
|
|
1875
|
+
Ke as getIconDisplayUrl,
|
|
1876
|
+
K as getIconUrl,
|
|
1877
|
+
Qe as getIconUrlByIndex,
|
|
1878
|
+
Le as getIkonDetails,
|
|
1879
|
+
Be as getIkonList,
|
|
1880
|
+
$e as normalizeIkon,
|
|
1881
|
+
Ye as normalizeIkoneme,
|
|
1882
|
+
ze as searchIkons
|
|
1883
|
+
};
|
|
1884
|
+
//# sourceMappingURL=ikoneme-lib.js.map
|