laif-ds 0.2.78 → 0.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/CHANGELOG.md +25 -0
  2. package/dist/_virtual/index3.js +5 -5
  3. package/dist/_virtual/index4.js +5 -5
  4. package/dist/_virtual/index5.js +4 -4
  5. package/dist/agent-docs/adoption-report.json +10 -10
  6. package/dist/agent-docs/components/AppEditor.md +4 -4
  7. package/dist/agent-docs/components/AppSelect.md +46 -0
  8. package/dist/agent-docs/manifest.json +5 -3
  9. package/dist/components/editor/editor-ui/content-editable.js +15 -8
  10. package/dist/components/ui/app-editor.js +88 -76
  11. package/dist/components/ui/app-select.js +232 -143
  12. package/dist/components/ui/date-picker.js +184 -153
  13. package/dist/components/ui/markdown-renderer.js +40 -30
  14. package/dist/index.d.ts +3 -1
  15. package/dist/node_modules/comma-separated-tokens/index.js +16 -5
  16. package/dist/node_modules/entities/dist/esm/decode-codepoint.js +39 -0
  17. package/dist/node_modules/entities/dist/esm/decode.js +246 -0
  18. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +8 -0
  19. package/dist/node_modules/eventemitter3/index.js +1 -1
  20. package/dist/node_modules/hast-util-from-parse5/lib/index.js +146 -0
  21. package/dist/node_modules/hast-util-parse-selector/lib/index.js +21 -0
  22. package/dist/node_modules/hast-util-raw/lib/index.js +218 -0
  23. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  24. package/dist/node_modules/hast-util-to-parse5/lib/index.js +119 -0
  25. package/dist/node_modules/hastscript/lib/create-h.js +113 -0
  26. package/dist/node_modules/hastscript/lib/index.js +9 -0
  27. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +45 -0
  28. package/dist/node_modules/parse5/dist/common/doctype.js +99 -0
  29. package/dist/node_modules/parse5/dist/common/error-codes.js +8 -0
  30. package/dist/node_modules/parse5/dist/common/foreign-content.js +211 -0
  31. package/dist/node_modules/parse5/dist/common/html.js +251 -0
  32. package/dist/node_modules/parse5/dist/common/token.js +15 -0
  33. package/dist/node_modules/parse5/dist/common/unicode.js +74 -0
  34. package/dist/node_modules/parse5/dist/parser/formatting-element-list.js +85 -0
  35. package/dist/node_modules/parse5/dist/parser/index.js +2272 -0
  36. package/dist/node_modules/parse5/dist/parser/open-element-stack.js +241 -0
  37. package/dist/node_modules/parse5/dist/serializer/index.js +3 -0
  38. package/dist/node_modules/parse5/dist/tokenizer/index.js +1941 -0
  39. package/dist/node_modules/parse5/dist/tokenizer/preprocessor.js +89 -0
  40. package/dist/node_modules/parse5/dist/tree-adapters/default.js +163 -0
  41. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  42. package/dist/node_modules/rehype-raw/lib/index.js +13 -0
  43. package/dist/node_modules/space-separated-tokens/index.js +8 -3
  44. package/dist/node_modules/unified/lib/index.js +1 -1
  45. package/dist/node_modules/vfile-location/lib/index.js +43 -0
  46. package/dist/node_modules/web-namespaces/index.js +12 -0
  47. package/dist/styles.v3.css +1 -1
  48. package/package.json +2 -1
