@deepseek-ai/dsh-client-ui-sidebar-documentpreview 0.1.6-alpha.1 → 0.1.7-alpha.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/README.i18n.yaml +2 -2
- package/README.md +74 -15
- package/README.zh.md +74 -15
- package/lib/client.excel.js +133782 -0
- package/lib/client.js +5306 -25638
- package/lib/client.pdf.js +32631 -0
- package/lib/index.js +33 -4
- package/lib/types/client/TextPreview.d.ts +2 -2
- package/lib/types/client/document/contract.d.ts +62 -8
- package/lib/types/client/document/registry.d.ts +2 -2
- package/lib/types/client/document/resource-group.d.ts +23 -0
- package/lib/types/client/document/tab-lifetime.d.ts +10 -0
- package/lib/types/client/excel/LazyExcelBody.d.ts +21 -0
- package/lib/types/client/excel/convert.d.ts +12 -0
- package/lib/types/client/excel/delimited.d.ts +10 -0
- package/lib/types/client/excel/error.d.ts +7 -0
- package/lib/types/client/excel/excel.d.ts +10 -0
- package/lib/types/client/excel/format.d.ts +9 -0
- package/lib/types/client/excel/index.d.ts +10 -0
- package/lib/types/client/excel/locales.d.ts +45 -0
- package/lib/types/client/excel/model.d.ts +35 -0
- package/lib/types/client/excel/parse.d.ts +12 -0
- package/lib/types/client/excel/worker.d.ts +2 -0
- package/lib/types/client/excel/xls.d.ts +18 -0
- package/lib/types/client/excel/xlsx-archive.d.ts +19 -0
- package/lib/types/client/excel/xlsx.d.ts +9 -0
- package/lib/types/client/face.d.ts +17 -2
- package/lib/types/client/failure-line.d.ts +10 -0
- package/lib/types/client/html/HtmlBody.d.ts +10 -4
- package/lib/types/client/html/basic-document.d.ts +7 -0
- package/lib/types/client/html/read-relative.d.ts +7 -6
- package/lib/types/client/image/ImageBody.d.ts +7 -8
- package/lib/types/client/image/locales.d.ts +12 -0
- package/lib/types/client/index.d.ts +3 -3
- package/lib/types/client/locales.d.ts +6 -0
- package/lib/types/client/markdown/MarkdownBody.d.ts +1 -1
- package/lib/types/client/markdown/path-images.d.ts +9 -0
- package/lib/types/client/office/FontNotice.d.ts +14 -0
- package/lib/types/client/office/OfficeBody.d.ts +38 -0
- package/lib/types/client/office/OfficeFontAction.d.ts +13 -0
- package/lib/types/client/office/cache.d.ts +70 -0
- package/lib/types/client/office/face.d.ts +31 -0
- package/lib/types/client/office/index.d.ts +16 -0
- package/lib/types/client/office/locales.d.ts +39 -0
- package/lib/types/client/office/store.d.ts +32 -0
- package/lib/types/client/pdf/LazyPdfBody.d.ts +10 -0
- package/lib/types/client/pdf/document.d.ts +8 -2
- package/lib/types/client/pdf/index.d.ts +13 -0
- package/lib/types/client/pdf/locales.d.ts +12 -0
- package/lib/types/client/pdf/{PdfBody.d.ts → pdf.d.ts} +8 -3
- package/lib/types/client/pdf/store.d.ts +5 -4
- package/lib/types/client/pdf/text.d.ts +10 -0
- package/lib/types/client/rpc.d.ts +4 -12
- package/lib/types/client/store.d.ts +11 -1
- package/lib/types/client/zoom/ZoomControls.d.ts +21 -0
- package/lib/types/client/zoom/ZoomViewport.d.ts +25 -0
- package/lib/types/client/zoom/locales.d.ts +21 -0
- package/lib/types/client/zoom/store.d.ts +28 -0
- package/lib/types/client/zoom/types.d.ts +27 -0
- package/lib/types/config.d.ts +31 -0
- package/lib/types/index.d.ts +10 -3
- package/package.json +40 -20
- package/lib/types/client/code/languages.d.ts +0 -9
- package/lib/types/client/icons.d.ts +0 -14
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Tab-local zoom preferences for renderers without additional view state. */
|
|
2
|
+
import { type EngineStoreHandle } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import type { TabId } from '@deepseek-ai/dsh-client-ui-dockkit';
|
|
4
|
+
import { type ZoomPreference } from './types.ts';
|
|
5
|
+
/** Tab-lifetime callback supplied by a zoomable renderer registration. */
|
|
6
|
+
export interface ZoomInjected {
|
|
7
|
+
/** @param tabId - owning tab. @param signal - complete tab-record lifetime. */
|
|
8
|
+
readonly retainTab: (tabId: TabId, signal: AbortSignal) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Zoom state isolated by the owning tab record. */
|
|
11
|
+
export interface ZoomState {
|
|
12
|
+
byTab: Record<TabId, ZoomPreference>;
|
|
13
|
+
}
|
|
14
|
+
type ZoomActions = {
|
|
15
|
+
zoom: (draft: ZoomState, tabId: TabId, preference: ZoomPreference) => void;
|
|
16
|
+
forget: (draft: ZoomState, tabId: TabId) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Create tab-local zoom state for a document renderer registration.
|
|
20
|
+
* @returns a store declaration retaining zoom until its tab closes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createZoomStore(): EngineStoreHandle<ZoomState, ZoomActions>;
|
|
23
|
+
/** Default zoom value for a tab without retained state. */
|
|
24
|
+
export declare const DEFAULT_ZOOM: ZoomPreference;
|
|
25
|
+
/** Store declaration used by image previews. */
|
|
26
|
+
export type ZoomStore = ReturnType<typeof createZoomStore>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Automatic fit or an explicit actual-size scale selected by the reader. */
|
|
2
|
+
export type ZoomPreference = {
|
|
3
|
+
readonly kind: 'fit-width';
|
|
4
|
+
} | {
|
|
5
|
+
readonly kind: 'fixed';
|
|
6
|
+
readonly scale: number;
|
|
7
|
+
};
|
|
8
|
+
/** Default preference for a newly opened zoomable preview. */
|
|
9
|
+
export declare const FIT_WIDTH: ZoomPreference;
|
|
10
|
+
/** Minimum scale retained by a fixed zoom preference. */
|
|
11
|
+
export declare const MIN_FIXED_ZOOM = 0.25;
|
|
12
|
+
/** Maximum scale retained by a fixed zoom preference. */
|
|
13
|
+
export declare const MAX_FIXED_ZOOM = 4;
|
|
14
|
+
/** Scale interval used by the incremental controls. */
|
|
15
|
+
export declare const ZOOM_STEP = 0.25;
|
|
16
|
+
/** Fixed scale choices shown in the zoom menu. */
|
|
17
|
+
export declare const ZOOM_OPTIONS: readonly [0.25, 0.5, 1, 1.5, 2];
|
|
18
|
+
/** Localized copy consumed by the framework-free zoom controls. */
|
|
19
|
+
export interface ZoomLabels {
|
|
20
|
+
readonly controls: string;
|
|
21
|
+
readonly menu: string;
|
|
22
|
+
readonly out: string;
|
|
23
|
+
readonly into: string;
|
|
24
|
+
readonly fitWidth: string;
|
|
25
|
+
readonly value: (percent: number) => string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Cache limits shared by the Host configuration and browser document previews. */
|
|
2
|
+
import z from '@deepseek-ai/schemastery';
|
|
3
|
+
/** Transient Office conversion reuse within one Client connection. */
|
|
4
|
+
export interface Config {
|
|
5
|
+
/** Retained PDF limits; pending conversions share cancellation by reader lifetime. */
|
|
6
|
+
office: {
|
|
7
|
+
/** Maximum retained completed PDFs. */
|
|
8
|
+
maxCachedEntries: number;
|
|
9
|
+
/** Maximum retained PDF bytes, counted by each binary buffer's byteLength. */
|
|
10
|
+
maxCachedBytes: number;
|
|
11
|
+
/** Maximum unsettled Host conversion RPCs, including cancellation teardown. */
|
|
12
|
+
maxPending: number;
|
|
13
|
+
/** Maximum readers including source and renderer metadata lookups. */
|
|
14
|
+
maxReaders: number;
|
|
15
|
+
};
|
|
16
|
+
/** Browser spreadsheet parser and dense cell allocation limits. */
|
|
17
|
+
excel: {
|
|
18
|
+
/** Maximum source file bytes. */
|
|
19
|
+
maxBytes: number;
|
|
20
|
+
/** Maximum combined rectangular cell area across worksheets. */
|
|
21
|
+
maxCells: number;
|
|
22
|
+
/** Maximum parser Worker lifetime in milliseconds. */
|
|
23
|
+
timeoutMs: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Deployment limits applied before Office preview registration. */
|
|
27
|
+
export declare const Config: z<{
|
|
28
|
+
office?: Partial<Config['office']>;
|
|
29
|
+
excel?: Partial<Config['excel']>;
|
|
30
|
+
}, Config>;
|
|
31
|
+
//# sourceMappingURL=config.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/** Host configuration for browser document previews. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { Config } from './config.ts';
|
|
4
|
+
export { Config } from './config.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Embed validated preview settings in browser pages.
|
|
7
|
+
* @param ctx - Host context serving browser pages.
|
|
8
|
+
* @param config - Cache limits adopted when the page loads.
|
|
9
|
+
*/
|
|
10
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
4
11
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-sidebar-documentpreview",
|
|
3
|
-
"description": "Extensible
|
|
4
|
-
"version": "0.1.
|
|
3
|
+
"description": "Extensible Sidebar previews for Office documents, spreadsheets, Markdown, code, images, PDF, HTML, and plain text",
|
|
4
|
+
"version": "0.1.7-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,47 +30,67 @@
|
|
|
30
30
|
"inject": [
|
|
31
31
|
"@deepseek-ai/dsh-api-gateway",
|
|
32
32
|
"@deepseek-ai/dsh-api-workspace-files",
|
|
33
|
+
"@deepseek-ai/dsh-client-resources",
|
|
33
34
|
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
34
35
|
"@deepseek-ai/dsh-client-ui-session",
|
|
35
|
-
"@deepseek-ai/dsh-api-remotes"
|
|
36
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
37
|
+
"@deepseek-ai/dsh-client-locale",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
36
39
|
],
|
|
37
40
|
"platform": "web"
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
"license": "MIT",
|
|
41
44
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
45
|
+
"@deepseek-ai/cordis": "^4.0.3"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
48
|
+
"@fortune-sheet/core": "1.0.4",
|
|
49
|
+
"@fortune-sheet/react": "1.0.4",
|
|
45
50
|
"@testing-library/react": "^16.1.0",
|
|
51
|
+
"@types/papaparse": "^5.3.16",
|
|
46
52
|
"@types/react": "~18.3.1",
|
|
47
53
|
"@types/react-dom": "~18.3.0",
|
|
48
54
|
"clsx": "^2.0.0",
|
|
55
|
+
"dompurify": "^3.4.11",
|
|
56
|
+
"exceljs": "4.4.0",
|
|
57
|
+
"fast-xml-parser": "5.11.1",
|
|
58
|
+
"fflate": "^0.8.3",
|
|
59
|
+
"papaparse": "5.5.3",
|
|
49
60
|
"pdfjs-dist": "6.3.289",
|
|
50
61
|
"react": "^18.2.0",
|
|
51
62
|
"react-dom": "^18.2.0",
|
|
52
|
-
"
|
|
53
|
-
"@deepseek-ai/
|
|
54
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.
|
|
55
|
-
"@deepseek-ai/dsh-api-workspace-files": "^0.1.
|
|
56
|
-
"@deepseek-ai/dsh-client-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-client-
|
|
59
|
-
"@deepseek-ai/dsh-client-
|
|
60
|
-
"@deepseek-ai/dsh-client-
|
|
61
|
-
"@deepseek-ai/dsh-client-
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-dockkit": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-client-ui-
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-
|
|
65
|
-
"@deepseek-ai/dsh-client-ui-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
63
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
64
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
65
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.7-alpha.1",
|
|
66
|
+
"@deepseek-ai/dsh-api-workspace-files": "^0.1.7-alpha.1",
|
|
67
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.7-alpha.1",
|
|
68
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.7-alpha.1",
|
|
69
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-alpha.1",
|
|
70
|
+
"@deepseek-ai/dsh-client-resources": "^0.1.7-alpha.1",
|
|
71
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.7-alpha.1",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-dockkit": "^0.1.7-alpha.1",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-alpha.1",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-alpha.1",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.7-alpha.1",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-alpha.1",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "^0.1.7-alpha.1",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-alpha.1",
|
|
80
|
+
"@deepseek-ai/dsh-office-to-pdf": "^0.1.7-alpha.1",
|
|
81
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.7-alpha.1",
|
|
82
|
+
"@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
|
|
83
|
+
"@deepseek-ai/dsh-util-workspace-path": "^0.1.7-alpha.1"
|
|
68
84
|
},
|
|
69
85
|
"files": [
|
|
70
86
|
"lib/index.js",
|
|
71
87
|
"lib/client.js",
|
|
88
|
+
"lib/client.*.js",
|
|
72
89
|
"lib/types/**/*.d.ts"
|
|
73
90
|
],
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@deepseek-ai/schemastery": "^3.18.3"
|
|
93
|
+
},
|
|
74
94
|
"scripts": {
|
|
75
95
|
"bundle": "tsdown",
|
|
76
96
|
"watch": "tsdown --watch"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Recognized suffixes shared by renderer selection and language hints. */
|
|
2
|
-
export declare const CODE_EXTENSIONS: readonly string[];
|
|
3
|
-
/**
|
|
4
|
-
* Select the shared highlighter's grammar for a filename.
|
|
5
|
-
* @param path - decoded source filename or path.
|
|
6
|
-
* @returns a supported grammar hint, or undefined for other suffixes.
|
|
7
|
-
*/
|
|
8
|
-
export declare function languageForPath(path: string): string | undefined;
|
|
9
|
-
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Glyphs this package draws that the shared icon set does not carry yet.
|
|
3
|
-
* Same props contract as `@deepseek-ai/dsh-client-ui-primitives` icons, so a
|
|
4
|
-
* shared replacement is a one-line import change.
|
|
5
|
-
*
|
|
6
|
-
* The wrap control swaps between the two glyphs below to preview the mode a
|
|
7
|
-
* click switches to, so neither needs a pressed style.
|
|
8
|
-
*/
|
|
9
|
-
import type { IconProps } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
10
|
-
/** Two margin bars, a straight arrow running to the right one: lines run past the edge. */
|
|
11
|
-
export declare const IconNowrapFill16: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
12
|
-
/** Two margin bars, an arrow sweeping around and back left: lines turn under themselves. */
|
|
13
|
-
export declare const IconWrapFill16: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
14
|
-
//# sourceMappingURL=icons.d.ts.map
|