@deepseek-ai/dsh-client-ui-sidebar-documentpreview 0.1.5-rc.2 → 0.1.6-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 +2 -2
- package/README.md +41 -8
- package/README.zh.md +45 -12
- package/lib/client.js +2067 -25178
- package/lib/client.pdf.js +32609 -0
- package/lib/index.js +26 -4
- package/lib/types/client/LoadingIndicator.d.ts +5 -1
- package/lib/types/client/TextPreview.d.ts +1 -1
- package/lib/types/client/document/contract.d.ts +21 -11
- package/lib/types/client/document/registry.d.ts +19 -4
- package/lib/types/client/document/suffix.d.ts +24 -0
- package/lib/types/client/document/tab-lifetime.d.ts +10 -0
- package/lib/types/client/document/unviewable.d.ts +7 -0
- package/lib/types/client/face.d.ts +9 -0
- package/lib/types/client/image/ImageBody.d.ts +5 -3
- package/lib/types/client/image/index.d.ts +2 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locales.d.ts +2 -0
- package/lib/types/client/office/FontNotice.d.ts +16 -0
- package/lib/types/client/office/OfficeBody.d.ts +44 -0
- package/lib/types/client/office/cache.d.ts +70 -0
- package/lib/types/client/office/index.d.ts +16 -0
- package/lib/types/client/office/locales.d.ts +43 -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/{PdfBody.d.ts → pdf.d.ts} +2 -2
- package/lib/types/client/pdf/store.d.ts +0 -2
- package/lib/types/client/pdf/text.d.ts +10 -0
- package/lib/types/client/rpc.d.ts +2 -2
- package/lib/types/client/store.d.ts +6 -1
- package/lib/types/config.d.ts +21 -0
- package/lib/types/index.d.ts +10 -3
- package/package.json +26 -18
|
@@ -33,6 +33,10 @@ export interface TextTabState {
|
|
|
33
33
|
rendererId?: string;
|
|
34
34
|
/** Current display-loading mode; absent before the first read. */
|
|
35
35
|
mode?: DocumentLoadMode;
|
|
36
|
+
/** Implementation owning source loading; absent for ordinary file reads. */
|
|
37
|
+
contentRendererId?: string;
|
|
38
|
+
/** Current content revision, incremented whenever loaded content is discarded. */
|
|
39
|
+
loadRevision: number;
|
|
36
40
|
/** Full byte result used by complete-file renderers. */
|
|
37
41
|
complete?: DocumentFileBytes;
|
|
38
42
|
/** The file version the loaded pages belong to; absent before the first page. */
|
|
@@ -66,7 +70,8 @@ export declare function fresh(): TextTabState;
|
|
|
66
70
|
/** The preview store's write set; every action names the tab it writes. */
|
|
67
71
|
type TextActions = {
|
|
68
72
|
selected: (draft: TextState, tabId: TabId, rendererId: string | undefined) => void;
|
|
69
|
-
loading: (draft: TextState, tabId: TabId, mode?: DocumentLoadMode, observedVersion?: string) => void;
|
|
73
|
+
loading: (draft: TextState, tabId: TabId, mode?: DocumentLoadMode, observedVersion?: string, contentRendererId?: string) => void;
|
|
74
|
+
rendered: (draft: TextState, tabId: TabId, revision: number, version: string) => void;
|
|
70
75
|
complete: (draft: TextState, tabId: TabId, file: DocumentFileBytes) => void;
|
|
71
76
|
page: (draft: TextState, tabId: TabId, page: WorkspaceFileText) => void;
|
|
72
77
|
failed: (draft: TextState, tabId: TabId, failure: RemoteFailure) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
17
|
+
/** Deployment limits applied before Office preview registration. */
|
|
18
|
+
export declare const Config: z<{
|
|
19
|
+
office?: Partial<Config['office']>;
|
|
20
|
+
}, Config>;
|
|
21
|
+
//# 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 document previews for Sidebar files: Markdown, highlighted code, images, PDF, HTML, and plain text",
|
|
4
|
-
"version": "0.1.
|
|
3
|
+
"description": "Extensible document previews for Sidebar files: Office, Markdown, highlighted code, images, PDF, HTML, and plain text",
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"@deepseek-ai/dsh-api-workspace-files",
|
|
33
33
|
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
34
34
|
"@deepseek-ai/dsh-client-ui-session",
|
|
35
|
-
"@deepseek-ai/dsh-api-remotes"
|
|
35
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
36
|
+
"@deepseek-ai/dsh-client-locale"
|
|
36
37
|
],
|
|
37
38
|
"platform": "web"
|
|
38
39
|
}
|
|
@@ -49,28 +50,35 @@
|
|
|
49
50
|
"pdfjs-dist": "6.3.289",
|
|
50
51
|
"react": "^18.2.0",
|
|
51
52
|
"react-dom": "^18.2.0",
|
|
53
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-api-workspace-files": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-resources": "^0.1.6-alpha.2",
|
|
52
58
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-client-
|
|
56
|
-
"@deepseek-ai/dsh-client-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-client-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-client-
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-
|
|
65
|
-
"@deepseek-ai/dsh-client-ui-
|
|
66
|
-
"@deepseek-ai/dsh-session": "^0.1.5-rc.2",
|
|
67
|
-
"@deepseek-ai/dsh-util-workspace-path": "^0.1.5-rc.2"
|
|
59
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-dockkit": "^0.1.6-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.6-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-util-workspace-path": "^0.1.6-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-office-to-pdf": "^0.1.6-alpha.2",
|
|
69
|
+
"@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "^0.1.6-alpha.2"
|
|
68
72
|
},
|
|
69
73
|
"files": [
|
|
70
74
|
"lib/index.js",
|
|
71
75
|
"lib/client.js",
|
|
76
|
+
"lib/client.*.js",
|
|
72
77
|
"lib/types/**/*.d.ts"
|
|
73
78
|
],
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
81
|
+
},
|
|
74
82
|
"scripts": {
|
|
75
83
|
"bundle": "tsdown",
|
|
76
84
|
"watch": "tsdown --watch"
|