@superblocksteam/library 2.0.59-next.2 → 2.0.59-next.3
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/dist/{early-console-buffer-SSPd-jq2.js → early-console-buffer-oUqxIuRK.js} +31 -4
- package/dist/early-console-buffer-oUqxIuRK.js.map +1 -0
- package/dist/jsx-dev-runtime/index.d.ts.map +1 -1
- package/dist/jsx-dev-runtime/index.js +7 -282
- package/dist/jsx-dev-runtime/index.js.map +1 -1
- package/dist/{widget-wrapper-naming-DxFT8zmk.js → jsx-wrapper-Ddb528TO.js} +410 -17
- package/dist/jsx-wrapper-Ddb528TO.js.map +1 -0
- package/dist/lib/index.d.ts +500 -19
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +214 -72
- package/dist/lib/index.js.map +1 -1
- package/dist/{logs-CgCPS9qr.js → logs-CQnzO-hw.js} +2 -2
- package/dist/{logs-CgCPS9qr.js.map → logs-CQnzO-hw.js.map} +1 -1
- package/package.json +3 -3
- package/dist/early-console-buffer-SSPd-jq2.js.map +0 -1
- package/dist/widget-wrapper-naming-DxFT8zmk.js.map +0 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import { EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
|
|
1
|
+
import { Dim, EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
|
|
2
|
+
import * as React$2 from "react";
|
|
2
3
|
import React$1, { LegacyRef, ReactNode } from "react";
|
|
4
|
+
import { DataRouter, Location, Params } from "react-router";
|
|
3
5
|
import { OrchestratorViewMode, PlaceholderInfo, Profile } from "@superblocksteam/shared";
|
|
4
|
-
import { AiContextMode, AiGenerationState, AppToEditorMessage, Catalog, CreateChild, CreateChild as CreateChild$1, DeleteMeLibraryApi, EditOperationPayload, EditOperationType, EditorConfig as EditorConfig$1, Entity, EntityOutputProp, InteractionMode, PayloadAction, PropertyInfo, RuntimeErrorData, SbElement, SourceLocation, TransactionInfo, UrlState, WithBindingIdentifier } from "@superblocksteam/library-shared/types";
|
|
6
|
+
import { AiContextMode, AiGenerationState, AppToEditorMessage, Catalog, CatalogWithInternalDetails, ComponentRegistryShareState, CreateChild, CreateChild as CreateChild$1, CreateRequest, DeleteMeLibraryApi, DeleteRequest, EditOperationPayload, EditOperationType, EditOperations, EditorConfig as EditorConfig$1, Entity, EntityOutputProp, InteractionMode, PayloadAction, PropertyInfo, ReparentRequest, RuntimeErrorData, RuntimeSyncComposite, SbApiRunOptions, SbElement, SbSelector, SetPropertiesRequest, SetPropertyRequest, SourceLocation, TransactionInfo, UrlState, ViteMessage, ViteMessageKind, WithBindingIdentifier } from "@superblocksteam/library-shared/types";
|
|
5
7
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
import { Callback, ControlType, DataType, DataTypeString, HeaderType, PropertiesPanelDefinition as PropertiesPanelDefinition$1, PropertiesPanelDisplay, PropertyForData, PropsCategory, Relation, WidgetPropertyDefinition } from "@superblocksteam/library-shared/props";
|
|
8
|
+
import { Callback, ControlType, DataType, DataTypeString, EntityDefinition, HeaderType, PropertiesPanelDefinition as PropertiesPanelDefinition$1, PropertiesPanelDisplay, PropertyForData, PropsCategory, Relation, WidgetPropertyDefinition } from "@superblocksteam/library-shared/props";
|
|
9
|
+
import { Graph } from "@dagrejs/graphlib";
|
|
7
10
|
import { XYCoord } from "react-dnd";
|
|
8
11
|
|
|
12
|
+
//#region src/lib/internal-details/scope/types.d.ts
|
|
13
|
+
declare const AppMode: {
|
|
14
|
+
readonly EDIT: "EDIT";
|
|
15
|
+
readonly PUBLISHED: "PUBLISHED";
|
|
16
|
+
readonly PREVIEW: "PREVIEW";
|
|
17
|
+
};
|
|
18
|
+
type AppMode = (typeof AppMode)[keyof typeof AppMode];
|
|
19
|
+
//#endregion
|
|
9
20
|
//#region src/lib/internal-details/superblocks-context.d.ts
|
|
10
21
|
type User = {
|
|
11
22
|
name: string;
|
|
@@ -41,6 +52,7 @@ declare function useSuperblocksProfiles(): {
|
|
|
41
52
|
profiles: Profiles | undefined;
|
|
42
53
|
setProfile: (profileName: string) => void;
|
|
43
54
|
};
|
|
55
|
+
declare function getAppMode(): AppMode | undefined;
|
|
44
56
|
//#endregion
|
|
45
57
|
//#region src/lib/user-facing/sb-provider.d.ts
|
|
46
58
|
declare const SbProvider: ({
|
|
@@ -106,6 +118,7 @@ interface StreamEvent {
|
|
|
106
118
|
execution: string;
|
|
107
119
|
};
|
|
108
120
|
}
|
|
121
|
+
type RouteInfo = Omit<UrlState, "host" | "hostname" | "href" | "port" | "protocol">;
|
|
109
122
|
type RouteChangePayload = Omit<UrlState, "host" | "hostname" | "href" | "pathname" | "port" | "protocol">;
|
|
110
123
|
type AiUpdatesPayload = {
|
|
111
124
|
parentToChild: {
|
|
@@ -127,6 +140,7 @@ type AiUpdatesPayload = {
|
|
|
127
140
|
childToParent: {
|
|
128
141
|
type: "add-component-to-context";
|
|
129
142
|
component: SbElement;
|
|
143
|
+
label?: string;
|
|
130
144
|
} | {
|
|
131
145
|
type: "toggle-component-in-context";
|
|
132
146
|
component: SbElement;
|
|
@@ -151,6 +165,14 @@ type FromParentToChildMessageTypesMap = {
|
|
|
151
165
|
interactionMode?: InteractionMode;
|
|
152
166
|
/** The value of the authorization header on requests to the dev server. */
|
|
153
167
|
devServerAuthorization: string | undefined;
|
|
168
|
+
/** Timestamp when the parent connection started (for end-to-end metrics) */
|
|
169
|
+
connectionStartTime?: number;
|
|
170
|
+
/** W3C Trace Context headers for linking app websocket span to parent trace */
|
|
171
|
+
traceContext?: Record<string, string>;
|
|
172
|
+
/** Connection type: initial or reconnect */
|
|
173
|
+
connectionType?: "initial" | "reconnect";
|
|
174
|
+
/** Connection target: local, sabs, or default */
|
|
175
|
+
connectionTarget?: string;
|
|
154
176
|
aiState?: {
|
|
155
177
|
generationState: AiGenerationState;
|
|
156
178
|
editingComponents: SbElement[];
|
|
@@ -345,15 +367,471 @@ type FromChildToParentMessageTypesMap = {
|
|
|
345
367
|
"logout-integration": {
|
|
346
368
|
callbackId: string;
|
|
347
369
|
};
|
|
370
|
+
"app-websocket-connected": {
|
|
371
|
+
success: boolean;
|
|
372
|
+
durationMs: number;
|
|
373
|
+
error?: {
|
|
374
|
+
message: string;
|
|
375
|
+
type: string;
|
|
376
|
+
stack?: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
348
379
|
} & AppToEditorMessage<PropertiesPanelDefinition$1>;
|
|
349
380
|
type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
|
|
350
381
|
//#endregion
|
|
382
|
+
//#region src/lib/internal-details/location-store.d.ts
|
|
383
|
+
declare class LocationStore {
|
|
384
|
+
route?: RouteInfo;
|
|
385
|
+
rootStore: RootStore;
|
|
386
|
+
constructor(rootStore: RootStore);
|
|
387
|
+
updateLocation(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): void;
|
|
388
|
+
sendLocationToEditor(): void;
|
|
389
|
+
/**
|
|
390
|
+
* Recursively searches through route tree (including nested children) to find a matching route
|
|
391
|
+
*/
|
|
392
|
+
private findMatchingRoute;
|
|
393
|
+
locationToRouteInfo(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): RouteInfo | undefined;
|
|
394
|
+
}
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/lib/internal-details/lib/features/api-store.d.ts
|
|
397
|
+
type ApiResult<T = any> = {
|
|
398
|
+
data?: T;
|
|
399
|
+
error?: string;
|
|
400
|
+
};
|
|
401
|
+
declare class ApiManager {
|
|
402
|
+
readonly rootStore: RootStore;
|
|
403
|
+
agentUrls: string[];
|
|
404
|
+
private token;
|
|
405
|
+
private accessToken;
|
|
406
|
+
private runningApiControllers;
|
|
407
|
+
private waitForInitApiPromise;
|
|
408
|
+
private callContexts;
|
|
409
|
+
constructor(rootStore: RootStore);
|
|
410
|
+
setTokens(token: string, accessToken: string): void;
|
|
411
|
+
isInitialized(): boolean;
|
|
412
|
+
private awaitInitApiIfNeeded;
|
|
413
|
+
loadApiManifest({
|
|
414
|
+
apis
|
|
415
|
+
}: {
|
|
416
|
+
apis?: Record<string, {
|
|
417
|
+
api: DeleteMeLibraryApi;
|
|
418
|
+
scopeId: string;
|
|
419
|
+
}>;
|
|
420
|
+
}): void;
|
|
421
|
+
rerunApiByCallId(callId: string): Promise<ApiResult>;
|
|
422
|
+
runApiByPath({
|
|
423
|
+
path,
|
|
424
|
+
inputs,
|
|
425
|
+
callId,
|
|
426
|
+
callback,
|
|
427
|
+
isTestRun,
|
|
428
|
+
injectedCallerId
|
|
429
|
+
}: {
|
|
430
|
+
path: string;
|
|
431
|
+
inputs: SbApiRunOptions;
|
|
432
|
+
callId?: string;
|
|
433
|
+
callback?: () => Promise<unknown>;
|
|
434
|
+
isTestRun?: boolean;
|
|
435
|
+
injectedCallerId?: string;
|
|
436
|
+
}): Promise<ApiResult>;
|
|
437
|
+
private getHMRCallHash;
|
|
438
|
+
private getCachedHMRExecution;
|
|
439
|
+
private executeApi;
|
|
440
|
+
private executeApiInternal;
|
|
441
|
+
private findError;
|
|
442
|
+
private extractStatusCode;
|
|
443
|
+
cancelApi(apiName: string, _scopeId?: string): Promise<void>;
|
|
444
|
+
}
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/edit-mode/runtime-graph/types.d.ts
|
|
447
|
+
type ComponentNode = {
|
|
448
|
+
selectorId: SbSelector;
|
|
449
|
+
sourceId: SbElement;
|
|
450
|
+
type: any;
|
|
451
|
+
isSbComponent: boolean;
|
|
452
|
+
isHtmlElement: boolean;
|
|
453
|
+
noSelect?: boolean;
|
|
454
|
+
props?: Record<string, unknown>;
|
|
455
|
+
firstRenderedTag: SbSelector | undefined;
|
|
456
|
+
nearestSelectableAncestor: SbSelector | undefined;
|
|
457
|
+
displayName: string;
|
|
458
|
+
};
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/edit-mode/features/runtime-tracking-store.d.ts
|
|
461
|
+
declare class RuntimeTrackingStore {
|
|
462
|
+
readonly editStore: EditStore | undefined;
|
|
463
|
+
constructor(editStore: EditStore | undefined);
|
|
464
|
+
private graph;
|
|
465
|
+
private jsxNodes;
|
|
466
|
+
private sourceNodes;
|
|
467
|
+
registerComponent(selectorId: SbSelector, params: {
|
|
468
|
+
sourceId: SbElement;
|
|
469
|
+
type: any;
|
|
470
|
+
parentSelectorId?: SbSelector;
|
|
471
|
+
isSbComponent: boolean;
|
|
472
|
+
isHtmlElement: boolean;
|
|
473
|
+
noSelect?: boolean;
|
|
474
|
+
}): void;
|
|
475
|
+
getDisplayName(selectorId: SbSelector): string;
|
|
476
|
+
unregisterComponent(selectorId: SbSelector): void;
|
|
477
|
+
getFirstAnchorableTag(selectorId: SbSelector): SbSelector | undefined;
|
|
478
|
+
getNearestSelectableAncestor(selectorId: SbSelector, skipSelf?: boolean): SbSelector | undefined;
|
|
479
|
+
updatePropsForComponent(selectorId: SbSelector, props: Record<string, unknown>): void;
|
|
480
|
+
getComponent(selectorId: SbSelector): ComponentNode | undefined;
|
|
481
|
+
getComponentParent(selectorId: SbSelector): SbSelector;
|
|
482
|
+
getComponentChildren(selectorId: SbSelector): SbSelector[];
|
|
483
|
+
getSelectorIdsForSourceId(sourceId: SbElement): Set<SbSelector>;
|
|
484
|
+
getSourceId(selectorId: SbSelector): SbElement | undefined;
|
|
485
|
+
getClosestAncestorByType(selectorId: SbSelector, type: string): SbSelector | undefined;
|
|
486
|
+
hasRenderedNodes(): boolean;
|
|
487
|
+
get jsxNodeCount(): number;
|
|
488
|
+
}
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/edit-mode/features/ai-store.d.ts
|
|
491
|
+
declare class AiManager {
|
|
492
|
+
private readonly runtimeTrackingStore;
|
|
493
|
+
private _isTaggingEnabled;
|
|
494
|
+
private _isEditing;
|
|
495
|
+
private _editingComponents;
|
|
496
|
+
private _contextMode;
|
|
497
|
+
private _targetedComponents;
|
|
498
|
+
private _targetedSelectors;
|
|
499
|
+
private _hasHadSuccessfulBuild;
|
|
500
|
+
private _hasEverHadSuccessfulBuild;
|
|
501
|
+
constructor(runtimeTrackingStore: RuntimeTrackingStore);
|
|
502
|
+
getIsTaggingEnabled(): boolean;
|
|
503
|
+
getIsEditing(): boolean;
|
|
504
|
+
getShouldShowLoader(): boolean;
|
|
505
|
+
setIsTaggingEnabled(isTaggingEnabled: boolean): void;
|
|
506
|
+
getAiContextMode(): AiContextMode;
|
|
507
|
+
shouldToggleComponentInAiContext(): boolean;
|
|
508
|
+
getTargetedComponents(): `SB-${string}`[];
|
|
509
|
+
isEditingComponent(id: SbElement): boolean;
|
|
510
|
+
isTargetingComponent(id: SbElement): boolean;
|
|
511
|
+
startEditing(): void;
|
|
512
|
+
setEditingComponents(components: SbElement[]): void;
|
|
513
|
+
finishEditing(): void;
|
|
514
|
+
setAiContextMode(mode: AiContextMode, components?: SbElement[]): void;
|
|
515
|
+
addTargetedSelector(selectorId: SbSelector): void;
|
|
516
|
+
toggleTargetedSelector(selectorId: SbSelector): void;
|
|
517
|
+
isTargetedSelector(selectorId: SbSelector): boolean;
|
|
518
|
+
/**
|
|
519
|
+
* Returns true if we are targeting a different selector of the same source id, since in some cases we want to keep
|
|
520
|
+
* the same source targeted, but just highlight another selector of it
|
|
521
|
+
*/
|
|
522
|
+
isAlternateSourceIdTarget(sourceId: SbElement, selectorId: SbSelector): boolean;
|
|
523
|
+
handleRuntimeError(data: RuntimeErrorData): void;
|
|
524
|
+
clearRuntimeError(id: string): void;
|
|
525
|
+
markFirstBuildSuccess(): void;
|
|
526
|
+
private notifyLoaderState;
|
|
527
|
+
private removeAllSharedSelectors;
|
|
528
|
+
private removeAllSelectorsForSource;
|
|
529
|
+
}
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region src/edit-mode/features/connection-manager.d.ts
|
|
532
|
+
type ConnectionStatus = "pre-init" | "disconnected" | "connecting" | "connected";
|
|
533
|
+
declare class ConnectionManager {
|
|
534
|
+
connectionStatus: ConnectionStatus;
|
|
535
|
+
constructor();
|
|
536
|
+
initializeSocket(): void;
|
|
537
|
+
connect(): void;
|
|
538
|
+
disconnect(): void;
|
|
539
|
+
}
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/edit-mode/features/operation-store.d.ts
|
|
542
|
+
type OptimisticOperation<P> = {
|
|
543
|
+
type: keyof EditOperations;
|
|
544
|
+
payload: P;
|
|
545
|
+
id: string;
|
|
546
|
+
callback?: () => void;
|
|
547
|
+
};
|
|
548
|
+
type ReparentTransaction = OptimisticOperation<ReparentRequest>;
|
|
549
|
+
type SetPropertiesTransaction = OptimisticOperation<SetPropertiesRequest>;
|
|
550
|
+
type SetPropertyTransaction = OptimisticOperation<SetPropertyRequest>;
|
|
551
|
+
type CreateComponentTransaction = OptimisticOperation<CreateRequest>;
|
|
552
|
+
type DeleteComponentsTransaction = OptimisticOperation<DeleteRequest>;
|
|
553
|
+
type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction | CreateComponentTransaction | DeleteComponentsTransaction;
|
|
554
|
+
declare class OperationManager {
|
|
555
|
+
private pendingTransactions;
|
|
556
|
+
private waitingForBatch;
|
|
557
|
+
private batchOperations;
|
|
558
|
+
private batchOperationTransactionId;
|
|
559
|
+
visibleSourceIds: string[];
|
|
560
|
+
constructor();
|
|
561
|
+
get allPendingTransactions(): PendingTransaction[];
|
|
562
|
+
get pendingReparentOperations(): ReparentTransaction[];
|
|
563
|
+
get pendingDeleteOperations(): DeleteComponentsTransaction[];
|
|
564
|
+
get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
|
|
565
|
+
get hasPendingOperations(): boolean;
|
|
566
|
+
get allNames(): never[];
|
|
567
|
+
private executeOrAddToBatch;
|
|
568
|
+
private addPendingTransaction;
|
|
569
|
+
clearPendingTransactions(transactionIds: string[]): void;
|
|
570
|
+
batchUpdate(performOperations: () => void): void;
|
|
571
|
+
createComponent(payload: CreateRequest): void;
|
|
572
|
+
dropComponent(action: {
|
|
573
|
+
from: {
|
|
574
|
+
source: SourceLocation;
|
|
575
|
+
};
|
|
576
|
+
to: {
|
|
577
|
+
source: SourceLocation;
|
|
578
|
+
};
|
|
579
|
+
propsToChange?: Record<string, PropertyInfo>;
|
|
580
|
+
}): void;
|
|
581
|
+
deleteComponents(sourceIds: SbElement[]): void;
|
|
582
|
+
acknowledgeEditOperation(operation: EditOperationPayload<EditOperationType>): void;
|
|
583
|
+
writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
|
|
584
|
+
setWidgetProperties({
|
|
585
|
+
sourceId,
|
|
586
|
+
properties,
|
|
587
|
+
callback
|
|
588
|
+
}: {
|
|
589
|
+
sourceId: SbElement;
|
|
590
|
+
properties: Record<string, PropertyInfo<unknown>>;
|
|
591
|
+
callback?: () => void;
|
|
592
|
+
}): void;
|
|
593
|
+
setWidgetProperty({
|
|
594
|
+
sourceId,
|
|
595
|
+
property,
|
|
596
|
+
value,
|
|
597
|
+
callback
|
|
598
|
+
}: {
|
|
599
|
+
sourceId: SbElement;
|
|
600
|
+
property: string;
|
|
601
|
+
value: PropertyInfo<unknown>;
|
|
602
|
+
callback?: () => void;
|
|
603
|
+
}): void;
|
|
604
|
+
ensureFilesSynced(): Promise<void>;
|
|
605
|
+
generateSourceId(): `SB-${string}`;
|
|
606
|
+
}
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/edit-mode/features/properties-panel-manager.d.ts
|
|
609
|
+
declare class PropertiesPanelManager {
|
|
610
|
+
readonly editStore: EditStore;
|
|
611
|
+
readonly componentsManager: ComponentRegistry;
|
|
612
|
+
private propertiesDefinitions;
|
|
613
|
+
private propertiesPanelTrackerDisposer;
|
|
614
|
+
private _propertyLookupCache;
|
|
615
|
+
private removeHotReloadListener;
|
|
616
|
+
constructor(editStore: EditStore, componentsManager: ComponentRegistry);
|
|
617
|
+
getPropertiesPanel(selectorId: SbSelector): PropertiesPanelDefinition$1;
|
|
618
|
+
trackPropertiesPanel(selectorId: SbSelector): void;
|
|
619
|
+
untrackPropertiesPanel(): void;
|
|
620
|
+
getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
|
|
621
|
+
setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
|
|
622
|
+
updatePropertiesDefinitionForType(type: string): void;
|
|
623
|
+
computeAndApplySideEffectsForPropertyUpdate(payload: {
|
|
624
|
+
sourceId: SbElement;
|
|
625
|
+
updates: Record<string, PropertyInfo<unknown>>;
|
|
626
|
+
}): Record<SbElement, Record<string, PropertyInfo<unknown>>>;
|
|
627
|
+
/**
|
|
628
|
+
* When a custom component's source code is updated, we want to update the properties definition for that component.
|
|
629
|
+
* In order to do that, we need to listen to vite's hot reload events. We can't put import.meta.hot calls in the library
|
|
630
|
+
* because Vite just compiled all of those out in library builds, so we inject a listener from the plugin instead.
|
|
631
|
+
* https://github.com/vitejs/vite/blob/v6.2/packages/vite/src/node/plugins/define.ts#L37
|
|
632
|
+
*/
|
|
633
|
+
private attachHotReloadListener;
|
|
634
|
+
}
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/edit-mode/features/resizing-store.d.ts
|
|
637
|
+
type ResizeState = {
|
|
638
|
+
selectorId: SbSelector;
|
|
639
|
+
sourceId: SbElement;
|
|
640
|
+
dragStartX: number;
|
|
641
|
+
dragStartY: number;
|
|
642
|
+
start: {
|
|
643
|
+
width: number;
|
|
644
|
+
height: number;
|
|
645
|
+
};
|
|
646
|
+
resizedPosition: string;
|
|
647
|
+
widthToUpdate: Dim | null;
|
|
648
|
+
heightToUpdate: Dim | null;
|
|
649
|
+
isApplyingResize: boolean;
|
|
650
|
+
};
|
|
651
|
+
declare class ResizingManager {
|
|
652
|
+
private root;
|
|
653
|
+
private _activeResizes;
|
|
654
|
+
constructor(root: RootStore);
|
|
655
|
+
get activeResize(): ResizeState | null | undefined;
|
|
656
|
+
private isLockedAspectRatio;
|
|
657
|
+
startResizing(dragStartX: number, dragStartY: number, selectorId: SbSelector, position: string): void;
|
|
658
|
+
private calculateDimension;
|
|
659
|
+
private handleResizeDimension;
|
|
660
|
+
resizeWidget(currentX: number, currentY: number, selectorId: SbSelector, canResizeWidth: boolean, canResizeHeight: boolean): void;
|
|
661
|
+
pendingResize(sourceId: SbElement): {
|
|
662
|
+
width: Dim | null;
|
|
663
|
+
height: Dim | null;
|
|
664
|
+
} | null;
|
|
665
|
+
get hasAnyPendingResize(): boolean;
|
|
666
|
+
get pendingResizes(): ResizeState[];
|
|
667
|
+
applyResize(selectorId: SbSelector): void;
|
|
668
|
+
}
|
|
669
|
+
//#endregion
|
|
670
|
+
//#region src/edit-mode/features/ui-store.d.ts
|
|
671
|
+
declare class UIStore {
|
|
672
|
+
readonly root: RootStore;
|
|
673
|
+
readonly editStore: EditStore;
|
|
674
|
+
resizing: ResizingManager;
|
|
675
|
+
private _selectedSourceIds;
|
|
676
|
+
private _selectedSelectorIds;
|
|
677
|
+
private _focusedSelectorId;
|
|
678
|
+
private _rootInstanceData;
|
|
679
|
+
private newComponentSelectPromise;
|
|
680
|
+
constructor(root: RootStore, editStore: EditStore);
|
|
681
|
+
getMostRelevantSelectorIdsForSourceId(sourceId: SbElement): SbSelector[];
|
|
682
|
+
isSourceSelected(sourceId: SbElement): boolean;
|
|
683
|
+
getSelectedSourceIds(): SbElement[];
|
|
684
|
+
getSelectedSelectorIds(): SbSelector[];
|
|
685
|
+
private get focusedSelectorId();
|
|
686
|
+
getFocusedSourceId(): SbElement | null;
|
|
687
|
+
getFocusedSelectorId(): SbSelector | null;
|
|
688
|
+
setSelectedSourceIds(sourceIds: SbElement[]): void;
|
|
689
|
+
private subscribeNewSourceIdsToRuntimeSync;
|
|
690
|
+
setSelectedSelectorIds(selectorIds: SbSelector[]): void;
|
|
691
|
+
setFocusedIds(selectorId: SbSelector | null): void;
|
|
692
|
+
selectWidget(selectorId: SbSelector | null, _addToSelection?: boolean): void;
|
|
693
|
+
/**
|
|
694
|
+
* This is cursed because component selection actually needs to be done by instance ids, but
|
|
695
|
+
* instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
|
|
696
|
+
* are assigned by the source tracker.
|
|
697
|
+
*
|
|
698
|
+
* If _any_ other selection comes in before we select something, we will cancel this reaction
|
|
699
|
+
*/
|
|
700
|
+
selectNewComponentBySourceId(sourceId: SbElement, selectorIdsToIgnore?: Set<`S-${string}`>): Promise<void>;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/edit-mode/runtime-sync/runtime-subscriptions-store.d.ts
|
|
704
|
+
/**
|
|
705
|
+
* MobX store that manages runtime component subscriptions.
|
|
706
|
+
* Tracks which components are subscribed and builds fresh composites on-demand.
|
|
707
|
+
* The subscriptions getter allows startEditorSync reactions to track deep observables
|
|
708
|
+
* from buildComposite, eliminating the need for manual reaction management.
|
|
709
|
+
*/
|
|
710
|
+
declare class RuntimeSubscriptionsStore {
|
|
711
|
+
readonly editStore: EditStore;
|
|
712
|
+
private subscribedSourceIds;
|
|
713
|
+
constructor(editStore: EditStore);
|
|
714
|
+
subscribe(sourceId: SbElement): void;
|
|
715
|
+
unsubscribe(sourceId: SbElement): void;
|
|
716
|
+
clearAll(): void;
|
|
717
|
+
get subscriptions(): Record<SbElement, RuntimeSyncComposite | null>;
|
|
718
|
+
get jsxNodeCount(): number;
|
|
719
|
+
}
|
|
720
|
+
//#endregion
|
|
721
|
+
//#region src/edit-mode/edit-store.d.ts
|
|
722
|
+
declare global {
|
|
723
|
+
interface Window {
|
|
724
|
+
_SB_ENABLE_SESSION_RECORDING?: boolean;
|
|
725
|
+
__SUPERBLOCKS_EDITOR_HOOK__: InstanceType<typeof EditStore>;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
declare class EditStore {
|
|
729
|
+
ui: UIStore;
|
|
730
|
+
operationManager: OperationManager;
|
|
731
|
+
propertiesPanelManager: PropertiesPanelManager;
|
|
732
|
+
runtimeTrackingStore: RuntimeTrackingStore;
|
|
733
|
+
connectionManager: ConnectionManager;
|
|
734
|
+
ai: AiManager;
|
|
735
|
+
runtimeSubscriptionsStore: RuntimeSubscriptionsStore;
|
|
736
|
+
isInitialized: boolean;
|
|
737
|
+
recordingInitialized: boolean;
|
|
738
|
+
interactionMode: InteractionMode;
|
|
739
|
+
lastInteractionMode: InteractionMode;
|
|
740
|
+
private viteMessageListeners;
|
|
741
|
+
constructor(rootStore: RootStore);
|
|
742
|
+
setIsInitialized(isInitialized: boolean): void;
|
|
743
|
+
setInteractionMode(mode: InteractionMode, notifyEditor?: boolean): void;
|
|
744
|
+
onViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
|
|
745
|
+
kind: T;
|
|
746
|
+
}>>(kind: T, callback: (message: Message) => void): () => void;
|
|
747
|
+
triggerViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
|
|
748
|
+
kind: T;
|
|
749
|
+
}>>(kind: T, message: Message): void;
|
|
750
|
+
startRecording(recording: {
|
|
751
|
+
userId: string;
|
|
752
|
+
appId: string;
|
|
753
|
+
sessionRecordingKey: string;
|
|
754
|
+
}): void;
|
|
755
|
+
}
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/lib/internal-details/lib/root-store.d.ts
|
|
758
|
+
declare class RootStore {
|
|
759
|
+
apis: ApiManager;
|
|
760
|
+
componentRegistry: ComponentRegistry;
|
|
761
|
+
editStore?: EditStore;
|
|
762
|
+
locationStore: LocationStore;
|
|
763
|
+
currentPageScopeId: string | undefined;
|
|
764
|
+
applicationId: string | undefined;
|
|
765
|
+
userId: string | undefined;
|
|
766
|
+
windowOriginUrl: string | undefined;
|
|
767
|
+
private editorRegisteredCallbacks;
|
|
768
|
+
constructor();
|
|
769
|
+
setEditStore(editStore: EditStore): void;
|
|
770
|
+
onEditorRegistered(fn: () => void): void;
|
|
771
|
+
}
|
|
772
|
+
//#endregion
|
|
351
773
|
//#region src/lib/internal-details/lib/features/component-registry.d.ts
|
|
352
774
|
type DefaultTagNames = {
|
|
353
775
|
container: string;
|
|
354
776
|
button: string;
|
|
355
777
|
text: string;
|
|
356
778
|
};
|
|
779
|
+
/**
|
|
780
|
+
* TODO: The component registry could be split into two a thin layer always on, and move some stuff to the EditStore.
|
|
781
|
+
* Some of the actions (rename, delete) and some of the data (isDroppable) are editor-only.
|
|
782
|
+
*/
|
|
783
|
+
declare class ComponentRegistry implements ComponentRegistryShareState {
|
|
784
|
+
readonly rootStore: RootStore;
|
|
785
|
+
private _componentRegistry;
|
|
786
|
+
private _componentToType;
|
|
787
|
+
private _defaultContainerType;
|
|
788
|
+
private _defaultButtonType;
|
|
789
|
+
private _defaultTextType;
|
|
790
|
+
constructor(rootStore: RootStore);
|
|
791
|
+
private getOrCreateMetadata;
|
|
792
|
+
addComponent(type: string, rawComponent: React$2.ElementType, propertiesDefinition: PropertiesDefinition): void;
|
|
793
|
+
deleteComponent(type: string): void;
|
|
794
|
+
renameComponent(oldName: string, newName: string): void;
|
|
795
|
+
addManagedProps(type: string, props: ManagedPropsList): void;
|
|
796
|
+
deleteManagedProps(type: string): void;
|
|
797
|
+
addEditorTemplate(type: string, template: EditorTemplate<any>): void;
|
|
798
|
+
getEditorTemplates(type: string): EditorTemplate<any>[] | undefined;
|
|
799
|
+
getEditorConfigFromComponentType(type: any): EditorConfig$1<any> | undefined;
|
|
800
|
+
addEditorConfig(type: string, config: EditorConfig$1): void;
|
|
801
|
+
addInternalProps(type: string, props: Array<{
|
|
802
|
+
path: string;
|
|
803
|
+
factory: () => any;
|
|
804
|
+
}>): void;
|
|
805
|
+
getInternalProps(type: string): Array<{
|
|
806
|
+
path: string;
|
|
807
|
+
factory: () => any;
|
|
808
|
+
}>;
|
|
809
|
+
getEditorConfig(type: string): EditorConfig$1<any> | undefined;
|
|
810
|
+
get entityDefinitions(): Record<string, EntityDefinition>;
|
|
811
|
+
get libraryComponentCatalogs(): CatalogWithInternalDetails[];
|
|
812
|
+
get libraryComponentEditorConfigs(): Record<string, EditorConfig$1<any>>;
|
|
813
|
+
get customComponentList(): string[];
|
|
814
|
+
get containerTypes(): Set<string>;
|
|
815
|
+
get defaultTagNames(): DefaultTagNames;
|
|
816
|
+
get managedPropsRegistry(): Map<string, ManagedPropsList>;
|
|
817
|
+
getManagedProps(type: string): ManagedPropsList;
|
|
818
|
+
/**
|
|
819
|
+
* Get the component type string for a raw component reference.
|
|
820
|
+
* Used for registry-based component identity checking.
|
|
821
|
+
*/
|
|
822
|
+
getTypeForComponent(component: React$2.ComponentType<any>): string | undefined;
|
|
823
|
+
/**
|
|
824
|
+
* Check if a component or element type is registered in the component registry.
|
|
825
|
+
* Accepts both component references and string element names (e.g., "div").
|
|
826
|
+
* Used for component identity checking instead of symbol-based approach.
|
|
827
|
+
*/
|
|
828
|
+
hasComponent(component: React$2.ElementType | string): boolean;
|
|
829
|
+
/**
|
|
830
|
+
* Get the property path with the record identifier if it exists. For example,
|
|
831
|
+
* `columns.columnName.label` becomes `columns.*.label`, for record properties.
|
|
832
|
+
*/
|
|
833
|
+
getPropertyWithRecordIdentifier(type: string, path: string): string;
|
|
834
|
+
}
|
|
357
835
|
//#endregion
|
|
358
836
|
//#region src/lib/internal-details/sb-wrapper.d.ts
|
|
359
837
|
type InjectedProps = {
|
|
@@ -383,9 +861,9 @@ interface EditorTemplate<P extends React$1.ComponentProps<any> = React$1.Compone
|
|
|
383
861
|
* A modal that when drag & dropped on the page will add a trigger button.
|
|
384
862
|
* The modal is closed by default, so the selected component after drop will be the trigger button.
|
|
385
863
|
*/
|
|
386
|
-
create?: (context: CreationContext) => CreateRequest<P> | Array<CreateRequest<P>>;
|
|
864
|
+
create?: (context: CreationContext) => CreateRequest$1<P> | Array<CreateRequest$1<P>>;
|
|
387
865
|
}
|
|
388
|
-
interface CreateRequest<P extends React$1.ComponentProps<any> = React$1.ComponentProps<any>> {
|
|
866
|
+
interface CreateRequest$1<P extends React$1.ComponentProps<any> = React$1.ComponentProps<any>> {
|
|
389
867
|
type: string;
|
|
390
868
|
properties?: PropertyValues<P>;
|
|
391
869
|
createAt?: "root" | "dropLocation";
|
|
@@ -440,16 +918,19 @@ type ManagedProp<T extends DataType = DataType> = PropertyForData<T> & {
|
|
|
440
918
|
contextual?: boolean;
|
|
441
919
|
computedArgs?: EvaluateOrValueComputedArgs;
|
|
442
920
|
};
|
|
921
|
+
type ManagedPropsList = Array<ManagedProp & {
|
|
922
|
+
propertiesPanelDisplay?: PropertiesPanelDisplay<any>;
|
|
923
|
+
}>;
|
|
443
924
|
/**
|
|
444
925
|
* Merges shared and variant properties for union types without creating intersections
|
|
445
926
|
* Variant properties override shared properties with the same key
|
|
446
927
|
*/
|
|
447
|
-
type MergeUnionVariant<SHARED extends Record<string, Prop<any, any>>, VARIANT extends Record<string, Prop<any, any>>> = Omit<SHARED, keyof VARIANT> & VARIANT;
|
|
928
|
+
type MergeUnionVariant<SHARED$1 extends Record<string, Prop<any, any>>, VARIANT extends Record<string, Prop<any, any>>> = Omit<SHARED$1, keyof VARIANT> & VARIANT;
|
|
448
929
|
/**
|
|
449
930
|
* Converts a union type to an intersection type
|
|
450
931
|
* Used to merge multiple section props into a single props type
|
|
451
932
|
*/
|
|
452
|
-
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I extends U) => void) ? I : never;
|
|
933
|
+
type UnionToIntersection<U$1> = (U$1 extends any ? (x: U$1) => void : never) extends ((x: infer I extends U$1) => void) ? I : never;
|
|
453
934
|
/**
|
|
454
935
|
* Controls how default values affect property optionality
|
|
455
936
|
* - RequiredIfDefault: Properties with default values become required
|
|
@@ -579,15 +1060,15 @@ declare class Prop<Type extends DataType, _HasDefault extends boolean = false, _
|
|
|
579
1060
|
* ```
|
|
580
1061
|
*/
|
|
581
1062
|
static record<T extends CompositeInputs>(props: T): RecordProp<T>;
|
|
582
|
-
static union<SHARED extends Record<string, Prop<unknown, boolean>>, VARIANTS extends UnionVariant<SHARED>[] = UnionVariant<SHARED>[]>(props: {
|
|
583
|
-
shared: SHARED;
|
|
584
|
-
variants: VARIANTS;
|
|
585
|
-
}): UnionProp<SHARED, VARIANTS, VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: SHARED & VARIANTS[I] }[number] : never>;
|
|
1063
|
+
static union<SHARED$1 extends Record<string, Prop<unknown, boolean>>, VARIANTS$1 extends UnionVariant<SHARED$1>[] = UnionVariant<SHARED$1>[]>(props: {
|
|
1064
|
+
shared: SHARED$1;
|
|
1065
|
+
variants: VARIANTS$1;
|
|
1066
|
+
}): UnionProp<SHARED$1, VARIANTS$1, VARIANTS$1 extends readonly any[] ? { [I in keyof VARIANTS$1]: SHARED$1 & VARIANTS$1[I] }[number] : never>;
|
|
586
1067
|
default(de: SingleInputProp<DataType>): Prop<Type, true>;
|
|
587
1068
|
contextual<TContext extends any[] | undefined = any[]>(computedArgs?: EvaluateOrValueComputedArgs): Prop<Type, _HasDefault, TContext>;
|
|
588
1069
|
setName(name: string): this;
|
|
589
1070
|
propertiesPanel<CT extends ControlType>(schema: Omit<Partial<PropertiesPanelDisplay<Type, CT>>, "isTriggerProperty">): this;
|
|
590
|
-
setDisplayProperty<K extends keyof PropertiesPanelDisplay<Type>>(property: K, value: PropertiesPanelDisplay<Type>[K]): this;
|
|
1071
|
+
setDisplayProperty<K$1 extends keyof PropertiesPanelDisplay<Type>>(property: K$1, value: PropertiesPanelDisplay<Type>[K$1]): this;
|
|
591
1072
|
docs(docs: Exclude<PropertyForData<DataType>["docs"], undefined>): this;
|
|
592
1073
|
build(): ManagedProp<Type>;
|
|
593
1074
|
toDefinition(props: Record<string, unknown>): WidgetPropertyDefinition<DataType> | undefined;
|
|
@@ -645,13 +1126,13 @@ declare class FunctionProp<ARGS extends any[] = any[], RETURN = any> extends Pro
|
|
|
645
1126
|
actionPanel(panel?: ActionPanel): this;
|
|
646
1127
|
getActionPanel(): ActionPanel | undefined;
|
|
647
1128
|
}
|
|
648
|
-
type UnionVariant<SHARED extends Record<string, Prop<any>>> = { [K in keyof SHARED]: Prop<any> };
|
|
649
|
-
declare class UnionProp<SHARED extends Record<string, Prop<unknown, boolean>>, VARIANTS extends UnionVariant<SHARED>[] = UnionVariant<SHARED>[], _OUTPUT = (VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: SHARED & VARIANTS[I] }[number] : never)> extends Prop<any> {
|
|
1129
|
+
type UnionVariant<SHARED$1 extends Record<string, Prop<any>>> = { [K in keyof SHARED$1]: Prop<any> };
|
|
1130
|
+
declare class UnionProp<SHARED$1 extends Record<string, Prop<unknown, boolean>>, VARIANTS$1 extends UnionVariant<SHARED$1>[] = UnionVariant<SHARED$1>[], _OUTPUT = (VARIANTS$1 extends readonly any[] ? { [I in keyof VARIANTS$1]: SHARED$1 & VARIANTS$1[I] }[number] : never)> extends Prop<any> {
|
|
650
1131
|
typeString: "union";
|
|
651
|
-
shared: SHARED;
|
|
652
|
-
variants: VARIANTS;
|
|
653
|
-
constructor(shared: SHARED, variants: VARIANTS);
|
|
654
|
-
getProps(): SHARED & Record<string, Prop<any, false, undefined>>;
|
|
1132
|
+
shared: SHARED$1;
|
|
1133
|
+
variants: VARIANTS$1;
|
|
1134
|
+
constructor(shared: SHARED$1, variants: VARIANTS$1);
|
|
1135
|
+
getProps(): SHARED$1 & Record<string, Prop<any, false, undefined>>;
|
|
655
1136
|
}
|
|
656
1137
|
//#endregion
|
|
657
1138
|
//#region src/lib/user-facing/components/app/props.d.ts
|
|
@@ -782,5 +1263,5 @@ declare const tailwindStylesCategory: (props?: {
|
|
|
782
1263
|
className: string;
|
|
783
1264
|
}>;
|
|
784
1265
|
//#endregion
|
|
785
|
-
export { App, type CreateChild, type CreationContext, type EditorConfig, type EditorTemplate, type FromChildToParentMessageTypes, type FromChildToParentMessageTypesMap, type FromParentToChildMessageTypes, type FromParentToChildMessageTypesMap, PageNotFound, Prop, type PropertiesPanelDefinition, Property, PropsCategory, RouteLoadError, Section, SbProvider as SuperblocksProvider, registerComponent, tailwindStylesCategory, useApiStateful as useApi, useSuperblocksGroups, useSuperblocksProfiles, useSuperblocksUser };
|
|
1266
|
+
export { App, type CreateChild, type CreationContext, type EditorConfig, type EditorTemplate, type FromChildToParentMessageTypes, type FromChildToParentMessageTypesMap, type FromParentToChildMessageTypes, type FromParentToChildMessageTypesMap, PageNotFound, Prop, type PropertiesPanelDefinition, Property, PropsCategory, RouteLoadError, Section, SbProvider as SuperblocksProvider, getAppMode, registerComponent, tailwindStylesCategory, useApiStateful as useApi, useSuperblocksGroups, useSuperblocksProfiles, useSuperblocksUser };
|
|
786
1267
|
//# sourceMappingURL=index.d.ts.map
|