@lingbi/studio 0.5.0 → 0.7.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 +28 -0
- package/ModelInventory.d.ts +19 -0
- package/ModelInventoryController.d.ts +29 -0
- package/StudioToolbarState.d.ts +5 -0
- package/StudioWorkspace.d.ts +10 -1
- package/THIRD_PARTY_LICENSES.md +24 -0
- package/index.d.ts +1 -0
- package/index.js +1857 -909
- package/package.json +5 -1
package/Application.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ImportPerformanceMode } from './ImportPerformanceMode';
|
|
2
|
+
import type { ModelInventoryConfirmationHandler, ModelInventoryHandler } from './ModelInventory';
|
|
2
3
|
import type { ModelResourceSceneSource } from './ModelResourceSceneSource';
|
|
3
4
|
import type { ObjImportResult } from './ObjImportResult';
|
|
4
5
|
export declare class Application {
|
|
@@ -15,16 +16,29 @@ export declare class Application {
|
|
|
15
16
|
private editedArchiveResourceContext;
|
|
16
17
|
private importGeneration;
|
|
17
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;
|
|
18
27
|
private lastPublishedInset;
|
|
19
28
|
private lastPublishedToolbarBusinessStateKey;
|
|
20
29
|
private lastPublishedToolbarState;
|
|
21
30
|
private latestRendererWorkspaceState;
|
|
22
31
|
private nextArchiveTaskId;
|
|
23
32
|
private nextDownloadTaskId;
|
|
33
|
+
private nextInventoryTaskId;
|
|
24
34
|
private renderer;
|
|
25
35
|
private workspace;
|
|
26
36
|
mount(container: HTMLElement): void;
|
|
27
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;
|
|
28
42
|
importModelResourceScene(source: ModelResourceSceneSource): Promise<ObjImportResult>;
|
|
29
43
|
/**
|
|
30
44
|
* Imports one ZIP produced by Studio's download command as a preserved-pose
|
|
@@ -36,6 +50,8 @@ export declare class Application {
|
|
|
36
50
|
takeScreenshot(): Promise<Blob>;
|
|
37
51
|
dispose(): void;
|
|
38
52
|
private cancelDownload;
|
|
53
|
+
private cancelInventory;
|
|
54
|
+
private cancelInventoryConfirmation;
|
|
39
55
|
private cancelArchiveImport;
|
|
40
56
|
private completeModelResourceSceneImport;
|
|
41
57
|
private completeEditedArchiveImport;
|
|
@@ -52,11 +68,20 @@ export declare class Application {
|
|
|
52
68
|
private getRenderer;
|
|
53
69
|
private handleDownloadFailure;
|
|
54
70
|
private handleDownloadSuccess;
|
|
71
|
+
private handleInventoryFailure;
|
|
72
|
+
private handleInventorySuccess;
|
|
55
73
|
private handleDownloadRequested;
|
|
74
|
+
private handleInventoryRequested;
|
|
75
|
+
/** Both call sites validate disposal, handler identity, and scene readiness first. */
|
|
76
|
+
private startInventory;
|
|
77
|
+
private confirmInventoryAndStart;
|
|
56
78
|
private handleBooleanRequested;
|
|
57
79
|
private handleModelVisibilityRequested;
|
|
58
80
|
private createExportJobFromCurrentScene;
|
|
81
|
+
private createInventoryJobFromCurrentScene;
|
|
59
82
|
private handleDownloadStateChanged;
|
|
83
|
+
private handleInventoryStateChanged;
|
|
84
|
+
private handleEditOperationBlocked;
|
|
60
85
|
private handleEditExited;
|
|
61
86
|
private handleEditRequested;
|
|
62
87
|
private handleBooleanEditConfirmed;
|
|
@@ -77,6 +102,9 @@ export declare class Application {
|
|
|
77
102
|
private isSameModelVisibility;
|
|
78
103
|
private shouldDeferToolbarState;
|
|
79
104
|
private canDownload;
|
|
105
|
+
private canInventory;
|
|
106
|
+
private isInventorySceneReady;
|
|
107
|
+
private isInventoryVisible;
|
|
80
108
|
private isExportReady;
|
|
81
109
|
private assertNotDisposed;
|
|
82
110
|
private releaseRuntime;
|
|
@@ -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
|
+
}
|
package/StudioToolbarState.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface StudioToolbarState {
|
|
|
12
12
|
readonly editActive: boolean;
|
|
13
13
|
readonly editEnabled: boolean;
|
|
14
14
|
readonly editVisible: boolean;
|
|
15
|
+
readonly editStatusMessage?: string;
|
|
16
|
+
readonly inventoryEnabled?: boolean;
|
|
17
|
+
readonly inventoryError?: string;
|
|
18
|
+
readonly inventoryInProgress?: boolean;
|
|
19
|
+
readonly inventoryVisible?: boolean;
|
|
15
20
|
readonly modelVisibility?: {
|
|
16
21
|
readonly baseVisible: boolean;
|
|
17
22
|
readonly enabled: boolean;
|
package/StudioWorkspace.d.ts
CHANGED
|
@@ -19,10 +19,14 @@ export declare class StudioWorkspace {
|
|
|
19
19
|
private readonly booleanEditConfirmationElement;
|
|
20
20
|
private readonly bottomToolbarElement;
|
|
21
21
|
private readonly downloadButtonElement;
|
|
22
|
+
private readonly downloadButtonWrapperElement;
|
|
22
23
|
private readonly downloadStatusElement;
|
|
23
24
|
private readonly downloadSuccessElement;
|
|
24
25
|
private readonly editButtonElement;
|
|
25
26
|
private readonly editStatusElement;
|
|
27
|
+
private readonly editStatusTextElement;
|
|
28
|
+
private readonly inventoryButtonElement;
|
|
29
|
+
private readonly inventoryButtonWrapperElement;
|
|
26
30
|
private readonly modelButtonElement;
|
|
27
31
|
private readonly modelVisibilityElement;
|
|
28
32
|
private readonly stoneVisibilityButtonElement;
|
|
@@ -30,13 +34,18 @@ export declare class StudioWorkspace {
|
|
|
30
34
|
private readonly listenerAbortController;
|
|
31
35
|
private readonly rootElement;
|
|
32
36
|
private readonly styleElement;
|
|
37
|
+
private currentEditActive;
|
|
33
38
|
private modelPanelVisible;
|
|
34
|
-
constructor(container: HTMLElement, onEditRequested: () => void, onEditExited: () => void, onDownloadRequested: () => void, onBooleanRequested?: () => void, onBooleanEditConfirmed?: () => void, onBooleanEditCancelled?: () => void, onModelVisibilityRequested?: (role: StudioModelRole, visible: boolean) => void);
|
|
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);
|
|
35
40
|
/** Applies Application's combined renderer and download state. */
|
|
36
41
|
setToolbarState(state: StudioToolbarState): void;
|
|
37
42
|
getViewportBottomInset(): number;
|
|
38
43
|
dispose(): void;
|
|
39
44
|
private wrapClick;
|
|
45
|
+
private wrapOperationClick;
|
|
46
|
+
private wrapOperationKeyDown;
|
|
47
|
+
private setInventoryButtonVisible;
|
|
48
|
+
private updateOperationButtonWrapper;
|
|
40
49
|
private toggleModelVisibilityPanel;
|
|
41
50
|
private wrapModelVisibilityClick;
|
|
42
51
|
private updateModelVisibilityButton;
|
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
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Application } from './Application';
|
|
2
2
|
export { ImportPerformanceMode } from './ImportPerformanceMode';
|
|
3
|
+
export type { ModelInventoryConfirmationHandler, ModelInventoryConfirmationRequest, ModelInventoryFiles, ModelInventoryHandler, ModelInventoryRequest, } from './ModelInventory';
|
|
3
4
|
export type { ModelResourceListSource } from './ModelResourceListSource';
|
|
4
5
|
export type { ModelResourceSceneSource } from './ModelResourceSceneSource';
|
|
5
6
|
export { ModelUpAxis } from './ModelUpAxis';
|