@seekbuddy/dsh-ui 0.2.0-beta.0 → 0.2.0-beta.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.
- package/CHANGELOG.md +34 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/UPSTREAM.md +7 -4
- package/dist/blocks.js +170 -135
- package/dist/chunks/{chunk-VIH56PDF.js → chunk-6SGSJ5KW.js} +2 -2
- package/dist/chunks/{chunk-QJKAQ6PO.js → chunk-7NH2UOZO.js} +2 -2
- package/dist/chunks/{chunk-KETGFAOH.js → chunk-7SKW4S35.js} +2 -2
- package/dist/chunks/chunk-ENKPNYOB.js +26 -0
- package/dist/chunks/{chunk-WUL523OW.js → chunk-EWAZFWLW.js} +1 -1
- package/dist/chunks/{chunk-5JXG4BHW.js → chunk-FFJ6TCCF.js} +1 -1
- package/dist/chunks/{chunk-R6AUJQ3G.js → chunk-FZXK4LTI.js} +1 -1
- package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
- package/dist/chunks/{chunk-TUK6UGXM.js → chunk-L7XALG4J.js} +1 -1
- package/dist/chunks/{chunk-AY44MQMD.js → chunk-OCAQFVT3.js} +180 -60
- package/dist/chunks/{chunk-CI73NXA5.js → chunk-RAXDA2PT.js} +4 -4
- package/dist/chunks/{chunk-5XDVPALS.js → chunk-SN6RSUWC.js} +1 -1
- package/dist/chunks/{chunk-CTQPGUZP.js → chunk-SNVSQWCU.js} +1 -1
- package/dist/chunks/{chunk-ZZNL5PWF.js → chunk-SO3DCAWG.js} +2 -2
- package/dist/chunks/{chunk-IOBKTEKP.js → chunk-UAEFKTV3.js} +1 -1
- package/dist/chunks/{chunk-NE62SYOZ.js → chunk-UGEORMLD.js} +2 -2
- package/dist/chunks/{chunk-TQU54HSM.js → chunk-W6FLI3AK.js} +1 -1
- package/dist/chunks/{chunk-TZ7HRE6D.js → chunk-WX46TSKP.js} +1 -1
- package/dist/chunks/{chunk-XX6MSZLS.js → chunk-XL33IPCV.js} +1 -1
- package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
- package/dist/chunks/chunk-YOBY6PSL.js +850 -0
- package/dist/icons.js +58 -2
- package/dist/index.js +810 -317
- package/dist/markdown.js +84 -7
- package/dist/meta.json +1038 -339
- package/dist/root-inputs.json +20 -1
- package/dist/seekbuddy-card.js +1 -1
- package/dist/seekbuddy-empty.js +2 -2
- package/dist/seekbuddy-internal/Message.js +2 -2
- package/dist/seekbuddy-internal/Pagination.js +1 -1
- package/dist/seekbuddy-internal/StatusBadge.js +1 -1
- package/dist/seekbuddy-internal/Switch.js +1 -1
- package/dist/seekbuddy-internal/Upload.js +1 -1
- package/dist/seekbuddy-internal/date/Calendar.js +1 -1
- package/dist/seekbuddy-internal/date/DatePicker.js +2 -2
- package/dist/seekbuddy-internal/date/DateRangePicker.js +2 -2
- package/dist/seekbuddy-internal/date/TimePicker.js +1 -1
- package/dist/seekbuddy-internal/date/fields.js +5 -5
- package/dist/seekbuddy-spinner.js +1 -1
- package/dist/seekbuddy-tabs.js +1 -1
- package/dist/seekbuddy-timeline.js +2 -2
- package/dist/seekbuddy.js +15 -15
- package/dist/tokens.css +60 -20
- package/dist/types/AnimatedRows.d.ts +45 -0
- package/dist/types/Button.d.ts +1 -1
- package/dist/types/CommandText.d.ts +15 -0
- package/dist/types/DetailDocument.d.ts +77 -0
- package/dist/types/DisclosureRow.d.ts +4 -2
- package/dist/types/DraggableImage.d.ts +18 -0
- package/dist/types/HoverCard.d.ts +11 -3
- package/dist/types/HoverCardGroup.d.ts +24 -0
- package/dist/types/ImageLightbox.d.ts +4 -1
- package/dist/types/InlineEditor.d.ts +22 -0
- package/dist/types/Menu.d.ts +30 -9
- package/dist/types/MenuSurface.d.ts +9 -0
- package/dist/types/PermissionIcon.d.ts +12 -0
- package/dist/types/QuotePreview.d.ts +23 -0
- package/dist/types/SegmentedTabs.d.ts +3 -1
- package/dist/types/TerminalBlock.d.ts +10 -2
- package/dist/types/Tooltip.d.ts +21 -15
- package/dist/types/UserMessageBubble.d.ts +10 -0
- package/dist/types/ZoomControls.d.ts +26 -0
- package/dist/types/blocks.d.ts +2 -0
- package/dist/types/document-zoom.d.ts +16 -0
- package/dist/types/file-drag-actions.d.ts +36 -0
- package/dist/types/focus.d.ts +7 -0
- package/dist/types/icons/artwork.d.ts +421 -0
- package/dist/types/icons/index.d.ts +205 -192
- package/dist/types/icons/shared-artwork.d.ts +6 -12
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/image-drag.d.ts +16 -0
- package/dist/types/index.d.ts +21 -3
- package/dist/types/markdown/MarkdownDelegate.d.ts +26 -3
- package/dist/types/markdown/MarkdownText.d.ts +12 -5
- package/dist/types/markdown/file-link.d.ts +13 -3
- package/dist/types/markdown/highlight.d.ts +22 -0
- package/dist/types/markdown/quote-text.d.ts +7 -0
- package/dist/types/markdown/render.d.ts +9 -4
- package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
- package/dist/types/markdown.d.ts +5 -2
- package/dist/types/overlay-top-margin.d.ts +9 -2
- package/dist/types/tooltip-placement.d.ts +34 -0
- package/dist/types/use-clipboard-copy.d.ts +13 -0
- package/dist/types/useAnchoredPosition.d.ts +22 -22
- package/dist/types/useRowDragPreview.d.ts +19 -0
- package/dist/types/user-text.d.ts +26 -31
- package/package.json +2 -2
- package/dist/chunks/chunk-3HCOU44R.js +0 -697
- package/dist/chunks/chunk-LA3QDZYN.js +0 -2777
- package/dist/chunks/chunk-OQPH36OI.js +0 -754
- package/dist/types/use-copy-feedback.d.ts +0 -13
package/dist/markdown.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunks/chunk-ENKPNYOB.js";
|
|
1
4
|
import {
|
|
2
5
|
CodeBlock,
|
|
3
6
|
MarkdownDelegateProvider,
|
|
4
7
|
MarkdownText,
|
|
5
|
-
parseGfm
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
8
|
+
parseGfm,
|
|
9
|
+
useMarkdownDelegate
|
|
10
|
+
} from "./chunks/chunk-OCAQFVT3.js";
|
|
11
|
+
import {
|
|
12
|
+
StateDot
|
|
13
|
+
} from "./chunks/chunk-JA3XDLIA.js";
|
|
14
|
+
import "./chunks/chunk-XW4L4ZGL.js";
|
|
9
15
|
import "./chunks/chunk-ZA47FP7C.js";
|
|
10
16
|
|
|
11
17
|
// src/markdown/JsonBlock.tsx
|
|
@@ -16,10 +22,10 @@ var id = "@seekbuddy/dsh-ui/markdown/JsonBlock.module.css";
|
|
|
16
22
|
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
17
23
|
const element = document.createElement("style");
|
|
18
24
|
element.setAttribute("data-dsh-ui-primitives", id);
|
|
19
|
-
element.textContent = ".oWcFJW_root{margin:4px 0}.oWcFJW_toggle{color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:var(--dsw-radius-sm);background:0 0;border:none;padding:2px 6px;font-size:12px;line-height:18px}.oWcFJW_toggle:hover{background:var(--dsw-alias-interactive-bg-hover)}.oWcFJW_body{background:var(--dsw-alias-markdown-code-block);border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-lg);max-height:200px;font-family:var(--ds-font-family-code);color:var(--dsw-alias-label-primary);margin:4px 0 0;padding:8px;font-size:11px;line-height:16px;overflow:auto}";
|
|
25
|
+
element.textContent = ".oWcFJW_root{margin:4px 0}.oWcFJW_toggle{color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:var(--dsw-radius-sm);background:0 0;border:none;padding:2px 6px;font-size:12px;line-height:18px}@media (hover:hover){.oWcFJW_toggle:hover{background:var(--dsw-alias-interactive-bg-hover)}}.oWcFJW_body{background:var(--dsw-alias-markdown-code-block);border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-lg);max-height:200px;font-family:var(--ds-font-family-code);color:var(--dsw-alias-label-primary);margin:4px 0 0;padding:8px;font-size:11px;line-height:16px;overflow:auto}";
|
|
20
26
|
document.head.appendChild(element);
|
|
21
27
|
}
|
|
22
|
-
var JsonBlock_module_default = { "
|
|
28
|
+
var JsonBlock_module_default = { "body": "oWcFJW_body", "toggle": "oWcFJW_toggle", "root": "oWcFJW_root" };
|
|
23
29
|
|
|
24
30
|
// src/markdown/JsonBlock.tsx
|
|
25
31
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -62,6 +68,72 @@ ${truncatedLabel(s.length)}` : s;
|
|
|
62
68
|
] });
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
// src/DetailDocument.tsx
|
|
72
|
+
import { useMemo as useMemo2 } from "react";
|
|
73
|
+
|
|
74
|
+
// .build/css/DetailDocument.module.mjs
|
|
75
|
+
var id2 = "@seekbuddy/dsh-ui/DetailDocument.module.css";
|
|
76
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id2 + '"]')) {
|
|
77
|
+
const element = document.createElement("style");
|
|
78
|
+
element.setAttribute("data-dsh-ui-primitives", id2);
|
|
79
|
+
element.textContent = ".LhBPoW_section{flex-direction:column;gap:12px;min-width:0;display:flex}.LhBPoW_document{border-block:.5px solid var(--dsw-alias-border-l1);scrollbar-gutter:stable;overflow-wrap:anywhere;min-width:0;max-height:min(560px,60vh);padding:12px 0;overflow-y:auto}.LhBPoW_document:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:3px}.LhBPoW_failure{align-items:center;gap:10px;display:flex}.LhBPoW_error{color:var(--dsw-alias-state-error-primary);align-items:center;gap:6px;margin:0;font-size:13px;line-height:20px;display:inline-flex}.LhBPoW_skeleton{flex-direction:column;gap:10px;display:flex}.LhBPoW_bar{border-radius:var(--dsw-radius-xs);background:var(--dsw-alias-bg-skeleton);height:12px;animation:2s cubic-bezier(.36,0,.64,1) infinite LhBPoW_dsh-plugin-detail-skeleton;display:block}.LhBPoW_long{width:min(480px,90%)}.LhBPoW_short{width:min(240px,50%)}@keyframes LhBPoW_dsh-plugin-detail-skeleton{0%{opacity:1}40%{opacity:.6}80%,to{opacity:1}}@media (prefers-reduced-motion:reduce){.LhBPoW_bar{animation:none}}";
|
|
80
|
+
document.head.appendChild(element);
|
|
81
|
+
}
|
|
82
|
+
var DetailDocument_module_default = { "bar": "LhBPoW_bar", "document": "LhBPoW_document", "short": "LhBPoW_short", "failure": "LhBPoW_failure", "dsh-plugin-detail-skeleton": "LhBPoW_dsh-plugin-detail-skeleton", "section": "LhBPoW_section", "skeleton": "LhBPoW_skeleton", "long": "LhBPoW_long", "error": "LhBPoW_error" };
|
|
83
|
+
|
|
84
|
+
// src/DetailDocument.tsx
|
|
85
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
86
|
+
function detailDocumentState(read) {
|
|
87
|
+
if (read?.status === "ready")
|
|
88
|
+
return read.markdown === void 0 ? { status: "none" } : { status: "found", markdown: read.markdown };
|
|
89
|
+
return read?.status === "error" ? read : { status: "loading" };
|
|
90
|
+
}
|
|
91
|
+
function useDetailDocumentLabels(copy) {
|
|
92
|
+
const { title, loading, retry, footnotes } = copy;
|
|
93
|
+
const { copy: copyLabel, copied: copiedLabel, codeBlock: codeLabel, wrap: wrapLabel, unwrap: unwrapLabel } = copy;
|
|
94
|
+
const markdown = useMemo2(
|
|
95
|
+
() => ({ code: { copyLabel, copiedLabel, toolbarLabels: { codeLabel, wrapLabel, unwrapLabel } }, footnotes }),
|
|
96
|
+
[copyLabel, copiedLabel, codeLabel, wrapLabel, unwrapLabel, footnotes]
|
|
97
|
+
);
|
|
98
|
+
return useMemo2(() => ({ title, loading, retry, markdown }), [title, loading, retry, markdown]);
|
|
99
|
+
}
|
|
100
|
+
function DetailDocument({
|
|
101
|
+
state,
|
|
102
|
+
labels,
|
|
103
|
+
images,
|
|
104
|
+
onRetry
|
|
105
|
+
}) {
|
|
106
|
+
if (state.status === "none") return null;
|
|
107
|
+
let body;
|
|
108
|
+
switch (state.status) {
|
|
109
|
+
case "found":
|
|
110
|
+
body = /* @__PURE__ */ jsx2("div", { className: DetailDocument_module_default.document, role: "region", "aria-label": labels.title, tabIndex: 0, children: /* @__PURE__ */ jsx2(MarkdownText, { text: state.markdown, labels: labels.markdown, pathImages: images, omitHtml: true }) });
|
|
111
|
+
break;
|
|
112
|
+
case "error":
|
|
113
|
+
body = /* @__PURE__ */ jsxs2("div", { className: DetailDocument_module_default.failure, children: [
|
|
114
|
+
/* @__PURE__ */ jsxs2("p", { className: DetailDocument_module_default.error, role: "alert", children: [
|
|
115
|
+
/* @__PURE__ */ jsx2(StateDot, { state: "error" }),
|
|
116
|
+
state.message
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ jsx2(Button, { variant: "outline", size: "sm", onClick: onRetry, children: labels.retry })
|
|
119
|
+
] });
|
|
120
|
+
break;
|
|
121
|
+
case "loading":
|
|
122
|
+
body = /* @__PURE__ */ jsxs2("div", { className: DetailDocument_module_default.skeleton, role: "status", "aria-label": labels.loading, "aria-busy": "true", children: [
|
|
123
|
+
/* @__PURE__ */ jsx2("span", { className: `${DetailDocument_module_default.bar} ${DetailDocument_module_default.long}` }),
|
|
124
|
+
/* @__PURE__ */ jsx2("span", { className: `${DetailDocument_module_default.bar} ${DetailDocument_module_default.long}` }),
|
|
125
|
+
/* @__PURE__ */ jsx2("span", { className: `${DetailDocument_module_default.bar} ${DetailDocument_module_default.short}` })
|
|
126
|
+
] });
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ jsx2("section", { className: DetailDocument_module_default.section, "data-detail-document": true, children: body });
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/markdown/quote-text.ts
|
|
133
|
+
function formatQuoteText(text) {
|
|
134
|
+
return text.replace(/\r\n?/gu, "\n").split("\n").map((line) => `> ${line}`).join("\n");
|
|
135
|
+
}
|
|
136
|
+
|
|
65
137
|
// src/markdown/plain-text.ts
|
|
66
138
|
function inlineText(node) {
|
|
67
139
|
switch (node.type) {
|
|
@@ -141,8 +213,13 @@ function extractMarkdownPlainText(markdown, options = {}) {
|
|
|
141
213
|
}
|
|
142
214
|
export {
|
|
143
215
|
CodeBlock,
|
|
216
|
+
DetailDocument,
|
|
144
217
|
JsonBlock,
|
|
145
218
|
MarkdownDelegateProvider,
|
|
146
219
|
MarkdownText,
|
|
147
|
-
|
|
220
|
+
detailDocumentState,
|
|
221
|
+
extractMarkdownPlainText,
|
|
222
|
+
formatQuoteText,
|
|
223
|
+
useDetailDocumentLabels,
|
|
224
|
+
useMarkdownDelegate
|
|
148
225
|
};
|