@@ -1,127 +1,143 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
3
- import * as f from "react";
4
- import { useCallback as L, useMemo as p, useEffect as ue } from "react";
5
- import { designTokens as r } from "../design-tokens.js";
6
- import { Calendar as X } from "./calendar.js";
7
- import { Icon as B } from "./icon.js";
8
- import { Label as fe } from "./label.js";
9
- import { Popover as he, PopoverTrigger as ge, PopoverContent as ve } from "./popover.js";
10
- import { cn as G } from "../../lib/utils.js";
11
- import { TimePickerColumn as k } from "./app-time-picker.js";
12
- import { it as be } from "../../node_modules/date-fns/locale/it.js";
13
- import { formatDate as H } from "../../node_modules/date-fns/format.js";
14
- import { isSameDay as Ce } from "../../node_modules/date-fns/isSameDay.js";
15
- const J = (t) => {
16
- if (!Number.isFinite(t)) return 1;
17
- const x = Math.trunc(t);
18
- return Math.min(59, Math.max(1, x));
2
+ import { jsxs as f, jsx as r } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { useCallback as X, useMemo as H, useEffect as G } from "react";
5
+ import { designTokens as l } from "../design-tokens.js";
6
+ import { Calendar as J, CalendarDayButton as Ce } from "./calendar.js";
7
+ import { Icon as K } from "./icon.js";
8
+ import { Label as xe } from "./label.js";
9
+ import { Popover as be, PopoverTrigger as De, PopoverContent as Me } from "./popover.js";
10
+ import { cn as Q } from "../../lib/utils.js";
11
+ import { TimePickerColumn as R } from "./app-time-picker.js";
12
+ import { it as Se } from "../../node_modules/date-fns/locale/it.js";
13
+ import { formatDate as z } from "../../node_modules/date-fns/format.js";
14
+ import { isSameDay as O } from "../../node_modules/date-fns/isSameDay.js";
15
+ const W = (o) => {
16
+ if (!Number.isFinite(o)) return 1;
17
+ const M = Math.trunc(o);
18
+ return Math.min(59, Math.max(1, M));
19
19
  };
20
- function Oe(t) {
20
+ function Te(o) {
21
21
  const {
22
- placeholder: x = "Seleziona data",
23
- dateFormat: K,
24
- className: Q,
22
+ placeholder: M = "Seleziona data",
23
+ dateFormat: Y,
24
+ className: Z,
25
25
  disabled: d = !1,
26
- size: h = "default",
27
- firstDate: P,
28
- lastDate: z,
29
- availableDates: O,
30
- locale: u = be,
31
- initialCalendarMonth: g,
32
- customCalendarProps: F,
33
- label: I,
34
- labelClassName: U,
35
- wrpClassName: W,
36
- id: Y,
37
- "data-testid": Z,
38
- minDate: T,
39
- maxDate: j,
40
- numberOfMonths: $,
41
- clearable: ee = !1,
42
- onClear: A
43
- } = t, n = t.mode === "range", v = !n && t.showTime === !0, w = !n && t.withSeconds === !0, M = n ? 1 : J(t.minuteStep), y = n ? 1 : J(t.secondStep), D = K ?? (v ? w ? "dd/MM/yyyy HH:mm:ss" : "dd/MM/yyyy HH:mm" : "dd/MM/yyyy"), [s, b] = f.useState(
44
- n ? void 0 : t.value
45
- ), [i, N] = f.useState(
46
- n ? t.value : void 0
47
- ), [R, C] = f.useState(
48
- g
49
- ), [_, V] = f.useState(!1), te = (e) => {
50
- const a = e ? new Date(e) : void 0;
51
- v && a && s && a.setHours(
52
- s.getHours(),
53
- s.getMinutes(),
54
- s.getSeconds()
55
- ), b(a), a && C(a), !n && t.onChange && t.onChange(a), !v && a && V(!1);
56
- }, ae = L(() => {
57
- n ? (N(void 0), t.onChange && t.onChange(void 0)) : (b(void 0), t.onChange && t.onChange(void 0)), A?.();
58
- }, [n, t.onChange, A]), ne = s?.getHours(), oe = s?.getMinutes(), se = s?.getSeconds(), ie = p(
59
- () => Array.from({ length: 24 }, (e, a) => a),
26
+ size: v = "default",
27
+ firstDate: E,
28
+ lastDate: F,
29
+ availableDates: I,
30
+ locale: u = Se,
31
+ initialCalendarMonth: w,
32
+ customCalendarProps: S,
33
+ label: T,
34
+ labelClassName: $,
35
+ wrpClassName: ee,
36
+ id: te,
37
+ "data-testid": ne,
38
+ minDate: A,
39
+ maxDate: _,
40
+ numberOfMonths: oe,
41
+ clearable: ae = !1,
42
+ onClear: j
43
+ } = o, a = o.mode === "range", C = !a && o.showTime === !0, N = !a && o.withSeconds === !0, p = a ? 1 : W(o.minuteStep), k = a ? 1 : W(o.secondStep), P = Y ?? (C ? N ? "dd/MM/yyyy HH:mm:ss" : "dd/MM/yyyy HH:mm" : "dd/MM/yyyy"), [i, x] = c.useState(
44
+ a ? void 0 : o.value
45
+ ), [n, b] = c.useState(
46
+ a ? o.value : void 0
47
+ ), [L, D] = c.useState(
48
+ w
49
+ ), [B, V] = c.useState(!1), re = (e) => {
50
+ const t = e ? new Date(e) : void 0;
51
+ C && t && i && t.setHours(
52
+ i.getHours(),
53
+ i.getMinutes(),
54
+ i.getSeconds()
55
+ ), x(t), t && D(t), !a && o.onChange && o.onChange(t), !C && t && V(!1);
56
+ }, ie = X(() => {
57
+ a ? (b(void 0), o.onChange && o.onChange(void 0)) : (x(void 0), o.onChange && o.onChange(void 0)), j?.();
58
+ }, [a, o.onChange, j]), se = i?.getHours(), le = i?.getMinutes(), fe = i?.getSeconds(), de = H(
59
+ () => Array.from({ length: 24 }, (e, t) => t),
60
60
  []
61
- ), re = p(
61
+ ), me = H(
62
62
  () => Array.from(
63
- { length: Math.floor(59 / M) + 1 },
64
- (e, a) => a * M
63
+ { length: Math.floor(59 / p) + 1 },
64
+ (e, t) => t * p
65
65
  ),
66
- [M]
67
- ), le = p(
66
+ [p]
67
+ ), ce = H(
68
68
  () => Array.from(
69
- { length: Math.floor(59 / y) + 1 },
70
- (e, a) => a * y
69
+ { length: Math.floor(59 / k) + 1 },
70
+ (e, t) => t * k
71
71
  ),
72
- [y]
73
- ), S = L(
74
- (e, a) => {
75
- const m = s ? new Date(s) : /* @__PURE__ */ new Date();
76
- s || m.setHours(0, 0, 0, 0), e === "hour" ? m.setHours(a) : e === "minute" ? m.setMinutes(a) : e === "second" && m.setSeconds(a), b(m), !n && t.onChange && t.onChange(m);
72
+ [k]
73
+ ), y = X(
74
+ (e, t) => {
75
+ const s = i ? new Date(i) : /* @__PURE__ */ new Date();
76
+ i || s.setHours(0, 0, 0, 0), e === "hour" ? s.setHours(t) : e === "minute" ? s.setMinutes(t) : e === "second" && s.setSeconds(t), x(s), !a && o.onChange && o.onChange(s);
77
77
  },
78
- [s, n, t.onChange]
79
- ), de = (e) => {
80
- N(e), e?.from && C(e.from), n && t.onChange && t.onChange(e);
78
+ [i, a, o.onChange]
79
+ ), ue = (e, t) => {
80
+ let s;
81
+ !n || !n.from ? s = { from: t, to: void 0 } : n.from && !n.to ? t < n.from ? s = { from: t, to: void 0 } : s = { from: n.from, to: t } : n.from && n.to && (s = { from: t, to: void 0 }), b(s), s?.from && D(s.from), a && o.onChange && o.onChange(s);
81
82
  };
82
- let c = [];
83
- P && c.push({ before: P }), z && c.push({ after: z }), O?.length && c.push(
84
- (e) => !O.some(
85
- (a) => Ce(a, e)
83
+ let m = [];
84
+ E && m.push({ before: E }), F && m.push({ after: F }), I?.length && m.push(
85
+ (e) => !I.some(
86
+ (t) => O(t, e)
86
87
  )
87
- ), d && (c = [!0]), ue(() => {
88
- if (n) {
89
- N(t.value);
90
- const e = t.value?.from;
91
- C(e ?? g);
88
+ ), d && (m = [!0]), G(() => {
89
+ if (a) {
90
+ b(o.value);
91
+ const e = o.value?.from;
92
+ D(e ?? w);
92
93
  } else
93
- b(t.value), C(
94
- t.value ?? g
94
+ x(o.value), D(
95
+ o.value ?? w
95
96
  );
96
- }, [t.value, n, g]);
97
- const ce = f.useId(), q = Y ?? ce, E = n ? !!i?.from : !!s, me = () => n && i ? /* @__PURE__ */ l("span", { children: [
98
- i.from && H(i.from, D, { locale: u }),
99
- i.from && i.to && " - ",
100
- i.to && H(i.to, D, { locale: u })
101
- ] }) : !n && s ? /* @__PURE__ */ o("span", { children: H(s, D, { locale: u }) }) : /* @__PURE__ */ o("span", { className: "text-d-muted-foreground", children: x });
102
- return /* @__PURE__ */ l("div", { className: G("flex flex-col gap-1.5", W), children: [
103
- I && /* @__PURE__ */ o(fe, { htmlFor: q, className: U, children: I }),
104
- /* @__PURE__ */ l(he, { open: d ? !1 : _, onOpenChange: V, modal: !0, children: [
105
- /* @__PURE__ */ o(ge, { asChild: !0, children: /* @__PURE__ */ l(
97
+ }, [o.value, a, w]);
98
+ const [h, g] = c.useState(
99
+ null
100
+ );
101
+ G(() => {
102
+ const e = () => {
103
+ h && (g(null), a && o.onChange && o.onChange(n));
104
+ };
105
+ return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
106
+ }, [h, a, o.onChange, n]);
107
+ const he = (e, t) => {
108
+ !a || !n || !n.from || !n.to || (O(e, n.from) ? (g("from"), t.preventDefault()) : O(e, n.to) && (g("to"), t.preventDefault()));
109
+ }, ge = (e) => {
110
+ if (!h || !n || !n.from || !n.to) return;
111
+ let t = { ...n };
112
+ h === "from" ? e <= n.to ? t.from = e : (t.from = n.to, t.to = e, g("to")) : h === "to" && (e >= n.from ? t.to = e : (t.to = n.from, t.from = e, g("from"))), b(t);
113
+ }, ve = c.useId(), q = te ?? ve, U = a ? !!n?.from : !!i, we = () => a && n ? /* @__PURE__ */ f("span", { children: [
114
+ n.from && z(n.from, P, { locale: u }),
115
+ n.from && n.to && " - ",
116
+ n.to && z(n.to, P, { locale: u })
117
+ ] }) : !a && i ? /* @__PURE__ */ r("span", { children: z(i, P, { locale: u }) }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: M });
118
+ return /* @__PURE__ */ f("div", { className: Q("flex flex-col gap-1.5", ee), children: [
119
+ T && /* @__PURE__ */ r(xe, { htmlFor: q, className: $, children: T }),
120
+ /* @__PURE__ */ f(be, { open: d ? !1 : B, onOpenChange: V, modal: !0, children: [
121
+ /* @__PURE__ */ r(De, { asChild: !0, children: /* @__PURE__ */ f(
106
122
  "div",
107
123
  {
108
124
  id: q,
109
- "data-testid": Z,
110
- className: G(
111
- r.input.base,
112
- r.radius.default,
113
- r.text.base,
114
- r.interaction.disabled,
125
+ "data-testid": ne,
126
+ className: Q(
127
+ l.input.base,
128
+ l.radius.default,
129
+ l.text.base,
130
+ l.interaction.disabled,
115
131
  "flex items-center gap-2 font-normal whitespace-nowrap [&>span]:line-clamp-1",
116
- r.focusRing,
117
- _ && r.activeRing,
132
+ l.focusRing,
133
+ B && l.activeRing,
118
134
  "hover:border-d-ring cursor-pointer transition-colors",
119
- !E && "text-d-muted-foreground",
135
+ !U && "text-d-muted-foreground",
120
136
  d && "cursor-not-allowed opacity-50",
121
- h === "default" && r.sizes.default,
122
- h === "sm" && r.sizes.sm,
123
- h === "lg" && r.sizes.lg,
124
- Q
137
+ v === "default" && l.sizes.default,
138
+ v === "sm" && l.sizes.sm,
139
+ v === "lg" && l.sizes.lg,
140
+ Z
125
141
  ),
126
142
  "aria-disabled": d,
127
143
  role: "button",
@@ -129,20 +145,20 @@ function Oe(t) {
129
145
  onClick: d ? void 0 : () => {
130
146
  },
131
147
  children: [
132
- /* @__PURE__ */ o(B, { name: "Calendar", size: h === "lg" ? "sm" : "xs" }),
133
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: me() }),
134
- ee && E && /* @__PURE__ */ o(
148
+ /* @__PURE__ */ r(K, { name: "Calendar", size: v === "lg" ? "sm" : "xs" }),
149
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: we() }),
150
+ ae && U && /* @__PURE__ */ r(
135
151
  "div",
136
152
  {
137
153
  role: "button",
138
154
  className: "bg-d-accent hover:bg-d-accent/80 border-d-border flex shrink-0 cursor-pointer items-center justify-center rounded-full border p-1 transition-colors",
139
155
  onClick: (e) => {
140
- e.stopPropagation(), e.preventDefault(), ae();
156
+ e.stopPropagation(), e.preventDefault(), ie();
141
157
  },
142
158
  onMouseDown: (e) => e.preventDefault(),
143
159
  "aria-label": "Clear selection",
144
- children: /* @__PURE__ */ o(
145
- B,
160
+ children: /* @__PURE__ */ r(
161
+ K,
146
162
  {
147
163
  name: "X",
148
164
  size: "xs",
@@ -155,83 +171,98 @@ function Oe(t) {
155
171
  }
156
172
  ) }),
157
173
  " ",
158
- /* @__PURE__ */ l(
159
- ve,
174
+ /* @__PURE__ */ f(
175
+ Me,
160
176
  {
161
177
  className: "flex max-h-[500px] min-h-0 w-auto flex-row p-0 shadow",
162
178
  align: "start",
163
179
  children: [
164
- n ? /* @__PURE__ */ o(
165
- X,
180
+ a ? /* @__PURE__ */ r(
181
+ J,
166
182
  {
167
- ...F || {},
183
+ ...S || {},
168
184
  mode: "range",
169
- selected: i,
170
- onSelect: de,
185
+ selected: n,
186
+ onSelect: ue,
171
187
  autoFocus: !0,
172
- disabled: c,
188
+ disabled: m,
173
189
  locale: u,
174
- defaultMonth: R,
175
- numberOfMonths: $ ?? 1,
176
- minDate: T,
177
- maxDate: j
190
+ defaultMonth: L,
191
+ numberOfMonths: oe ?? 1,
192
+ minDate: A,
193
+ maxDate: _,
194
+ components: {
195
+ ...S?.components,
196
+ DayButton: (e) => /* @__PURE__ */ r(
197
+ Ce,
198
+ {
199
+ ...e,
200
+ onPointerDown: (t) => {
201
+ e.onPointerDown && e.onPointerDown(t), he(e.day.date, t);
202
+ },
203
+ onPointerEnter: (t) => {
204
+ e.onPointerEnter && e.onPointerEnter(t), ge(e.day.date);
205
+ }
206
+ }
207
+ )
208
+ }
178
209
  }
179
- ) : /* @__PURE__ */ o(
180
- X,
210
+ ) : /* @__PURE__ */ r(
211
+ J,
181
212
  {
182
- ...F || {},
213
+ ...S || {},
183
214
  mode: "single",
184
- selected: s,
185
- onSelect: te,
215
+ selected: i,
216
+ onSelect: re,
186
217
  autoFocus: !0,
187
- disabled: c,
218
+ disabled: m,
188
219
  locale: u,
189
- defaultMonth: R,
190
- minDate: T,
191
- maxDate: j
220
+ defaultMonth: L,
221
+ minDate: A,
222
+ maxDate: _
192
223
  }
193
224
  ),
194
- v && /* @__PURE__ */ l("div", { className: "border-d-border/50 relative flex shrink-0 flex-row overflow-hidden border-l", children: [
195
- /* @__PURE__ */ l(
225
+ C && /* @__PURE__ */ f("div", { className: "border-d-border/50 relative flex shrink-0 flex-row overflow-hidden border-l", children: [
226
+ /* @__PURE__ */ f(
196
227
  "div",
197
228
  {
198
229
  className: "invisible flex h-0 flex-row overflow-hidden opacity-0 select-none",
199
230
  "aria-hidden": "true",
200
231
  children: [
201
- /* @__PURE__ */ o("div", { className: "w-12 shrink-0 sm:w-14" }),
202
- /* @__PURE__ */ o("div", { className: "w-12 shrink-0 sm:w-14" }),
203
- w && /* @__PURE__ */ o("div", { className: "w-12 shrink-0 sm:w-14" })
232
+ /* @__PURE__ */ r("div", { className: "w-12 shrink-0 sm:w-14" }),
233
+ /* @__PURE__ */ r("div", { className: "w-12 shrink-0 sm:w-14" }),
234
+ N && /* @__PURE__ */ r("div", { className: "w-12 shrink-0 sm:w-14" })
204
235
  ]
205
236
  }
206
237
  ),
207
- /* @__PURE__ */ l("div", { className: "absolute inset-0 flex h-full w-full flex-row overflow-y-auto", children: [
208
- /* @__PURE__ */ o(
209
- k,
238
+ /* @__PURE__ */ f("div", { className: "absolute inset-0 flex h-full w-full flex-row overflow-y-auto", children: [
239
+ /* @__PURE__ */ r(
240
+ R,
210
241
  {
211
242
  type: "hour",
212
- value: ne,
213
- options: ie,
214
- onChange: (e) => S("hour", e),
243
+ value: se,
244
+ options: de,
245
+ onChange: (e) => y("hour", e),
215
246
  className: "flex flex-1"
216
247
  }
217
248
  ),
218
- /* @__PURE__ */ o(
219
- k,
249
+ /* @__PURE__ */ r(
250
+ R,
220
251
  {
221
252
  type: "minute",
222
- value: oe,
223
- options: re,
224
- onChange: (e) => S("minute", e),
253
+ value: le,
254
+ options: me,
255
+ onChange: (e) => y("minute", e),
225
256
  className: "flex flex-1"
226
257
  }
227
258
  ),
228
- w && /* @__PURE__ */ o(
229
- k,
259
+ N && /* @__PURE__ */ r(
260
+ R,
230
261
  {
231
262
  type: "second",
232
- value: se,
233
- options: le,
234
- onChange: (e) => S("second", e),
263
+ value: fe,
264
+ options: ce,
265
+ onChange: (e) => y("second", e),
235
266
  className: "flex flex-1"
236
267
  }
237
268
  )
@@ -244,5 +275,5 @@ function Oe(t) {
244
275
  ] });
245
276
  }
246
277
  export {
247
- Oe as DatePicker
278
+ Te as DatePicker
248
279
  };
@@ -1,30 +1,39 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as p, Fragment as y } from "react/jsx-runtime";
2
+ import { jsx as t, jsxs as p, Fragment as y } from "react/jsx-runtime";
3
3
  import g, { Suspense as x } from "react";
4
4
  import { CopyButton as k } from "./copy-button.js";
5
5
  import { cn as m } from "../../lib/utils.js";
6
- import { Markdown as N } from "../../node_modules/react-markdown/lib/index.js";
6
+ import { Markdown as w } from "../../node_modules/react-markdown/lib/index.js";
7
+ import N from "../../node_modules/rehype-raw/lib/index.js";
7
8
  import v from "../../node_modules/remark-gfm/lib/index.js";
8
- function q({ children: e }) {
9
- return /* @__PURE__ */ o("div", { className: "space-y-3", children: /* @__PURE__ */ o(N, { remarkPlugins: [v], components: C, children: e }) });
9
+ function B({ children: e }) {
10
+ return /* @__PURE__ */ t("div", { className: "space-y-3", children: /* @__PURE__ */ t(
11
+ w,
12
+ {
13
+ remarkPlugins: [v],
14
+ rehypePlugins: [N],
15
+ components: S,
16
+ children: e
17
+ }
18
+ ) });
10
19
  }
11
- const h = g.memo(
12
- async ({ children: e, language: t, ...n }) => {
20
+ const u = g.memo(
21
+ async ({ children: e, language: o, ...n }) => {
13
22
  const { codeToTokens: i, bundledLanguages: d } = await import("../../node_modules/shiki/dist/index.js");
14
- if (!(t in d))
15
- return /* @__PURE__ */ o("pre", { ...n, children: e });
23
+ if (!(o in d))
24
+ return /* @__PURE__ */ t("pre", { ...n, children: e });
16
25
  const { tokens: l } = await i(e, {
17
- lang: t,
26
+ lang: o,
18
27
  defaultColor: !1,
19
28
  themes: {
20
29
  light: "github-light",
21
30
  dark: "github-dark"
22
31
  }
23
32
  });
24
- return /* @__PURE__ */ o("pre", { ...n, children: /* @__PURE__ */ o("code", { children: l.map((u, c) => /* @__PURE__ */ p(y, { children: [
25
- /* @__PURE__ */ o("span", { children: u.map((a, b) => {
33
+ return /* @__PURE__ */ t("pre", { ...n, children: /* @__PURE__ */ t("code", { children: l.map((h, c) => /* @__PURE__ */ p(y, { children: [
34
+ /* @__PURE__ */ t("span", { children: h.map((a, b) => {
26
35
  const f = typeof a.htmlStyle == "string" ? void 0 : a.htmlStyle;
27
- return /* @__PURE__ */ o(
36
+ return /* @__PURE__ */ t(
28
37
  "span",
29
38
  {
30
39
  className: "text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",
@@ -39,53 +48,54 @@ const h = g.memo(
39
48
  ] })) }) });
40
49
  }
41
50
  );
42
- h.displayName = "HighlightedCode";
43
- const w = ({
51
+ u.displayName = "HighlightedCode";
52
+ const C = ({
44
53
  children: e,
45
- className: t,
54
+ className: o,
46
55
  language: n,
47
56
  ...i
48
57
  }) => {
49
58
  const d = typeof e == "string" ? e : s(e), l = m(
50
59
  "overflow-x-scroll rounded-md border border-d-border bg-d-background/50 p-4 font-mono text-sm [scrollbar-width:none]",
51
- t
60
+ o
52
61
  );
53
62
  return /* @__PURE__ */ p("div", { className: "group/code relative mb-4", children: [
54
- /* @__PURE__ */ o(
63
+ /* @__PURE__ */ t(
55
64
  x,
56
65
  {
57
- fallback: /* @__PURE__ */ o("pre", { className: l, ...i, children: e }),
58
- children: /* @__PURE__ */ o(h, { language: n, className: l, children: d })
66
+ fallback: /* @__PURE__ */ t("pre", { className: l, ...i, children: e }),
67
+ children: /* @__PURE__ */ t(u, { language: n, className: l, children: d })
59
68
  }
60
69
  ),
61
- /* @__PURE__ */ o("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ o(k, { content: d, copyMessage: "Copied code to clipboard" }) })
70
+ /* @__PURE__ */ t("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ t(k, { content: d, copyMessage: "Copied code to clipboard" }) })
62
71
  ] });
63
72
  };
64
73
  function s(e) {
65
74
  if (typeof e == "string")
66
75
  return e;
67
76
  if (g.isValidElement(e) && e.props && typeof e.props == "object" && "children" in e.props) {
68
- const t = e.props.children;
69
- return t && typeof t == "object" && Array.isArray(t) ? t.map((n) => s(n)).join("") : s(t);
77
+ const o = e.props.children;
78
+ return o && typeof o == "object" && Array.isArray(o) ? o.map((n) => s(n)).join("") : s(o);
70
79
  }
71
80
  return "";
72
81
  }
73
- const C = {
82
+ const S = {
74
83
  h1: r("h1", "text-2xl font-semibold"),
75
84
  h2: r("h2", "font-semibold text-xl"),
76
85
  h3: r("h3", "font-semibold text-lg"),
77
86
  h4: r("h4", "font-semibold text-base"),
78
87
  h5: r("h5", "font-medium"),
79
88
  strong: r("strong", "font-semibold"),
89
+ u: r("u", "underline"),
80
90
  a: r("a", "text-d-primary underline underline-offset-2"),
81
91
  blockquote: r("blockquote", "border-l-2 border-d-primary pl-4"),
82
92
  code: ({
83
93
  children: e,
84
- className: t,
94
+ className: o,
85
95
  ...n
86
96
  }) => {
87
- const i = /language-(\w+)/.exec(t || "");
88
- return i ? /* @__PURE__ */ o(w, { className: t, language: i[1], ...n, children: e }) : /* @__PURE__ */ o(
97
+ const i = /language-(\w+)/.exec(o || "");
98
+ return i ? /* @__PURE__ */ t(C, { className: o, language: i[1], ...n, children: e }) : /* @__PURE__ */ t(
89
99
  "code",
90
100
  {
91
101
  className: m(
@@ -116,13 +126,13 @@ const C = {
116
126
  p: r("p", "whitespace-pre-wrap"),
117
127
  hr: r("hr", "border-foreground/20")
118
128
  };
119
- function r(e, t) {
129
+ function r(e, o) {
120
130
  const n = ({
121
131
  ...i
122
- }) => /* @__PURE__ */ o(e, { className: t, ...i });
132
+ }) => /* @__PURE__ */ t(e, { className: o, ...i });
123
133
  return n.displayName = String(e), n;
124
134
  }
125
135
  export {
126
- q as MarkdownRenderer,
127
- q as default
136
+ B as MarkdownRenderer,
137
+ B as default
128
138
  };
package/dist/index.d.ts CHANGED
@@ -260,7 +260,7 @@ export declare interface AppDialogProps extends Omit<DialogContentProps, "title"
260
260
  preventClose?: "overlay" | "all";
261
261
  }
262
262
 
263
- export declare function AppEditor({ defaultValue, onMarkdownEdit, plugins, toolbars, placeholder, onlyMarkdown, className, }: AppEditorProps): JSX.Element;
263
+ export declare function AppEditor({ defaultValue, onMarkdownEdit, plugins, toolbars, placeholder, onlyMarkdown, className, wrpClassName, }: AppEditorProps): JSX.Element;
264
264
 
265
265
  declare type AppEditorPlugin = "clear" | "counter";
266
266
 
@@ -272,6 +272,7 @@ declare interface AppEditorProps {
272
272
  placeholder?: string;
273
273
  onlyMarkdown?: boolean;
274
274
  className?: string;
275
+ wrpClassName?: string;
275
276
  }
276
277
 
277
278
  declare type AppEditorToolbar = "block-format" | "font-format" | "history";
@@ -2594,6 +2595,7 @@ declare type MultiSelectProps = BaseProps & {
2594
2595
  defaultValue?: (string | number)[];
2595
2596
  onValueChange?: (value: (string | number)[]) => void;
2596
2597
  renderValue?: (option: AppSelectOption) => React.ReactNode;
2598
+ selectableAll?: boolean;
2597
2599
  };
2598
2600
 
2599
2601
  export declare interface NavGroup {
@@ -1,10 +1,21 @@
1
1
  "use client";
2
- function o(t, i) {
3
- const n = i || {};
4
- return (t[t.length - 1] === "" ? [...t, ""] : t).join(
5
- (n.padRight ? " " : "") + "," + (n.padLeft === !1 ? "" : " ")
2
+ function f(n) {
3
+ const i = [], t = String(n || "");
4
+ let e = t.indexOf(","), s = 0, r = !1;
5
+ for (; !r; ) {
6
+ e === -1 && (e = t.length, r = !0);
7
+ const o = t.slice(s, e).trim();
8
+ (o || !r) && i.push(o), s = e + 1, e = t.indexOf(",", s);
9
+ }
10
+ return i;
11
+ }
12
+ function c(n, i) {
13
+ const t = i || {};
14
+ return (n[n.length - 1] === "" ? [...n, ""] : n).join(
15
+ (t.padRight ? " " : "") + "," + (t.padLeft === !1 ? "" : " ")
6
16
  ).trim();
7
17
  }
8
18
  export {
9
- o as stringify
19
+ f as parse,
20
+ c as stringify
10
21
  };