@slotted/react 0.1.0-beta.15 → 0.1.0-beta.16

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 (130) hide show
  1. package/dist/{action-sheet-Klu-YxIk.js → action-sheet-dNnB26br.js} +20 -20
  2. package/dist/action-sheet.js +1 -1
  3. package/dist/{attachment-DKKiNUKe.js → attachment-C1wBuup6.js} +2 -0
  4. package/dist/attachment.js +1 -1
  5. package/dist/calendar-wqDIW4Z8.js +469 -0
  6. package/dist/calendar.js +1 -1
  7. package/dist/{column-manager-e234Ey_u.js → column-manager-C8fN_mDy.js} +6 -6
  8. package/dist/column-manager.js +1 -1
  9. package/dist/dashboard-grid-ByThIV_n.js +1066 -0
  10. package/dist/dashboard-grid.js +1 -1
  11. package/dist/{data-grid-B5feiNsE.js → data-grid-aHlR2FHu.js} +4 -4
  12. package/dist/data-grid.js +1 -1
  13. package/dist/{data-list-CUvUS2AX.js → data-list-Cu6LtnDX.js} +1 -1
  14. package/dist/data-list.js +1 -1
  15. package/dist/{date-picker-Dys-z9mZ.js → date-picker-B5V8NZCT.js} +1 -1
  16. package/dist/date-picker.js +1 -1
  17. package/dist/{date-range-picker-Cu95hHyO.js → date-range-picker-B89Q973N.js} +1 -1
  18. package/dist/date-range-picker.js +1 -1
  19. package/dist/{datetime-picker-B7eWKoN3.js → datetime-picker-Cx6Z52Ka.js} +1 -1
  20. package/dist/datetime-picker.js +1 -1
  21. package/dist/{datetime-range-picker-Cm42pY3M.js → datetime-range-picker-DYshAlgq.js} +1 -1
  22. package/dist/datetime-range-picker.js +1 -1
  23. package/dist/docs/calendar.json +19 -1
  24. package/dist/docs/calendar.md +3 -1
  25. package/dist/docs/dashboard-grid.json +26 -4
  26. package/dist/docs/dashboard-grid.md +5 -2
  27. package/dist/docs/drawer.json +13 -4
  28. package/dist/docs/drawer.md +5 -4
  29. package/dist/docs/link.json +16 -0
  30. package/dist/docs/link.md +3 -1
  31. package/dist/docs/list-item.json +10 -2
  32. package/dist/docs/list-item.md +20 -13
  33. package/dist/docs/markdown.json +7 -0
  34. package/dist/docs/markdown.md +1 -0
  35. package/dist/docs/message-scroller.json +1 -1
  36. package/dist/docs/prompt-composer.json +9 -2
  37. package/dist/docs/prompt-composer.md +3 -1
  38. package/dist/{drawer-CFpBsLG6.js → drawer-Du1aC1px.js} +17 -4
  39. package/dist/drawer.js +2 -2
  40. package/dist/{event-calendar-liaKOKOH.js → event-calendar-CEIyV-fW.js} +520 -520
  41. package/dist/event-calendar.js +1 -1
  42. package/dist/{filter-bar-vJzwcDZj.js → filter-bar-BHzy0o7n.js} +8 -8
  43. package/dist/filter-bar.js +1 -1
  44. package/dist/{import-export-center-BIB7sRCl.js → import-export-center-BX1Bhj8c.js} +1 -1
  45. package/dist/import-export-center.js +1 -1
  46. package/dist/index.js +124 -124
  47. package/dist/{link-rGL3Lr2t.js → link-YvD_Wov8.js} +23 -22
  48. package/dist/link.js +1 -1
  49. package/dist/list-item-2z75VYyp.js +160 -0
  50. package/dist/list-item.js +1 -1
  51. package/dist/markdown-gfrgwq6-.js +311 -0
  52. package/dist/markdown.js +1 -1
  53. package/dist/{prompt-composer-BDOi4rVK.js → prompt-composer-C57BzYrn.js} +109 -77
  54. package/dist/prompt-composer.js +2 -2
  55. package/dist/styles/action-sheet.css +1 -1
  56. package/dist/styles/calendar.css +3 -1
  57. package/dist/styles/chart.css +1 -1
  58. package/dist/styles/column-manager.css +1 -1
  59. package/dist/styles/command-palette.css +1 -1
  60. package/dist/styles/dashboard-grid.css +3 -1
  61. package/dist/styles/data-grid.css +1 -1
  62. package/dist/styles/date-picker.css +3 -1
  63. package/dist/styles/date-range-picker.css +3 -1
  64. package/dist/styles/datetime-picker.css +3 -1
  65. package/dist/styles/datetime-range-picker.css +3 -1
  66. package/dist/styles/detail-panel.css +1 -1
  67. package/dist/styles/dialog.css +1 -1
  68. package/dist/styles/drawer.css +1 -1
  69. package/dist/styles/event-calendar.css +1 -1
  70. package/dist/styles/filter-bar.css +4 -2
  71. package/dist/styles/import-export-center.css +2 -2
  72. package/dist/styles/index.css +11 -11
  73. package/dist/styles/link.css +1 -1
  74. package/dist/styles/markdown.css +1 -1
  75. package/dist/styles/message.css +1 -1
  76. package/dist/styles/prompt-composer.css +1 -1
  77. package/dist/styles/section.css +1 -1
  78. package/dist/styles/stat-card.css +1 -1
  79. package/dist/styles/table.css +2 -2
  80. package/dist/styles/upload.css +1 -1
  81. package/dist/styles.css +1 -1
  82. package/dist/{table-_xX87qua.js → table-BHuKvsgJ.js} +4 -4
  83. package/dist/table.js +1 -1
  84. package/dist/types/calendar/calendar.d.ts +2 -1
  85. package/dist/types/calendar/calendar.d.ts.map +1 -1
  86. package/dist/types/calendar/calendar.types.d.ts +11 -0
  87. package/dist/types/calendar/calendar.types.d.ts.map +1 -1
  88. package/dist/types/calendar/index.d.ts +1 -1
  89. package/dist/types/calendar/index.d.ts.map +1 -1
  90. package/dist/types/dashboard-grid/dashboard-grid.d.ts +1 -1
  91. package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
  92. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts +23 -3
  93. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts.map +1 -1
  94. package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
  95. package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
  96. package/dist/types/dashboard-grid/index.d.ts +1 -1
  97. package/dist/types/dashboard-grid/index.d.ts.map +1 -1
  98. package/dist/types/drawer/drawer-parts.d.ts +3 -1
  99. package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
  100. package/dist/types/drawer/drawer.types.d.ts +2 -0
  101. package/dist/types/drawer/drawer.types.d.ts.map +1 -1
  102. package/dist/types/drawer/index.d.ts +2 -2
  103. package/dist/types/drawer/index.d.ts.map +1 -1
  104. package/dist/types/link/index.d.ts +1 -1
  105. package/dist/types/link/index.d.ts.map +1 -1
  106. package/dist/types/link/link.d.ts +1 -1
  107. package/dist/types/link/link.d.ts.map +1 -1
  108. package/dist/types/link/link.types.d.ts +7 -0
  109. package/dist/types/link/link.types.d.ts.map +1 -1
  110. package/dist/types/list-item/list-item-content.d.ts +3 -3
  111. package/dist/types/list-item/list-item-content.d.ts.map +1 -1
  112. package/dist/types/list-item/list-item-nesting.d.ts +15 -0
  113. package/dist/types/list-item/list-item-nesting.d.ts.map +1 -0
  114. package/dist/types/list-item/list-item-parts.d.ts +3 -3
  115. package/dist/types/list-item/list-item-parts.d.ts.map +1 -1
  116. package/dist/types/markdown/markdown.d.ts +1 -1
  117. package/dist/types/markdown/markdown.d.ts.map +1 -1
  118. package/dist/types/markdown/markdown.types.d.ts +6 -1
  119. package/dist/types/markdown/markdown.types.d.ts.map +1 -1
  120. package/dist/types/prompt-composer/index.d.ts +2 -2
  121. package/dist/types/prompt-composer/index.d.ts.map +1 -1
  122. package/dist/types/prompt-composer/prompt-composer.d.ts +8 -1
  123. package/dist/types/prompt-composer/prompt-composer.d.ts.map +1 -1
  124. package/dist/types/prompt-composer/prompt-composer.types.d.ts +7 -1
  125. package/dist/types/prompt-composer/prompt-composer.types.d.ts.map +1 -1
  126. package/package.json +6 -6
  127. package/dist/calendar-DZx00W81.js +0 -457
  128. package/dist/dashboard-grid-B9-_lwn6.js +0 -1048
  129. package/dist/list-item-CHaJYl5r.js +0 -125
  130. package/dist/markdown-B_lMpWz0.js +0 -306
