@koide-labs/ui 0.0.8 → 0.0.10

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,18 +1,18 @@
1
1
  "use client";
2
- import { jsxs as ne, jsx as j } from "react/jsx-runtime";
3
- import { c as re } from "../../clsx-OuTLNxxd.js";
2
+ import { jsxs as re, jsx as P } from "react/jsx-runtime";
3
+ import { c as J } from "../../clsx-OuTLNxxd.js";
4
4
  import { useMemo as ie } from "react";
5
- import { Surface as J } from "../surface/index.js";
5
+ import { Surface as V } from "../surface/index.js";
6
6
  import { Text as se } from "../text/index.js";
7
7
  import { View as ue } from "../view/index.js";
8
- import '../../index22.css';var V = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
8
+ import '../../index22.css';var K = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
9
9
  function le(b) {
10
10
  return b && b.__esModule && Object.prototype.hasOwnProperty.call(b, "default") ? b.default : b;
11
11
  }
12
- var Z = { exports: {} }, K;
12
+ var Z = { exports: {} }, Q;
13
13
  function oe() {
14
- return K || (K = 1, (function(b) {
15
- var z = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
14
+ return Q || (Q = 1, (function(b) {
15
+ var j = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
16
16
  var i = (function(g) {
17
17
  var f = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, F = 0, A = {}, s = {
18
18
  /**
@@ -358,8 +358,8 @@ function oe() {
358
358
  a.hasOwnProperty(o) || (l[o] = r[o]);
359
359
  }
360
360
  var d = n[t];
361
- return n[t] = l, s.languages.DFS(s.languages, function(v, k) {
362
- k === d && v != t && (this[v] = l);
361
+ return n[t] = l, s.languages.DFS(s.languages, function(v, _) {
362
+ _ === d && v != t && (this[v] = l);
363
363
  }), l;
364
364
  },
365
365
  // Traverse a language definition with Depth First Search
@@ -454,8 +454,8 @@ function oe() {
454
454
  grammar: r,
455
455
  code: o
456
456
  };
457
- function d(k) {
458
- u.highlightedCode = k, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), a && a.call(u.element);
457
+ function d(_) {
458
+ u.highlightedCode = _, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), a && a.call(u.element);
459
459
  }
460
460
  if (s.hooks.run("before-sanity-check", u), l = u.element.parentElement, l && l.nodeName.toLowerCase() === "pre" && !l.hasAttribute("tabindex") && l.setAttribute("tabindex", "0"), !u.code) {
461
461
  s.hooks.run("complete", u), a && a.call(u.element);
@@ -467,8 +467,8 @@ function oe() {
467
467
  }
468
468
  if (e && g.Worker) {
469
469
  var v = new Worker(s.filename);
470
- v.onmessage = function(k) {
471
- d(k.data);
470
+ v.onmessage = function(_) {
471
+ d(_.data);
472
472
  }, v.postMessage(JSON.stringify({
473
473
  language: u.language,
474
474
  code: u.code,
@@ -539,7 +539,7 @@ function oe() {
539
539
  delete e.rest;
540
540
  }
541
541
  var r = new T();
542
- return S(r, r.head, t), P(t, r, e, r.head, 0), L(r);
542
+ return S(r, r.head, t), I(t, r, e, r.head, 0), M(r);
543
543
  },
544
544
  /**
545
545
  * @namespace
@@ -618,7 +618,7 @@ function oe() {
618
618
  }
619
619
  return r;
620
620
  }
621
- function P(t, e, a, n, r, l) {
621
+ function I(t, e, a, n, r, l) {
622
622
  for (var o in a)
623
623
  if (!(!a.hasOwnProperty(o) || !a[o])) {
624
624
  var u = a[o];
@@ -626,41 +626,41 @@ function oe() {
626
626
  for (var d = 0; d < u.length; ++d) {
627
627
  if (l && l.cause == o + "," + d)
628
628
  return;
629
- var v = u[d], k = v.inside, W = !!v.lookbehind, N = !!v.greedy, Q = v.alias;
629
+ var v = u[d], _ = v.inside, W = !!v.lookbehind, N = !!v.greedy, ee = v.alias;
630
630
  if (N && !v.pattern.global) {
631
- var ee = v.pattern.toString().match(/[imsuy]*$/)[0];
632
- v.pattern = RegExp(v.pattern.source, ee + "g");
631
+ var te = v.pattern.toString().match(/[imsuy]*$/)[0];
632
+ v.pattern = RegExp(v.pattern.source, te + "g");
633
633
  }
634
634
  for (var X = v.pattern || v, m = n.next, w = r; m !== e.tail && !(l && w >= l.reach); w += m.value.length, m = m.next) {
635
635
  var E = m.value;
636
636
  if (e.length > t.length)
637
637
  return;
638
638
  if (!(E instanceof y)) {
639
- var I = 1, x;
639
+ var z = 1, x;
640
640
  if (N) {
641
641
  if (x = $(X, w, t, W), !x || x.index >= t.length)
642
642
  break;
643
- var M = x.index, te = x.index + x[0].length, _ = w;
644
- for (_ += m.value.length; M >= _; )
645
- m = m.next, _ += m.value.length;
646
- if (_ -= m.value.length, w = _, m.value instanceof y)
643
+ var D = x.index, ae = x.index + x[0].length, k = w;
644
+ for (k += m.value.length; D >= k; )
645
+ m = m.next, k += m.value.length;
646
+ if (k -= m.value.length, w = k, m.value instanceof y)
647
647
  continue;
648
- for (var C = m; C !== e.tail && (_ < te || typeof C.value == "string"); C = C.next)
649
- I++, _ += C.value.length;
650
- I--, E = t.slice(w, _), x.index -= w;
648
+ for (var C = m; C !== e.tail && (k < ae || typeof C.value == "string"); C = C.next)
649
+ z++, k += C.value.length;
650
+ z--, E = t.slice(w, k), x.index -= w;
651
651
  } else if (x = $(X, 0, E, W), !x)
652
652
  continue;
653
- var M = x.index, D = x[0], q = E.slice(0, M), Y = E.slice(M + D.length), G = w + E.length;
653
+ var D = x.index, O = x[0], q = E.slice(0, D), Y = E.slice(D + O.length), G = w + E.length;
654
654
  l && G > l.reach && (l.reach = G);
655
- var O = m.prev;
656
- q && (O = S(e, O, q), w += q.length), H(e, O, I);
657
- var ae = new y(o, k ? s.tokenize(D, k) : D, Q, D);
658
- if (m = S(e, O, ae), Y && S(e, m, Y), I > 1) {
655
+ var R = m.prev;
656
+ q && (R = S(e, R, q), w += q.length), H(e, R, z);
657
+ var ne = new y(o, _ ? s.tokenize(O, _) : O, ee, O);
658
+ if (m = S(e, R, ne), Y && S(e, m, Y), z > 1) {
659
659
  var U = {
660
660
  cause: o + "," + d,
661
661
  reach: G
662
662
  };
663
- P(t, e, a, m.prev, w, U), l && U.reach > l.reach && (l.reach = U.reach);
663
+ I(t, e, a, m.prev, w, U), l && U.reach > l.reach && (l.reach = U.reach);
664
664
  }
665
665
  }
666
666
  }
@@ -680,7 +680,7 @@ function oe() {
680
680
  n = n.next;
681
681
  e.next = n, n.prev = e, t.length -= r;
682
682
  }
683
- function L(t) {
683
+ function M(t) {
684
684
  for (var e = [], a = t.head.next; a !== t.tail; )
685
685
  e.push(a.value), a = a.next;
686
686
  return e;
@@ -700,8 +700,8 @@ function oe() {
700
700
  h === "loading" || h === "interactive" && p && p.defer ? document.addEventListener("DOMContentLoaded", c) : window.requestAnimationFrame ? window.requestAnimationFrame(c) : window.setTimeout(c, 16);
701
701
  }
702
702
  return s;
703
- })(z);
704
- b.exports && (b.exports = i), typeof V < "u" && (V.Prism = i), i.languages.markup = {
703
+ })(j);
704
+ b.exports && (b.exports = i), typeof K < "u" && (K.Prism = i), i.languages.markup = {
705
705
  comment: {
706
706
  pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
707
707
  greedy: !0
@@ -1091,7 +1091,7 @@ function oe() {
1091
1091
  bat: "batch",
1092
1092
  h: "c",
1093
1093
  tex: "latex"
1094
- }, s = "data-src-status", y = "loading", $ = "loaded", P = "failed", T = "pre[data-src]:not([" + s + '="' + $ + '"]):not([' + s + '="' + y + '"])';
1094
+ }, s = "data-src-status", y = "loading", $ = "loaded", I = "failed", T = "pre[data-src]:not([" + s + '="' + $ + '"]):not([' + s + '="' + y + '"])';
1095
1095
  function S(p, c, h) {
1096
1096
  var t = new XMLHttpRequest();
1097
1097
  t.open("GET", p, !0), t.onreadystatechange = function() {
@@ -1136,7 +1136,7 @@ function oe() {
1136
1136
  h.textContent = r, i.highlightElement(h);
1137
1137
  },
1138
1138
  function(r) {
1139
- c.setAttribute(s, P), h.textContent = r;
1139
+ c.setAttribute(s, I), h.textContent = r;
1140
1140
  }
1141
1141
  );
1142
1142
  }
@@ -1153,45 +1153,46 @@ function oe() {
1153
1153
  i.highlightElement(e);
1154
1154
  }
1155
1155
  };
1156
- var L = !1;
1156
+ var M = !1;
1157
1157
  i.fileHighlight = function() {
1158
- L || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), L = !0), i.plugins.fileHighlight.highlight.apply(this, arguments);
1158
+ M || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), M = !0), i.plugins.fileHighlight.highlight.apply(this, arguments);
1159
1159
  };
1160
1160
  })();
1161
1161
  })(Z)), Z.exports;
1162
1162
  }
1163
1163
  var ge = oe();
1164
- const B = /* @__PURE__ */ le(ge), ce = "_code_1uijz_1", de = "_code_title_1uijz_6", fe = "_code__value_1uijz_10", pe = "_code__title_1uijz_15", R = {
1165
- code: ce,
1166
- code_title: de,
1167
- code__value: fe,
1168
- code__title: pe
1164
+ const B = /* @__PURE__ */ le(ge), ce = "_code__root_1cnms_1", de = "_code_1cnms_1", fe = "_code_title_1cnms_12", pe = "_code__value_1cnms_16", he = "_code__title_1cnms_21", L = {
1165
+ code__root: ce,
1166
+ code: de,
1167
+ code_title: fe,
1168
+ code__value: pe,
1169
+ code__title: he
1169
1170
  };
1170
- function xe({
1171
+ function Ae({
1171
1172
  language: b = "javascript",
1172
- children: z = "",
1173
+ children: j = "",
1173
1174
  title: i,
1174
1175
  className: g
1175
1176
  }) {
1176
1177
  const f = ie(
1177
1178
  () => B.highlight(
1178
- z,
1179
+ j,
1179
1180
  B.languages[b] ?? B.languages.javascript,
1180
1181
  b
1181
1182
  ),
1182
- [z, b]
1183
+ [j, b]
1183
1184
  );
1184
- return /* @__PURE__ */ ne(ue, { className: g, children: [
1185
- i ? /* @__PURE__ */ j(J, { elevated: !0, className: R.code__title, children: /* @__PURE__ */ j(se, { size: "sm", color: "dimmer", children: i }) }) : null,
1186
- /* @__PURE__ */ j(
1187
- J,
1185
+ return /* @__PURE__ */ re(ue, { className: J(L.code__root, g), children: [
1186
+ i ? /* @__PURE__ */ P(V, { elevated: !0, className: L.code__title, children: /* @__PURE__ */ P(se, { size: "sm", color: "dimmer", children: i }) }) : null,
1187
+ /* @__PURE__ */ P(
1188
+ V,
1188
1189
  {
1189
1190
  elevated: !0,
1190
- className: re(R.code, i && R.code_title),
1191
- children: /* @__PURE__ */ j("pre", { children: /* @__PURE__ */ j(
1191
+ className: J(L.code, i && L.code_title),
1192
+ children: /* @__PURE__ */ P("pre", { children: /* @__PURE__ */ P(
1192
1193
  "code",
1193
1194
  {
1194
- className: R.code__value,
1195
+ className: L.code__value,
1195
1196
  dangerouslySetInnerHTML: {
1196
1197
  __html: f
1197
1198
  }
@@ -1202,5 +1203,5 @@ function xe({
1202
1203
  ] });
1203
1204
  }
1204
1205
  export {
1205
- xe as Code
1206
+ Ae as Code
1206
1207
  };
package/dist/index2.css CHANGED
@@ -1 +1 @@
1
- ._react-markdown_slb08_1{display:flex;flex-direction:column}._react-markdown__h1_slb08_6,._react-markdown__h2_slb08_7{margin-top:var(--space-24)}._react-markdown__h3_slb08_11,._react-markdown__h4_slb08_12{margin-top:var(--space-16)}._react-markdown__h5_slb08_16,._react-markdown__p_slb08_17,._react-markdown__code_slb08_18{margin-top:var(--space-8)}._react-markdown__ul_slb08_22{margin-top:var(--space-8);padding-left:var(--space-24);list-style-type:disc}._react-markdown__ol_slb08_28{margin-top:var(--space-8);padding-left:var(--space-24);list-style-type:decimal}._react-markdown__li_slb08_34{vertical-align:middle}._react-markdown__li_slb08_34>ul,._react-markdown__li_slb08_34>ol{margin-top:0}._react-markdown__img-root_slb08_45{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--space-8);margin-top:var(--space-8);text-align:center}._react-markdown__img_slb08_45{border:1px solid var(--surface-border-interactive);border-radius:var(--border-radius-default);background-color:var(--background-surface);width:100%;height:auto;overflow:hidden}
1
+ ._react-markdown_1hq09_1{display:flex;flex-direction:column}._react-markdown__h1_1hq09_6,._react-markdown__h2_1hq09_7{margin-top:var(--space-24)}._react-markdown__h3_1hq09_11,._react-markdown__h4_1hq09_12{margin-top:var(--space-16)}._react-markdown__h5_1hq09_16,._react-markdown__p_1hq09_17,._react-markdown__code_1hq09_18{margin-top:var(--space-8)}._react-markdown__ul_1hq09_22{margin-top:var(--space-8);padding-left:var(--space-24);list-style-type:disc}._react-markdown__ol_1hq09_28{margin-top:var(--space-8);padding-left:var(--space-24);list-style-type:decimal}._react-markdown__li_1hq09_34{vertical-align:middle}._react-markdown__li_1hq09_34>ul,._react-markdown__li_1hq09_34>ol{margin-top:0}._react-markdown__img-root_1hq09_45{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--space-8);margin-top:var(--space-8);text-align:center}._react-markdown__img_1hq09_45{border:1px solid var(--surface-interactive-border);border-radius:var(--border-radius-default);background-color:var(--surface-background);width:100%;height:auto;overflow:hidden}
package/dist/index22.css CHANGED
@@ -1 +1 @@
1
- ._code_1uijz_1{border-radius:var(--border-radius-default);padding:var(--space-8)}._code_title_1uijz_6{border-top-left-radius:0}._code__value_1uijz_10{font-size:var(--font-size-default);font-family:var(--font-family-code)}._code__title_1uijz_15{border-top-right-radius:var(--border-radius-default);border-top-left-radius:var(--border-radius-default);padding:var(--space-4) var(--space-8);width:-moz-fit-content;width:fit-content}
1
+ ._code__root_1cnms_1{border-radius:var(--border-radius-default);overflow:hidden}._code_1cnms_1{border-radius:var(--border-radius-default);padding:var(--space-8);overflow-x:auto}._code_title_1cnms_12{border-top-left-radius:0}._code__value_1cnms_16{font-size:var(--font-size-default);font-family:var(--font-family-code)}._code__title_1cnms_21{border-top-right-radius:var(--border-radius-default);border-top-left-radius:var(--border-radius-default);padding:var(--space-4) var(--space-8);width:-moz-fit-content;width:fit-content}
@@ -1,36 +1,36 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import s from "react-markdown";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import i from "react-markdown";
3
3
  import { omit as a } from "../../-utils.js";
4
- import { Anchor as i } from "../../components/anchor/index.js";
5
- import { Code as w } from "../../components/code/index.js";
4
+ import { Anchor as h } from "../../components/anchor/index.js";
5
+ import { Code as s } from "../../components/code/index.js";
6
6
  import { Heading as m } from "../../components/heading/index.js";
7
- import { InlineCode as k } from "../../components/inline-code/index.js";
8
- import { S as h } from "../../index-DVjyPAD4.js";
9
- import { Text as l } from "../../components/text/index.js";
7
+ import { InlineCode as w } from "../../components/inline-code/index.js";
8
+ import { S as k } from "../../index-DVjyPAD4.js";
9
+ import { Text as c } from "../../components/text/index.js";
10
10
  import { View as u } from "../../components/view/index.js";
11
11
  import '../../index2.css';const _ = {
12
- "react-markdown__h1": "_react-markdown__h1_slb08_6",
13
- "react-markdown__h2": "_react-markdown__h2_slb08_7",
14
- "react-markdown__h3": "_react-markdown__h3_slb08_11",
15
- "react-markdown__h4": "_react-markdown__h4_slb08_12",
16
- "react-markdown__h5": "_react-markdown__h5_slb08_16",
17
- "react-markdown__p": "_react-markdown__p_slb08_17",
18
- "react-markdown__code": "_react-markdown__code_slb08_18",
19
- "react-markdown__ul": "_react-markdown__ul_slb08_22",
20
- "react-markdown__ol": "_react-markdown__ol_slb08_28",
21
- "react-markdown__li": "_react-markdown__li_slb08_34",
22
- "react-markdown__img-root": "_react-markdown__img-root_slb08_45",
23
- "react-markdown__img": "_react-markdown__img_slb08_45"
12
+ "react-markdown__h1": "_react-markdown__h1_1hq09_6",
13
+ "react-markdown__h2": "_react-markdown__h2_1hq09_7",
14
+ "react-markdown__h3": "_react-markdown__h3_1hq09_11",
15
+ "react-markdown__h4": "_react-markdown__h4_1hq09_12",
16
+ "react-markdown__h5": "_react-markdown__h5_1hq09_16",
17
+ "react-markdown__p": "_react-markdown__p_1hq09_17",
18
+ "react-markdown__code": "_react-markdown__code_1hq09_18",
19
+ "react-markdown__ul": "_react-markdown__ul_1hq09_22",
20
+ "react-markdown__ol": "_react-markdown__ol_1hq09_28",
21
+ "react-markdown__li": "_react-markdown__li_1hq09_34",
22
+ "react-markdown__img-root": "_react-markdown__img-root_1hq09_45",
23
+ "react-markdown__img": "_react-markdown__img_1hq09_45"
24
24
  };
25
- function z({
25
+ function S({
26
26
  components: n,
27
27
  children: t,
28
- ...c
28
+ ...d
29
29
  }) {
30
30
  return /* @__PURE__ */ e(
31
- s,
31
+ i,
32
32
  {
33
- ...c,
33
+ ...d,
34
34
  components: {
35
35
  h1: (r) => /* @__PURE__ */ e(
36
36
  m,
@@ -73,14 +73,14 @@ function z({
73
73
  }
74
74
  ),
75
75
  p: (r) => /* @__PURE__ */ e(
76
- l,
76
+ c,
77
77
  {
78
78
  ...a(r, ["node"]),
79
79
  multiline: !0,
80
80
  className: _["react-markdown__p"]
81
81
  }
82
82
  ),
83
- hr: () => /* @__PURE__ */ e(h, {}),
83
+ hr: () => /* @__PURE__ */ e(k, {}),
84
84
  ul: (r) => /* @__PURE__ */ e(
85
85
  "ul",
86
86
  {
@@ -103,7 +103,7 @@ function z({
103
103
  }
104
104
  ),
105
105
  a: ({ href: r, ...o }) => /* @__PURE__ */ e(
106
- i,
106
+ h,
107
107
  {
108
108
  ...a(o, ["node"]),
109
109
  href: r,
@@ -114,15 +114,15 @@ function z({
114
114
  }
115
115
  ),
116
116
  code: ({ className: r, ...o }) => typeof o.children == "string" && !o.children.includes(`
117
- `) ? /* @__PURE__ */ e(k, { ...a(o, ["node"]) }) : /* @__PURE__ */ e(
118
- w,
117
+ `) ? /* @__PURE__ */ e(w, { ...a(o, ["node"]) }) : /* @__PURE__ */ e(
118
+ s,
119
119
  {
120
120
  className: _["react-markdown__code"],
121
121
  ...a(o, ["node"]),
122
122
  language: g(r)
123
123
  }
124
124
  ),
125
- img: ({ alt: r, ...o }) => /* @__PURE__ */ d(u, { className: _["react-markdown__img-root"], children: [
125
+ img: ({ alt: r, ...o }) => /* @__PURE__ */ l(u, { className: _["react-markdown__img-root"], children: [
126
126
  /* @__PURE__ */ e(
127
127
  "img",
128
128
  {
@@ -131,7 +131,7 @@ function z({
131
131
  className: _["react-markdown__img"]
132
132
  }
133
133
  ),
134
- r ? /* @__PURE__ */ e(l, { size: "sm", color: "dimmer", multiline: !0, children: r }) : null
134
+ r ? /* @__PURE__ */ e(c, { size: "sm", color: "dimmer", multiline: !0, children: r }) : null
135
135
  ] }),
136
136
  ...n
137
137
  },
@@ -147,5 +147,5 @@ function f(n) {
147
147
  return n?.startsWith("https://");
148
148
  }
149
149
  export {
150
- z as Markdown
150
+ S as Markdown
151
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koide-labs/ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {