@superblocksteam/library 2.0.102 → 2.0.103-next.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/dist/devtools-consolidated-CwxpaGqQ.js.map +1 -1
- package/dist/early-console-buffer-D4wVuyBf.js.map +1 -1
- package/dist/jsx-dev-runtime/index.d.ts.map +1 -1
- package/dist/jsx-dev-runtime/index.js +1 -1
- package/dist/jsx-dev-runtime/index.js.map +1 -1
- package/dist/{jsx-wrapper-aSZhsulk.js → jsx-wrapper-DnM3BCRU.js} +50 -18
- package/dist/jsx-wrapper-DnM3BCRU.js.map +1 -0
- package/dist/lib/index.d.ts +550 -549
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +121 -58
- package/dist/lib/index.js.map +1 -1
- package/dist/logs-hyzhDMp7.js.map +1 -1
- package/package.json +4 -4
- package/dist/jsx-wrapper-aSZhsulk.js.map +0 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Callback, ControlType, DataType, DataTypeString, EntityDefinition, HeaderType, PropertiesPanelDefinition as PropertiesPanelDefinition$1, PropertiesPanelDisplay, PropertyForData, PropsCategory, Relation, WidgetPropertyDefinition } from "@superblocksteam/library-shared/props";
|
|
2
|
-
import { Dim, EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
|
|
3
2
|
import { DataRouter, Location, Params } from "react-router";
|
|
3
|
+
import { Dim, EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
|
|
4
4
|
import * as React$2 from "react";
|
|
5
5
|
import React$1, { LegacyRef, ReactNode, createElement } from "react";
|
|
6
6
|
import { OrchestratorViewMode, PlaceholderInfo, Profile } from "@superblocksteam/shared";
|
|
@@ -32,10 +32,11 @@ type Group = {
|
|
|
32
32
|
name: string;
|
|
33
33
|
size: number;
|
|
34
34
|
};
|
|
35
|
+
type DataTag = Profile;
|
|
35
36
|
type DataTags = {
|
|
36
|
-
available:
|
|
37
|
-
selected?:
|
|
38
|
-
default:
|
|
37
|
+
available: DataTag[];
|
|
38
|
+
selected?: DataTag;
|
|
39
|
+
default: DataTag;
|
|
39
40
|
};
|
|
40
41
|
/** @deprecated Use DataTags instead */
|
|
41
42
|
type Profiles = DataTags;
|
|
@@ -86,84 +87,423 @@ declare const SbProvider: ({
|
|
|
86
87
|
context?: SuperblocksAppContext;
|
|
87
88
|
}) => react_jsx_runtime0.JSX.Element;
|
|
88
89
|
//#endregion
|
|
89
|
-
//#region src/lib/internal-details/lib/types.d.ts
|
|
90
|
-
type
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
//#region src/lib/internal-details/lib/evaluator/entity-types.d.ts
|
|
91
|
+
type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = T extends Callback ? Callback<ARGS> : T;
|
|
92
|
+
type NestedInputProp<T, ARGS extends any[] = any[]> = T extends object ? { [K in keyof T]: SingleInputProp<T[K], ARGS> | NestedInputProp<T[K], ARGS> } : never;
|
|
93
|
+
type InputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = SingleInputProp<T, ARGS> | NestedInputProp<T, ARGS>;
|
|
94
|
+
type EntityFunction<ARGS extends any[] = any[], R = EntityOutputProp> = (this: Entity, ...ARGS: ARGS) => R;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/edit-mode/runtime-graph/types.d.ts
|
|
97
|
+
type ComponentNode = {
|
|
98
|
+
selectorId: SbSelector;
|
|
99
|
+
sourceId: SbElement;
|
|
100
|
+
type: any;
|
|
101
|
+
isSbComponent: boolean;
|
|
102
|
+
isHtmlElement: boolean;
|
|
103
|
+
noSelect?: boolean;
|
|
104
|
+
props?: Record<string, unknown>;
|
|
105
|
+
firstRenderedTag: SbSelector | undefined;
|
|
106
|
+
nearestSelectableAncestor: SbSelector | undefined;
|
|
107
|
+
displayName: string;
|
|
96
108
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/edit-mode/features/runtime-tracking-store.d.ts
|
|
111
|
+
declare class RuntimeTrackingStore {
|
|
112
|
+
readonly editStore: EditStore | undefined;
|
|
113
|
+
constructor(editStore: EditStore | undefined);
|
|
114
|
+
private graph;
|
|
115
|
+
private jsxNodes;
|
|
116
|
+
private sourceNodes;
|
|
117
|
+
private disabledComponents;
|
|
118
|
+
registerComponent(selectorId: SbSelector, params: {
|
|
119
|
+
sourceId: SbElement;
|
|
120
|
+
type: any;
|
|
121
|
+
parentSelectorId?: SbSelector;
|
|
122
|
+
isSbComponent: boolean;
|
|
123
|
+
isHtmlElement: boolean;
|
|
124
|
+
noSelect?: boolean;
|
|
125
|
+
}): void;
|
|
126
|
+
getDisplayName(selectorId: SbSelector): string;
|
|
127
|
+
unregisterComponent(selectorId: SbSelector): void;
|
|
128
|
+
getFirstAnchorableTag(selectorId: SbSelector): SbSelector | undefined;
|
|
129
|
+
getNearestSelectableAncestor(selectorId: SbSelector, skipSelf?: boolean): SbSelector | undefined;
|
|
130
|
+
updatePropsForComponent(selectorId: SbSelector, props: Record<string, unknown>): void;
|
|
131
|
+
getComponent(selectorId: SbSelector): ComponentNode | undefined;
|
|
132
|
+
getComponentParent(selectorId: SbSelector): SbSelector;
|
|
133
|
+
getComponentChildren(selectorId: SbSelector): SbSelector[];
|
|
134
|
+
getSelectorIdsForSourceId(sourceId: SbElement): Set<SbSelector>;
|
|
135
|
+
getSourceId(selectorId: SbSelector): SbElement | undefined;
|
|
136
|
+
getClosestAncestorByType(selectorId: SbSelector, type: string): SbSelector | undefined;
|
|
137
|
+
hasRenderedNodes(): boolean;
|
|
138
|
+
getDisabledComponents(): SbSelector[];
|
|
139
|
+
/**
|
|
140
|
+
* Given a selectorId that represents a DOM element, walks up the component tree
|
|
141
|
+
* to find the outermost registered component whose firstRenderedTag matches this selectorId.
|
|
142
|
+
* This is used to select the component when clicking on its root DOM element.
|
|
143
|
+
*
|
|
144
|
+
* IMPORTANT: This only returns a component if the anchorSelectorId is the IMMEDIATE parent
|
|
145
|
+
* of the component (i.e., the component doesn't have any intermediate nodes between itself
|
|
146
|
+
* and the anchor). This prevents inner HTML elements from being treated as component roots.
|
|
147
|
+
*
|
|
148
|
+
* ONLY returns registered components (isSbComponent: true). Unregistered wrapper components
|
|
149
|
+
* are treated as transparent and skipped.
|
|
150
|
+
*
|
|
151
|
+
* Returns undefined if no registered component has this as its firstRenderedTag.
|
|
152
|
+
*/
|
|
153
|
+
getOutermostComponentForFirstRenderedTag(anchorSelectorId: SbSelector): SbSelector | undefined;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/edit-mode/features/ai-store.d.ts
|
|
157
|
+
declare class AiManager {
|
|
158
|
+
private readonly runtimeTrackingStore;
|
|
159
|
+
private _isTaggingEnabled;
|
|
160
|
+
private _isEditing;
|
|
161
|
+
private _editingComponents;
|
|
162
|
+
private _contextMode;
|
|
163
|
+
private _targetedComponents;
|
|
164
|
+
private _targetedSelectors;
|
|
165
|
+
private _hasHadSuccessfulBuild;
|
|
166
|
+
private _hasEverHadSuccessfulBuild;
|
|
167
|
+
constructor(runtimeTrackingStore: RuntimeTrackingStore);
|
|
168
|
+
getIsTaggingEnabled(): boolean;
|
|
169
|
+
getIsEditing(): boolean;
|
|
170
|
+
getShouldShowLoader(): boolean;
|
|
171
|
+
setIsTaggingEnabled(isTaggingEnabled: boolean): void;
|
|
172
|
+
getAiContextMode(): AiContextMode;
|
|
173
|
+
shouldToggleComponentInAiContext(): boolean;
|
|
174
|
+
getTargetedComponents(): `SB-${string}`[];
|
|
175
|
+
getTargetedSelectors(): `S-${string}`[];
|
|
176
|
+
isEditingComponent(id: SbElement): boolean;
|
|
177
|
+
isTargetingComponent(id: SbElement): boolean;
|
|
178
|
+
startEditing(): void;
|
|
179
|
+
setEditingComponents(components: SbElement[]): void;
|
|
180
|
+
finishEditing(): void;
|
|
181
|
+
setAiContextMode(mode: AiContextMode, components?: {
|
|
182
|
+
id: SbElement;
|
|
183
|
+
selectorId?: SbSelector;
|
|
184
|
+
}[]): void;
|
|
185
|
+
addTargetedSelector(selectorId: SbSelector): void;
|
|
186
|
+
toggleTargetedSelector(selectorId: SbSelector): void;
|
|
187
|
+
isTargetedSelector(selectorId: SbSelector): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Returns true if we are targeting a different selector of the same source id, since in some cases we want to keep
|
|
190
|
+
* the same source targeted, but just highlight another selector of it
|
|
191
|
+
*/
|
|
192
|
+
isAlternateSourceIdTarget(sourceId: SbElement, selectorId: SbSelector): boolean;
|
|
193
|
+
handleRuntimeError(data: RuntimeErrorData): void;
|
|
194
|
+
clearRuntimeError(id: string): void;
|
|
195
|
+
markFirstBuildSuccess(): void;
|
|
196
|
+
private notifyLoaderState;
|
|
197
|
+
private removeAllSharedSelectors;
|
|
198
|
+
private removeAllSelectorsForSource;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/edit-mode/features/connection-manager.d.ts
|
|
202
|
+
type ConnectionStatus = "pre-init" | "disconnected" | "connecting" | "connected";
|
|
203
|
+
declare class ConnectionManager {
|
|
204
|
+
connectionStatus: ConnectionStatus;
|
|
205
|
+
constructor();
|
|
206
|
+
initializeSocket(): void;
|
|
207
|
+
connect(): void;
|
|
208
|
+
disconnect(): void;
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/edit-mode/features/operation-store.d.ts
|
|
212
|
+
type OptimisticOperation<P> = {
|
|
213
|
+
type: keyof EditOperations;
|
|
214
|
+
payload: P;
|
|
215
|
+
id: string;
|
|
216
|
+
callback?: () => void;
|
|
102
217
|
};
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
218
|
+
type ReparentTransaction = OptimisticOperation<ReparentRequest>;
|
|
219
|
+
type SetPropertiesTransaction = OptimisticOperation<SetPropertiesRequest>;
|
|
220
|
+
type SetPropertyTransaction = OptimisticOperation<SetPropertyRequest>;
|
|
221
|
+
type CreateComponentTransaction = OptimisticOperation<CreateRequest>;
|
|
222
|
+
type DeleteComponentsTransaction = OptimisticOperation<DeleteRequest>;
|
|
223
|
+
type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction | CreateComponentTransaction | DeleteComponentsTransaction;
|
|
224
|
+
declare class OperationManager {
|
|
225
|
+
private pendingTransactions;
|
|
226
|
+
private waitingForBatch;
|
|
227
|
+
private batchOperations;
|
|
228
|
+
private batchOperationTransactionId;
|
|
229
|
+
visibleSourceIds: string[];
|
|
230
|
+
constructor();
|
|
231
|
+
get allPendingTransactions(): PendingTransaction[];
|
|
232
|
+
get pendingDeleteOperations(): DeleteComponentsTransaction[];
|
|
233
|
+
get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
|
|
234
|
+
get hasPendingOperations(): boolean;
|
|
235
|
+
get allNames(): never[];
|
|
236
|
+
private executeOrAddToBatch;
|
|
237
|
+
private addPendingTransaction;
|
|
238
|
+
clearPendingTransactions(transactionIds: string[]): void;
|
|
239
|
+
batchUpdate(performOperations: () => void): void;
|
|
240
|
+
createComponent(payload: CreateRequest): void;
|
|
241
|
+
dropComponent(action: {
|
|
242
|
+
from: {
|
|
243
|
+
source: SourceLocation;
|
|
121
244
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
result?: any;
|
|
125
|
-
request?: string;
|
|
126
|
-
requestV2?: ExecutionEventRequest;
|
|
127
|
-
stdout?: Array<string>;
|
|
128
|
-
stderr?: Array<string>;
|
|
245
|
+
to: {
|
|
246
|
+
source: SourceLocation;
|
|
129
247
|
};
|
|
130
|
-
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
248
|
+
propsToChange?: Record<string, PropertyInfo>;
|
|
249
|
+
}): void;
|
|
250
|
+
deleteComponents(sourceIds: SbElement[]): void;
|
|
251
|
+
acknowledgeEditOperation(operation: EditOperationPayload<EditOperationType>): void;
|
|
252
|
+
writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
|
|
253
|
+
setWidgetProperties({
|
|
254
|
+
sourceId,
|
|
255
|
+
properties,
|
|
256
|
+
callback
|
|
257
|
+
}: {
|
|
258
|
+
sourceId: SbElement;
|
|
259
|
+
properties: Record<string, PropertyInfo<unknown>>;
|
|
260
|
+
callback?: () => void;
|
|
261
|
+
}): void;
|
|
262
|
+
setWidgetProperty({
|
|
263
|
+
sourceId,
|
|
264
|
+
property,
|
|
265
|
+
value,
|
|
266
|
+
callback
|
|
267
|
+
}: {
|
|
268
|
+
sourceId: SbElement;
|
|
269
|
+
property: string;
|
|
270
|
+
value: PropertyInfo<unknown>;
|
|
271
|
+
callback?: () => void;
|
|
272
|
+
}): void;
|
|
273
|
+
ensureFilesSynced(): Promise<void>;
|
|
274
|
+
generateSourceId(): `SB-${string}`;
|
|
150
275
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/edit-mode/features/properties-panel-manager.d.ts
|
|
278
|
+
declare class PropertiesPanelManager {
|
|
279
|
+
readonly editStore: EditStore;
|
|
280
|
+
readonly componentsManager: ComponentRegistry;
|
|
281
|
+
private propertiesDefinitions;
|
|
282
|
+
private propertiesPanelTrackerDisposer;
|
|
283
|
+
private _propertyLookupCache;
|
|
284
|
+
private removeHotReloadListener;
|
|
285
|
+
constructor(editStore: EditStore, componentsManager: ComponentRegistry);
|
|
286
|
+
getPropertiesPanel(selectorId: SbSelector): PropertiesPanelDefinition$1;
|
|
287
|
+
trackPropertiesPanel(selectorId: SbSelector): void;
|
|
288
|
+
untrackPropertiesPanel(): void;
|
|
289
|
+
getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
|
|
290
|
+
setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
|
|
291
|
+
updatePropertiesDefinitionForType(type: string): void;
|
|
292
|
+
computeAndApplySideEffectsForPropertyUpdate(payload: {
|
|
293
|
+
sourceId: SbElement;
|
|
294
|
+
updates: Record<string, PropertyInfo<unknown>>;
|
|
295
|
+
}): Record<SbElement, Record<string, PropertyInfo<unknown>>>;
|
|
296
|
+
/**
|
|
297
|
+
* When a custom component's source code is updated, we want to update the properties definition for that component.
|
|
298
|
+
* 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
|
|
299
|
+
* because Vite just compiled all of those out in library builds, so we inject a listener from the plugin instead.
|
|
300
|
+
* https://github.com/vitejs/vite/blob/v6.2/packages/vite/src/node/plugins/define.ts#L37
|
|
301
|
+
*/
|
|
302
|
+
private attachHotReloadListener;
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/edit-mode/features/resizing-store.d.ts
|
|
306
|
+
type ResizeState = {
|
|
307
|
+
selectorId: SbSelector;
|
|
308
|
+
sourceId: SbElement;
|
|
309
|
+
dragStartX: number;
|
|
310
|
+
dragStartY: number;
|
|
311
|
+
start: {
|
|
312
|
+
width: number;
|
|
313
|
+
height: number;
|
|
314
|
+
};
|
|
315
|
+
resizedPosition: string;
|
|
316
|
+
widthToUpdate: Dim | null;
|
|
317
|
+
heightToUpdate: Dim | null;
|
|
318
|
+
isApplyingResize: boolean;
|
|
319
|
+
};
|
|
320
|
+
declare class ResizingManager {
|
|
321
|
+
private root;
|
|
322
|
+
private _activeResizes;
|
|
323
|
+
constructor(root: RootStore);
|
|
324
|
+
get activeResize(): ResizeState | null | undefined;
|
|
325
|
+
private isLockedAspectRatio;
|
|
326
|
+
startResizing(dragStartX: number, dragStartY: number, selectorId: SbSelector, position: string): void;
|
|
327
|
+
private calculateDimension;
|
|
328
|
+
private handleResizeDimension;
|
|
329
|
+
resizeWidget(currentX: number, currentY: number, selectorId: SbSelector, canResizeWidth: boolean, canResizeHeight: boolean): void;
|
|
330
|
+
pendingResize(sourceId: SbElement): {
|
|
331
|
+
width: Dim | null;
|
|
332
|
+
height: Dim | null;
|
|
333
|
+
} | null;
|
|
334
|
+
get hasAnyPendingResize(): boolean;
|
|
335
|
+
get pendingResizes(): ResizeState[];
|
|
336
|
+
applyResize(selectorId: SbSelector): void;
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/edit-mode/features/ui-store.d.ts
|
|
340
|
+
declare class UIStore {
|
|
341
|
+
readonly root: RootStore;
|
|
342
|
+
readonly editStore: EditStore;
|
|
343
|
+
resizing: ResizingManager;
|
|
344
|
+
private _selectedSourceIds;
|
|
345
|
+
private _selectedSelectorIds;
|
|
346
|
+
private _focusedSelectorId;
|
|
347
|
+
private _rootInstanceData;
|
|
348
|
+
private newComponentSelectPromise;
|
|
349
|
+
constructor(root: RootStore, editStore: EditStore);
|
|
350
|
+
getMostRelevantSelectorIdsForSourceId(sourceId: SbElement): SbSelector[];
|
|
351
|
+
isSourceSelected(sourceId: SbElement): boolean;
|
|
352
|
+
getSelectedSourceIds(): SbElement[];
|
|
353
|
+
getSelectedSelectorIds(): SbSelector[];
|
|
354
|
+
private get focusedSelectorId();
|
|
355
|
+
getFocusedSourceId(): SbElement | null;
|
|
356
|
+
getFocusedSelectorId(): SbSelector | null;
|
|
357
|
+
setSelectedSourceIds(sourceIds: SbElement[]): void;
|
|
358
|
+
private subscribeNewSourceIdsToRuntimeSync;
|
|
359
|
+
setSelectedSelectorIds(selectorIds: SbSelector[]): void;
|
|
360
|
+
setFocusedIds(selectorId: SbSelector | null): void;
|
|
361
|
+
selectWidget(selectorId: SbSelector | null, _addToSelection?: boolean): void;
|
|
362
|
+
/**
|
|
363
|
+
* This is cursed because component selection actually needs to be done by instance ids, but
|
|
364
|
+
* instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
|
|
365
|
+
* are assigned by the source tracker.
|
|
366
|
+
*
|
|
367
|
+
* If _any_ other selection comes in before we select something, we will cancel this reaction
|
|
368
|
+
*/
|
|
369
|
+
selectNewComponentBySourceId(sourceId: SbElement, selectorIdsToIgnore?: Set<`S-${string}`>): Promise<void>;
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/edit-mode/runtime-sync/runtime-subscriptions-store.d.ts
|
|
373
|
+
/**
|
|
374
|
+
* MobX store that manages runtime component subscriptions.
|
|
375
|
+
* Tracks which components are subscribed and builds fresh composites on-demand.
|
|
376
|
+
* The subscriptions getter allows startEditorSync reactions to track deep observables
|
|
377
|
+
* from buildComposite, eliminating the need for manual reaction management.
|
|
378
|
+
*/
|
|
379
|
+
declare class RuntimeSubscriptionsStore {
|
|
380
|
+
readonly editStore: EditStore;
|
|
381
|
+
private subscribedSourceIds;
|
|
382
|
+
constructor(editStore: EditStore);
|
|
383
|
+
subscribe(sourceId: SbElement): void;
|
|
384
|
+
unsubscribe(sourceId: SbElement): void;
|
|
385
|
+
clearAll(): void;
|
|
386
|
+
get subscriptions(): Record<SbElement, RuntimeSyncComposite | null>;
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/edit-mode/edit-store.d.ts
|
|
390
|
+
declare global {
|
|
391
|
+
interface Window {
|
|
392
|
+
_SB_ENABLE_SESSION_RECORDING?: boolean;
|
|
393
|
+
__SUPERBLOCKS_EDITOR_HOOK__: InstanceType<typeof EditStore>;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
declare class EditStore {
|
|
397
|
+
ui: UIStore;
|
|
398
|
+
operationManager: OperationManager;
|
|
399
|
+
propertiesPanelManager: PropertiesPanelManager;
|
|
400
|
+
runtimeTrackingStore: RuntimeTrackingStore;
|
|
401
|
+
connectionManager: ConnectionManager;
|
|
402
|
+
ai: AiManager;
|
|
403
|
+
runtimeSubscriptionsStore: RuntimeSubscriptionsStore;
|
|
404
|
+
isInitialized: boolean;
|
|
405
|
+
recordingInitialized: boolean;
|
|
406
|
+
interactionMode: InteractionMode;
|
|
407
|
+
lastInteractionMode: InteractionMode;
|
|
408
|
+
isDesignModeLocked: boolean;
|
|
409
|
+
designModeDisabled: boolean;
|
|
410
|
+
private viteMessageListeners;
|
|
411
|
+
constructor(rootStore: RootStore);
|
|
412
|
+
setIsInitialized(isInitialized: boolean): void;
|
|
413
|
+
setDesignModeDisabled(disabled: boolean): void;
|
|
414
|
+
setInteractionMode(mode: InteractionMode, notifyEditor?: boolean): void;
|
|
415
|
+
setDesignModeLocked(locked: boolean): void;
|
|
416
|
+
onViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
|
|
417
|
+
kind: T;
|
|
418
|
+
}>>(kind: T, callback: (message: Message) => void): () => void;
|
|
419
|
+
triggerViteMessage<T extends ViteMessageKind, Message extends Extract<ViteMessage, {
|
|
420
|
+
kind: T;
|
|
421
|
+
}>>(kind: T, message: Message): void;
|
|
422
|
+
startRecording(recording: {
|
|
423
|
+
userId: string;
|
|
424
|
+
appId: string;
|
|
425
|
+
sessionRecordingKey: string;
|
|
426
|
+
}): void;
|
|
427
|
+
}
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/lib/internal-details/lib/types.d.ts
|
|
430
|
+
type ExecutionError = {
|
|
431
|
+
name?: string;
|
|
432
|
+
message: string;
|
|
433
|
+
formPath: string;
|
|
434
|
+
blockPath: string;
|
|
435
|
+
handled?: boolean;
|
|
436
|
+
};
|
|
437
|
+
type ExecutionEventRequest = {
|
|
438
|
+
summary: string;
|
|
439
|
+
metadata: {
|
|
440
|
+
placeHoldersInfo?: Record<string, PlaceholderInfo>;
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
type Resolutions = Record<string,
|
|
444
|
+
// name of the field: eg: "range", for the range field let's say the code is {{[1,2,3]}}
|
|
445
|
+
{
|
|
446
|
+
value: any;
|
|
447
|
+
bindings: any[];
|
|
448
|
+
}>;
|
|
449
|
+
type ExecutionEvent = {
|
|
450
|
+
name: string;
|
|
451
|
+
type: string;
|
|
452
|
+
timestamp: string;
|
|
453
|
+
start?: Record<string, unknown>;
|
|
454
|
+
end?: {
|
|
455
|
+
performance?: {
|
|
456
|
+
start: string | number;
|
|
457
|
+
finish: string | number;
|
|
458
|
+
total: string | number;
|
|
459
|
+
execution: string | number;
|
|
460
|
+
overhead: string | number;
|
|
461
|
+
};
|
|
462
|
+
error?: ExecutionError;
|
|
463
|
+
output?: {
|
|
464
|
+
result?: any;
|
|
465
|
+
request?: string;
|
|
466
|
+
requestV2?: ExecutionEventRequest;
|
|
467
|
+
stdout?: Array<string>;
|
|
468
|
+
stderr?: Array<string>;
|
|
469
|
+
};
|
|
470
|
+
resolved?: Resolutions;
|
|
471
|
+
};
|
|
472
|
+
parent: string;
|
|
473
|
+
};
|
|
474
|
+
interface StreamEvent {
|
|
475
|
+
result: {
|
|
476
|
+
event: ExecutionEvent;
|
|
477
|
+
execution: string;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
type RouteInfo = Omit<UrlState, "host" | "hostname" | "href" | "port" | "protocol">;
|
|
481
|
+
/**
|
|
482
|
+
* Schema representation for SDK API input/output/chunk schemas.
|
|
483
|
+
* Contains both TypeScript and JSON Schema formats for display in the UI.
|
|
484
|
+
*/
|
|
485
|
+
interface SdkApiSchemaInfo {
|
|
486
|
+
/** TypeScript type string representation, e.g., "{ userId: string; limit?: number }" */
|
|
487
|
+
typescript: string;
|
|
488
|
+
/** JSON Schema representation for the schema */
|
|
489
|
+
jsonSchema: object;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Metadata for an SDK API, sent from the library to ui-code-mode
|
|
493
|
+
* when an SDK API is registered.
|
|
494
|
+
*/
|
|
495
|
+
interface SdkApiMetadata {
|
|
496
|
+
/** Unique name of the API */
|
|
497
|
+
name: string;
|
|
498
|
+
/** Plain-language summary of what this API does */
|
|
499
|
+
description?: string;
|
|
500
|
+
/** Input schema information */
|
|
501
|
+
inputSchema: SdkApiSchemaInfo;
|
|
502
|
+
/** Output schema information (for non-streaming APIs) */
|
|
503
|
+
outputSchema?: SdkApiSchemaInfo;
|
|
504
|
+
/** Chunk schema information (for streaming APIs) */
|
|
505
|
+
chunkSchema?: SdkApiSchemaInfo;
|
|
506
|
+
/** Whether this is a streaming API */
|
|
167
507
|
isStreaming: boolean;
|
|
168
508
|
/** Declared integrations for this API */
|
|
169
509
|
integrations: Array<{
|
|
@@ -670,481 +1010,148 @@ type FromChildToParentMessageTypesMap = {
|
|
|
670
1010
|
"sdk-api-execution-started": {
|
|
671
1011
|
executionId: string;
|
|
672
1012
|
apiName: string;
|
|
673
|
-
input: Record<string, unknown>;
|
|
674
|
-
};
|
|
675
|
-
/**
|
|
676
|
-
* Notify the parent when an SDK API execution completes successfully.
|
|
677
|
-
*/
|
|
678
|
-
"sdk-api-execution-completed": {
|
|
679
|
-
executionId: string;
|
|
680
|
-
apiName: string;
|
|
681
|
-
output: unknown;
|
|
682
|
-
durationMs: number;
|
|
683
|
-
diagnostics?: unknown[];
|
|
684
|
-
};
|
|
685
|
-
/**
|
|
686
|
-
* Notify the parent when an SDK API execution fails.
|
|
687
|
-
*/
|
|
688
|
-
"sdk-api-execution-failed": {
|
|
689
|
-
executionId: string;
|
|
690
|
-
apiName: string;
|
|
691
|
-
error: {
|
|
692
|
-
code: string;
|
|
693
|
-
message: string;
|
|
694
|
-
};
|
|
695
|
-
durationMs: number;
|
|
696
|
-
diagnostics?: unknown[];
|
|
697
|
-
};
|
|
698
|
-
} & AppToEditorMessage<PropertiesPanelDefinition$1>;
|
|
699
|
-
type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
|
|
700
|
-
//#endregion
|
|
701
|
-
//#region src/lib/internal-details/location-store.d.ts
|
|
702
|
-
declare class LocationStore {
|
|
703
|
-
route?: RouteInfo;
|
|
704
|
-
rootStore: RootStore;
|
|
705
|
-
constructor(rootStore: RootStore);
|
|
706
|
-
updateLocation(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): void;
|
|
707
|
-
sendLocationToEditor(): void;
|
|
708
|
-
private matchesToRoutePattern;
|
|
709
|
-
locationToRouteInfo(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): RouteInfo | undefined;
|
|
710
|
-
}
|
|
711
|
-
//#endregion
|
|
712
|
-
//#region src/lib/internal-details/lib/features/api-store.d.ts
|
|
713
|
-
type ApiResult<T = any> = {
|
|
714
|
-
data?: T;
|
|
715
|
-
error?: string;
|
|
716
|
-
};
|
|
717
|
-
declare class ApiManager {
|
|
718
|
-
readonly rootStore: RootStore;
|
|
719
|
-
/**
|
|
720
|
-
* Pre-filtered agent URLs for the current profile, sent by the parent.
|
|
721
|
-
* Used as fallback for cloud orgs where URLs come from
|
|
722
|
-
* SUPERBLOCKS_UI_AGENT_BASE_URL rather than agent metadata.
|
|
723
|
-
*/
|
|
724
|
-
private _agentUrls;
|
|
725
|
-
/**
|
|
726
|
-
* Full on-premise agent metadata (all profiles) from the parent,
|
|
727
|
-
* enabling local profile-based filtering without a postMessage
|
|
728
|
-
* round-trip. Empty for cloud orgs.
|
|
729
|
-
*/
|
|
730
|
-
private _agents;
|
|
731
|
-
/**
|
|
732
|
-
* DP routing config mapping profile keys to DP URLs, sent by the parent.
|
|
733
|
-
* Only populated when dataPlaneGatewayEnabled is true.
|
|
734
|
-
*/
|
|
735
|
-
private _dpRoutingConfig;
|
|
736
|
-
private token;
|
|
737
|
-
private accessToken;
|
|
738
|
-
private runningApiControllers;
|
|
739
|
-
private waitForInitApiPromise;
|
|
740
|
-
private waitForBootstrapPromise;
|
|
741
|
-
private resolveBootstrapPromise;
|
|
742
|
-
private callContexts;
|
|
743
|
-
constructor(rootStore: RootStore);
|
|
744
|
-
set agentUrls(urls: string[]);
|
|
745
|
-
set agents(agents: AgentInfo[]);
|
|
746
|
-
set dpRoutingConfig(config: Record<string, string>);
|
|
747
|
-
setTokens(token: string, accessToken: string): void;
|
|
748
|
-
isInitialized(): boolean;
|
|
749
|
-
/**
|
|
750
|
-
* Get agent URLs for the given profile by filtering locally stored
|
|
751
|
-
* agent metadata. Falls back to the pre-filtered `_agentUrls` when
|
|
752
|
-
* no full agent metadata is available (cloud orgs or legacy parents).
|
|
753
|
-
*/
|
|
754
|
-
private getAgentUrlsForProfile;
|
|
755
|
-
/**
|
|
756
|
-
* Selects a random agent URL from the available agents and returns it normalized
|
|
757
|
-
* (with trailing slash) to ensure proper URL path joining.
|
|
758
|
-
*/
|
|
759
|
-
private getRandomAgentBaseUrl;
|
|
760
|
-
private awaitInitApiIfNeeded;
|
|
761
|
-
private awaitBootstrapIfNeeded;
|
|
762
|
-
notifyBootstrapComplete(): void;
|
|
763
|
-
loadApiManifest({
|
|
764
|
-
apis
|
|
765
|
-
}: {
|
|
766
|
-
apis?: Record<string, {
|
|
767
|
-
api: DeleteMeLibraryApi;
|
|
768
|
-
scopeId: string;
|
|
769
|
-
}>;
|
|
770
|
-
}): void;
|
|
771
|
-
rerunApiByCallId(callId: string): Promise<ApiResult>;
|
|
772
|
-
runApiByPath({
|
|
773
|
-
path,
|
|
774
|
-
inputs,
|
|
775
|
-
callId,
|
|
776
|
-
callback,
|
|
777
|
-
isTestRun,
|
|
778
|
-
injectedCallerId
|
|
779
|
-
}: {
|
|
780
|
-
path: string;
|
|
781
|
-
inputs: SbApiRunOptions;
|
|
782
|
-
callId?: string;
|
|
783
|
-
callback?: () => Promise<unknown>;
|
|
784
|
-
isTestRun?: boolean;
|
|
785
|
-
injectedCallerId?: string;
|
|
786
|
-
}): Promise<ApiResult>;
|
|
787
|
-
private getHMRCallHash;
|
|
788
|
-
private getCachedHMRExecution;
|
|
789
|
-
private executeApi;
|
|
790
|
-
private executeApiInternal;
|
|
791
|
-
private findError;
|
|
792
|
-
private extractStatusCode;
|
|
793
|
-
/**
|
|
794
|
-
* Extract step-level logs from execution events.
|
|
795
|
-
* Captures console.log (stdout), console.error (stderr), output, and errors for each step.
|
|
796
|
-
*/
|
|
797
|
-
private extractStepLogs;
|
|
798
|
-
/**
|
|
799
|
-
* Execute an SDK API directly via the orchestrator's v3/execute endpoint.
|
|
800
|
-
* Reads execution context (profile, branch, tokens) from rootStore so the
|
|
801
|
-
* caller doesn't need to resolve them through the parent frame.
|
|
802
|
-
*/
|
|
803
|
-
executeSdkApiV3(apiName: string, inputs: Record<string, unknown>, options?: {
|
|
804
|
-
signal?: AbortSignal;
|
|
805
|
-
}): Promise<{
|
|
806
|
-
success: boolean;
|
|
807
|
-
output?: unknown;
|
|
808
|
-
error?: {
|
|
809
|
-
code: string;
|
|
810
|
-
message: string;
|
|
811
|
-
};
|
|
812
|
-
diagnostics?: unknown[];
|
|
813
|
-
}>;
|
|
814
|
-
cancelApi(apiName: string, _scopeId?: string): Promise<void>;
|
|
815
|
-
}
|
|
816
|
-
//#endregion
|
|
817
|
-
//#region src/edit-mode/runtime-graph/types.d.ts
|
|
818
|
-
type ComponentNode = {
|
|
819
|
-
selectorId: SbSelector;
|
|
820
|
-
sourceId: SbElement;
|
|
821
|
-
type: any;
|
|
822
|
-
isSbComponent: boolean;
|
|
823
|
-
isHtmlElement: boolean;
|
|
824
|
-
noSelect?: boolean;
|
|
825
|
-
props?: Record<string, unknown>;
|
|
826
|
-
firstRenderedTag: SbSelector | undefined;
|
|
827
|
-
nearestSelectableAncestor: SbSelector | undefined;
|
|
828
|
-
displayName: string;
|
|
829
|
-
};
|
|
830
|
-
//#endregion
|
|
831
|
-
//#region src/edit-mode/features/runtime-tracking-store.d.ts
|
|
832
|
-
declare class RuntimeTrackingStore {
|
|
833
|
-
readonly editStore: EditStore | undefined;
|
|
834
|
-
constructor(editStore: EditStore | undefined);
|
|
835
|
-
private graph;
|
|
836
|
-
private jsxNodes;
|
|
837
|
-
private sourceNodes;
|
|
838
|
-
private disabledComponents;
|
|
839
|
-
registerComponent(selectorId: SbSelector, params: {
|
|
840
|
-
sourceId: SbElement;
|
|
841
|
-
type: any;
|
|
842
|
-
parentSelectorId?: SbSelector;
|
|
843
|
-
isSbComponent: boolean;
|
|
844
|
-
isHtmlElement: boolean;
|
|
845
|
-
noSelect?: boolean;
|
|
846
|
-
}): void;
|
|
847
|
-
getDisplayName(selectorId: SbSelector): string;
|
|
848
|
-
unregisterComponent(selectorId: SbSelector): void;
|
|
849
|
-
getFirstAnchorableTag(selectorId: SbSelector): SbSelector | undefined;
|
|
850
|
-
getNearestSelectableAncestor(selectorId: SbSelector, skipSelf?: boolean): SbSelector | undefined;
|
|
851
|
-
updatePropsForComponent(selectorId: SbSelector, props: Record<string, unknown>): void;
|
|
852
|
-
getComponent(selectorId: SbSelector): ComponentNode | undefined;
|
|
853
|
-
getComponentParent(selectorId: SbSelector): SbSelector;
|
|
854
|
-
getComponentChildren(selectorId: SbSelector): SbSelector[];
|
|
855
|
-
getSelectorIdsForSourceId(sourceId: SbElement): Set<SbSelector>;
|
|
856
|
-
getSourceId(selectorId: SbSelector): SbElement | undefined;
|
|
857
|
-
getClosestAncestorByType(selectorId: SbSelector, type: string): SbSelector | undefined;
|
|
858
|
-
hasRenderedNodes(): boolean;
|
|
859
|
-
getDisabledComponents(): SbSelector[];
|
|
860
|
-
/**
|
|
861
|
-
* Given a selectorId that represents a DOM element, walks up the component tree
|
|
862
|
-
* to find the outermost registered component whose firstRenderedTag matches this selectorId.
|
|
863
|
-
* This is used to select the component when clicking on its root DOM element.
|
|
864
|
-
*
|
|
865
|
-
* IMPORTANT: This only returns a component if the anchorSelectorId is the IMMEDIATE parent
|
|
866
|
-
* of the component (i.e., the component doesn't have any intermediate nodes between itself
|
|
867
|
-
* and the anchor). This prevents inner HTML elements from being treated as component roots.
|
|
868
|
-
*
|
|
869
|
-
* ONLY returns registered components (isSbComponent: true). Unregistered wrapper components
|
|
870
|
-
* are treated as transparent and skipped.
|
|
871
|
-
*
|
|
872
|
-
* Returns undefined if no registered component has this as its firstRenderedTag.
|
|
873
|
-
*/
|
|
874
|
-
getOutermostComponentForFirstRenderedTag(anchorSelectorId: SbSelector): SbSelector | undefined;
|
|
875
|
-
}
|
|
876
|
-
//#endregion
|
|
877
|
-
//#region src/edit-mode/features/ai-store.d.ts
|
|
878
|
-
declare class AiManager {
|
|
879
|
-
private readonly runtimeTrackingStore;
|
|
880
|
-
private _isTaggingEnabled;
|
|
881
|
-
private _isEditing;
|
|
882
|
-
private _editingComponents;
|
|
883
|
-
private _contextMode;
|
|
884
|
-
private _targetedComponents;
|
|
885
|
-
private _targetedSelectors;
|
|
886
|
-
private _hasHadSuccessfulBuild;
|
|
887
|
-
private _hasEverHadSuccessfulBuild;
|
|
888
|
-
constructor(runtimeTrackingStore: RuntimeTrackingStore);
|
|
889
|
-
getIsTaggingEnabled(): boolean;
|
|
890
|
-
getIsEditing(): boolean;
|
|
891
|
-
getShouldShowLoader(): boolean;
|
|
892
|
-
setIsTaggingEnabled(isTaggingEnabled: boolean): void;
|
|
893
|
-
getAiContextMode(): AiContextMode;
|
|
894
|
-
shouldToggleComponentInAiContext(): boolean;
|
|
895
|
-
getTargetedComponents(): `SB-${string}`[];
|
|
896
|
-
getTargetedSelectors(): `S-${string}`[];
|
|
897
|
-
isEditingComponent(id: SbElement): boolean;
|
|
898
|
-
isTargetingComponent(id: SbElement): boolean;
|
|
899
|
-
startEditing(): void;
|
|
900
|
-
setEditingComponents(components: SbElement[]): void;
|
|
901
|
-
finishEditing(): void;
|
|
902
|
-
setAiContextMode(mode: AiContextMode, components?: {
|
|
903
|
-
id: SbElement;
|
|
904
|
-
selectorId?: SbSelector;
|
|
905
|
-
}[]): void;
|
|
906
|
-
addTargetedSelector(selectorId: SbSelector): void;
|
|
907
|
-
toggleTargetedSelector(selectorId: SbSelector): void;
|
|
908
|
-
isTargetedSelector(selectorId: SbSelector): boolean;
|
|
909
|
-
/**
|
|
910
|
-
* Returns true if we are targeting a different selector of the same source id, since in some cases we want to keep
|
|
911
|
-
* the same source targeted, but just highlight another selector of it
|
|
912
|
-
*/
|
|
913
|
-
isAlternateSourceIdTarget(sourceId: SbElement, selectorId: SbSelector): boolean;
|
|
914
|
-
handleRuntimeError(data: RuntimeErrorData): void;
|
|
915
|
-
clearRuntimeError(id: string): void;
|
|
916
|
-
markFirstBuildSuccess(): void;
|
|
917
|
-
private notifyLoaderState;
|
|
918
|
-
private removeAllSharedSelectors;
|
|
919
|
-
private removeAllSelectorsForSource;
|
|
920
|
-
}
|
|
921
|
-
//#endregion
|
|
922
|
-
//#region src/edit-mode/features/connection-manager.d.ts
|
|
923
|
-
type ConnectionStatus = "pre-init" | "disconnected" | "connecting" | "connected";
|
|
924
|
-
declare class ConnectionManager {
|
|
925
|
-
connectionStatus: ConnectionStatus;
|
|
926
|
-
constructor();
|
|
927
|
-
initializeSocket(): void;
|
|
928
|
-
connect(): void;
|
|
929
|
-
disconnect(): void;
|
|
930
|
-
}
|
|
931
|
-
//#endregion
|
|
932
|
-
//#region src/edit-mode/features/operation-store.d.ts
|
|
933
|
-
type OptimisticOperation<P> = {
|
|
934
|
-
type: keyof EditOperations;
|
|
935
|
-
payload: P;
|
|
936
|
-
id: string;
|
|
937
|
-
callback?: () => void;
|
|
938
|
-
};
|
|
939
|
-
type ReparentTransaction = OptimisticOperation<ReparentRequest>;
|
|
940
|
-
type SetPropertiesTransaction = OptimisticOperation<SetPropertiesRequest>;
|
|
941
|
-
type SetPropertyTransaction = OptimisticOperation<SetPropertyRequest>;
|
|
942
|
-
type CreateComponentTransaction = OptimisticOperation<CreateRequest>;
|
|
943
|
-
type DeleteComponentsTransaction = OptimisticOperation<DeleteRequest>;
|
|
944
|
-
type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction | CreateComponentTransaction | DeleteComponentsTransaction;
|
|
945
|
-
declare class OperationManager {
|
|
946
|
-
private pendingTransactions;
|
|
947
|
-
private waitingForBatch;
|
|
948
|
-
private batchOperations;
|
|
949
|
-
private batchOperationTransactionId;
|
|
950
|
-
visibleSourceIds: string[];
|
|
951
|
-
constructor();
|
|
952
|
-
get allPendingTransactions(): PendingTransaction[];
|
|
953
|
-
get pendingDeleteOperations(): DeleteComponentsTransaction[];
|
|
954
|
-
get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
|
|
955
|
-
get hasPendingOperations(): boolean;
|
|
956
|
-
get allNames(): never[];
|
|
957
|
-
private executeOrAddToBatch;
|
|
958
|
-
private addPendingTransaction;
|
|
959
|
-
clearPendingTransactions(transactionIds: string[]): void;
|
|
960
|
-
batchUpdate(performOperations: () => void): void;
|
|
961
|
-
createComponent(payload: CreateRequest): void;
|
|
962
|
-
dropComponent(action: {
|
|
963
|
-
from: {
|
|
964
|
-
source: SourceLocation;
|
|
965
|
-
};
|
|
966
|
-
to: {
|
|
967
|
-
source: SourceLocation;
|
|
968
|
-
};
|
|
969
|
-
propsToChange?: Record<string, PropertyInfo>;
|
|
970
|
-
}): void;
|
|
971
|
-
deleteComponents(sourceIds: SbElement[]): void;
|
|
972
|
-
acknowledgeEditOperation(operation: EditOperationPayload<EditOperationType>): void;
|
|
973
|
-
writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
|
|
974
|
-
setWidgetProperties({
|
|
975
|
-
sourceId,
|
|
976
|
-
properties,
|
|
977
|
-
callback
|
|
978
|
-
}: {
|
|
979
|
-
sourceId: SbElement;
|
|
980
|
-
properties: Record<string, PropertyInfo<unknown>>;
|
|
981
|
-
callback?: () => void;
|
|
982
|
-
}): void;
|
|
983
|
-
setWidgetProperty({
|
|
984
|
-
sourceId,
|
|
985
|
-
property,
|
|
986
|
-
value,
|
|
987
|
-
callback
|
|
988
|
-
}: {
|
|
989
|
-
sourceId: SbElement;
|
|
990
|
-
property: string;
|
|
991
|
-
value: PropertyInfo<unknown>;
|
|
992
|
-
callback?: () => void;
|
|
993
|
-
}): void;
|
|
994
|
-
ensureFilesSynced(): Promise<void>;
|
|
995
|
-
generateSourceId(): `SB-${string}`;
|
|
996
|
-
}
|
|
997
|
-
//#endregion
|
|
998
|
-
//#region src/edit-mode/features/properties-panel-manager.d.ts
|
|
999
|
-
declare class PropertiesPanelManager {
|
|
1000
|
-
readonly editStore: EditStore;
|
|
1001
|
-
readonly componentsManager: ComponentRegistry;
|
|
1002
|
-
private propertiesDefinitions;
|
|
1003
|
-
private propertiesPanelTrackerDisposer;
|
|
1004
|
-
private _propertyLookupCache;
|
|
1005
|
-
private removeHotReloadListener;
|
|
1006
|
-
constructor(editStore: EditStore, componentsManager: ComponentRegistry);
|
|
1007
|
-
getPropertiesPanel(selectorId: SbSelector): PropertiesPanelDefinition$1;
|
|
1008
|
-
trackPropertiesPanel(selectorId: SbSelector): void;
|
|
1009
|
-
untrackPropertiesPanel(): void;
|
|
1010
|
-
getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
|
|
1011
|
-
setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
|
|
1012
|
-
updatePropertiesDefinitionForType(type: string): void;
|
|
1013
|
-
computeAndApplySideEffectsForPropertyUpdate(payload: {
|
|
1014
|
-
sourceId: SbElement;
|
|
1015
|
-
updates: Record<string, PropertyInfo<unknown>>;
|
|
1016
|
-
}): Record<SbElement, Record<string, PropertyInfo<unknown>>>;
|
|
1017
|
-
/**
|
|
1018
|
-
* When a custom component's source code is updated, we want to update the properties definition for that component.
|
|
1019
|
-
* 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
|
|
1020
|
-
* because Vite just compiled all of those out in library builds, so we inject a listener from the plugin instead.
|
|
1021
|
-
* https://github.com/vitejs/vite/blob/v6.2/packages/vite/src/node/plugins/define.ts#L37
|
|
1013
|
+
input: Record<string, unknown>;
|
|
1014
|
+
};
|
|
1015
|
+
/**
|
|
1016
|
+
* Notify the parent when an SDK API execution completes successfully.
|
|
1022
1017
|
*/
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
sourceId: SbElement;
|
|
1030
|
-
dragStartX: number;
|
|
1031
|
-
dragStartY: number;
|
|
1032
|
-
start: {
|
|
1033
|
-
width: number;
|
|
1034
|
-
height: number;
|
|
1018
|
+
"sdk-api-execution-completed": {
|
|
1019
|
+
executionId: string;
|
|
1020
|
+
apiName: string;
|
|
1021
|
+
output: unknown;
|
|
1022
|
+
durationMs: number;
|
|
1023
|
+
diagnostics?: unknown[];
|
|
1035
1024
|
};
|
|
1036
|
-
resizedPosition: string;
|
|
1037
|
-
widthToUpdate: Dim | null;
|
|
1038
|
-
heightToUpdate: Dim | null;
|
|
1039
|
-
isApplyingResize: boolean;
|
|
1040
|
-
};
|
|
1041
|
-
declare class ResizingManager {
|
|
1042
|
-
private root;
|
|
1043
|
-
private _activeResizes;
|
|
1044
|
-
constructor(root: RootStore);
|
|
1045
|
-
get activeResize(): ResizeState | null | undefined;
|
|
1046
|
-
private isLockedAspectRatio;
|
|
1047
|
-
startResizing(dragStartX: number, dragStartY: number, selectorId: SbSelector, position: string): void;
|
|
1048
|
-
private calculateDimension;
|
|
1049
|
-
private handleResizeDimension;
|
|
1050
|
-
resizeWidget(currentX: number, currentY: number, selectorId: SbSelector, canResizeWidth: boolean, canResizeHeight: boolean): void;
|
|
1051
|
-
pendingResize(sourceId: SbElement): {
|
|
1052
|
-
width: Dim | null;
|
|
1053
|
-
height: Dim | null;
|
|
1054
|
-
} | null;
|
|
1055
|
-
get hasAnyPendingResize(): boolean;
|
|
1056
|
-
get pendingResizes(): ResizeState[];
|
|
1057
|
-
applyResize(selectorId: SbSelector): void;
|
|
1058
|
-
}
|
|
1059
|
-
//#endregion
|
|
1060
|
-
//#region src/edit-mode/features/ui-store.d.ts
|
|
1061
|
-
declare class UIStore {
|
|
1062
|
-
readonly root: RootStore;
|
|
1063
|
-
readonly editStore: EditStore;
|
|
1064
|
-
resizing: ResizingManager;
|
|
1065
|
-
private _selectedSourceIds;
|
|
1066
|
-
private _selectedSelectorIds;
|
|
1067
|
-
private _focusedSelectorId;
|
|
1068
|
-
private _rootInstanceData;
|
|
1069
|
-
private newComponentSelectPromise;
|
|
1070
|
-
constructor(root: RootStore, editStore: EditStore);
|
|
1071
|
-
getMostRelevantSelectorIdsForSourceId(sourceId: SbElement): SbSelector[];
|
|
1072
|
-
isSourceSelected(sourceId: SbElement): boolean;
|
|
1073
|
-
getSelectedSourceIds(): SbElement[];
|
|
1074
|
-
getSelectedSelectorIds(): SbSelector[];
|
|
1075
|
-
private get focusedSelectorId();
|
|
1076
|
-
getFocusedSourceId(): SbElement | null;
|
|
1077
|
-
getFocusedSelectorId(): SbSelector | null;
|
|
1078
|
-
setSelectedSourceIds(sourceIds: SbElement[]): void;
|
|
1079
|
-
private subscribeNewSourceIdsToRuntimeSync;
|
|
1080
|
-
setSelectedSelectorIds(selectorIds: SbSelector[]): void;
|
|
1081
|
-
setFocusedIds(selectorId: SbSelector | null): void;
|
|
1082
|
-
selectWidget(selectorId: SbSelector | null, _addToSelection?: boolean): void;
|
|
1083
1025
|
/**
|
|
1084
|
-
*
|
|
1085
|
-
* instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
|
|
1086
|
-
* are assigned by the source tracker.
|
|
1087
|
-
*
|
|
1088
|
-
* If _any_ other selection comes in before we select something, we will cancel this reaction
|
|
1026
|
+
* Notify the parent when an SDK API execution fails.
|
|
1089
1027
|
*/
|
|
1090
|
-
|
|
1091
|
-
|
|
1028
|
+
"sdk-api-execution-failed": {
|
|
1029
|
+
executionId: string;
|
|
1030
|
+
apiName: string;
|
|
1031
|
+
error: {
|
|
1032
|
+
code: string;
|
|
1033
|
+
message: string;
|
|
1034
|
+
};
|
|
1035
|
+
durationMs: number;
|
|
1036
|
+
diagnostics?: unknown[];
|
|
1037
|
+
};
|
|
1038
|
+
} & AppToEditorMessage<PropertiesPanelDefinition$1>;
|
|
1039
|
+
type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
|
|
1092
1040
|
//#endregion
|
|
1093
|
-
//#region src/
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
private subscribedSourceIds;
|
|
1103
|
-
constructor(editStore: EditStore);
|
|
1104
|
-
subscribe(sourceId: SbElement): void;
|
|
1105
|
-
unsubscribe(sourceId: SbElement): void;
|
|
1106
|
-
clearAll(): void;
|
|
1107
|
-
get subscriptions(): Record<SbElement, RuntimeSyncComposite | null>;
|
|
1041
|
+
//#region src/lib/internal-details/location-store.d.ts
|
|
1042
|
+
declare class LocationStore {
|
|
1043
|
+
route?: RouteInfo;
|
|
1044
|
+
rootStore: RootStore;
|
|
1045
|
+
constructor(rootStore: RootStore);
|
|
1046
|
+
updateLocation(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): void;
|
|
1047
|
+
sendLocationToEditor(): void;
|
|
1048
|
+
private matchesToRoutePattern;
|
|
1049
|
+
locationToRouteInfo(location: Location, routes: DataRouter["routes"], params: Readonly<Params<string>>): RouteInfo | undefined;
|
|
1108
1050
|
}
|
|
1109
1051
|
//#endregion
|
|
1110
|
-
//#region src/
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1052
|
+
//#region src/lib/internal-details/lib/features/api-store.d.ts
|
|
1053
|
+
type ApiResult<T = any> = {
|
|
1054
|
+
data?: T;
|
|
1055
|
+
error?: string;
|
|
1056
|
+
};
|
|
1057
|
+
declare class ApiManager {
|
|
1058
|
+
readonly rootStore: RootStore;
|
|
1059
|
+
/**
|
|
1060
|
+
* Pre-filtered agent URLs for the current profile, sent by the parent.
|
|
1061
|
+
* Used as fallback for cloud orgs where URLs come from
|
|
1062
|
+
* SUPERBLOCKS_UI_AGENT_BASE_URL rather than agent metadata.
|
|
1063
|
+
*/
|
|
1064
|
+
private _agentUrls;
|
|
1065
|
+
/**
|
|
1066
|
+
* Full on-premise agent metadata (all profiles) from the parent,
|
|
1067
|
+
* enabling local profile-based filtering without a postMessage
|
|
1068
|
+
* round-trip. Empty for cloud orgs.
|
|
1069
|
+
*/
|
|
1070
|
+
private _agents;
|
|
1071
|
+
/**
|
|
1072
|
+
* DP routing config mapping profile keys to DP URLs, sent by the parent.
|
|
1073
|
+
* Only populated when dataPlaneGatewayEnabled is true.
|
|
1074
|
+
*/
|
|
1075
|
+
private _dpRoutingConfig;
|
|
1076
|
+
private token;
|
|
1077
|
+
private accessToken;
|
|
1078
|
+
private runningApiControllers;
|
|
1079
|
+
private waitForInitApiPromise;
|
|
1080
|
+
private waitForBootstrapPromise;
|
|
1081
|
+
private resolveBootstrapPromise;
|
|
1082
|
+
private callContexts;
|
|
1132
1083
|
constructor(rootStore: RootStore);
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1084
|
+
set agentUrls(urls: string[]);
|
|
1085
|
+
set agents(agents: AgentInfo[]);
|
|
1086
|
+
set dpRoutingConfig(config: Record<string, string>);
|
|
1087
|
+
setTokens(token: string, accessToken: string): void;
|
|
1088
|
+
isInitialized(): boolean;
|
|
1089
|
+
/**
|
|
1090
|
+
* Get agent URLs for the given profile by filtering locally stored
|
|
1091
|
+
* agent metadata. Falls back to the pre-filtered `_agentUrls` when
|
|
1092
|
+
* no full agent metadata is available (cloud orgs or legacy parents).
|
|
1093
|
+
*/
|
|
1094
|
+
private getAgentUrlsForProfile;
|
|
1095
|
+
/**
|
|
1096
|
+
* Selects a random agent URL from the available agents and returns it normalized
|
|
1097
|
+
* (with trailing slash) to ensure proper URL path joining.
|
|
1098
|
+
*/
|
|
1099
|
+
private getRandomAgentBaseUrl;
|
|
1100
|
+
private awaitInitApiIfNeeded;
|
|
1101
|
+
private awaitBootstrapIfNeeded;
|
|
1102
|
+
notifyBootstrapComplete(): void;
|
|
1103
|
+
loadApiManifest({
|
|
1104
|
+
apis
|
|
1105
|
+
}: {
|
|
1106
|
+
apis?: Record<string, {
|
|
1107
|
+
api: DeleteMeLibraryApi;
|
|
1108
|
+
scopeId: string;
|
|
1109
|
+
}>;
|
|
1147
1110
|
}): void;
|
|
1111
|
+
rerunApiByCallId(callId: string): Promise<ApiResult>;
|
|
1112
|
+
runApiByPath({
|
|
1113
|
+
path,
|
|
1114
|
+
inputs,
|
|
1115
|
+
callId,
|
|
1116
|
+
callback,
|
|
1117
|
+
isTestRun,
|
|
1118
|
+
injectedCallerId
|
|
1119
|
+
}: {
|
|
1120
|
+
path: string;
|
|
1121
|
+
inputs: SbApiRunOptions;
|
|
1122
|
+
callId?: string;
|
|
1123
|
+
callback?: () => Promise<unknown>;
|
|
1124
|
+
isTestRun?: boolean;
|
|
1125
|
+
injectedCallerId?: string;
|
|
1126
|
+
}): Promise<ApiResult>;
|
|
1127
|
+
private getHMRCallHash;
|
|
1128
|
+
private getCachedHMRExecution;
|
|
1129
|
+
private executeApi;
|
|
1130
|
+
private executeApiInternal;
|
|
1131
|
+
private findError;
|
|
1132
|
+
private extractStatusCode;
|
|
1133
|
+
/**
|
|
1134
|
+
* Extract step-level logs from execution events.
|
|
1135
|
+
* Captures console.log (stdout), console.error (stderr), output, and errors for each step.
|
|
1136
|
+
*/
|
|
1137
|
+
private extractStepLogs;
|
|
1138
|
+
/**
|
|
1139
|
+
* Execute an SDK API directly via the orchestrator's v3/execute endpoint.
|
|
1140
|
+
* Reads execution context (profile, branch, tokens) from rootStore so the
|
|
1141
|
+
* caller doesn't need to resolve them through the parent frame.
|
|
1142
|
+
*/
|
|
1143
|
+
executeSdkApiV3(apiName: string, inputs: Record<string, unknown>, options?: {
|
|
1144
|
+
signal?: AbortSignal;
|
|
1145
|
+
}): Promise<{
|
|
1146
|
+
success: boolean;
|
|
1147
|
+
output?: unknown;
|
|
1148
|
+
error?: {
|
|
1149
|
+
code: string;
|
|
1150
|
+
message: string;
|
|
1151
|
+
};
|
|
1152
|
+
diagnostics?: unknown[];
|
|
1153
|
+
}>;
|
|
1154
|
+
cancelApi(apiName: string, _scopeId?: string): Promise<void>;
|
|
1148
1155
|
}
|
|
1149
1156
|
//#endregion
|
|
1150
1157
|
//#region src/lib/internal-details/lib/root-store.d.ts
|
|
@@ -1392,12 +1399,6 @@ type SbComponentProps<El = HTMLElement> = {
|
|
|
1392
1399
|
loading?: boolean;
|
|
1393
1400
|
} & Omit<React.HTMLAttributes<El>, "height" | "width">;
|
|
1394
1401
|
//#endregion
|
|
1395
|
-
//#region src/lib/internal-details/lib/evaluator/entity-types.d.ts
|
|
1396
|
-
type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = T extends Callback ? Callback<ARGS> : T;
|
|
1397
|
-
type NestedInputProp<T, ARGS extends any[] = any[]> = T extends object ? { [K in keyof T]: SingleInputProp<T[K], ARGS> | NestedInputProp<T[K], ARGS> } : never;
|
|
1398
|
-
type InputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = SingleInputProp<T, ARGS> | NestedInputProp<T, ARGS>;
|
|
1399
|
-
type EntityFunction<ARGS extends any[] = any[], R = EntityOutputProp> = (this: Entity, ...ARGS: ARGS) => R;
|
|
1400
|
-
//#endregion
|
|
1401
1402
|
//#region src/lib/user-facing/properties-panel/props-builder.d.ts
|
|
1402
1403
|
type Exact<T, Shape> = T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? T : never : never;
|
|
1403
1404
|
type ManagedProp<T extends DataType = DataType> = PropertyForData<T> & {
|