@@ -1,125 +0,0 @@
1
- import { n as e, t } from "./icon-D04-_QFA.js";
2
- import { i as n } from "./list-B7gaPH1U.js";
3
- import { definedProps as r, keyedProps as i, withSelectorKey as a } from "@slotted/core/selector-key";
4
- import { createContext as o, useContext as s } from "react";
5
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
- //#region src/list-item/list-item-defaults.tsx
7
- var d = o({
8
- align: "center",
9
- inset: !1,
10
- size: "md",
11
- tone: "secondary",
12
- truncate: !1
13
- });
14
- function f() {
15
- return s(d);
16
- }
17
- function p({ children: e, ...t }) {
18
- let n = f();
19
- return /* @__PURE__ */ l(d.Provider, {
20
- value: {
21
- align: t.align ?? n.align,
22
- inset: t.inset ?? n.inset,
23
- size: t.size ?? n.size,
24
- tone: t.tone ?? n.tone,
25
- truncate: t.truncate ?? n.truncate
26
- },
27
- children: e
28
- });
29
- }
30
- //#endregion
31
- //#region src/list-item/list-item.tsx
32
- var m = o({
33
- disabled: !1,
34
- loading: !1
35
- });
36
- function h() {
37
- return s(m);
38
- }
39
- function g({ align: r, children: a, current: o = !1, disabled: s = !1, inset: d, loading: p = !1, marker: h, position: g, render: _, selected: v = !1, setSize: y, size: b, tone: x, truncate: S, variant: C, ...w }) {
40
- let T = f(), E = n(), D = r ?? T.align, O = (d ?? E?.inset ?? T.inset) === !0, k = h ?? E?.marker ?? "none", A = b ?? E?.size ?? T.size, j = x ?? T.tone, M = (S ?? T.truncate) === !0, N = C ?? E?.variant ?? "plain", P = i({
41
- ...w,
42
- children: k === "bullet" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
43
- "aria-hidden": "true",
44
- "data-part": "marker",
45
- "data-part-marker": "",
46
- children: /* @__PURE__ */ l(t, { children: /* @__PURE__ */ l(e, { name: "dot" }) })
47
- }), a] }) : a,
48
- ...o === !1 ? {} : {
49
- "aria-current": o,
50
- "data-current": ""
51
- },
52
- ...g === void 0 ? {} : { "aria-posinset": g },
53
- ...y === void 0 ? {} : { "aria-setsize": y },
54
- ...s ? { "data-disabled": "" } : {},
55
- ...p ? { "data-loading": "" } : {},
56
- ...O ? { "data-inset": "" } : {},
57
- ...v ? { "data-selected": "" } : {},
58
- ...M ? { "data-truncate": "" } : {},
59
- "data-align": D,
60
- "data-marker": k,
61
- "data-part": "root",
62
- "data-size": A,
63
- "data-tone": j,
64
- "data-ui": "list-item",
65
- "data-variant": N
66
- }), F = _ === void 0 ? /* @__PURE__ */ l("li", { ...P }) : _(P);
67
- return /* @__PURE__ */ l(m.Provider, {
68
- value: {
69
- disabled: s,
70
- loading: p
71
- },
72
- children: F
73
- });
74
- }
75
- //#endregion
76
- //#region src/list-item/list-item-content.tsx
77
- function _({ render: e, ...t }) {
78
- let n = h(), r = i({
79
- ...t,
80
- ...n.loading ? { "aria-busy": !0 } : {},
81
- "data-part": "content"
82
- });
83
- return e === void 0 ? /* @__PURE__ */ l("div", { ...r }) : e(r);
84
- }
85
- function v({ render: e, type: t = "button", ...n }) {
86
- let r = h(), a = r.disabled || r.loading, o = i({
87
- ...n,
88
- ...r.loading ? { "aria-busy": !0 } : {},
89
- "data-part": "content",
90
- disabled: a || n.disabled === !0,
91
- type: t
92
- });
93
- return e === void 0 ? /* @__PURE__ */ l("button", { ...o }) : e(o);
94
- }
95
- function y({ href: e, onClick: t, render: n, ...a }) {
96
- let o = h(), s = o.disabled || o.loading, c = i({
97
- ...a,
98
- ...o.loading ? { "aria-busy": !0 } : {},
99
- ...s ? { "aria-disabled": !0 } : {},
100
- "data-part": "content",
101
- href: e,
102
- onClick: (e) => {
103
- if (s) {
104
- e.preventDefault();
105
- return;
106
- }
107
- t?.(e);
108
- }
109
- });
110
- return n === void 0 ? /* @__PURE__ */ l("a", { ...c }) : n(r(c));
111
- }
112
- //#endregion
113
- //#region src/list-item/list-item-parts.tsx
114
- function b(e) {
115
- return function({ render: t, ...n }) {
116
- let r = a({
117
- ...n,
118
- "data-part": e
119
- }, "part", e);
120
- return t === void 0 ? /* @__PURE__ */ l("div", { ...r }) : t(r);
121
- };
122
- }
123
- var x = b("start"), S = b("body"), C = b("label"), w = b("description"), T = b("end"), E = b("actions");
124
- //#endregion
125
- export { C as a, _ as c, h as d, p as f, T as i, y as l, S as n, x as o, f as p, w as r, v as s, E as t, g as u };
@@ -1,306 +0,0 @@
1
- import { r as e } from "./i18n-D7xXDd8-.js";
2
- import { n as t, t as n } from "./icon-D04-_QFA.js";
3
- import { a as r, i, r as a, t as o } from "./alert-DPSZUCRn.js";
4
- import { n as ee } from "./icon-button-DbSZKGT4.js";
5
- import { t as s } from "./inline-message-DgEAUjar.js";
6
- import { t as c } from "./checkbox-Hq1PXk04.js";
7
- import { t as l } from "./code-block-Cy548yk7.js";
8
- import { n as u, o as d, t as f } from "./skeleton-DeEOmm1y.js";
9
- import { t as p } from "./visually-hidden-BUSrFZ1_.js";
10
- import { t as m } from "./link-rGL3Lr2t.js";
11
- import { c as h, i as g, n as _, o as v, t as y } from "./prose-CQN4Bqqh.js";
12
- import { keyedProps as b, selectorKeyProps as x } from "@slotted/core/selector-key";
13
- import { Fragment as S, createContext as C, createElement as w, useContext as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
14
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
15
- import { markdownMessages as N } from "@slotted/core/i18n";
16
- import { initialLoadingVisibility as P, nextLoadingVisibility as F } from "@slotted/core/loading";
17
- import { MARKDOWN_KINDS as I, prepareMarkdown as L } from "@slotted/core/markdown";
18
- //#region src/markdown/markdown-defaults.tsx
19
- var R = C({});
20
- function z() {
21
- return T(R);
22
- }
23
- function B({ children: e, ...t }) {
24
- let n = z();
25
- return /* @__PURE__ */ j(R.Provider, {
26
- value: {
27
- alerts: t.alerts ?? n.alerts,
28
- allow: t.allow ?? n.allow,
29
- external: t.external ?? n.external,
30
- headingAnchors: t.headingAnchors ?? n.headingAnchors,
31
- isExternal: t.isExternal ?? n.isExternal,
32
- transformUrl: t.transformUrl ?? n.transformUrl
33
- },
34
- children: e
35
- });
36
- }
37
- //#endregion
38
- //#region src/markdown/markdown.tsx
39
- var V = new Set(I);
40
- function H({ alerts: t, allow: n, empty: r, extensions: i, external: a, flow: o, headingAnchors: c, headingOffset: l, idPrefix: p, isExternal: m, loading: g = !1, messages: _, onRetry: y, onTaskChange: x, render: S, renderers: C, size: w, status: T = "ready", streaming: E = !1, transformUrl: O, tree: k, unwrapDisallowed: A, ...P }) {
41
- let F = z(), I = h(), R = d(), B = e(N, _), V = o ?? I.flow, H = O ?? F.transformUrl, W = m ?? F.isExternal, G = n ?? F.allow, K = t ?? F.alerts ?? !0, q = D(() => Object.keys(i ?? {}).join("\n"), [i]), Y = D(() => L(k, {
42
- alerts: K,
43
- allow: G,
44
- custom: q ? q.split("\n") : [],
45
- headingOffset: l,
46
- idPrefix: p,
47
- isExternal: W,
48
- transformUrl: H,
49
- unwrapDisallowed: A
50
- }), [
51
- k,
52
- K,
53
- G,
54
- q,
55
- l,
56
- p,
57
- W,
58
- H,
59
- A
60
- ]), X = te({
61
- delay: R.delay ?? 0,
62
- loading: g,
63
- minDuration: R.minDuration ?? 0
64
- }), Z = {
65
- document: Y,
66
- extensions: i ?? {},
67
- external: a ?? F.external ?? "new-tab",
68
- headingAnchors: c ?? F.headingAnchors ?? !1,
69
- onTaskChange: x,
70
- t: B,
71
- renderers: C ?? {}
72
- }, Q;
73
- Q = T === "error" ? /* @__PURE__ */ M("div", {
74
- "data-part": "error",
75
- "data-part-error": "",
76
- children: [/* @__PURE__ */ j(s, {
77
- tone: "danger",
78
- children: B("error")
79
- }), y === void 0 ? null : /* @__PURE__ */ j(ee, {
80
- onClick: (e) => y(e.detail === 0 ? "keyboard" : "pointer"),
81
- size: "sm",
82
- tone: "secondary",
83
- variant: "outline",
84
- children: B("retry")
85
- })]
86
- }) : X ? /* @__PURE__ */ j(u, {
87
- delay: 0,
88
- messages: { label: B("loading") },
89
- loading: !0,
90
- minDuration: 0,
91
- children: /* @__PURE__ */ j(v, {
92
- flow: V,
93
- size: w,
94
- children: /* @__PURE__ */ j(f, {
95
- lastLineSize: "62%",
96
- lines: 3
97
- })
98
- })
99
- }) : Y.empty ? g ? null : /* @__PURE__ */ j("p", {
100
- "data-part": "empty",
101
- "data-part-empty": "",
102
- children: r ?? B("empty")
103
- }) : /* @__PURE__ */ M(v, {
104
- flow: V,
105
- size: w,
106
- children: [U(Y.children, Z), J(Y, Z)]
107
- });
108
- let $ = b({
109
- ...P,
110
- "aria-busy": E || X || void 0,
111
- children: Q,
112
- "data-empty": T === "ready" && !X && Y.empty || void 0,
113
- "data-flow": V,
114
- "data-loading": X || void 0,
115
- "data-part": "root",
116
- "data-status": T,
117
- "data-streaming": E || void 0,
118
- "data-ui": "markdown"
119
- });
120
- return S === void 0 ? /* @__PURE__ */ j("div", { ...$ }) : S($);
121
- }
122
- function U(e, t) {
123
- return e.map((e) => /* @__PURE__ */ j(S, { children: W(e, t) }, e.key));
124
- }
125
- function W(e, t) {
126
- let n = "children" in e ? G(e, t) : null;
127
- if (e.kind === "custom") {
128
- let r = t.extensions[e.type];
129
- return r === void 0 ? n : r({
130
- children: n,
131
- element: e
132
- });
133
- }
134
- if (V.has(e.kind)) {
135
- let r = t.renderers[e.kind];
136
- if (r !== void 0) return r({
137
- children: n,
138
- element: e
139
- });
140
- }
141
- return K(e, n, t);
142
- }
143
- function G(e, t) {
144
- return e.kind === "list" || "children" in e ? U(e.children, t) : null;
145
- }
146
- function K(e, t, n) {
147
- switch (e.kind) {
148
- case "text": return e.value;
149
- case "inlineCode": return /* @__PURE__ */ j("code", { children: e.value });
150
- case "break": return /* @__PURE__ */ j("br", {});
151
- case "thematicBreak": return /* @__PURE__ */ j("hr", {});
152
- case "paragraph": return /* @__PURE__ */ j("p", { children: t });
153
- case "emphasis": return /* @__PURE__ */ j("em", { children: t });
154
- case "strong": return /* @__PURE__ */ j("strong", { children: t });
155
- case "delete": return /* @__PURE__ */ j("del", { children: t });
156
- case "blockquote": return /* @__PURE__ */ j("blockquote", { children: t });
157
- case "heading": return w(`h${e.level}`, { id: e.id }, t, n.headingAnchors ? /* @__PURE__ */ j(_, {
158
- "aria-label": n.t("anchor", { heading: e.text }),
159
- href: `#${e.id}`,
160
- children: "#"
161
- }) : null);
162
- case "alert": return /* @__PURE__ */ j("div", {
163
- "data-part": "embed",
164
- "data-part-embed": "",
165
- children: /* @__PURE__ */ j(o, {
166
- live: "off",
167
- reach: "section",
168
- tone: e.tone,
169
- children: /* @__PURE__ */ M(a, { children: [/* @__PURE__ */ j(r, { children: n.t(`alerts.${e.type}`) }), /* @__PURE__ */ j(i, {
170
- render: ({ children: e, ...t }) => /* @__PURE__ */ j("div", {
171
- ...t,
172
- children: e
173
- }),
174
- children: /* @__PURE__ */ j("div", {
175
- "data-part": "alert-body",
176
- "data-part-alert-body": "",
177
- children: t
178
- })
179
- })] })
180
- })
181
- });
182
- case "list": {
183
- let n = e.task ? "task-list" : void 0;
184
- return e.ordered ? /* @__PURE__ */ j("ol", {
185
- "data-part": n,
186
- ...x("part", n),
187
- start: e.start ?? void 0,
188
- children: t
189
- }) : /* @__PURE__ */ j("ul", {
190
- "data-part": n,
191
- ...x("part", n),
192
- children: t
193
- });
194
- }
195
- case "item": return e.checked === null ? /* @__PURE__ */ j("li", { children: t }) : q(e, t, n);
196
- case "code": return /* @__PURE__ */ j("div", {
197
- "data-part": "embed",
198
- "data-part-embed": "",
199
- children: /* @__PURE__ */ j(l, {
200
- code: e.code,
201
- language: e.language ?? void 0,
202
- lineNumbers: e.lineNumbers || void 0,
203
- marks: e.highlight === null ? void 0 : { highlight: e.highlight },
204
- title: e.title ?? void 0
205
- })
206
- });
207
- case "table": return /* @__PURE__ */ j(y, { children: /* @__PURE__ */ M("table", { children: [/* @__PURE__ */ j("thead", { children: /* @__PURE__ */ j("tr", { children: e.head.map((e) => /* @__PURE__ */ j("th", {
208
- "data-align": e.align ?? void 0,
209
- scope: "col",
210
- children: U(e.children, n)
211
- }, e.key)) }) }), e.rows.length === 0 ? null : /* @__PURE__ */ j("tbody", { children: e.rows.map((e, t) => /* @__PURE__ */ j("tr", { children: e.map((e) => /* @__PURE__ */ j("td", {
212
- "data-align": e.align ?? void 0,
213
- children: U(e.children, n)
214
- }, e.key)) }, e[0]?.key ?? t)) })] }) });
215
- case "link": return e.external && n.external === "new-tab" ? /* @__PURE__ */ j(m, {
216
- external: !0,
217
- href: e.href,
218
- title: e.title ?? void 0,
219
- children: t
220
- }) : /* @__PURE__ */ j("a", {
221
- href: e.href,
222
- title: e.title ?? void 0,
223
- children: t
224
- });
225
- case "image": return /* @__PURE__ */ j("img", {
226
- alt: e.alt,
227
- decoding: "async",
228
- loading: "lazy",
229
- src: e.src,
230
- title: e.title ?? void 0
231
- });
232
- case "footnoteReference": return /* @__PURE__ */ j("sup", { children: /* @__PURE__ */ j("a", {
233
- "aria-describedby": n.document.footnoteLabelId,
234
- "data-footnote-ref": "",
235
- href: `#${e.target}`,
236
- id: e.id,
237
- children: e.number
238
- }) });
239
- case "custom": return t;
240
- }
241
- }
242
- function q(e, t, n) {
243
- let { onTaskChange: r } = n, i = e.task ?? 0;
244
- return /* @__PURE__ */ M("li", {
245
- "data-part": "task",
246
- "data-part-task": "",
247
- children: [/* @__PURE__ */ j(c, {
248
- "aria-label": e.label,
249
- checked: e.checked === !0,
250
- onCheckedChange: r === void 0 ? void 0 : (t, n) => {
251
- let a = {
252
- checked: t,
253
- index: i,
254
- offset: e.offset
255
- };
256
- r(a, n);
257
- },
258
- readOnly: r === void 0 || void 0
259
- }), /* @__PURE__ */ j("div", {
260
- "data-part": "task-body",
261
- "data-part-task-body": "",
262
- children: t
263
- })]
264
- });
265
- }
266
- function J(e, t) {
267
- return e.footnotes.length === 0 ? null : /* @__PURE__ */ M(g, { children: [/* @__PURE__ */ j(p, {
268
- id: e.footnoteLabelId,
269
- render: (e) => /* @__PURE__ */ j("h2", { ...e }),
270
- children: t.t("footnotes")
271
- }), /* @__PURE__ */ j("ol", { children: e.footnotes.map((e) => /* @__PURE__ */ j("li", {
272
- id: e.id,
273
- children: Y(e, t)
274
- }, e.key)) })] });
275
- }
276
- function Y(e, r) {
277
- let i = e.references.map((i, a) => /* @__PURE__ */ j("a", {
278
- "aria-label": r.t("backReference", {
279
- number: e.number,
280
- occurrence: a + 1
281
- }),
282
- "data-part": "backref",
283
- "data-part-backref": "",
284
- href: `#${i}`,
285
- children: /* @__PURE__ */ j(n, { children: /* @__PURE__ */ j(t, { name: "arrow-left" }) })
286
- }, i)), a = e.children.at(-1);
287
- return a?.kind === "paragraph" ? /* @__PURE__ */ M(A, { children: [U(e.children.slice(0, -1), r), /* @__PURE__ */ M("p", { children: [U(a.children, r), i] }, a.key)] }) : /* @__PURE__ */ M(A, { children: [U(e.children, r), i] });
288
- }
289
- function te({ delay: e, loading: t, minDuration: n }) {
290
- let r = O(P), [, i] = k(0), a = F({
291
- delay: e,
292
- loading: t,
293
- minDuration: n,
294
- now: Date.now(),
295
- state: r.current
296
- });
297
- r.current = a.state;
298
- let { wait: o } = a;
299
- return E(() => {
300
- if (o === null) return;
301
- let e = setTimeout(() => i((e) => e + 1), o);
302
- return () => clearTimeout(e);
303
- }, [o, t]), a.state.visible;
304
- }
305
- //#endregion
306
- export { B as n, z as r, H as t };