@deepseek-ai/dsh-client-ui-sidebar-documentpreview 0.2.0-rc.2 → 0.2.1-alpha.2
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/README.i18n.yaml +4 -4
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/client.excel.js +2 -2
- package/lib/client.frontmatter-fields.js +5768 -0
- package/lib/client.js +494 -96
- package/lib/types/client/markdown/MarkdownBody.d.ts +2 -0
- package/lib/types/client/markdown/frontmatter-fields.d.ts +20 -0
- package/lib/types/client/markdown/frontmatter.d.ts +13 -0
- package/package.json +27 -26
|
@@ -5,6 +5,8 @@ import type { DocumentPreviewProps } from '../document/contract.ts';
|
|
|
5
5
|
export type MarkdownBodyProps = DocumentPreviewProps & PropsLocale<'documentMarkdown'>;
|
|
6
6
|
/**
|
|
7
7
|
* Render one accumulated document; EOF completes the primitive's full parse.
|
|
8
|
+
* A leading YAML frontmatter block renders as a field list instead of Markdown; its
|
|
9
|
+
* verbatim source stands in while the field-list chunk loads or when it fails.
|
|
8
10
|
* @param props - owner-loaded contents and localized primitive labels.
|
|
9
11
|
* @returns Markdown content, or nothing for a non-text delivery.
|
|
10
12
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field list for a Markdown document's leading YAML frontmatter. The Markdown
|
|
3
|
+
* body loads this module lazily so the YAML parser stays out of the startup
|
|
4
|
+
* chunk.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
|
+
/** Owner inputs for the lazily loaded field list. */
|
|
8
|
+
export interface FrontmatterFieldsProps {
|
|
9
|
+
/** YAML between the frontmatter delimiters. */
|
|
10
|
+
source: string;
|
|
11
|
+
/** Verbatim block shown for invalid YAML and non-mapping documents. */
|
|
12
|
+
fallback: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Render frontmatter fields, or the owner's verbatim block when the YAML is not a mapping.
|
|
16
|
+
* @param props - frontmatter source and its verbatim fallback.
|
|
17
|
+
* @returns the field list, the fallback, or nothing for a document without content.
|
|
18
|
+
*/
|
|
19
|
+
export declare function FrontmatterFields({ source, fallback }: FrontmatterFieldsProps): ReactNode;
|
|
20
|
+
//# sourceMappingURL=frontmatter-fields.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Leading YAML frontmatter split from a Markdown document before Markdown parsing. */
|
|
2
|
+
/** Frontmatter source between its delimiters and the Markdown body after the closing delimiter. */
|
|
3
|
+
export interface FrontmatterSplit {
|
|
4
|
+
source: string;
|
|
5
|
+
body: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Split a leading YAML frontmatter block from Markdown text without parsing its YAML.
|
|
9
|
+
* @param text - Markdown source; an unterminated block is not frontmatter.
|
|
10
|
+
* @returns frontmatter source and the remaining body, or `undefined` when the text has none.
|
|
11
|
+
*/
|
|
12
|
+
export declare function splitFrontmatter(text: string): FrontmatterSplit | undefined;
|
|
13
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-sidebar-documentpreview",
|
|
3
3
|
"description": "Extensible Sidebar previews for Office documents, spreadsheets, Markdown, code, images, PDF, HTML, and plain text",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -42,45 +42,46 @@
|
|
|
42
42
|
},
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
45
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-api-gateway": "0.2.1-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.1-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-client-connection": "0.2.1-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-client-resources": "0.2.1-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-store": "0.2.1-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-dockkit": "0.2.1-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-office-to-pdf": "0.2.1-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.2",
|
|
48
68
|
"@fortune-sheet/core": "1.0.4",
|
|
49
69
|
"@fortune-sheet/react": "1.0.4",
|
|
50
|
-
"@testing-library/react": "^16.
|
|
70
|
+
"@testing-library/react": "^16.3.3",
|
|
51
71
|
"@types/papaparse": "^5.3.16",
|
|
52
72
|
"@types/react": "~18.3.1",
|
|
53
73
|
"@types/react-dom": "~18.3.0",
|
|
54
74
|
"clsx": "^2.0.0",
|
|
55
|
-
"dompurify": "^3.4.
|
|
75
|
+
"dompurify": "^3.4.16",
|
|
56
76
|
"exceljs": "4.4.0",
|
|
57
77
|
"fast-xml-parser": "5.11.1",
|
|
58
78
|
"fflate": "^0.8.3",
|
|
59
|
-
"papaparse": "5.
|
|
79
|
+
"papaparse": "5.7.0",
|
|
60
80
|
"pdfjs-dist": "6.3.289",
|
|
61
81
|
"react": "^18.2.0",
|
|
62
82
|
"react-dom": "^18.2.0",
|
|
63
83
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
64
|
-
"
|
|
65
|
-
"@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
|
|
66
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.0-rc.2",
|
|
67
|
-
"@deepseek-ai/dsh-api-workspace-files": "0.2.0-rc.2",
|
|
68
|
-
"@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
|
|
69
|
-
"@deepseek-ai/dsh-client-resources": "0.2.0-rc.2",
|
|
70
|
-
"@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
|
|
71
|
-
"@deepseek-ai/dsh-client-test-runtime": "0.2.0-rc.2",
|
|
72
|
-
"@deepseek-ai/dsh-client-ui-dockkit": "0.2.0-rc.2",
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.2",
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.0-rc.2",
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
|
|
79
|
-
"@deepseek-ai/dsh-office-to-pdf": "0.2.0-rc.2",
|
|
80
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
|
|
81
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.2.0-rc.2",
|
|
82
|
-
"@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
|
|
83
|
-
"@deepseek-ai/dsh-session": "0.2.0-rc.2"
|
|
84
|
+
"yaml": "^2.9.0"
|
|
84
85
|
},
|
|
85
86
|
"files": [
|
|
86
87
|
"lib/index.js",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
"lib/types/**/*.d.ts"
|
|
90
91
|
],
|
|
91
92
|
"dependencies": {
|
|
92
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
93
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
93
94
|
},
|
|
94
95
|
"scripts": {
|
|
95
96
|
"bundle": "tsdown",
|