lumiverse-spindle-types 0.5.23 → 0.5.25
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/package.json +1 -1
- package/src/api.ts +2 -0
- package/src/dom.ts +20 -0
- package/src/index.ts +2 -1
- package/src/spindle-api.ts +6 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -2944,6 +2944,8 @@ export type HostToWorker =
|
|
|
2944
2944
|
}
|
|
2945
2945
|
| {
|
|
2946
2946
|
type: "permission_changed";
|
|
2947
|
+
/** Extension identifier for the worker receiving this scoped change */
|
|
2948
|
+
extensionId?: string;
|
|
2947
2949
|
permission: string;
|
|
2948
2950
|
granted: boolean;
|
|
2949
2951
|
allGranted: string[];
|
package/src/dom.ts
CHANGED
|
@@ -212,6 +212,13 @@ export interface SpindleDockPanelHandle {
|
|
|
212
212
|
onVisibilityChange(handler: (visible: boolean) => void): () => void;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
// ── Tab Mobility ──
|
|
216
|
+
|
|
217
|
+
/** Where a built-in drawer tab currently lives. */
|
|
218
|
+
export type SpindleTabLocation =
|
|
219
|
+
| { kind: "main-drawer" }
|
|
220
|
+
| { kind: "container"; containerId: string };
|
|
221
|
+
|
|
215
222
|
// ── App Mount ──
|
|
216
223
|
|
|
217
224
|
export interface SpindleAppMountOptions {
|
|
@@ -752,6 +759,12 @@ export interface SpindleFrontendContext {
|
|
|
752
759
|
* ```
|
|
753
760
|
*/
|
|
754
761
|
showConfirm(options: SpindleConfirmOptions): Promise<SpindleConfirmResult>;
|
|
762
|
+
/** Request a tab move to a specific drawer location. */
|
|
763
|
+
requestTabLocation(tabId: string, location: SpindleTabLocation): void;
|
|
764
|
+
/** Get the display title of a built-in drawer tab by its id. */
|
|
765
|
+
getBuiltInTabTitle(tabId: string): string | undefined;
|
|
766
|
+
/** Get the root HTMLElement of a built-in drawer tab by its id, or undefined if not mounted. */
|
|
767
|
+
getBuiltInTabRoot(tabId: string): HTMLElement | undefined;
|
|
755
768
|
};
|
|
756
769
|
/**
|
|
757
770
|
* Mount instances of Lumiverse's first-party shared UI components (form
|
|
@@ -761,6 +774,13 @@ export interface SpindleFrontendContext {
|
|
|
761
774
|
* {@link SpindleComponentsHelper} for the full surface.
|
|
762
775
|
*/
|
|
763
776
|
components: SpindleComponentsHelper;
|
|
777
|
+
/** Register or unregister passive DOM containers that can receive tab roots. */
|
|
778
|
+
containers: {
|
|
779
|
+
/** Register a container element with a stable id. Tabs routed to this id via `requestTabLocation` will be reparented into `element`. Idempotent on id collision. */
|
|
780
|
+
registerContainer(entry: { id: string; side: 'left' | 'right' | 'top' | 'bottom'; element: HTMLElement }): void;
|
|
781
|
+
/** Remove a previously registered container. Tabs still pointing to this id will fall back to the main drawer. */
|
|
782
|
+
unregisterContainer(id: string): void;
|
|
783
|
+
};
|
|
764
784
|
uploads: {
|
|
765
785
|
pickFile(options?: {
|
|
766
786
|
accept?: string[];
|
package/src/index.ts
CHANGED
package/src/spindle-api.ts
CHANGED
|
@@ -224,6 +224,12 @@ export interface SpindlePromptRegex {
|
|
|
224
224
|
|
|
225
225
|
/** The global `spindle` object available in backend extension workers */
|
|
226
226
|
export interface SpindleAPI {
|
|
227
|
+
/**
|
|
228
|
+
* Subscribe to permission grant/revoke changes for this extension only.
|
|
229
|
+
* This is delivered directly by the worker host and does not subscribe to
|
|
230
|
+
* the global backend event bus.
|
|
231
|
+
*/
|
|
232
|
+
on(event: "PERMISSION_CHANGED", handler: (payload: PermissionChangedDetail) => void): () => void;
|
|
227
233
|
/** Subscribe to generation-started events (requires `generation` permission). The optional `userId` identifies which user triggered the event. */
|
|
228
234
|
on(event: "GENERATION_STARTED", handler: (payload: GenerationStartedPayloadDTO, userId?: string) => void): () => void;
|
|
229
235
|
/** Subscribe to streamed token events (requires `generation` permission). The optional `userId` identifies which user triggered the event. */
|