@lingbi/studio 0.4.0 → 0.6.0
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/Application.d.ts +97 -21
- package/DownloadSaveSink.d.ts +21 -0
- package/EditedArchiveResourceContext.d.ts +32 -0
- package/ImportPerformanceMode.d.ts +5 -0
- package/ModelDownloadController.d.ts +21 -0
- package/ModelExportContext.d.ts +20 -0
- package/ModelExportContextFactory.d.ts +21 -0
- package/ModelInventory.d.ts +19 -0
- package/ModelInventoryController.d.ts +29 -0
- package/StudioToolbarState.d.ts +25 -0
- package/StudioWorkspace.d.ts +36 -8
- package/THIRD_PARTY_LICENSES.md +24 -0
- package/archive/ArchiveImportCentralDirectoryValidator.d.ts +21 -0
- package/archive/ArchiveImportChunkAcknowledgement.d.ts +12 -0
- package/archive/ArchiveImportCrc32.d.ts +8 -0
- package/archive/ArchiveImportError.d.ts +9 -0
- package/archive/ArchiveImportFileResult.d.ts +7 -0
- package/archive/ArchiveImportJobRequest.d.ts +4 -0
- package/archive/ArchiveImportJobValidator.d.ts +8 -0
- package/archive/ArchiveImportModelFormat.d.ts +1 -0
- package/archive/ArchiveImportPathValidator.d.ts +22 -0
- package/archive/ArchiveImportResult.d.ts +6 -0
- package/archive/ArchiveImportResultAccumulator.d.ts +17 -0
- package/archive/ArchiveImportRole.d.ts +1 -0
- package/archive/ArchiveImportRoleResult.d.ts +6 -0
- package/archive/ArchiveImportSignatureValidator.d.ts +7 -0
- package/archive/ArchiveImportWorkerClient.d.ts +23 -0
- package/archive/ArchiveImportWorkerClientTask.d.ts +17 -0
- package/archive/ArchiveImportWorkerEndpoint.d.ts +13 -0
- package/archive/ArchiveImportWorkerEntry.d.ts +1 -0
- package/archive/ArchiveImportWorkerFactory.d.ts +4 -0
- package/archive/ArchiveImportWorkerMessage.d.ts +48 -0
- package/archive/ArchiveImportWorkerMessageParser.d.ts +16 -0
- package/archive/ArchiveImportWorkerPort.d.ts +5 -0
- package/archive/ArchiveImportWorkerRuntime.d.ts +47 -0
- package/archive/ArchiveImportWorkerTask.d.ts +38 -0
- package/archive/BrowserArchiveImportWorkerEndpoint.d.ts +15 -0
- package/archive/BrowserArchiveImportWorkerFactory.d.ts +5 -0
- package/archive/BrowserArchiveImportWorkerPort.d.ts +7 -0
- package/assets/ArchiveImportWorkerEntry-Dh4RZo22.js +1548 -0
- package/assets/ManifoldWorkerEntry-BulSBVFW.js +3028 -0
- package/assets/ModelExportWorkerEntry-DwhcdDU3.js +3457 -0
- package/export/BrowserExportWorkerPort.d.ts +7 -0
- package/export/BrowserModelExportWorkerEndpoint.d.ts +15 -0
- package/export/BrowserModelExportWorkerFactory.d.ts +6 -0
- package/export/ByteChunkWriter.d.ts +11 -0
- package/export/ExportChunkAcknowledgement.d.ts +13 -0
- package/export/ExportJobRequest.d.ts +6 -0
- package/export/ExportJobValidator.d.ts +17 -0
- package/export/ExportModelFormat.d.ts +1 -0
- package/export/ExportModelRole.d.ts +1 -0
- package/export/ExportResourceFile.d.ts +6 -0
- package/export/ExportRoleRequest.d.ts +25 -0
- package/export/ExportWorkerMessage.d.ts +41 -0
- package/export/ExportWorkerMessageParser.d.ts +29 -0
- package/export/ExportWorkerPort.d.ts +6 -0
- package/export/ExportWorkerTask.d.ts +15 -0
- package/export/GeneratedMtlWriter.d.ts +10 -0
- package/export/GeneratedObjModelBaker.d.ts +12 -0
- package/export/GeneratedTextChunkWriter.d.ts +10 -0
- package/export/MatrixTransformer.d.ts +21 -0
- package/export/ModelExportError.d.ts +14 -0
- package/export/ModelExportWorkerClient.d.ts +24 -0
- package/export/ModelExportWorkerClientListener.d.ts +5 -0
- package/export/ModelExportWorkerClientTask.d.ts +14 -0
- package/export/ModelExportWorkerEndpoint.d.ts +14 -0
- package/export/ModelExportWorkerEntry.d.ts +1 -0
- package/export/ModelExportWorkerFactory.d.ts +4 -0
- package/export/ModelExportWorkerRuntime.d.ts +47 -0
- package/export/ObjModelBaker.d.ts +27 -0
- package/export/PlyHeaderParser.d.ts +64 -0
- package/export/PlyModelBaker.d.ts +52 -0
- package/index.d.ts +2 -4
- package/index.js +12856 -6907
- package/package.json +1 -1
- package/ObjImportSource.d.ts +0 -7
- package/ObjResourceListSource.d.ts +0 -5
- package/ObjResourceSceneSource.d.ts +0 -14
- package/ObjSceneSource.d.ts +0 -14
package/Application.d.ts
CHANGED
|
@@ -1,39 +1,115 @@
|
|
|
1
|
+
import { ImportPerformanceMode } from './ImportPerformanceMode';
|
|
2
|
+
import type { ModelInventoryConfirmationHandler, ModelInventoryHandler } from './ModelInventory';
|
|
1
3
|
import type { ModelResourceSceneSource } from './ModelResourceSceneSource';
|
|
2
4
|
import type { ObjImportResult } from './ObjImportResult';
|
|
3
|
-
import type { ObjImportSource } from './ObjImportSource';
|
|
4
|
-
import type { ObjResourceListSource } from './ObjResourceListSource';
|
|
5
|
-
import type { ObjResourceSceneSource } from './ObjResourceSceneSource';
|
|
6
|
-
import type { ObjSceneSource } from './ObjSceneSource';
|
|
7
5
|
export declare class Application {
|
|
6
|
+
private archiveImportController;
|
|
7
|
+
private archiveImporting;
|
|
8
|
+
private booleanEditConfirmationVisible;
|
|
8
9
|
private disposed;
|
|
9
|
-
private
|
|
10
|
+
private downloadController;
|
|
11
|
+
private downloadError;
|
|
12
|
+
private downloadSuccess;
|
|
13
|
+
private downloading;
|
|
14
|
+
private readonly exportContextFactory;
|
|
15
|
+
private exportSceneContext;
|
|
16
|
+
private editedArchiveResourceContext;
|
|
17
|
+
private importGeneration;
|
|
18
|
+
private importPerformanceMode;
|
|
19
|
+
private inventoryConfirmationController;
|
|
20
|
+
private inventoryConfirming;
|
|
21
|
+
private inventoryError;
|
|
22
|
+
private inventorying;
|
|
23
|
+
private modelInventoryConfirmationHandler;
|
|
24
|
+
private modelInventoryController;
|
|
25
|
+
private modelInventoryHandler;
|
|
26
|
+
private editStatusMessage;
|
|
10
27
|
private lastPublishedInset;
|
|
28
|
+
private lastPublishedToolbarBusinessStateKey;
|
|
29
|
+
private lastPublishedToolbarState;
|
|
30
|
+
private latestRendererWorkspaceState;
|
|
31
|
+
private nextArchiveTaskId;
|
|
32
|
+
private nextDownloadTaskId;
|
|
33
|
+
private nextInventoryTaskId;
|
|
11
34
|
private renderer;
|
|
12
35
|
private workspace;
|
|
13
36
|
mount(container: HTMLElement): void;
|
|
14
|
-
|
|
37
|
+
setImportPerformanceMode(mode: ImportPerformanceMode): void;
|
|
38
|
+
/** Injects the host-owned business operation used by the inventory button. */
|
|
39
|
+
setModelInventoryHandler(handler?: ModelInventoryHandler): void;
|
|
40
|
+
/** Injects the host confirmation shown before inventory preparation starts. */
|
|
41
|
+
setModelInventoryConfirmationHandler(handler?: ModelInventoryConfirmationHandler): void;
|
|
15
42
|
importModelResourceScene(source: ModelResourceSceneSource): Promise<ObjImportResult>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Imports one ZIP produced by Studio's download command as a preserved-pose
|
|
45
|
+
* stone-and-base scene. The caller chooses this entry explicitly; the
|
|
46
|
+
* archive is never inspected for an implicit baked marker.
|
|
47
|
+
*/
|
|
48
|
+
importEditedModelArchive(file: File): Promise<ObjImportResult>;
|
|
19
49
|
resetView(): void;
|
|
20
50
|
takeScreenshot(): Promise<Blob>;
|
|
21
51
|
dispose(): void;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
52
|
+
private cancelDownload;
|
|
53
|
+
private cancelInventory;
|
|
54
|
+
private cancelInventoryConfirmation;
|
|
55
|
+
private cancelArchiveImport;
|
|
56
|
+
private completeModelResourceSceneImport;
|
|
57
|
+
private completeEditedArchiveImport;
|
|
58
|
+
private completeEditedArchiveImportFailure;
|
|
59
|
+
private commitExportSceneContext;
|
|
60
|
+
private clearExportSceneContext;
|
|
61
|
+
private createExportJob;
|
|
62
|
+
private createExportJobRequest;
|
|
63
|
+
private createCancelledImportResult;
|
|
64
|
+
private createExportRole;
|
|
65
|
+
private createGeneratedBaseExportRole;
|
|
66
|
+
private getGeneratedMaterialFileName;
|
|
67
|
+
private isModelFile;
|
|
25
68
|
private getRenderer;
|
|
69
|
+
private handleDownloadFailure;
|
|
70
|
+
private handleDownloadSuccess;
|
|
71
|
+
private handleInventoryFailure;
|
|
72
|
+
private handleInventorySuccess;
|
|
73
|
+
private handleDownloadRequested;
|
|
74
|
+
private handleInventoryRequested;
|
|
75
|
+
/** Both call sites validate disposal, handler identity, and scene readiness first. */
|
|
76
|
+
private startInventory;
|
|
77
|
+
private confirmInventoryAndStart;
|
|
78
|
+
private handleBooleanRequested;
|
|
79
|
+
private handleModelVisibilityRequested;
|
|
80
|
+
private createExportJobFromCurrentScene;
|
|
81
|
+
private createInventoryJobFromCurrentScene;
|
|
82
|
+
private handleDownloadStateChanged;
|
|
83
|
+
private handleInventoryStateChanged;
|
|
84
|
+
private handleEditOperationBlocked;
|
|
85
|
+
private handleEditExited;
|
|
86
|
+
private handleEditRequested;
|
|
87
|
+
private handleBooleanEditConfirmed;
|
|
88
|
+
private handleBooleanEditCancelled;
|
|
89
|
+
private handleRendererWorkspaceStateChanged;
|
|
26
90
|
private hasValidSceneSource;
|
|
27
|
-
private releaseRuntime;
|
|
28
|
-
private mapObjImportResult;
|
|
29
|
-
private mapObjImportSource;
|
|
30
|
-
private mapModelResourceSceneSource;
|
|
31
91
|
private mapModelResourceListSource;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private mapUpAxis;
|
|
92
|
+
private mapImportPerformanceMode;
|
|
93
|
+
private mapModelResourceSceneSource;
|
|
94
|
+
private mapObjImportResult;
|
|
36
95
|
private mapStoneBasePoseMode;
|
|
37
|
-
private
|
|
96
|
+
private mapUpAxis;
|
|
38
97
|
private mapWarnings;
|
|
98
|
+
private clearBooleanEditConfirmation;
|
|
99
|
+
private publishWorkspaceState;
|
|
100
|
+
private createToolbarBusinessStateKey;
|
|
101
|
+
private isSameToolbarState;
|
|
102
|
+
private isSameModelVisibility;
|
|
103
|
+
private shouldDeferToolbarState;
|
|
104
|
+
private canDownload;
|
|
105
|
+
private canInventory;
|
|
106
|
+
private isInventorySceneReady;
|
|
107
|
+
private isInventoryVisible;
|
|
108
|
+
private isExportReady;
|
|
109
|
+
private assertNotDisposed;
|
|
110
|
+
private releaseRuntime;
|
|
111
|
+
private isCurrentImportGeneration;
|
|
112
|
+
private mapEditedArchiveError;
|
|
113
|
+
private startImportGeneration;
|
|
114
|
+
private invalidateImportGeneration;
|
|
39
115
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser save target for a ZIP stream. Chromium writes directly to the user
|
|
3
|
+
* selected file; other browsers retain chunks only for the final Blob fallback.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DownloadSaveSink {
|
|
6
|
+
private aborted;
|
|
7
|
+
private readonly blobChunks;
|
|
8
|
+
private completed;
|
|
9
|
+
private readonly nativeWritable;
|
|
10
|
+
private constructor();
|
|
11
|
+
static create(): Promise<DownloadSaveSink>;
|
|
12
|
+
get usesNativeStream(): boolean;
|
|
13
|
+
abort(): Promise<void>;
|
|
14
|
+
complete(): Promise<void>;
|
|
15
|
+
write(chunk: Uint8Array): Promise<void>;
|
|
16
|
+
private static createNativeSink;
|
|
17
|
+
private static getBrowserFilePicker;
|
|
18
|
+
private static hasBrowserFilePicker;
|
|
19
|
+
private downloadBlob;
|
|
20
|
+
private revokeObjectUrl;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModelUpAxis, StoneBasePoseMode } from '@lingbi/renderer';
|
|
2
|
+
import type { ArchiveImportResult } from './archive/ArchiveImportResult';
|
|
3
|
+
import type { ModelExportSceneCandidate } from './ModelExportContext';
|
|
4
|
+
export interface EditedArchiveRendererResourceFile {
|
|
5
|
+
readonly fetchUrl: string;
|
|
6
|
+
readonly fileName: string;
|
|
7
|
+
}
|
|
8
|
+
interface EditedArchiveRendererResourceList {
|
|
9
|
+
readonly files: readonly EditedArchiveRendererResourceFile[];
|
|
10
|
+
readonly upAxis: ModelUpAxis.Z;
|
|
11
|
+
}
|
|
12
|
+
export interface EditedArchiveRendererSource {
|
|
13
|
+
readonly base: EditedArchiveRendererResourceList;
|
|
14
|
+
readonly poseMode: StoneBasePoseMode.PreservePose;
|
|
15
|
+
readonly stone: EditedArchiveRendererResourceList;
|
|
16
|
+
}
|
|
17
|
+
/** Owns local Blob URLs created from one validated edited-result archive. */
|
|
18
|
+
export declare class EditedArchiveResourceContext {
|
|
19
|
+
readonly candidate: ModelExportSceneCandidate;
|
|
20
|
+
readonly rendererSource: EditedArchiveRendererSource;
|
|
21
|
+
private disposed;
|
|
22
|
+
private readonly objectUrls;
|
|
23
|
+
constructor(result: ArchiveImportResult);
|
|
24
|
+
dispose(): void;
|
|
25
|
+
private createFile;
|
|
26
|
+
private createRoleResources;
|
|
27
|
+
private findRole;
|
|
28
|
+
private getMimeType;
|
|
29
|
+
private getUrl;
|
|
30
|
+
private matchesRole;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ExportJobRequest } from './export/ExportJobRequest';
|
|
2
|
+
/**
|
|
3
|
+
* Owns one browser download lifecycle. It keeps the Worker, native file
|
|
4
|
+
* stream and stale task messages together so Application only manages UI and
|
|
5
|
+
* renderer resource context.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ModelDownloadController {
|
|
8
|
+
private readonly onDownloadFailed;
|
|
9
|
+
private readonly onDownloadSucceeded;
|
|
10
|
+
private readonly onDownloadStateChanged;
|
|
11
|
+
private activeTask;
|
|
12
|
+
private disposed;
|
|
13
|
+
constructor(onDownloadFailed: () => void, onDownloadSucceeded: () => void, onDownloadStateChanged: (downloading: boolean) => void);
|
|
14
|
+
cancel(): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
start(createJob: () => ExportJobRequest | undefined): void;
|
|
17
|
+
writeZipChunk(taskId: number, chunk: Uint8Array): Promise<void>;
|
|
18
|
+
private completeTask;
|
|
19
|
+
private run;
|
|
20
|
+
private isCurrentTask;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ModelExportFormat = 'obj' | 'ply';
|
|
2
|
+
export type ModelExportRole = 'base' | 'stone';
|
|
3
|
+
export interface ModelExportFile {
|
|
4
|
+
readonly fileName: string;
|
|
5
|
+
readonly isModel: boolean;
|
|
6
|
+
readonly url: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ModelExportRoleContext {
|
|
9
|
+
readonly files: readonly ModelExportFile[];
|
|
10
|
+
readonly format: ModelExportFormat;
|
|
11
|
+
readonly role: ModelExportRole;
|
|
12
|
+
}
|
|
13
|
+
export interface ModelExportSceneCandidate {
|
|
14
|
+
readonly base?: ModelExportRoleContext;
|
|
15
|
+
readonly stone: ModelExportRoleContext;
|
|
16
|
+
}
|
|
17
|
+
/** Resource context committed only after Renderer commits the same scene. */
|
|
18
|
+
export interface ModelExportSceneContext extends ModelExportSceneCandidate {
|
|
19
|
+
readonly revision: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ModelExportSceneCandidate, ModelExportSceneContext } from './ModelExportContext';
|
|
2
|
+
import type { ModelResourceListSource } from './ModelResourceListSource';
|
|
3
|
+
interface ModelExportSceneSource {
|
|
4
|
+
readonly base?: ModelResourceListSource;
|
|
5
|
+
readonly stone?: ModelResourceListSource;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Copies and validates the caller-owned resource list before it enters the
|
|
9
|
+
* Renderer. It retains only data Studio needs for a later download.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ModelExportContextFactory {
|
|
12
|
+
commit(candidate: ModelExportSceneCandidate, revision: number): ModelExportSceneContext | undefined;
|
|
13
|
+
create(source: ModelExportSceneSource): ModelExportSceneCandidate | undefined;
|
|
14
|
+
private createFile;
|
|
15
|
+
private createRoleContext;
|
|
16
|
+
private getFileName;
|
|
17
|
+
private getModelFormat;
|
|
18
|
+
private parseResourceUrl;
|
|
19
|
+
private isStringArray;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The complete, latest file set for one stone-and-base inventory request. */
|
|
2
|
+
export interface ModelInventoryFiles {
|
|
3
|
+
readonly base: readonly File[];
|
|
4
|
+
readonly stone: readonly File[];
|
|
5
|
+
}
|
|
6
|
+
/** Data handed to the host after Studio has prepared the inventory files. */
|
|
7
|
+
export interface ModelInventoryRequest {
|
|
8
|
+
readonly files: ModelInventoryFiles;
|
|
9
|
+
/** Aborts when Studio invalidates the in-flight inventory task. */
|
|
10
|
+
readonly signal: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
/** Data handed to the host before Studio starts preparing inventory files. */
|
|
13
|
+
export interface ModelInventoryConfirmationRequest {
|
|
14
|
+
readonly signal: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
/** Allows the host to confirm an inventory request before any export work starts. */
|
|
17
|
+
export type ModelInventoryConfirmationHandler = (request: ModelInventoryConfirmationRequest) => Promise<boolean>;
|
|
18
|
+
/** Host-owned business operation which receives the prepared files. */
|
|
19
|
+
export type ModelInventoryHandler = (request: ModelInventoryRequest) => Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExportJobRequest } from './export/ExportJobRequest';
|
|
2
|
+
import type { ModelExportWorkerClientListener } from './export/ModelExportWorkerClientListener';
|
|
3
|
+
import type { ModelExportWorkerFactory } from './export/ModelExportWorkerFactory';
|
|
4
|
+
import type { ModelInventoryHandler } from './ModelInventory';
|
|
5
|
+
/** Owns preparation, collection and host hand-off for one inventory task. */
|
|
6
|
+
export declare class ModelInventoryController implements ModelExportWorkerClientListener {
|
|
7
|
+
private readonly onInventoryFailed;
|
|
8
|
+
private readonly onInventorySucceeded;
|
|
9
|
+
private readonly onInventoryStateChanged;
|
|
10
|
+
private readonly workerFactory;
|
|
11
|
+
private activeTask;
|
|
12
|
+
private disposed;
|
|
13
|
+
constructor(onInventoryFailed: () => void, onInventorySucceeded: () => void, onInventoryStateChanged: (inProgress: boolean) => void, workerFactory?: ModelExportWorkerFactory);
|
|
14
|
+
cancel(): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
reportExportError(_taskId: number, _message: string): void;
|
|
17
|
+
reportExportProgress(_taskId: number, _completedFileCount: number, _totalFileCount: number): void;
|
|
18
|
+
start(createJob: () => ExportJobRequest | undefined, handler: ModelInventoryHandler): void;
|
|
19
|
+
writeZipChunk(taskId: number, chunk: Uint8Array): Promise<void>;
|
|
20
|
+
private completeTask;
|
|
21
|
+
private concatenate;
|
|
22
|
+
private createFiles;
|
|
23
|
+
private copyBytes;
|
|
24
|
+
private getMimeType;
|
|
25
|
+
private run;
|
|
26
|
+
private isCancelled;
|
|
27
|
+
private isAbortError;
|
|
28
|
+
private isCurrentTask;
|
|
29
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Studio-owned state projected onto the bottom toolbar. */
|
|
2
|
+
export interface StudioToolbarState {
|
|
3
|
+
readonly booleanEnabled?: boolean;
|
|
4
|
+
readonly booleanInProgress?: boolean;
|
|
5
|
+
readonly booleanReediting?: boolean;
|
|
6
|
+
readonly booleanResultInvalidated?: boolean;
|
|
7
|
+
readonly booleanEditConfirmationVisible?: boolean;
|
|
8
|
+
readonly downloadEnabled: boolean;
|
|
9
|
+
readonly downloadError?: string;
|
|
10
|
+
readonly downloadInProgress?: boolean;
|
|
11
|
+
readonly downloadSuccess?: string;
|
|
12
|
+
readonly editActive: boolean;
|
|
13
|
+
readonly editEnabled: boolean;
|
|
14
|
+
readonly editVisible: boolean;
|
|
15
|
+
readonly editStatusMessage?: string;
|
|
16
|
+
readonly inventoryEnabled?: boolean;
|
|
17
|
+
readonly inventoryError?: string;
|
|
18
|
+
readonly inventoryInProgress?: boolean;
|
|
19
|
+
readonly inventoryVisible?: boolean;
|
|
20
|
+
readonly modelVisibility?: {
|
|
21
|
+
readonly baseVisible: boolean;
|
|
22
|
+
readonly enabled: boolean;
|
|
23
|
+
readonly stoneVisible: boolean;
|
|
24
|
+
};
|
|
25
|
+
}
|
package/StudioWorkspace.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { StudioToolbarState } from './StudioToolbarState';
|
|
2
|
+
type StudioModelRole = 'base' | 'stone';
|
|
1
3
|
/**
|
|
2
4
|
* Studio-owned chrome around the render canvas: the viewport, the bottom
|
|
3
5
|
* toolbar with its edit control, and the floating edit-status bubble that
|
|
@@ -6,21 +8,47 @@
|
|
|
6
8
|
*/
|
|
7
9
|
export declare class StudioWorkspace {
|
|
8
10
|
readonly canvas: HTMLCanvasElement;
|
|
9
|
-
private static readonly
|
|
11
|
+
private static readonly SVG_NAMESPACE;
|
|
12
|
+
private static readonly BOTTOM_TOOLBAR_BOTTOM_OFFSET;
|
|
13
|
+
private static readonly BOTTOM_TOOLBAR_HEIGHT;
|
|
14
|
+
private static readonly BOTTOM_TOOLBAR_VIEWPORT_GAP;
|
|
15
|
+
private static readonly BOTTOM_TOOLBAR_VIEWPORT_BOTTOM_INSET;
|
|
16
|
+
private readonly booleanButtonElement;
|
|
17
|
+
private readonly booleanOperationOverlayElement;
|
|
18
|
+
private readonly booleanOperationStatusElement;
|
|
19
|
+
private readonly booleanEditConfirmationElement;
|
|
10
20
|
private readonly bottomToolbarElement;
|
|
21
|
+
private readonly downloadButtonElement;
|
|
22
|
+
private readonly downloadButtonWrapperElement;
|
|
23
|
+
private readonly downloadStatusElement;
|
|
24
|
+
private readonly downloadSuccessElement;
|
|
11
25
|
private readonly editButtonElement;
|
|
12
26
|
private readonly editStatusElement;
|
|
27
|
+
private readonly editStatusTextElement;
|
|
28
|
+
private readonly inventoryButtonElement;
|
|
29
|
+
private readonly inventoryButtonWrapperElement;
|
|
30
|
+
private readonly modelButtonElement;
|
|
31
|
+
private readonly modelVisibilityElement;
|
|
32
|
+
private readonly stoneVisibilityButtonElement;
|
|
33
|
+
private readonly baseVisibilityButtonElement;
|
|
13
34
|
private readonly listenerAbortController;
|
|
14
35
|
private readonly rootElement;
|
|
15
36
|
private readonly styleElement;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
setEditButtonState(visible: boolean, enabled: boolean, active: boolean): void;
|
|
37
|
+
private currentEditActive;
|
|
38
|
+
private modelPanelVisible;
|
|
39
|
+
constructor(container: HTMLElement, onEditRequested: () => void, onEditExited: () => void, onDownloadRequested: () => void, onBooleanRequested?: () => void, onBooleanEditConfirmed?: () => void, onBooleanEditCancelled?: () => void, onModelVisibilityRequested?: (role: StudioModelRole, visible: boolean) => void, onInventoryRequested?: () => void, onEditOperationBlocked?: () => void);
|
|
40
|
+
/** Applies Application's combined renderer and download state. */
|
|
41
|
+
setToolbarState(state: StudioToolbarState): void;
|
|
23
42
|
getViewportBottomInset(): number;
|
|
24
43
|
dispose(): void;
|
|
25
44
|
private wrapClick;
|
|
45
|
+
private wrapOperationClick;
|
|
46
|
+
private wrapOperationKeyDown;
|
|
47
|
+
private setInventoryButtonVisible;
|
|
48
|
+
private updateOperationButtonWrapper;
|
|
49
|
+
private toggleModelVisibilityPanel;
|
|
50
|
+
private wrapModelVisibilityClick;
|
|
51
|
+
private updateModelVisibilityButton;
|
|
52
|
+
private createVisibilityIcon;
|
|
26
53
|
}
|
|
54
|
+
export {};
|
package/THIRD_PARTY_LICENSES.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
The app bundles dependencies which contain the following licenses:
|
|
4
4
|
|
|
5
|
+
## fflate - 0.8.3 (MIT)
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 Arjun Barrett
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
5
29
|
## three - 0.185.1 (MIT)
|
|
6
30
|
|
|
7
31
|
The MIT License
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ArchiveImportChecksumEntry {
|
|
2
|
+
readonly byteLength: number;
|
|
3
|
+
readonly crc32: number;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
}
|
|
6
|
+
/** Checks central-directory sizes and CRC values without buffering model data. */
|
|
7
|
+
export declare class ArchiveImportCentralDirectoryValidator {
|
|
8
|
+
private readonly pathValidator;
|
|
9
|
+
validate(file: File, entries: readonly ArchiveImportChecksumEntry[], signal?: AbortSignal): Promise<void>;
|
|
10
|
+
private decodeName;
|
|
11
|
+
private findEndRecord;
|
|
12
|
+
private invalidArchive;
|
|
13
|
+
private parseCentralRecord;
|
|
14
|
+
private readCentralDirectory;
|
|
15
|
+
private readEndRecord;
|
|
16
|
+
private validatePath;
|
|
17
|
+
private validateRecords;
|
|
18
|
+
private readUint16;
|
|
19
|
+
private readUint32;
|
|
20
|
+
private throwIfAborted;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ArchiveImportChunkAcknowledgement {
|
|
2
|
+
readonly chunkId: number;
|
|
3
|
+
readonly promise: Promise<void>;
|
|
4
|
+
readonly taskId: number;
|
|
5
|
+
private rejectPromise;
|
|
6
|
+
private resolvePromise;
|
|
7
|
+
private settled;
|
|
8
|
+
constructor(taskId: number, chunkId: number);
|
|
9
|
+
acknowledge(): void;
|
|
10
|
+
cancel(): void;
|
|
11
|
+
private initializePromise;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum ArchiveImportErrorCode {
|
|
2
|
+
Cancelled = "cancelled",
|
|
3
|
+
InvalidSource = "invalid-source",
|
|
4
|
+
Protocol = "protocol"
|
|
5
|
+
}
|
|
6
|
+
export declare class ArchiveImportError extends Error {
|
|
7
|
+
readonly code: ArchiveImportErrorCode;
|
|
8
|
+
constructor(code: ArchiveImportErrorCode, message: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ArchiveImportModelFormat } from './ArchiveImportModelFormat';
|
|
2
|
+
export interface ArchiveImportFileResult {
|
|
3
|
+
readonly chunks: readonly Uint8Array<ArrayBuffer>[];
|
|
4
|
+
readonly fileName: string;
|
|
5
|
+
readonly format?: ArchiveImportModelFormat;
|
|
6
|
+
readonly isModel: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ArchiveImportJobRequest } from './ArchiveImportJobRequest';
|
|
2
|
+
/** Validates the small structured-clone request before a Worker task starts. */
|
|
3
|
+
export declare class ArchiveImportJobValidator {
|
|
4
|
+
validate(job: ArchiveImportJobRequest): void;
|
|
5
|
+
private isReadableFile;
|
|
6
|
+
private getRecord;
|
|
7
|
+
private isRecord;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ArchiveImportModelFormat = 'obj' | 'ply';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ArchiveImportModelFormat } from './ArchiveImportModelFormat';
|
|
2
|
+
import type { ArchiveImportRole } from './ArchiveImportRole';
|
|
3
|
+
export type ArchiveImportPath = {
|
|
4
|
+
readonly kind: 'directory';
|
|
5
|
+
readonly role: ArchiveImportRole;
|
|
6
|
+
} | {
|
|
7
|
+
readonly fileName: string;
|
|
8
|
+
readonly format?: ArchiveImportModelFormat;
|
|
9
|
+
readonly isModel: boolean;
|
|
10
|
+
readonly kind: 'file';
|
|
11
|
+
readonly role: ArchiveImportRole;
|
|
12
|
+
};
|
|
13
|
+
/** Enforces the two-level stone/base archive contract. */
|
|
14
|
+
export declare class ArchiveImportPathValidator {
|
|
15
|
+
parse(path: string): ArchiveImportPath;
|
|
16
|
+
private getModelFormat;
|
|
17
|
+
private hasControlCharacter;
|
|
18
|
+
private invalidPath;
|
|
19
|
+
private isDrivePath;
|
|
20
|
+
private parseDirectory;
|
|
21
|
+
private parseRole;
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ArchiveImportRoleResult } from './ArchiveImportRoleResult';
|
|
2
|
+
export interface ArchiveImportResult {
|
|
3
|
+
readonly roles: readonly ArchiveImportRoleResult[];
|
|
4
|
+
}
|
|
5
|
+
export type { ArchiveImportFileResult } from './ArchiveImportFileResult';
|
|
6
|
+
export type { ArchiveImportRoleResult } from './ArchiveImportRoleResult';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ArchiveImportResult } from './ArchiveImportResult';
|
|
2
|
+
import type { ArchiveImportEntryChunkMessage, ArchiveImportEntryStartMessage } from './ArchiveImportWorkerMessage';
|
|
3
|
+
/** Reassembles ordered Worker entry chunks and performs a second protocol check. */
|
|
4
|
+
export declare class ArchiveImportResultAccumulator {
|
|
5
|
+
private activeEntry;
|
|
6
|
+
private readonly entries;
|
|
7
|
+
private lastChunkId;
|
|
8
|
+
private lastEntryId;
|
|
9
|
+
private lastRoleIndex;
|
|
10
|
+
acceptChunk(message: ArchiveImportEntryChunkMessage): void;
|
|
11
|
+
complete(): ArchiveImportResult;
|
|
12
|
+
startEntry(message: ArchiveImportEntryStartMessage): void;
|
|
13
|
+
private createFileResult;
|
|
14
|
+
private createRoleResults;
|
|
15
|
+
private protocolError;
|
|
16
|
+
private hasControlCharacter;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ArchiveImportRole = 'base' | 'stone';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ArchiveImportFileResult } from './ArchiveImportFileResult';
|
|
2
|
+
import type { ArchiveImportRole } from './ArchiveImportRole';
|
|
3
|
+
export interface ArchiveImportRoleResult {
|
|
4
|
+
readonly files: readonly ArchiveImportFileResult[];
|
|
5
|
+
readonly role: ArchiveImportRole;
|
|
6
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ArchiveImportJobRequest } from './ArchiveImportJobRequest';
|
|
2
|
+
import type { ArchiveImportResult } from './ArchiveImportResult';
|
|
3
|
+
import type { ArchiveImportWorkerEndpointErrorListener, ArchiveImportWorkerEndpointMessageListener } from './ArchiveImportWorkerEndpoint';
|
|
4
|
+
import type { ArchiveImportWorkerFactory } from './ArchiveImportWorkerFactory';
|
|
5
|
+
/** Main-thread side of the archive import protocol and chunk accumulator. */
|
|
6
|
+
export declare class ArchiveImportWorkerClient implements ArchiveImportWorkerEndpointErrorListener, ArchiveImportWorkerEndpointMessageListener {
|
|
7
|
+
private activeTask;
|
|
8
|
+
private disposed;
|
|
9
|
+
private readonly jobValidator;
|
|
10
|
+
private lastStartedTaskId;
|
|
11
|
+
private readonly messageParser;
|
|
12
|
+
private readonly workerFactory;
|
|
13
|
+
constructor(workerFactory?: ArchiveImportWorkerFactory);
|
|
14
|
+
cancel(taskId?: number): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
handleWorkerEndpointError(message: string): void;
|
|
17
|
+
handleWorkerEndpointMessage(message: unknown): void;
|
|
18
|
+
start(job: ArchiveImportJobRequest): Promise<ArchiveImportResult>;
|
|
19
|
+
private acceptChunk;
|
|
20
|
+
private rejectTask;
|
|
21
|
+
private resolveTask;
|
|
22
|
+
private toError;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ArchiveImportResult } from './ArchiveImportResult';
|
|
2
|
+
import { ArchiveImportResultAccumulator } from './ArchiveImportResultAccumulator';
|
|
3
|
+
import type { ArchiveImportWorkerEndpoint } from './ArchiveImportWorkerEndpoint';
|
|
4
|
+
/** Completion state for one archive import Worker task. */
|
|
5
|
+
export declare class ArchiveImportWorkerClientTask {
|
|
6
|
+
readonly accumulator: ArchiveImportResultAccumulator;
|
|
7
|
+
readonly completion: Promise<ArchiveImportResult>;
|
|
8
|
+
readonly endpoint: ArchiveImportWorkerEndpoint;
|
|
9
|
+
readonly taskId: number;
|
|
10
|
+
private rejectCompletion;
|
|
11
|
+
private resolveCompletion;
|
|
12
|
+
private settled;
|
|
13
|
+
constructor(taskId: number, endpoint: ArchiveImportWorkerEndpoint);
|
|
14
|
+
reject(reason: unknown): void;
|
|
15
|
+
resolve(result: ArchiveImportResult): void;
|
|
16
|
+
private initializeCompletion;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ArchiveImportInboundMessage } from './ArchiveImportWorkerMessage';
|
|
2
|
+
export interface ArchiveImportWorkerEndpointErrorListener {
|
|
3
|
+
handleWorkerEndpointError(message: string): void;
|
|
4
|
+
}
|
|
5
|
+
export interface ArchiveImportWorkerEndpointMessageListener {
|
|
6
|
+
handleWorkerEndpointMessage(message: unknown): void;
|
|
7
|
+
}
|
|
8
|
+
export interface ArchiveImportWorkerEndpoint {
|
|
9
|
+
postMessage(message: ArchiveImportInboundMessage): void;
|
|
10
|
+
setErrorListener(listener: ArchiveImportWorkerEndpointErrorListener): void;
|
|
11
|
+
setMessageListener(listener: ArchiveImportWorkerEndpointMessageListener): void;
|
|
12
|
+
terminate(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|