ikoneme-lib 0.1.0 → 0.1.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.
@@ -1,5 +1,5 @@
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";
1
+ import { jsxs as f, Fragment as P, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as xe, createElement as ne, useState as E, useEffect as le, useCallback as fe } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.294.0 - ISC
5
5
  *
@@ -23,7 +23,7 @@ var ke = {
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
25
  */
26
- const be = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(), H = (e, o) => {
26
+ const be = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(), D = (e, o) => {
27
27
  const l = xe(
28
28
  ({ color: r = "currentColor", size: i = 24, strokeWidth: p = 2, absoluteStrokeWidth: c, className: I = "", children: k, ...N }, T) => ne(
29
29
  "svg",
@@ -38,7 +38,7 @@ const be = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(),
38
38
  ...N
39
39
  },
40
40
  [
41
- ...o.map(([_, y]) => ne(_, y)),
41
+ ...o.map(([S, y]) => ne(S, y)),
42
42
  ...Array.isArray(k) ? k : [k]
43
43
  ]
44
44
  )
@@ -51,7 +51,7 @@ const be = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim(),
51
51
  * This source code is licensed under the ISC license.
52
52
  * See the LICENSE file in the root directory of this source tree.
53
53
  */
54
- const ye = H("ArrowLeft", [
54
+ const ye = D("ArrowLeft", [
55
55
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
56
56
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
57
57
  ]);
@@ -61,7 +61,7 @@ const ye = H("ArrowLeft", [
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
63
  */
64
- const ve = H("Pen", [
64
+ const ve = D("Pen", [
65
65
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }]
66
66
  ]);
67
67
  /**
@@ -70,7 +70,7 @@ const ve = H("Pen", [
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
72
  */
73
- const we = H("Search", [
73
+ const we = D("Search", [
74
74
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
75
75
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
76
76
  ]);
@@ -80,7 +80,7 @@ const we = H("Search", [
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
82
  */
83
- const Ie = H("Trash2", [
83
+ const Ie = D("Trash2", [
84
84
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
85
85
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
86
86
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
@@ -93,7 +93,7 @@ const Ie = H("Trash2", [
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const _e = H("X", [
96
+ const Se = D("X", [
97
97
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
98
98
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
99
99
  ]), h = {
@@ -152,34 +152,36 @@ const _e = H("X", [
152
152
  { tooltip: "Exclam", url: "https://text2ikon.komunikon.com/mode-assets/KomunIKON_Exclam.svg" },
153
153
  { tooltip: "Which", url: "https://text2ikon.komunikon.com/mode-assets/KomunIKON_Which.svg" }
154
154
  ],
155
+ // Direct source URLs (bypassing text2ikon's `_next/image` proxy, which 500s
156
+ // on these — it can no longer optimize images from this old ikondb domain).
155
157
  root: [
156
158
  {
157
159
  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"
160
+ url: "https://ikondb.komunikon.com/uploads/images/icons/ZFcaar88AP.png"
159
161
  },
160
162
  {
161
163
  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"
164
+ url: "https://ikondb.komunikon.com/uploads/images/icons/M0ADaSXzWe.png"
163
165
  },
164
166
  {
165
167
  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"
168
+ url: "https://ikondb.komunikon.com/uploads/images/icons/6ghAUKbdIs.png"
167
169
  },
168
170
  {
169
171
  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"
172
+ url: "https://ikondb.komunikon.com/uploads/images/icons/zq0n4vHSQW.png"
171
173
  },
172
174
  {
173
175
  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"
176
+ url: "https://ikondb.komunikon.com/uploads/images/icons/DVhDIm6KqB.png"
175
177
  },
176
178
  {
177
179
  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"
180
+ url: "https://ikondb.komunikon.com/uploads/images/icons/UnpCfhHsUa.png"
179
181
  },
180
182
  {
181
183
  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"
184
+ url: "https://ikondb.komunikon.com/uploads/images/icons/5Ex6my6BI7.png"
183
185
  }
184
186
  ],
185
187
  tenses: [
@@ -260,7 +262,7 @@ const _e = H("X", [
260
262
  url: "https://text2ikon.komunikon.com/time-assets/KomunIKON_Verbal_Tense_os.svg"
261
263
  }
262
264
  ]
263
- }, W = [
265
+ }, H = [
264
266
  { id: "name", label: "Name", color: "#60a5fa", plural: !1 },
265
267
  { id: "verb", label: "Verb", color: "#f87171", plural: !1 },
266
268
  { id: "adjective", label: "Adjective", color: "#4ade80", plural: !1 },
@@ -273,9 +275,9 @@ const _e = H("X", [
273
275
  { id: "adverb_plural", label: "Adverb (plural)", color: "#fb923c", plural: !0 },
274
276
  { id: "conjunction_plural", label: "Conjunction (plural)", color: "#a78bfa", plural: !0 },
275
277
  { id: "neutral_plural", label: "Neutral (plural)", color: "#94a3b8", plural: !0 }
276
- ], Se = W.map((e) => e.id), Ne = new Set(Se);
278
+ ], _e = H.map((e) => e.id), Ne = new Set(_e);
277
279
  function Te(e) {
278
- return W.find((o) => o.id === e) ?? null;
280
+ return H.find((o) => o.id === e) ?? null;
279
281
  }
280
282
  function C(e, o) {
281
283
  var l;
@@ -310,7 +312,7 @@ function re() {
310
312
  };
311
313
  }
312
314
  function $e(e) {
313
- var k, N, T, _, y, m, S;
315
+ var k, N, T, S, y, m, _;
314
316
  if (!e) return e;
315
317
  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
318
  return {
@@ -320,10 +322,10 @@ function $e(e) {
320
322
  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
323
  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
324
  },
323
- role: typeof e.role == "object" && ((_ = e.role) == null ? void 0 : _.url) != null ? e.role : r ? b(r) : { name: "", url: e.role || "" },
325
+ role: typeof e.role == "object" && ((S = e.role) == null ? void 0 : S.url) != null ? e.role : r ? b(r) : { name: "", url: e.role || "" },
324
326
  modes: typeof e.modes == "object" && ((y = e.modes) == null ? void 0 : y.url) != null ? e.modes : i ? b(i) : { name: "", url: e.modes || "" },
325
327
  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 || "" },
328
+ tenses: typeof e.tenses == "object" && ((_ = e.tenses) == null ? void 0 : _.url) != null ? e.tenses : c ? b(c) : { name: "", url: e.tenses || "" },
327
329
  border: I
328
330
  };
329
331
  }
@@ -360,12 +362,12 @@ function Je(e) {
360
362
  left: I ? b(h.reference[0]) : null,
361
363
  right: b(h.reference[k])
362
364
  }, 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);
365
+ const N = H.filter((T) => !T.plural);
364
366
  i.border = N[c.nextInt(0, N.length)].id, l.push(i);
365
367
  }
366
368
  return l.length > 0 ? l : [re()];
367
369
  }
368
- const q = {
370
+ const U = {
369
371
  maxWidth: "100%",
370
372
  maxHeight: "100%",
371
373
  width: "100%",
@@ -384,7 +386,7 @@ const q = {
384
386
  padding: `${e}px`
385
387
  });
386
388
  function Me(e = 768) {
387
- const [o, l] = F(
389
+ const [o, l] = E(
388
390
  () => typeof window < "u" && window.innerWidth < e
389
391
  );
390
392
  return le(() => {
@@ -392,7 +394,7 @@ function Me(e = 768) {
392
394
  return r.addEventListener("change", i), () => r.removeEventListener("change", i);
393
395
  }, [e]), o;
394
396
  }
395
- function P({
397
+ function q({
396
398
  ikon: e,
397
399
  onClick: o,
398
400
  size: l = 64,
@@ -405,14 +407,14 @@ function P({
405
407
  hideActionOverlay: N = !1
406
408
  }) {
407
409
  var te, oe;
408
- const [T, _] = F(!1), y = Me(), m = e != null && e.border ? Te(e.border) : null, S = (a, R) => {
410
+ const [T, S] = E(!1), y = Me(), m = e != null && e.border ? Te(e.border) : null, _ = (a, R) => {
409
411
  r ? (R.stopPropagation(), r(a)) : o && o(R);
410
412
  }, $ = (a) => {
411
413
  r && (a.currentTarget.style.filter = "brightness(1.3)");
412
414
  }, v = (a) => {
413
415
  r && (a.currentTarget.style.filter = "brightness(1)");
414
416
  }, M = (a, R) => {
415
- const z = i === a;
417
+ const L = i === a;
416
418
  return {
417
419
  // A selected zone draws a 2px inset outline; border-box keeps that
418
420
  // outline (and every zone's padding) inside the slot the grid gave it,
@@ -421,41 +423,41 @@ function P({
421
423
  ...R,
422
424
  cursor: r || o ? "pointer" : "default",
423
425
  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
+ border: L ? "2px solid var(--ikoneme-primary)" : R.border || "none",
427
+ boxShadow: L ? "0 0 8px var(--ikoneme-primary)" : "none",
426
428
  position: "relative"
427
429
  };
428
- }, E = (a, R) => {
429
- const z = Ke(R);
430
- if (!z) return null;
430
+ }, O = (a, R) => {
431
+ const L = Ke(R);
432
+ if (!L) return null;
431
433
  const V = C(a, K(R)), ge = R && typeof R == "object" && R.name || (V == null ? void 0 : V.tooltip) || a;
432
434
  return /* @__PURE__ */ n(
433
435
  "img",
434
436
  {
435
- src: z,
437
+ src: L,
436
438
  alt: ge,
437
- style: q,
439
+ style: U,
438
440
  onError: (he) => {
439
441
  he.target.style.display = "none";
440
442
  }
441
443
  }
442
444
  );
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}` } : {
445
+ }, 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, j = Math.max(2, Math.round(w / 40)), se = Math.max(2, Math.round(w / 44)), B = 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: `${j}px solid ${m.color}` } : {
444
446
  border: p && !c ? "2px solid rgba(0, 168, 132, 0.8)" : "1px solid rgba(255, 255, 255, 0.1)"
445
447
  }, Q = m != null && m.plural ? {
446
448
  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}`
449
+ `inset -${j}px 0 0 ${m.color}`,
450
+ `inset -${j * 2}px 0 0 ${m.color}`,
451
+ `inset -${j * 3}px 0 0 ${m.color}`,
452
+ `inset 0 -${j}px 0 ${m.color}`,
453
+ `inset 0 -${j * 2}px 0 ${m.color}`,
454
+ `inset 0 -${j * 3}px 0 ${m.color}`
453
455
  ].join(", ")
454
456
  } : {}, ue = p && !c ? "rgba(0, 168, 132, 0.15)" : "white", Y = m && !m.plural ? Q.boxShadow : null, J = [
455
457
  p && !c ? "0 0 12px rgba(0, 168, 132, 0.4)" : null,
456
458
  i === "border" ? "0 0 0 3px var(--ikoneme-primary)" : null,
457
459
  Y
458
- ].filter(Boolean).join(", "), pe = ["0 0 10px rgba(0, 168, 132, 0.5)", Y].filter(Boolean).join(", "), ee = /* @__PURE__ */ f(U, { children: [
460
+ ].filter(Boolean).join(", "), pe = ["0 0 10px rgba(0, 168, 132, 0.5)", Y].filter(Boolean).join(", "), ee = /* @__PURE__ */ f(P, { children: [
459
461
  /* @__PURE__ */ f(
460
462
  "div",
461
463
  {
@@ -498,7 +500,7 @@ function P({
498
500
  /* @__PURE__ */ n(
499
501
  "div",
500
502
  {
501
- onClick: (a) => S("context", a),
503
+ onClick: (a) => _("context", a),
502
504
  onMouseEnter: $,
503
505
  onMouseLeave: v,
504
506
  style: M("context", {
@@ -513,16 +515,16 @@ function P({
513
515
  minWidth: 0,
514
516
  minHeight: 0,
515
517
  overflow: "hidden",
516
- padding: `${j}px`
518
+ padding: `${B}px`
517
519
  }),
518
520
  className: "ikoneme-zone",
519
- children: E("context", e.context)
521
+ children: O("context", e.context)
520
522
  }
521
523
  ),
522
524
  /* @__PURE__ */ f(
523
525
  "div",
524
526
  {
525
- onClick: (a) => S("reference", a),
527
+ onClick: (a) => _("reference", a),
526
528
  onMouseEnter: $,
527
529
  onMouseLeave: v,
528
530
  style: M("reference", {
@@ -558,7 +560,7 @@ function P({
558
560
  "div",
559
561
  {
560
562
  style: {
561
- ...ie(j),
563
+ ...ie(B),
562
564
  borderRight: "1px solid rgba(0, 0, 0, 0.14)"
563
565
  },
564
566
  children: K((te = e.reference) == null ? void 0 : te.left) && /* @__PURE__ */ n(
@@ -566,7 +568,7 @@ function P({
566
568
  {
567
569
  src: K(e.reference.left),
568
570
  alt: "Asterisk",
569
- style: q,
571
+ style: U,
570
572
  onError: (a) => {
571
573
  a.target.style.display = "none";
572
574
  }
@@ -578,7 +580,7 @@ function P({
578
580
  "div",
579
581
  {
580
582
  style: {
581
- ...ie(j),
583
+ ...ie(B),
582
584
  borderRight: "1px solid rgba(0, 0, 0, 0.14)"
583
585
  },
584
586
  children: K((oe = e.reference) == null ? void 0 : oe.right) && /* @__PURE__ */ n(
@@ -586,7 +588,7 @@ function P({
586
588
  {
587
589
  src: K(e.reference.right),
588
590
  alt: "Number",
589
- style: q,
591
+ style: U,
590
592
  onError: (a) => {
591
593
  a.target.style.display = "none";
592
594
  }
@@ -601,7 +603,7 @@ function P({
601
603
  /* @__PURE__ */ n(
602
604
  "div",
603
605
  {
604
- onClick: (a) => S("role", a),
606
+ onClick: (a) => _("role", a),
605
607
  onMouseEnter: $,
606
608
  onMouseLeave: v,
607
609
  style: M("role", {
@@ -615,16 +617,16 @@ function P({
615
617
  minWidth: 0,
616
618
  minHeight: 0,
617
619
  overflow: "hidden",
618
- padding: `${j}px`
620
+ padding: `${B}px`
619
621
  }),
620
622
  className: "ikoneme-zone",
621
- children: E("role", e.role)
623
+ children: O("role", e.role)
622
624
  }
623
625
  ),
624
626
  /* @__PURE__ */ n(
625
627
  "div",
626
628
  {
627
- onClick: (a) => S("modes", a),
629
+ onClick: (a) => _("modes", a),
628
630
  onMouseEnter: $,
629
631
  onMouseLeave: v,
630
632
  style: M("modes", {
@@ -639,16 +641,16 @@ function P({
639
641
  minWidth: 0,
640
642
  minHeight: 0,
641
643
  overflow: "hidden",
642
- padding: `${j}px`
644
+ padding: `${B}px`
643
645
  }),
644
646
  className: "ikoneme-zone",
645
- children: E("modes", e.modes)
647
+ children: O("modes", e.modes)
646
648
  }
647
649
  ),
648
650
  /* @__PURE__ */ n(
649
651
  "div",
650
652
  {
651
- onClick: (a) => S("root", a),
653
+ onClick: (a) => _("root", a),
652
654
  onMouseEnter: $,
653
655
  onMouseLeave: v,
654
656
  style: M("root", {
@@ -669,7 +671,7 @@ function P({
669
671
  padding: `${ae}px`
670
672
  }),
671
673
  className: "ikoneme-zone",
672
- children: E("root", e.root)
674
+ children: O("root", e.root)
673
675
  }
674
676
  ),
675
677
  /* @__PURE__ */ n(
@@ -694,7 +696,7 @@ function P({
694
696
  /* @__PURE__ */ n(
695
697
  "div",
696
698
  {
697
- onClick: (a) => S("tenses", a),
699
+ onClick: (a) => _("tenses", a),
698
700
  onMouseEnter: $,
699
701
  onMouseLeave: v,
700
702
  style: M("tenses", {
@@ -707,10 +709,10 @@ function P({
707
709
  minWidth: 0,
708
710
  minHeight: 0,
709
711
  overflow: "hidden",
710
- padding: `${j}px`
712
+ padding: `${B}px`
711
713
  }),
712
714
  className: "ikoneme-zone",
713
- children: E("tenses", e.tenses)
715
+ children: O("tenses", e.tenses)
714
716
  }
715
717
  )
716
718
  ]
@@ -825,8 +827,8 @@ function P({
825
827
  flexShrink: 0,
826
828
  gap: "6px"
827
829
  },
828
- onMouseEnter: () => _(!0),
829
- onMouseLeave: () => _(!1),
830
+ onMouseEnter: () => S(!0),
831
+ onMouseLeave: () => S(!1),
830
832
  children: [
831
833
  /* @__PURE__ */ n("div", { style: { position: "relative", width: `${w}px`, height: `${w}px` }, children: ee }),
832
834
  me
@@ -841,48 +843,48 @@ function P({
841
843
  height: `${l}px`,
842
844
  flexShrink: 0
843
845
  },
844
- onMouseEnter: () => _(!0),
845
- onMouseLeave: () => _(!1),
846
+ onMouseEnter: () => S(!0),
847
+ onMouseLeave: () => S(!1),
846
848
  children: ee
847
849
  }
848
850
  );
849
851
  }
850
- const G = "https://ikondb.iigap.com", Fe = 60 * 60 * 1e3;
851
- let L = null, B = null;
852
+ const G = "https://ikondb.iigap.com", Ee = 60 * 60 * 1e3;
853
+ let W = null, z = null;
852
854
  const A = /* @__PURE__ */ new Map();
853
- function Ee(e) {
855
+ function Oe(e) {
854
856
  return !e || Array.isArray(e) ? null : e.origin || e.preview || e.thumb || e.svg || null;
855
857
  }
856
- function Oe(e) {
858
+ function je(e) {
857
859
  if (!e || Array.isArray(e)) return {};
858
860
  const { origin: o = null, preview: l = null, thumb: r = null, svg: i = null } = e;
859
861
  return { origin: o, preview: l, thumb: r, svg: i };
860
862
  }
861
- async function je(e) {
863
+ async function Be(e) {
862
864
  const o = await fetch(`${e}/api/ikons`);
863
865
  if (!o.ok) throw new Error(`IkonDB GET /api/ikons -> ${o.status}`);
864
866
  const l = await o.json();
865
867
  return (Array.isArray(l == null ? void 0 : l.data) ? l.data : []).map((i) => ({
866
868
  id: i.id,
867
869
  name: i.description || "",
868
- url: Ee(i.media)
870
+ url: Oe(i.media)
869
871
  })).filter((i) => i.url);
870
872
  }
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);
873
+ async function ze({ baseUrl: e = G } = {}) {
874
+ return W && Date.now() - W.at < Ee ? W.list : z || (z = Be(e).then((o) => (W = { at: Date.now(), list: o }, o)).finally(() => {
875
+ z = null;
876
+ }), z);
875
877
  }
876
- async function ze(e, { baseUrl: o = G, limit: l = 20 } = {}) {
878
+ async function Le(e, { baseUrl: o = G, limit: l = 20 } = {}) {
877
879
  const r = (e || "").trim().toLowerCase();
878
880
  if (!r) return [];
879
- const i = await Be({ baseUrl: o }), p = [];
881
+ const i = await ze({ baseUrl: o }), p = [];
880
882
  for (const c of i)
881
883
  if (c.name.toLowerCase().includes(r) && (p.push(c), p.length >= l))
882
884
  break;
883
885
  return p;
884
886
  }
885
- async function Le(e, { baseUrl: o = G } = {}) {
887
+ async function We(e, { baseUrl: o = G } = {}) {
886
888
  if (e == null) return null;
887
889
  if (A.has(e)) return A.get(e);
888
890
  const l = await fetch(`${o}/api/ikons/${encodeURIComponent(e)}`);
@@ -890,7 +892,7 @@ async function Le(e, { baseUrl: o = G } = {}) {
890
892
  const r = await l.json();
891
893
  if ((r == null ? void 0 : r.status) !== "success" || !(r != null && r.data))
892
894
  return A.set(e, null), null;
893
- const i = Oe(r.data.media), p = {
895
+ const i = je(r.data.media), p = {
894
896
  id: r.data.id,
895
897
  name: r.data.description || "",
896
898
  url: i.origin || i.preview || i.thumb || i.svg || null,
@@ -900,15 +902,15 @@ async function Le(e, { baseUrl: o = G } = {}) {
900
902
  }
901
903
  async function Ae(e) {
902
904
  try {
903
- return await ze(e);
905
+ return await Le(e);
904
906
  } catch {
905
907
  return [];
906
908
  }
907
909
  }
908
910
  function et() {
909
- L = null, B = null, A.clear();
911
+ W = null, z = null, A.clear();
910
912
  }
911
- const D = {
913
+ const F = {
912
914
  context: { name: "Context", description: "Northwest - Contextual information" },
913
915
  reference: { name: "Reference", description: "North - Reference point" },
914
916
  role: { name: "Role", description: "Northeast - Role indicator" },
@@ -919,13 +921,13 @@ const D = {
919
921
  name: "Border",
920
922
  description: "Grammatical category — singular (one border) or plural (stacked borders)"
921
923
  }
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({
924
+ }, He = 1, De = 300, Fe = 10, Ve = 5;
925
+ function Ue({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
926
+ const [i, p] = E({
925
927
  ...e,
926
928
  reference: e.reference ? { ...e.reference } : { left: null, right: null },
927
929
  rootName: e.rootName ?? null
928
- }), [c, I] = F("root"), [k, N] = F(""), [T, _] = F([]), [y, m] = F(!1), S = (t, s) => {
930
+ }), [c, I] = E("root"), [k, N] = E(""), [T, S] = E([]), [y, m] = E(!1), _ = (t, s) => {
929
931
  const u = C(t === "reference" ? "reference" : t, s), d = u ? { name: u.tooltip, url: u.url } : { name: "", url: s };
930
932
  if (t === "reference") {
931
933
  const g = h.reference[0].url;
@@ -962,21 +964,21 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
962
964
  }));
963
965
  };
964
966
  le(() => {
965
- if (c !== "root" || k.length < We) {
966
- _([]);
967
+ if (c !== "root" || k.length < He) {
968
+ S([]);
967
969
  return;
968
970
  }
969
971
  const t = setTimeout(async () => {
970
972
  m(!0);
971
973
  try {
972
974
  const s = await r(k.trim());
973
- _((s || []).slice(0, De));
975
+ S((s || []).slice(0, Fe));
974
976
  } catch {
975
- _([]);
977
+ S([]);
976
978
  } finally {
977
979
  m(!1);
978
980
  }
979
- }, He);
981
+ }, De);
980
982
  return () => clearTimeout(t);
981
983
  }, [c, k, r]);
982
984
  const M = fe(async (t) => {
@@ -986,7 +988,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
986
988
  rootName: t.name
987
989
  })), t.id != null)
988
990
  try {
989
- const s = await Le(t.id);
991
+ const s = await We(t.id);
990
992
  if (!s) return;
991
993
  p((u) => {
992
994
  var d;
@@ -1138,7 +1140,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1138
1140
  }
1139
1141
  ),
1140
1142
  /* @__PURE__ */ n(
1141
- P,
1143
+ q,
1142
1144
  {
1143
1145
  ikon: i,
1144
1146
  size: 280,
@@ -1158,7 +1160,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1158
1160
  background: "var(--ikoneme-primary)",
1159
1161
  borderRadius: "20px"
1160
1162
  },
1161
- children: D[c].name
1163
+ children: F[c].name
1162
1164
  }
1163
1165
  )
1164
1166
  ]
@@ -1174,7 +1176,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1174
1176
  marginBottom: "8px",
1175
1177
  fontWeight: "500"
1176
1178
  },
1177
- children: c === "border" ? "Select Border Type" : "Choose Icon for: " + D[c].name
1179
+ children: c === "border" ? "Select Border Type" : "Choose Icon for: " + F[c].name
1178
1180
  }
1179
1181
  ),
1180
1182
  c === "border" ? /* @__PURE__ */ f(
@@ -1186,7 +1188,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1186
1188
  marginBottom: "12px"
1187
1189
  },
1188
1190
  children: [
1189
- D.border.description,
1191
+ F.border.description,
1190
1192
  ". Click the same border again to clear."
1191
1193
  ]
1192
1194
  }
@@ -1226,12 +1228,12 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1226
1228
  marginBottom: "12px"
1227
1229
  },
1228
1230
  children: [
1229
- D[c].description,
1231
+ F[c].description,
1230
1232
  ". Click the same icon again to clear."
1231
1233
  ]
1232
1234
  }
1233
1235
  ),
1234
- c === "border" ? /* @__PURE__ */ f(U, { children: [
1236
+ c === "border" ? /* @__PURE__ */ f(P, { children: [
1235
1237
  /* @__PURE__ */ n("div", { style: { marginBottom: "12px" }, children: /* @__PURE__ */ n(
1236
1238
  "button",
1237
1239
  {
@@ -1272,7 +1274,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1272
1274
  gap: "10px",
1273
1275
  marginBottom: "16px"
1274
1276
  },
1275
- children: W.filter((t) => !t.plural).map((t) => {
1277
+ children: H.filter((t) => !t.plural).map((t) => {
1276
1278
  const s = i.border === t.id;
1277
1279
  return /* @__PURE__ */ f(
1278
1280
  "button",
@@ -1364,7 +1366,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1364
1366
  children: "Plural"
1365
1367
  }
1366
1368
  ) }),
1367
- /* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "10px" }, children: W.filter((t) => t.plural).map((t) => {
1369
+ /* @__PURE__ */ n("div", { style: { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "10px" }, children: H.filter((t) => t.plural).map((t) => {
1368
1370
  const s = i.border === t.id, u = 5, d = {
1369
1371
  boxShadow: [
1370
1372
  `inset -${u}px 0 0 ${t.color}`,
@@ -1453,7 +1455,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1453
1455
  t.id
1454
1456
  );
1455
1457
  }) })
1456
- ] }) : c === "root" ? /* @__PURE__ */ f(U, { children: [
1458
+ ] }) : c === "root" ? /* @__PURE__ */ f(P, { children: [
1457
1459
  /* @__PURE__ */ f(
1458
1460
  "div",
1459
1461
  {
@@ -1621,7 +1623,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1621
1623
  return /* @__PURE__ */ f(
1622
1624
  "button",
1623
1625
  {
1624
- onClick: () => S(c, t.url),
1626
+ onClick: () => _(c, t.url),
1625
1627
  title: t.tooltip,
1626
1628
  style: {
1627
1629
  padding: "12px",
@@ -1720,7 +1722,7 @@ function qe({ ikon: e, onSave: o, onClose: l, searchRoot: r = Ae }) {
1720
1722
  }
1721
1723
  );
1722
1724
  }
1723
- function Ue({ ikon: e, size: o = 320, onClose: l }) {
1725
+ function Pe({ ikon: e, size: o = 320, onClose: l }) {
1724
1726
  const r = typeof window < "u" ? Math.max(120, Math.min(o, window.innerWidth - 48, window.innerHeight - 156)) : o;
1725
1727
  return /* @__PURE__ */ n(
1726
1728
  "div",
@@ -1751,7 +1753,7 @@ function Ue({ ikon: e, size: o = 320, onClose: l }) {
1751
1753
  maxWidth: "100%"
1752
1754
  },
1753
1755
  children: [
1754
- /* @__PURE__ */ n(P, { ikon: e, size: r }),
1756
+ /* @__PURE__ */ n(q, { ikon: e, size: r }),
1755
1757
  /* @__PURE__ */ n(
1756
1758
  "button",
1757
1759
  {
@@ -1770,7 +1772,7 @@ function Ue({ ikon: e, size: o = 320, onClose: l }) {
1770
1772
  },
1771
1773
  title: "Close",
1772
1774
  "aria-label": "Close",
1773
- children: /* @__PURE__ */ n(_e, { size: 20 })
1775
+ children: /* @__PURE__ */ n(Se, { size: 20 })
1774
1776
  }
1775
1777
  )
1776
1778
  ]
@@ -1779,7 +1781,7 @@ function Ue({ ikon: e, size: o = 320, onClose: l }) {
1779
1781
  }
1780
1782
  );
1781
1783
  }
1782
- const Pe = {
1784
+ const qe = {
1783
1785
  "--ikoneme-primary": "#00a884",
1784
1786
  "--ikoneme-primary-dark": "#008069",
1785
1787
  "--ikoneme-background": "#0c0e12",
@@ -1802,15 +1804,15 @@ function tt({
1802
1804
  searchRoot: k,
1803
1805
  theme: N,
1804
1806
  className: T,
1805
- style: _
1807
+ style: S
1806
1808
  }) {
1807
- const [y, m] = F(null), [S, $] = F(null), v = o === "edit", M = (d) => {
1809
+ const [y, m] = E(null), [_, $] = E(null), v = o === "edit", M = (d) => {
1808
1810
  c && c(e.filter((g, x) => x !== d));
1809
- }, E = (d) => {
1811
+ }, O = (d) => {
1810
1812
  y != null && c && c(e.map((g, x) => x === y ? d : g)), m(null);
1811
1813
  }, t = (d, g) => {
1812
1814
  !v && I && I(d, g), i && $(g);
1813
- }, s = { ...Pe, ...N }, u = i || !v && !!I;
1815
+ }, s = { ...qe, ...N }, u = i || !v && !!I;
1814
1816
  return /* @__PURE__ */ f(
1815
1817
  "div",
1816
1818
  {
@@ -1821,11 +1823,11 @@ function tt({
1821
1823
  alignItems: "center",
1822
1824
  gap: `${r}px`,
1823
1825
  ...s,
1824
- ..._
1826
+ ...S
1825
1827
  },
1826
1828
  children: [
1827
1829
  e.map((d, g) => /* @__PURE__ */ n(
1828
- P,
1830
+ q,
1829
1831
  {
1830
1832
  ikon: d,
1831
1833
  size: l,
@@ -1836,18 +1838,18 @@ function tt({
1836
1838
  g
1837
1839
  )),
1838
1840
  v && y != null && e[y] && /* @__PURE__ */ n("div", { style: s, children: /* @__PURE__ */ n(
1839
- qe,
1841
+ Ue,
1840
1842
  {
1841
1843
  ikon: e[y],
1842
1844
  searchRoot: k,
1843
- onSave: E,
1845
+ onSave: O,
1844
1846
  onClose: () => m(null)
1845
1847
  }
1846
1848
  ) }),
1847
- i && S != null && e[S] && /* @__PURE__ */ n("div", { style: s, children: /* @__PURE__ */ n(
1848
- Ue,
1849
+ i && _ != null && e[_] && /* @__PURE__ */ n("div", { style: s, children: /* @__PURE__ */ n(
1850
+ Pe,
1849
1851
  {
1850
- ikon: e[S],
1852
+ ikon: e[_],
1851
1853
  size: p,
1852
1854
  onClose: () => $(null)
1853
1855
  }
@@ -1857,13 +1859,13 @@ function tt({
1857
1859
  );
1858
1860
  }
1859
1861
  export {
1860
- W as BORDER_CONFIG,
1861
- Se as BORDER_IDS,
1862
- Pe as DEFAULT_THEME,
1862
+ H as BORDER_CONFIG,
1863
+ _e as BORDER_IDS,
1864
+ qe as DEFAULT_THEME,
1863
1865
  G as IKONDB_BASE_URL,
1864
- P as Ikon,
1865
- qe as IkonEditor,
1866
- Ue as IkonZoomView,
1866
+ q as Ikon,
1867
+ Ue as IkonEditor,
1868
+ Pe as IkonZoomView,
1867
1869
  tt as Ikoneme,
1868
1870
  h as ZONE_CONFIG,
1869
1871
  et as clearIkonDbCache,
@@ -1875,10 +1877,10 @@ export {
1875
1877
  Ke as getIconDisplayUrl,
1876
1878
  K as getIconUrl,
1877
1879
  Qe as getIconUrlByIndex,
1878
- Le as getIkonDetails,
1879
- Be as getIkonList,
1880
+ We as getIkonDetails,
1881
+ ze as getIkonList,
1880
1882
  $e as normalizeIkon,
1881
1883
  Ye as normalizeIkoneme,
1882
- ze as searchIkons
1884
+ Le as searchIkons
1883
1885
  };
1884
1886
  //# sourceMappingURL=ikoneme-lib.js.map