@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
|
@@ -10,7 +10,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
10
10
|
element.textContent = ".WjHBIa_badge{white-space:nowrap}.WjHBIa_dot{flex:none}.WjHBIa_progress{color:var(--dsw-alias-label-secondary)}.WjHBIa_neutral{color:var(--dsw-alias-label-tertiary)}.WjHBIa_success{color:var(--dsw-alias-state-success-primary)}.WjHBIa_warning{color:var(--dsw-alias-state-warn-primary)}.WjHBIa_error{color:var(--dsw-alias-state-error-primary)}";
|
|
11
11
|
document.head.appendChild(element);
|
|
12
12
|
}
|
|
13
|
-
var StatusBadge_module_default = { "
|
|
13
|
+
var StatusBadge_module_default = { "neutral": "WjHBIa_neutral", "success": "WjHBIa_success", "progress": "WjHBIa_progress", "warning": "WjHBIa_warning", "error": "WjHBIa_error", "badge": "WjHBIa_badge", "dot": "WjHBIa_dot" };
|
|
14
14
|
|
|
15
15
|
// src/seekbuddy/StatusBadge.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DraggableImage,
|
|
2
3
|
HoverCard,
|
|
3
4
|
ImageLightbox,
|
|
4
5
|
MarkdownText_module_default,
|
|
5
6
|
Tooltip,
|
|
6
7
|
writeClipboard
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JA3XDLIA.js";
|
|
8
9
|
import {
|
|
9
10
|
CodeBracketsArtwork,
|
|
10
11
|
FolderCloseArtwork,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
IconLoadingOutlineRegular,
|
|
17
18
|
IconNowrapFillRegular,
|
|
18
19
|
IconWrapFillRegular
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XW4L4ZGL.js";
|
|
20
21
|
import {
|
|
21
22
|
__publicField
|
|
22
23
|
} from "./chunk-ZA47FP7C.js";
|
|
@@ -406,7 +407,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
406
407
|
element.textContent = ".ypnJ9a_icon{--dsh-file-type-violet:#8b76f6;color:var(--dsh-file-type-icon-color,var(--dsh-file-type-default-color))}.ypnJ9a_code{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_excel{--dsh-file-type-default-color:var(--dsw-static-green-500)}.ypnJ9a_folder{--dsh-file-type-default-color:var(--dsw-static-amber-400)}.ypnJ9a_html{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_image{--dsh-file-type-default-color:var(--dsh-file-type-violet)}.ypnJ9a_markdown{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_other{--dsh-file-type-default-color:var(--dsw-static-neutral-bluish-300)}.ypnJ9a_pdf{--dsh-file-type-default-color:var(--dsw-static-red-600)}.ypnJ9a_ppt{--dsh-file-type-default-color:var(--dsw-static-amber-500)}.ypnJ9a_video{--dsh-file-type-default-color:var(--dsh-file-type-violet)}.ypnJ9a_word{--dsh-file-type-default-color:var(--dsw-static-deepseek-450)}";
|
|
407
408
|
document.head.appendChild(element);
|
|
408
409
|
}
|
|
409
|
-
var FileTypeIcon_module_default = { "
|
|
410
|
+
var FileTypeIcon_module_default = { "image": "ypnJ9a_image", "icon": "ypnJ9a_icon", "excel": "ypnJ9a_excel", "markdown": "ypnJ9a_markdown", "folder": "ypnJ9a_folder", "html": "ypnJ9a_html", "other": "ypnJ9a_other", "code": "ypnJ9a_code", "pdf": "ypnJ9a_pdf", "ppt": "ypnJ9a_ppt", "video": "ypnJ9a_video", "word": "ypnJ9a_word" };
|
|
410
411
|
|
|
411
412
|
// src/FileTypeIcon.tsx
|
|
412
413
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
@@ -677,10 +678,29 @@ import langTs from "@shikijs/langs/typescript";
|
|
|
677
678
|
import langBash from "@shikijs/langs/shellscript";
|
|
678
679
|
import langJson from "@shikijs/langs/json";
|
|
679
680
|
var LANGS = [langTs, langBash, langJson];
|
|
681
|
+
function patchGoGrammar(grammars) {
|
|
682
|
+
const go = grammars.find((grammar) => grammar.name === "go");
|
|
683
|
+
const fields = go?.repository.struct_variables_types_fields;
|
|
684
|
+
const patterns = fields?.patterns ?? [];
|
|
685
|
+
const rules = patterns.filter((rule) => typeof rule.match === "string" && rule.match.includes('[^"/`\\s]+;?'));
|
|
686
|
+
if (go === void 0 || fields === void 0 || rules.length !== 1) {
|
|
687
|
+
throw new Error(
|
|
688
|
+
`ui-primitives: expected exactly one Go struct-field rule to patch for worlpaker/go-syntax#25, found ${rules.length}; update or delete the patch`
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
const repository = { ...go.repository };
|
|
692
|
+
repository.struct_variables_types_fields = {
|
|
693
|
+
...fields,
|
|
694
|
+
patterns: patterns.map(
|
|
695
|
+
(rule) => rule === rules[0] ? { ...rule, match: '(?:(?<=\\{)([^/\\`"]*[^\\s/\\`"])\\s*(?=\\}))' } : rule
|
|
696
|
+
)
|
|
697
|
+
};
|
|
698
|
+
return grammars.map((grammar) => grammar === go ? { ...go, repository } : grammar);
|
|
699
|
+
}
|
|
680
700
|
var LAZY_GRAMMARS = /* @__PURE__ */ new Map([
|
|
681
701
|
["python", () => import("@shikijs/langs/python")],
|
|
682
702
|
["ruby", () => import("@shikijs/langs/ruby")],
|
|
683
|
-
["go", () => import("@shikijs/langs/go")],
|
|
703
|
+
["go", async () => ({ default: patchGoGrammar((await import("@shikijs/langs/go")).default) })],
|
|
684
704
|
["rust", () => import("@shikijs/langs/rust")],
|
|
685
705
|
["java", () => import("@shikijs/langs/java")],
|
|
686
706
|
["c", () => import("@shikijs/langs/c")],
|
|
@@ -866,6 +886,7 @@ var regexEngine = createJavaScriptRegexEngine({
|
|
|
866
886
|
lazyCompileLength: Number.POSITIVE_INFINITY
|
|
867
887
|
})
|
|
868
888
|
});
|
|
889
|
+
var TOKENIZE_MAX_LINE_LENGTH = 1e3;
|
|
869
890
|
var singleton;
|
|
870
891
|
var BOOT_GRAMMAR_WARMUPS = [
|
|
871
892
|
{ lang: "typescript", code: "const answer: number = 42" },
|
|
@@ -925,7 +946,11 @@ function highlightToHtml(code, lang) {
|
|
|
925
946
|
const resolved = grammarForHint(lang);
|
|
926
947
|
if (resolved === void 0) return void 0;
|
|
927
948
|
if (!ensureGrammar(resolved)) return void 0;
|
|
928
|
-
return highlighter().codeToHtml(code, {
|
|
949
|
+
return highlighter().codeToHtml(code, {
|
|
950
|
+
lang: resolved,
|
|
951
|
+
theme: "css-variables",
|
|
952
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
|
|
953
|
+
});
|
|
929
954
|
}
|
|
930
955
|
var DECORATION_BITS = [
|
|
931
956
|
[4, "underline"],
|
|
@@ -982,6 +1007,7 @@ var StreamingHighlightSession = class {
|
|
|
982
1007
|
return highlighter().codeToTokensBase(text, {
|
|
983
1008
|
lang: resolved,
|
|
984
1009
|
theme: "css-variables",
|
|
1010
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH,
|
|
985
1011
|
...this.state === void 0 ? {} : { grammarState: this.state }
|
|
986
1012
|
});
|
|
987
1013
|
}
|
|
@@ -1047,7 +1073,11 @@ function highlightLines(code, lang) {
|
|
|
1047
1073
|
const resolved = grammarForHint(lang);
|
|
1048
1074
|
if (resolved === void 0) return void 0;
|
|
1049
1075
|
if (!ensureGrammar(resolved)) return void 0;
|
|
1050
|
-
const { tokens } = highlighter().codeToTokens(code, {
|
|
1076
|
+
const { tokens } = highlighter().codeToTokens(code, {
|
|
1077
|
+
lang: resolved,
|
|
1078
|
+
theme: "css-variables",
|
|
1079
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
|
|
1080
|
+
});
|
|
1051
1081
|
const last = tokens[tokens.length - 1];
|
|
1052
1082
|
const lines = tokens.length > 1 && last !== void 0 && last.length === 0 ? tokens.slice(0, -1) : tokens;
|
|
1053
1083
|
return lines.map((line) => line.map((token) => ({ text: token.content, style: { color: token.color } })));
|
|
@@ -1058,10 +1088,10 @@ var id2 = "@seekbuddy/dsh-ui/CodeCard.module.css";
|
|
|
1058
1088
|
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id2 + '"]')) {
|
|
1059
1089
|
const element = document.createElement("style");
|
|
1060
1090
|
element.setAttribute("data-dsh-ui-primitives", id2);
|
|
1061
|
-
element.textContent = ".Aa0DoW_card{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-markdown-code-block);border-radius:var(--dsw-radius-lg);font:var(--dsw-font-markdown-code-block);margin:16px 0;position:relative}.Aa0DoW_header{background:var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block));border-top-left-radius:inherit;border-top-right-radius:inherit;color:var(--dsw-alias-label-secondary);font:11px/18px var(--dsw-font-family);justify-content:space-between;align-items:center;gap:12px;padding:10px 18px 8px 22px;display:flex}.Aa0DoW_heading{align-items:baseline;gap:12px;min-width:0;display:flex}.Aa0DoW_language{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code);flex:none}.Aa0DoW_title{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Aa0DoW_actions{flex:none;align-items:center;gap:4px;display:flex}.Aa0DoW_status{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:8px}.Aa0DoW_action{border-radius:var(--dsw-radius-sm);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.Aa0DoW_action:hover{background:var(--dsw-alias-interactive-bg-hover)}.Aa0DoW_action:focus-visible{outline:1px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.Aa0DoW_body{font:var(--dsw-font-markdown-code-block);padding:6px 22px 20px;overflow-x:auto}";
|
|
1091
|
+
element.textContent = ".Aa0DoW_card{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-markdown-code-block);border-radius:var(--dsw-radius-lg);font:var(--dsw-font-markdown-code-block);margin:16px 0;position:relative}.Aa0DoW_header{background:var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block));border-top-left-radius:inherit;border-top-right-radius:inherit;color:var(--dsw-alias-label-secondary);font:11px/18px var(--dsw-font-family);justify-content:space-between;align-items:center;gap:12px;padding:10px 18px 8px 22px;display:flex}.Aa0DoW_heading{align-items:baseline;gap:12px;min-width:0;display:flex}.Aa0DoW_language{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code);flex:none}.Aa0DoW_title{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Aa0DoW_actions{flex:none;align-items:center;gap:4px;display:flex}.Aa0DoW_status{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:8px}.Aa0DoW_action{border-radius:var(--dsw-radius-sm);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}@media (hover:hover){.Aa0DoW_action:hover{background:var(--dsw-alias-interactive-bg-hover)}}.Aa0DoW_action:focus-visible{outline:1px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.Aa0DoW_body{font:var(--dsw-font-markdown-code-block);padding:6px 22px 20px;overflow-x:auto}";
|
|
1062
1092
|
document.head.appendChild(element);
|
|
1063
1093
|
}
|
|
1064
|
-
var CodeCard_module_default = { "
|
|
1094
|
+
var CodeCard_module_default = { "title": "Aa0DoW_title", "action": "Aa0DoW_action", "language": "Aa0DoW_language", "status": "Aa0DoW_status", "actions": "Aa0DoW_actions", "header": "Aa0DoW_header", "body": "Aa0DoW_body", "heading": "Aa0DoW_heading", "card": "Aa0DoW_card" };
|
|
1065
1095
|
|
|
1066
1096
|
// src/CodeToolbar.tsx
|
|
1067
1097
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -1165,7 +1195,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
1165
1195
|
element.textContent = ".GgTsgG_block{--dsl-code-block-banner-background-color:var(--dsw-alias-markdown-code-block-banner);--dsl-code-block-border-radius:var(--dsw-radius-lg);--dsl-code-block-banner-font:11px/18px var(--dsw-font-family);--dsl-code-block-content-font:var(--dsw-font-markdown-code-block);--dsl-code-block-background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);background:var(--dsl-code-block-background);border-radius:var(--dsl-code-block-border-radius);margin:16px 0;position:relative}.GgTsgG_block:not(:last-child){margin-bottom:11px}.GgTsgG_bannerWrap{z-index:6;background-color:var(--dsw-alias-bg-base);border-top-left-radius:var(--dsl-code-block-border-radius);border-top-right-radius:var(--dsl-code-block-border-radius);position:sticky;top:0}.GgTsgG_banner{background:var(--dsl-code-block-banner-background-color);font:var(--dsl-code-block-banner-font);border-top-left-radius:var(--dsl-code-block-border-radius);border-top-right-radius:var(--dsl-code-block-border-radius);justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;display:flex}.GgTsgG_infostring{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:11px;line-height:18px;overflow:hidden}.GgTsgG_action{flex-shrink:0;align-items:center;display:flex}.GgTsgG_copyButton{color:inherit;cursor:pointer;font:inherit;background-color:#fff0;border:none;margin:0;padding:0}.GgTsgG_content{display:contents}.GgTsgG_block :where(pre){font:var(--dsl-code-block-content-font);white-space:pre-wrap;word-break:break-all;background:var(--dsl-code-block-background);border-bottom-left-radius:var(--dsl-code-block-border-radius);border-bottom-right-radius:var(--dsl-code-block-border-radius);padding:16px;overflow-x:auto;margin:0!important}.GgTsgG_block :where(pre.GgTsgG_shiki){background:var(--dsl-code-block-background)!important}.GgTsgG_block :where(pre) code{font:inherit;background:0 0;padding:0}.GgTsgG_plain{color:var(--dsw-alias-label-primary)}.GgTsgG_card :where(pre){word-break:normal;overflow-wrap:anywhere;padding:6px 22px 20px}.GgTsgG_card[data-code-wrap=false]{--dsl-code-block-line-white-space:pre}.GgTsgG_card[data-code-wrap=false] :where(pre){white-space:pre;overflow-wrap:normal}.GgTsgG_numbered :where(pre) code{counter-reset:source-line;white-space:normal;display:block}.GgTsgG_numbered :where(pre) code>.line{min-height:1lh;counter-increment:source-line;white-space:var(--dsl-code-block-line-white-space,pre-wrap);padding-inline-start:calc(var(--dsl-code-block-line-number-width) + 12px);display:block;position:relative}.GgTsgG_numbered :where(pre) code>.line:before{width:var(--dsl-code-block-line-number-width);color:var(--dsw-alias-label-tertiary);text-align:end;content:counter(source-line);user-select:none;position:absolute;inset-inline-start:0}";
|
|
1166
1196
|
document.head.appendChild(element);
|
|
1167
1197
|
}
|
|
1168
|
-
var CodeBlock_module_default = { "
|
|
1198
|
+
var CodeBlock_module_default = { "copyButton": "GgTsgG_copyButton", "infostring": "GgTsgG_infostring", "action": "GgTsgG_action", "plain": "GgTsgG_plain", "content": "GgTsgG_content", "shiki": "GgTsgG_shiki", "numbered": "GgTsgG_numbered", "bannerWrap": "GgTsgG_bannerWrap", "banner": "GgTsgG_banner", "card": "GgTsgG_card", "block": "GgTsgG_block" };
|
|
1169
1199
|
|
|
1170
1200
|
// src/markdown/CodeBlock.tsx
|
|
1171
1201
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -1319,7 +1349,7 @@ function CodeBlock({
|
|
|
1319
1349
|
} : void 0
|
|
1320
1350
|
}
|
|
1321
1351
|
) : /* @__PURE__ */ jsxs3("div", { className: CodeBlock_module_default.banner, "data-code-block-banner": true, children: [
|
|
1322
|
-
/* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.infostring, children: lang ?? "" }),
|
|
1352
|
+
/* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.infostring, "data-text-interaction-exclude": "", children: lang ?? "" }),
|
|
1323
1353
|
/* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.action, children: /* @__PURE__ */ jsx4("button", { type: "button", className: CodeBlock_module_default.copyButton, onClick: onCopy, children: copied ? copiedLabel : copyLabel }) })
|
|
1324
1354
|
] }) }),
|
|
1325
1355
|
/* @__PURE__ */ jsx4("div", { ref: contentRef, className: CodeBlock_module_default.content, "data-code-block-content": true, children: body })
|
|
@@ -1668,9 +1698,13 @@ function MarkdownDelegateProvider({
|
|
|
1668
1698
|
children,
|
|
1669
1699
|
openExternalLink,
|
|
1670
1700
|
openFile,
|
|
1671
|
-
fileImages
|
|
1701
|
+
fileImages,
|
|
1702
|
+
getTriggerProps
|
|
1672
1703
|
}) {
|
|
1673
|
-
const delegate = useMemo2(
|
|
1704
|
+
const delegate = useMemo2(
|
|
1705
|
+
() => ({ openExternalLink, openFile, fileImages, getTriggerProps }),
|
|
1706
|
+
[openExternalLink, openFile, fileImages, getTriggerProps]
|
|
1707
|
+
);
|
|
1674
1708
|
return /* @__PURE__ */ jsx7(MarkdownDelegateContext.Provider, { value: delegate, children });
|
|
1675
1709
|
}
|
|
1676
1710
|
function useMarkdownDelegate() {
|
|
@@ -2252,12 +2286,28 @@ function mathCompatibility() {
|
|
|
2252
2286
|
return backslashMath;
|
|
2253
2287
|
}
|
|
2254
2288
|
|
|
2289
|
+
// src/markdown/windows-path-destinations.ts
|
|
2290
|
+
import { decodeString } from "micromark-util-decode-string";
|
|
2291
|
+
function isWindowsPath(raw) {
|
|
2292
|
+
return raw.includes("\\") && !/^[a-z][a-z\d+.-]+:/iu.test(raw) && (!raw.includes("/") || /\\[\p{L}\p{N}]/u.test(raw));
|
|
2293
|
+
}
|
|
2294
|
+
function exitDestination(token) {
|
|
2295
|
+
const parsed = this.resume();
|
|
2296
|
+
const raw = this.sliceSerialize(token);
|
|
2297
|
+
const node = this.stack.at(-1);
|
|
2298
|
+
node.url = isWindowsPath(raw) ? decodeString(raw.replaceAll("\\", "\\\\")) : parsed;
|
|
2299
|
+
}
|
|
2300
|
+
function windowsPathDestinations() {
|
|
2301
|
+
return { exit: { resourceDestinationString: exitDestination, definitionDestinationString: exitDestination } };
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2255
2304
|
// src/markdown/parse.ts
|
|
2305
|
+
var gfmOptions = { singleTilde: false };
|
|
2256
2306
|
function parseGfm(text) {
|
|
2257
2307
|
return recoverLocalImages(
|
|
2258
2308
|
fromMarkdown(text, {
|
|
2259
|
-
extensions: [gfm(), cjkFriendlyStrong()],
|
|
2260
|
-
mdastExtensions: [gfmFromMarkdown()]
|
|
2309
|
+
extensions: [gfm(gfmOptions), cjkFriendlyStrong()],
|
|
2310
|
+
mdastExtensions: [gfmFromMarkdown(), windowsPathDestinations()]
|
|
2261
2311
|
}),
|
|
2262
2312
|
text
|
|
2263
2313
|
);
|
|
@@ -2265,8 +2315,8 @@ function parseGfm(text) {
|
|
|
2265
2315
|
function parseGfmWithMath(text) {
|
|
2266
2316
|
return recoverLocalImages(
|
|
2267
2317
|
fromMarkdown(text, {
|
|
2268
|
-
extensions: [gfm(), cjkFriendlyStrong(), mathCompatibility(), math()],
|
|
2269
|
-
mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown()]
|
|
2318
|
+
extensions: [gfm(gfmOptions), cjkFriendlyStrong(), mathCompatibility(), math()],
|
|
2319
|
+
mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown(), windowsPathDestinations()]
|
|
2270
2320
|
}),
|
|
2271
2321
|
text
|
|
2272
2322
|
);
|
|
@@ -2278,6 +2328,9 @@ import clsx3 from "clsx";
|
|
|
2278
2328
|
import { normalizeUri } from "micromark-util-sanitize-uri";
|
|
2279
2329
|
|
|
2280
2330
|
// src/markdown/file-link.ts
|
|
2331
|
+
function isExplicitFilePath(value) {
|
|
2332
|
+
return /^(?:[\\/]|\.{1,2}[\\/]|[a-z]:[\\/])/i.test(value);
|
|
2333
|
+
}
|
|
2281
2334
|
function parseFileLink(value) {
|
|
2282
2335
|
const hash = value.indexOf("#");
|
|
2283
2336
|
const destination = hash < 0 ? value : value.slice(0, hash);
|
|
@@ -2288,15 +2341,16 @@ function parseFileLink(value) {
|
|
|
2288
2341
|
} catch {
|
|
2289
2342
|
return void 0;
|
|
2290
2343
|
}
|
|
2291
|
-
if (path.length === 0 || /[\u0000-\u001f\u007f]/.test(path)
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2344
|
+
if (path.length === 0 || /[\u0000-\u001f\u007f]/.test(path)) return void 0;
|
|
2345
|
+
if (!isExplicitFilePath(path) && URL.canParse(path)) return void 0;
|
|
2346
|
+
const suffix = hash < 0 ? /:(\d+)(?::\d+|-(\d+))?$/.exec(destination) : null;
|
|
2347
|
+
if (suffix !== null) path = path.slice(0, -suffix[0].length);
|
|
2348
|
+
if (path.length === 0) return void 0;
|
|
2349
|
+
const match = suffix ?? (hash < 0 ? null : /^L(\d+)(?:-L(\d+))?$/.exec(value.slice(hash + 1)));
|
|
2350
|
+
if (match === null) return { path };
|
|
2297
2351
|
const line = Number(match[1]);
|
|
2298
2352
|
const end = match[2] === void 0 ? line : Number(match[2]);
|
|
2299
|
-
if (!Number.isSafeInteger(line) || !Number.isSafeInteger(end) || end < line) return
|
|
2353
|
+
if (!Number.isSafeInteger(line) || !Number.isSafeInteger(end) || line < 1 || end < line) return { path };
|
|
2300
2354
|
return { path, line };
|
|
2301
2355
|
}
|
|
2302
2356
|
|
|
@@ -2328,7 +2382,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
2328
2382
|
element.textContent = ".ZTpGaW_frame{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);place-items:center;width:100%;height:180px;display:grid;position:relative;overflow:hidden}.ZTpGaW_image{object-fit:contain;opacity:0;width:100%;height:100%;min-height:0}.ZTpGaW_image[data-ready]{opacity:1}.ZTpGaW_status{color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;gap:8px;padding:12px;font-size:12px;line-height:18px;display:flex;position:absolute;inset:0}";
|
|
2329
2383
|
document.head.appendChild(element);
|
|
2330
2384
|
}
|
|
2331
|
-
var ImagePreview_module_default = { "
|
|
2385
|
+
var ImagePreview_module_default = { "image": "ZTpGaW_image", "status": "ZTpGaW_status", "frame": "ZTpGaW_frame" };
|
|
2332
2386
|
|
|
2333
2387
|
// src/ImagePreview.tsx
|
|
2334
2388
|
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -2376,14 +2430,16 @@ function Preview({
|
|
|
2376
2430
|
// src/markdown/render.tsx
|
|
2377
2431
|
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2378
2432
|
function sanitizeUrl(url) {
|
|
2433
|
+
if (isExplicitFilePath(url)) return "";
|
|
2379
2434
|
try {
|
|
2380
2435
|
switch (new URL(url).protocol) {
|
|
2381
|
-
case "
|
|
2382
|
-
case "
|
|
2383
|
-
case "
|
|
2384
|
-
|
|
2385
|
-
default:
|
|
2436
|
+
case "javascript:":
|
|
2437
|
+
case "vbscript:":
|
|
2438
|
+
case "data:":
|
|
2439
|
+
case "blob:":
|
|
2386
2440
|
return "";
|
|
2441
|
+
default:
|
|
2442
|
+
return url;
|
|
2387
2443
|
}
|
|
2388
2444
|
} catch {
|
|
2389
2445
|
return "";
|
|
@@ -2397,19 +2453,38 @@ function remoteImageUrl(url) {
|
|
|
2397
2453
|
return void 0;
|
|
2398
2454
|
}
|
|
2399
2455
|
}
|
|
2456
|
+
var DESKTOP_MEDIA_ROUTES = [
|
|
2457
|
+
"dsh-app://app/api/file?",
|
|
2458
|
+
"dsh-app://app/api/plugin-market/detail-file?",
|
|
2459
|
+
"dsh-app://app/api/plugin-manager/detail-file?"
|
|
2460
|
+
];
|
|
2400
2461
|
function vocabularyImageUrl(url) {
|
|
2401
2462
|
try {
|
|
2402
2463
|
const protocol = new URL(url).protocol;
|
|
2403
|
-
return protocol === "http:" || protocol === "https:" || protocol === "blob:" || protocol === "data:" || url.startsWith(
|
|
2464
|
+
return protocol === "http:" || protocol === "https:" || protocol === "blob:" || protocol === "data:" || DESKTOP_MEDIA_ROUTES.some((route) => url.startsWith(route)) ? url : void 0;
|
|
2404
2465
|
} catch {
|
|
2405
2466
|
return void 0;
|
|
2406
2467
|
}
|
|
2407
2468
|
}
|
|
2408
|
-
function imageSource(url, pathImages) {
|
|
2469
|
+
function imageSource(url, pathImages, load) {
|
|
2409
2470
|
const remote = remoteImageUrl(sanitizeUrl(normalizeUri(url)));
|
|
2410
2471
|
if (remote !== void 0) return remote;
|
|
2411
2472
|
const rewritten = pathImages?.resolve(url);
|
|
2412
|
-
|
|
2473
|
+
const allowed = rewritten === void 0 ? void 0 : vocabularyImageUrl(rewritten);
|
|
2474
|
+
return allowed === void 0 ? void 0 : freshImageUrl(allowed, load);
|
|
2475
|
+
}
|
|
2476
|
+
var imageLoads = 0;
|
|
2477
|
+
var nextImageLoad = () => ++imageLoads;
|
|
2478
|
+
function freshImageUrl(url, load) {
|
|
2479
|
+
let fresh;
|
|
2480
|
+
try {
|
|
2481
|
+
fresh = new URL(url);
|
|
2482
|
+
} catch {
|
|
2483
|
+
return url;
|
|
2484
|
+
}
|
|
2485
|
+
if (!fresh.pathname.endsWith("/api/file")) return url;
|
|
2486
|
+
fresh.search = `${fresh.search === "" ? "?" : `${fresh.search}&`}load=${load}`;
|
|
2487
|
+
return fresh.href;
|
|
2413
2488
|
}
|
|
2414
2489
|
function createReferenceTargets() {
|
|
2415
2490
|
return { definitions: /* @__PURE__ */ new Map(), footnotes: /* @__PURE__ */ new Map() };
|
|
@@ -2493,6 +2568,7 @@ function renderNode(node, key, context) {
|
|
|
2493
2568
|
title: mention.title,
|
|
2494
2569
|
"aria-label": mention.label,
|
|
2495
2570
|
onClick: mention.open,
|
|
2571
|
+
...mention.contextMenuProps,
|
|
2496
2572
|
children: [
|
|
2497
2573
|
/* @__PURE__ */ jsx10(LinkIconMedium, { kind: classifyLinkPath(value), className: MarkdownText_module_default.linkIcon }),
|
|
2498
2574
|
value
|
|
@@ -2503,7 +2579,7 @@ function renderNode(node, key, context) {
|
|
|
2503
2579
|
return /* @__PURE__ */ jsx10("code", { children: value }, key);
|
|
2504
2580
|
}
|
|
2505
2581
|
case "html":
|
|
2506
|
-
return node.value;
|
|
2582
|
+
return context.omitHtml ? null : node.value;
|
|
2507
2583
|
case "code":
|
|
2508
2584
|
return renderCode(node, key, context);
|
|
2509
2585
|
case "math":
|
|
@@ -2612,8 +2688,8 @@ function renderTable(node, key, context) {
|
|
|
2612
2688
|
const columns = align === null ? headRow?.children.length ?? 0 : align.length;
|
|
2613
2689
|
const wide = columns >= 4 && context.inBlockquote !== true;
|
|
2614
2690
|
return (
|
|
2615
|
-
//
|
|
2616
|
-
// MarkdownText.module.css),
|
|
2691
|
+
// On hover-capable inputs, wide tables rest with overflow-x hidden (the
|
|
2692
|
+
// hover-revealed bar in MarkdownText.module.css), dropping Chromium's implicit scroller
|
|
2617
2693
|
// focusability — the explicit tabindex keeps them keyboard-reachable,
|
|
2618
2694
|
// and :focus-visible restores scrolling.
|
|
2619
2695
|
/* @__PURE__ */ jsx10(
|
|
@@ -2661,13 +2737,14 @@ function MarkdownAnchor({
|
|
|
2661
2737
|
glyph: glyph2,
|
|
2662
2738
|
children
|
|
2663
2739
|
}) {
|
|
2664
|
-
const { openExternalLink } = useMarkdownDelegate();
|
|
2740
|
+
const { openExternalLink, getTriggerProps } = useMarkdownDelegate();
|
|
2665
2741
|
const external = ["http:", "https:"].includes(new URL(href).protocol);
|
|
2666
2742
|
const open = external ? openExternalLink : void 0;
|
|
2667
2743
|
return /* @__PURE__ */ jsxs6(
|
|
2668
2744
|
"a",
|
|
2669
2745
|
{
|
|
2670
2746
|
href,
|
|
2747
|
+
...external ? getTriggerProps?.({ kind: "url", url: href }) : {},
|
|
2671
2748
|
...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
2672
2749
|
onClick: open === void 0 ? void 0 : (event) => {
|
|
2673
2750
|
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
@@ -2682,8 +2759,9 @@ function MarkdownAnchor({
|
|
|
2682
2759
|
);
|
|
2683
2760
|
}
|
|
2684
2761
|
function renderAnchor(url, children, key, glyph2 = true, streaming = false) {
|
|
2685
|
-
const file =
|
|
2762
|
+
const file = parseFileLink(url);
|
|
2686
2763
|
if (file !== void 0) {
|
|
2764
|
+
if (streaming) return /* @__PURE__ */ jsx10(Fragment2, { children }, key);
|
|
2687
2765
|
return /* @__PURE__ */ jsx10(MarkdownFileLink, { file, glyph: glyph2, children }, key);
|
|
2688
2766
|
}
|
|
2689
2767
|
return renderSafeLink(normalizeUri(url), children, key, glyph2);
|
|
@@ -2693,16 +2771,19 @@ function MarkdownFileLink({
|
|
|
2693
2771
|
glyph: glyph2,
|
|
2694
2772
|
children
|
|
2695
2773
|
}) {
|
|
2696
|
-
const { openFile, fileImages } = useMarkdownDelegate();
|
|
2774
|
+
const { openFile, fileImages, getTriggerProps } = useMarkdownDelegate();
|
|
2775
|
+
const [load] = useState4(nextImageLoad);
|
|
2697
2776
|
if (openFile === void 0) return /* @__PURE__ */ jsx10(Fragment3, { children });
|
|
2698
2777
|
const preview = glyph2 && classifyLinkPath(file.path) === "image" ? fileImages : void 0;
|
|
2699
|
-
const
|
|
2778
|
+
const resolved = preview?.resolve(file.path);
|
|
2779
|
+
const src = resolved === void 0 ? void 0 : freshImageUrl(resolved, load);
|
|
2700
2780
|
const anchor = /* @__PURE__ */ jsxs6(
|
|
2701
2781
|
"button",
|
|
2702
2782
|
{
|
|
2703
2783
|
type: "button",
|
|
2704
2784
|
className: clsx3(MarkdownText_module_default.fileMention, MarkdownText_module_default.fileLink),
|
|
2705
2785
|
title: src === void 0 ? file.path : void 0,
|
|
2786
|
+
...getTriggerProps?.({ kind: "file", ...file }),
|
|
2706
2787
|
onClick: () => {
|
|
2707
2788
|
openFile(file.path, file.line === void 0 ? void 0 : { line: file.line });
|
|
2708
2789
|
},
|
|
@@ -2763,8 +2844,10 @@ function MarkdownImage({
|
|
|
2763
2844
|
inLink
|
|
2764
2845
|
}) {
|
|
2765
2846
|
const { fileImages } = useMarkdownDelegate();
|
|
2847
|
+
const [load] = useState4(nextImageLoad);
|
|
2766
2848
|
const file = streaming ? void 0 : parseFileLink(destination);
|
|
2767
|
-
const
|
|
2849
|
+
const resolved = file === void 0 ? void 0 : fileImages?.resolve(file.path);
|
|
2850
|
+
const src = resolved === void 0 ? imageSource(destination, pathImages, load) : freshImageUrl(resolved, load);
|
|
2768
2851
|
if (src === void 0) return /* @__PURE__ */ jsx10("span", { className: MarkdownText_module_default.imageAlt, children: alt });
|
|
2769
2852
|
return /* @__PURE__ */ jsx10(
|
|
2770
2853
|
LoadedMarkdownImage,
|
|
@@ -2783,6 +2866,7 @@ function LoadedMarkdownImage({
|
|
|
2783
2866
|
destination,
|
|
2784
2867
|
preview
|
|
2785
2868
|
}) {
|
|
2869
|
+
const { getTriggerProps } = useMarkdownDelegate();
|
|
2786
2870
|
const [failed, setFailed] = useState4(false);
|
|
2787
2871
|
const [open, setOpen] = useState4(false);
|
|
2788
2872
|
const close = useCallback3(() => {
|
|
@@ -2793,21 +2877,36 @@ function LoadedMarkdownImage({
|
|
|
2793
2877
|
preview === void 0 ? "" : `${preview.labels.failed} \xB7 `,
|
|
2794
2878
|
alt || destination
|
|
2795
2879
|
] });
|
|
2880
|
+
const file = parseFileLink(destination);
|
|
2881
|
+
const contextMenuProps = getTriggerProps?.({
|
|
2882
|
+
kind: "image",
|
|
2883
|
+
url: src,
|
|
2884
|
+
...file === void 0 ? {} : { path: file.path }
|
|
2885
|
+
});
|
|
2886
|
+
const imageProps = {
|
|
2887
|
+
className: MarkdownText_module_default.image,
|
|
2888
|
+
src,
|
|
2889
|
+
alt,
|
|
2890
|
+
onError: () => {
|
|
2891
|
+
setFailed(true);
|
|
2892
|
+
},
|
|
2893
|
+
loading: "lazy",
|
|
2894
|
+
decoding: "async",
|
|
2895
|
+
referrerPolicy: "no-referrer"
|
|
2896
|
+
};
|
|
2897
|
+
if (preview === void 0) return /* @__PURE__ */ jsx10("img", { ...imageProps, ...contextMenuProps });
|
|
2898
|
+
const localFileName = file?.path.split(/[\\/]/u).at(-1);
|
|
2899
|
+
const urlFileName = destination.split("/").at(-1)?.split(/[?#]/u)[0];
|
|
2900
|
+
const exportName = localFileName || urlFileName || "image";
|
|
2796
2901
|
const img = /* @__PURE__ */ jsx10(
|
|
2797
|
-
|
|
2902
|
+
DraggableImage,
|
|
2798
2903
|
{
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
setFailed(true);
|
|
2804
|
-
},
|
|
2805
|
-
loading: "lazy",
|
|
2806
|
-
decoding: "async",
|
|
2807
|
-
referrerPolicy: "no-referrer"
|
|
2904
|
+
fileDrag: preview.fileDrag,
|
|
2905
|
+
...imageProps,
|
|
2906
|
+
resourceAddress: file === void 0 ? void 0 : preview.resourceAddress?.(file.path),
|
|
2907
|
+
name: exportName
|
|
2808
2908
|
}
|
|
2809
2909
|
);
|
|
2810
|
-
if (preview === void 0) return img;
|
|
2811
2910
|
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2812
2911
|
/* @__PURE__ */ jsx10(
|
|
2813
2912
|
"button",
|
|
@@ -2815,6 +2914,7 @@ function LoadedMarkdownImage({
|
|
|
2815
2914
|
type: "button",
|
|
2816
2915
|
className: MarkdownText_module_default.imageButton,
|
|
2817
2916
|
title: preview.labels.open,
|
|
2917
|
+
...contextMenuProps,
|
|
2818
2918
|
"aria-label": alt ? `${preview.labels.open}: ${alt}` : preview.labels.open,
|
|
2819
2919
|
onClick: () => {
|
|
2820
2920
|
setOpen(true);
|
|
@@ -2822,7 +2922,16 @@ function LoadedMarkdownImage({
|
|
|
2822
2922
|
children: img
|
|
2823
2923
|
}
|
|
2824
2924
|
),
|
|
2825
|
-
open && /* @__PURE__ */ jsx10(
|
|
2925
|
+
open && /* @__PURE__ */ jsx10(
|
|
2926
|
+
ImageLightbox,
|
|
2927
|
+
{
|
|
2928
|
+
src,
|
|
2929
|
+
alt,
|
|
2930
|
+
labels: preview.labels,
|
|
2931
|
+
onClose: close,
|
|
2932
|
+
contextMenuProps
|
|
2933
|
+
}
|
|
2934
|
+
)
|
|
2826
2935
|
] });
|
|
2827
2936
|
}
|
|
2828
2937
|
function referenceSuffix(node) {
|
|
@@ -2891,7 +3000,7 @@ function renderFootnoteSection(context) {
|
|
|
2891
3000
|
|
|
2892
3001
|
// src/markdown/MarkdownText.tsx
|
|
2893
3002
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2894
|
-
function renderSettled(text, labels, fileMentions, pathImages) {
|
|
3003
|
+
function renderSettled(text, labels, fileMentions, pathImages, omitHtml) {
|
|
2895
3004
|
const root = parseGfmWithMath(text);
|
|
2896
3005
|
const targets = createReferenceTargets();
|
|
2897
3006
|
collectReferenceTargets(root.children, targets);
|
|
@@ -2900,6 +3009,7 @@ function renderSettled(text, labels, fileMentions, pathImages) {
|
|
|
2900
3009
|
labels,
|
|
2901
3010
|
fileMentions,
|
|
2902
3011
|
pathImages,
|
|
3012
|
+
omitHtml,
|
|
2903
3013
|
targets,
|
|
2904
3014
|
footnoteOrder: [],
|
|
2905
3015
|
footnoteCounts: /* @__PURE__ */ new Map()
|
|
@@ -2919,9 +3029,13 @@ function renderSettled(text, labels, fileMentions, pathImages) {
|
|
|
2919
3029
|
return section === null ? blocks : [...blocks, "\n", section];
|
|
2920
3030
|
}
|
|
2921
3031
|
var StreamingRenderer = class {
|
|
2922
|
-
/**
|
|
2923
|
-
|
|
3032
|
+
/**
|
|
3033
|
+
* @param labels - Localized Markdown chrome baked into cached elements; the owner replaces the renderer when it changes.
|
|
3034
|
+
* @param omitHtml - Whether raw HTML renders nothing; the owner replaces the renderer when it changes.
|
|
3035
|
+
*/
|
|
3036
|
+
constructor(labels, omitHtml) {
|
|
2924
3037
|
this.labels = labels;
|
|
3038
|
+
this.omitHtml = omitHtml;
|
|
2925
3039
|
__publicField(this, "parser", new IncrementalMarkdownParser(parseGfm));
|
|
2926
3040
|
__publicField(this, "generation", -1);
|
|
2927
3041
|
__publicField(this, "frozenCount", 0);
|
|
@@ -2968,6 +3082,7 @@ var StreamingRenderer = class {
|
|
|
2968
3082
|
labels: this.labels,
|
|
2969
3083
|
fileMentions: void 0,
|
|
2970
3084
|
pathImages: void 0,
|
|
3085
|
+
omitHtml: this.omitHtml,
|
|
2971
3086
|
targets: frameTargets,
|
|
2972
3087
|
footnoteOrder: this.frozenFootnoteOrder,
|
|
2973
3088
|
footnoteCounts: this.frozenFootnoteCounts
|
|
@@ -2985,6 +3100,7 @@ var StreamingRenderer = class {
|
|
|
2985
3100
|
labels: this.labels,
|
|
2986
3101
|
fileMentions: void 0,
|
|
2987
3102
|
pathImages: void 0,
|
|
3103
|
+
omitHtml: this.omitHtml,
|
|
2988
3104
|
targets: frameTargets,
|
|
2989
3105
|
footnoteOrder: [...this.frozenFootnoteOrder],
|
|
2990
3106
|
footnoteCounts: new Map(this.frozenFootnoteCounts)
|
|
@@ -3007,25 +3123,28 @@ var MarkdownText = memo(function MarkdownText2({
|
|
|
3007
3123
|
labels,
|
|
3008
3124
|
fileMentions,
|
|
3009
3125
|
pathImages,
|
|
3010
|
-
variant = "body"
|
|
3126
|
+
variant = "body",
|
|
3127
|
+
omitHtml = false,
|
|
3128
|
+
textInteractionSource = false
|
|
3011
3129
|
}) {
|
|
3012
3130
|
const streamRef = useRef2(null);
|
|
3013
3131
|
const streamLabelsRef = useRef2(labels);
|
|
3014
3132
|
const children = useMemo3(() => {
|
|
3015
3133
|
if (!streaming) {
|
|
3016
3134
|
streamRef.current = null;
|
|
3017
|
-
return renderSettled(text, labels, fileMentions, pathImages);
|
|
3135
|
+
return renderSettled(text, labels, fileMentions, pathImages, omitHtml);
|
|
3018
3136
|
}
|
|
3019
|
-
if (streamRef.current === null || streamLabelsRef.current !== labels) {
|
|
3020
|
-
streamRef.current = new StreamingRenderer(labels);
|
|
3137
|
+
if (streamRef.current === null || streamLabelsRef.current !== labels || streamRef.current.omitHtml !== omitHtml) {
|
|
3138
|
+
streamRef.current = new StreamingRenderer(labels, omitHtml);
|
|
3021
3139
|
streamLabelsRef.current = labels;
|
|
3022
3140
|
}
|
|
3023
3141
|
return streamRef.current.render(text);
|
|
3024
|
-
}, [text, streaming, labels, fileMentions, pathImages]);
|
|
3142
|
+
}, [text, streaming, labels, fileMentions, pathImages, omitHtml]);
|
|
3025
3143
|
return /* @__PURE__ */ jsx11(
|
|
3026
3144
|
"div",
|
|
3027
3145
|
{
|
|
3028
3146
|
className: clsx4(MarkdownText_module_default.markdown, variant === "compact" && MarkdownText_module_default.compact),
|
|
3147
|
+
"data-text-interaction-source": textInteractionSource ? "" : void 0,
|
|
3029
3148
|
"data-markdown-variant": variant === "compact" ? variant : void 0,
|
|
3030
3149
|
children
|
|
3031
3150
|
}
|
|
@@ -3048,5 +3167,6 @@ export {
|
|
|
3048
3167
|
LinkIconRegular,
|
|
3049
3168
|
LinkIconMedium,
|
|
3050
3169
|
MarkdownDelegateProvider,
|
|
3170
|
+
useMarkdownDelegate,
|
|
3051
3171
|
MarkdownText
|
|
3052
3172
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DatePicker
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UGEORMLD.js";
|
|
4
4
|
import {
|
|
5
5
|
DateRangePicker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7NH2UOZO.js";
|
|
7
7
|
import {
|
|
8
8
|
TimePicker
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UAEFKTV3.js";
|
|
10
10
|
|
|
11
11
|
// src/seekbuddy/date/fields.tsx
|
|
12
12
|
import clsx from "clsx";
|
|
@@ -23,7 +23,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
23
23
|
element.textContent = ".FzjDnq_field{display:inline-flex;position:relative}.FzjDnq_trigger{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);min-width:160px;height:32px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);cursor:pointer;text-align:left;align-items:center;gap:6px;padding:0 8px;font-size:14px;line-height:22px;display:inline-flex}.FzjDnq_trigger:hover:not(:disabled){border-color:var(--dsw-alias-border-l3)}.FzjDnq_trigger:focus-visible,.FzjDnq_open{border-color:var(--dsw-alias-state-business-primary);outline:none}.FzjDnq_trigger:disabled{cursor:not-allowed;opacity:.4}.FzjDnq_value{font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.FzjDnq_placeholder{color:var(--dsw-alias-label-dimmed)}.FzjDnq_icon{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.FzjDnq_srOnly{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.FzjDnq_panel{z-index:1100;box-sizing:border-box;border-radius:var(--dsw-radius-lg);background:var(--dsw-specific-menu);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);padding:12px;position:fixed}";
|
|
24
24
|
document.head.appendChild(element);
|
|
25
25
|
}
|
|
26
|
-
var fields_module_default = { "
|
|
26
|
+
var fields_module_default = { "placeholder": "FzjDnq_placeholder", "panel": "FzjDnq_panel", "value": "FzjDnq_value", "srOnly": "FzjDnq_srOnly", "icon": "FzjDnq_icon", "trigger": "FzjDnq_trigger", "open": "FzjDnq_open", "field": "FzjDnq_field" };
|
|
27
27
|
|
|
28
28
|
// src/seekbuddy/date/fields.tsx
|
|
29
29
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
10
10
|
element.textContent = "._3Mj9Ga_switch{--switch-height:20px;--switch-thumb:16px;--switch-pad:2px;appearance:none;box-sizing:border-box;min-width:calc(var(--switch-height) * 1.8);height:var(--switch-height);min-height:0;padding:var(--switch-pad);corner-shape:round;background:color-mix(in srgb, var(--dsw-alias-label-primary) 40%, transparent);color:var(--dsw-alias-label-primary-foreground);cursor:pointer;vertical-align:middle;border:0;border-radius:999px;flex:none;align-items:center;margin:0;display:inline-flex;position:relative}._3Mj9Ga_large{--switch-height:22px;--switch-thumb:18px}._3Mj9Ga_small{--switch-height:16px;--switch-thumb:12px}._3Mj9Ga_on{background:var(--dsw-alias-brand-primary)}._3Mj9Ga_switch:disabled{cursor:not-allowed;opacity:.5}._3Mj9Ga_switch:focus-visible{outline-offset:2px;outline-style:solid}._3Mj9Ga_thumb{top:var(--switch-pad);width:var(--switch-thumb);height:var(--switch-thumb);corner-shape:round;background:var(--dsw-alias-switch-thumb);border-radius:50%;position:absolute;inset-inline-start:var(--switch-pad)}._3Mj9Ga_on ._3Mj9Ga_thumb{background:var(--dsw-alias-label-primary-foreground);inset-inline-start:calc(100% - var(--switch-thumb) - var(--switch-pad))}._3Mj9Ga_inner{min-width:0;padding-inline:calc(var(--switch-thumb) + var(--switch-pad) + 4px) 6px;font:var(--dsw-font-xxs-12);white-space:nowrap;align-items:center;line-height:1;display:inline-flex}._3Mj9Ga_large ._3Mj9Ga_inner{padding-inline:calc(var(--switch-thumb) + var(--switch-pad) + 5px) 8px;font:var(--dsw-font-xs-13);line-height:1}._3Mj9Ga_small ._3Mj9Ga_inner{padding-inline:calc(var(--switch-thumb) + var(--switch-pad) + 3px) 5px;font:var(--dsw-font-xxxs-11);line-height:1}._3Mj9Ga_on ._3Mj9Ga_inner{padding-inline:6px calc(var(--switch-thumb) + var(--switch-pad) + 4px)}._3Mj9Ga_on._3Mj9Ga_large ._3Mj9Ga_inner{padding-inline:8px calc(var(--switch-thumb) + var(--switch-pad) + 5px)}._3Mj9Ga_on._3Mj9Ga_small ._3Mj9Ga_inner{padding-inline:5px calc(var(--switch-thumb) + var(--switch-pad) + 3px)}";
|
|
11
11
|
document.head.appendChild(element);
|
|
12
12
|
}
|
|
13
|
-
var Switch_module_default = { "
|
|
13
|
+
var Switch_module_default = { "thumb": "_3Mj9Ga_thumb", "inner": "_3Mj9Ga_inner", "on": "_3Mj9Ga_on", "large": "_3Mj9Ga_large", "switch": "_3Mj9Ga_switch", "small": "_3Mj9Ga_small" };
|
|
14
14
|
|
|
15
15
|
// src/seekbuddy/Switch.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,7 +9,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
9
9
|
element.textContent = ".wbxAxW_card{--card-pad:16px;box-sizing:border-box;padding:var(--card-pad);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);--dsw-elevation-stroke-color:var(--dsw-alias-border-l3);box-shadow:var(--dsw-elevation-panel);border:0;margin:0;list-style:none}.wbxAxW_none{--card-pad:0}.wbxAxW_sm{--card-pad:14px}.wbxAxW_md{--card-pad:16px}.wbxAxW_interactive{cursor:pointer}.wbxAxW_interactive:hover{background-image:linear-gradient(var(--dsw-alias-interactive-bg-hover), var(--dsw-alias-interactive-bg-hover))}.wbxAxW_card:focus-visible{outline-offset:2px;outline-style:solid}";
|
|
10
10
|
document.head.appendChild(element);
|
|
11
11
|
}
|
|
12
|
-
var Card_module_default = { "
|
|
12
|
+
var Card_module_default = { "sm": "wbxAxW_sm", "md": "wbxAxW_md", "card": "wbxAxW_card", "interactive": "wbxAxW_interactive", "none": "wbxAxW_none" };
|
|
13
13
|
|
|
14
14
|
// src/seekbuddy/Card.tsx
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Spinner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EWAZFWLW.js";
|
|
4
4
|
|
|
5
5
|
// src/seekbuddy/Message.tsx
|
|
6
6
|
import clsx from "clsx";
|
|
@@ -16,7 +16,7 @@ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-u
|
|
|
16
16
|
element.textContent = ".Hl-94G_stack{z-index:1100;pointer-events:none;flex-direction:column;align-items:center;gap:8px;max-width:min(560px,100vw - 48px);display:flex;position:fixed;top:120px;left:50%;transform:translate(-50%)}.Hl-94G_message{box-sizing:border-box;border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-button-contrast-fill);max-width:100%;color:var(--dsw-alias-label-primary-inverted);font:var(--dsw-font-s-14);box-shadow:var(--dsw-shadow-lv3);align-items:center;gap:10px;padding:12px 16px;animation:.16s ease-out Hl-94G_seekbuddy-message-in;display:flex}.Hl-94G_leaving{animation:1s forwards Hl-94G_seekbuddy-message-out}.Hl-94G_icon{flex:none;place-items:center;display:grid}.Hl-94G_content{min-width:0}.Hl-94G_success .Hl-94G_icon{color:var(--dsw-alias-state-success-primary)}.Hl-94G_error .Hl-94G_icon{color:var(--dsw-alias-state-error-primary)}.Hl-94G_warning .Hl-94G_icon{color:var(--dsw-alias-state-warn-label)}@keyframes Hl-94G_seekbuddy-message-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}@keyframes Hl-94G_seekbuddy-message-out{to{opacity:0}}@media (prefers-reduced-motion:reduce){.Hl-94G_message{animation:none}.Hl-94G_leaving{animation:1s forwards Hl-94G_seekbuddy-message-out}}";
|
|
17
17
|
document.head.appendChild(element);
|
|
18
18
|
}
|
|
19
|
-
var Message_module_default = { "
|
|
19
|
+
var Message_module_default = { "content": "Hl-94G_content", "success": "Hl-94G_success", "warning": "Hl-94G_warning", "stack": "Hl-94G_stack", "leaving": "Hl-94G_leaving", "icon": "Hl-94G_icon", "message": "Hl-94G_message", "seekbuddy-message-out": "Hl-94G_seekbuddy-message-out", "error": "Hl-94G_error", "seekbuddy-message-in": "Hl-94G_seekbuddy-message-in" };
|
|
20
20
|
|
|
21
21
|
// src/seekbuddy/Message.tsx
|
|
22
22
|
import { jsx, jsxs } from "react/jsx-runtime";
|