@superblocksteam/library 2.0.55 → 2.0.56-next.1

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.
Files changed (37) hide show
  1. package/dist/{build-manifest-BNJahcH4.js → build-manifest-DZwcz6uX.js} +1 -1
  2. package/dist/{build-manifest-BNJahcH4.js.map → build-manifest-DZwcz6uX.js.map} +1 -1
  3. package/dist/{devtools-consolidated-BJ2tPWBk.js → devtools-consolidated-Dm9AFGZs.js} +2 -2
  4. package/dist/{devtools-consolidated-BJ2tPWBk.js.map → devtools-consolidated-Dm9AFGZs.js.map} +1 -1
  5. package/dist/{early-console-buffer-Bd5jqqBJ.js → early-console-buffer-SSPd-jq2.js} +1 -1
  6. package/dist/{early-console-buffer-Bd5jqqBJ.js.map → early-console-buffer-SSPd-jq2.js.map} +1 -1
  7. package/dist/jsx-dev-runtime/index.d.ts +14 -0
  8. package/dist/jsx-dev-runtime/index.d.ts.map +1 -0
  9. package/dist/jsx-dev-runtime/index.js +329 -0
  10. package/dist/jsx-dev-runtime/index.js.map +1 -0
  11. package/dist/jsx-runtime/index.d.ts +7 -0
  12. package/dist/jsx-runtime/index.d.ts.map +1 -0
  13. package/dist/jsx-runtime/index.js +10 -0
  14. package/dist/jsx-runtime/index.js.map +1 -0
  15. package/dist/{index.css → lib/index.css} +17 -11
  16. package/dist/lib/index.css.map +1 -0
  17. package/dist/lib/index.d.ts +786 -0
  18. package/dist/lib/index.d.ts.map +1 -0
  19. package/dist/lib/index.js +5007 -0
  20. package/dist/lib/index.js.map +1 -0
  21. package/dist/{logs-BA3qqo2m.js → logs-CgCPS9qr.js} +2 -2
  22. package/dist/{logs-BA3qqo2m.js.map → logs-CgCPS9qr.js.map} +1 -1
  23. package/dist/{utils-xmrGF_mk.js → utils-AzBGeVXo.js} +1 -1
  24. package/dist/{utils-xmrGF_mk.js.map → utils-AzBGeVXo.js.map} +1 -1
  25. package/dist/utils-DR35eYvX.js +3 -0
  26. package/dist/widget-wrapper-naming-DxFT8zmk.js +3068 -0
  27. package/dist/widget-wrapper-naming-DxFT8zmk.js.map +1 -0
  28. package/package.json +27 -14
  29. package/dist/index.css.map +0 -1
  30. package/dist/index.d.ts +0 -1339
  31. package/dist/index.d.ts.map +0 -1
  32. package/dist/index.js +0 -11471
  33. package/dist/index.js.map +0 -1
  34. package/dist/root-store-Cc3dO2jP.js +0 -4721
  35. package/dist/root-store-Cc3dO2jP.js.map +0 -1
  36. package/dist/root-store-xviorlO5.js +0 -4
  37. package/dist/utils-BVE4VhSk.js +0 -3
@@ -0,0 +1,786 @@
1
+ import { EditorConfig, EvaluateOrValueComputedArgs, Property, TailwindPropertyKey } from "@superblocksteam/library-shared";
2
+ import React$1, { LegacyRef, ReactNode } from "react";
3
+ 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";
5
+ 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";
7
+ import { XYCoord } from "react-dnd";
8
+
9
+ //#region src/lib/internal-details/superblocks-context.d.ts
10
+ type User = {
11
+ name: string;
12
+ email: string;
13
+ id: string;
14
+ groups: Group[];
15
+ username: string;
16
+ metadata: Record<string, unknown>;
17
+ };
18
+ type Group = {
19
+ id: string;
20
+ name: string;
21
+ size: number;
22
+ };
23
+ type Profiles = {
24
+ available: Profile[];
25
+ selected?: Profile;
26
+ default: Profile;
27
+ };
28
+ declare class SuperblocksAppContext {
29
+ private context?;
30
+ constructor();
31
+ get user(): User | undefined;
32
+ get groups(): Group[] | undefined;
33
+ get selectedProfile(): Profile | undefined;
34
+ get profiles(): Profiles | undefined;
35
+ setProfile(profileName: string): void;
36
+ updateContext(context: Partial<SuperblocksAppContext>): void;
37
+ }
38
+ declare function useSuperblocksUser(): User | undefined;
39
+ declare function useSuperblocksGroups(): Group[] | undefined;
40
+ declare function useSuperblocksProfiles(): {
41
+ profiles: Profiles | undefined;
42
+ setProfile: (profileName: string) => void;
43
+ };
44
+ //#endregion
45
+ //#region src/lib/user-facing/sb-provider.d.ts
46
+ declare const SbProvider: ({
47
+ name,
48
+ children,
49
+ className,
50
+ context
51
+ }: {
52
+ name?: string;
53
+ children?: React$1.ReactNode;
54
+ className?: string;
55
+ context?: SuperblocksAppContext;
56
+ }) => react_jsx_runtime0.JSX.Element;
57
+ //#endregion
58
+ //#region src/lib/internal-details/lib/types.d.ts
59
+ type ExecutionError = {
60
+ name?: string;
61
+ message: string;
62
+ formPath: string;
63
+ blockPath: string;
64
+ handled?: boolean;
65
+ };
66
+ type ExecutionEventRequest = {
67
+ summary: string;
68
+ metadata: {
69
+ placeHoldersInfo?: Record<string, PlaceholderInfo>;
70
+ };
71
+ };
72
+ type Resolutions = Record<string,
73
+ // name of the field: eg: "range", for the range field let's say the code is {{[1,2,3]}}
74
+ {
75
+ value: any;
76
+ bindings: any[];
77
+ }>;
78
+ type ExecutionEvent = {
79
+ name: string;
80
+ type: string;
81
+ timestamp: string;
82
+ start?: Record<string, unknown>;
83
+ end?: {
84
+ performance?: {
85
+ start: string | number;
86
+ finish: string | number;
87
+ total: string | number;
88
+ execution: string | number;
89
+ overhead: string | number;
90
+ };
91
+ error?: ExecutionError;
92
+ output?: {
93
+ result?: any;
94
+ request?: string;
95
+ requestV2?: ExecutionEventRequest;
96
+ stdout?: Array<string>;
97
+ stderr?: Array<string>;
98
+ };
99
+ resolved?: Resolutions;
100
+ };
101
+ parent: string;
102
+ };
103
+ interface StreamEvent {
104
+ result: {
105
+ event: ExecutionEvent;
106
+ execution: string;
107
+ };
108
+ }
109
+ type RouteChangePayload = Omit<UrlState, "host" | "hostname" | "href" | "pathname" | "port" | "protocol">;
110
+ type AiUpdatesPayload = {
111
+ parentToChild: {
112
+ type: "start-editing";
113
+ components?: SbElement[];
114
+ } | {
115
+ type: "finish-editing";
116
+ } | {
117
+ type: "update-editing-entities";
118
+ components: SbElement[];
119
+ } | {
120
+ type: "set-ai-context-mode";
121
+ mode: AiContextMode;
122
+ components?: SbElement[];
123
+ } | {
124
+ type: "set-tagging-enabled";
125
+ isTaggingEnabled: boolean;
126
+ };
127
+ childToParent: {
128
+ type: "add-component-to-context";
129
+ component: SbElement;
130
+ } | {
131
+ type: "toggle-component-in-context";
132
+ component: SbElement;
133
+ label?: string;
134
+ } | {
135
+ type: "set-ai-context-mode";
136
+ mode: AiContextMode;
137
+ } | {
138
+ type: "ai-generate";
139
+ prompt: string;
140
+ } | {
141
+ type: "loader-state";
142
+ shouldShowLoader: boolean;
143
+ };
144
+ };
145
+ type FromParentToChildMessageTypesMap = {
146
+ "sb-init": {
147
+ peerId: string;
148
+ userId?: string;
149
+ appId: string;
150
+ sessionRecordingKey?: string;
151
+ interactionMode?: InteractionMode;
152
+ /** The value of the authorization header on requests to the dev server. */
153
+ devServerAuthorization: string | undefined;
154
+ aiState?: {
155
+ generationState: AiGenerationState;
156
+ editingComponents: SbElement[];
157
+ };
158
+ };
159
+ "sb-bootstrap-response": {
160
+ userId?: string;
161
+ appId: string;
162
+ token: string;
163
+ accessToken: string;
164
+ /** @deprecated Use agentUrls instead */
165
+ agentUrl?: string;
166
+ agentUrls: string[];
167
+ logContext: Record<string, unknown>;
168
+ featureFlags?: Record<string, unknown>;
169
+ sessionRecordingKey?: string;
170
+ };
171
+ "sb-editor-request-bootstrap": void;
172
+ "sb-update-active-agents": {
173
+ agentUrls: string[];
174
+ };
175
+ "sb-update-property-with-effects": {
176
+ sourceId: string;
177
+ callbackId: string;
178
+ updates: Record<string, PropertyInfo<unknown>>;
179
+ transaction: TransactionInfo;
180
+ };
181
+ "sb-edit-operation-acknowledge": EditOperationPayload<EditOperationType>;
182
+ "sb-retrieve-property-panel-props": {
183
+ sourceId: string;
184
+ };
185
+ "sb-global-sync": {
186
+ global: Record<string, unknown>;
187
+ };
188
+ "parent-action-batch": PayloadAction<unknown>[];
189
+ click: void;
190
+ "register-keypress": {
191
+ keys: string;
192
+ options?: any;
193
+ };
194
+ "canvas-scale-update": {
195
+ canvasScaleFactor: number;
196
+ };
197
+ "resolve-promise": unknown;
198
+ "reject-promise": unknown;
199
+ "flash-element": {
200
+ elementId: string;
201
+ };
202
+ "set-theme": {
203
+ theme: unknown;
204
+ updateRedux?: boolean;
205
+ storedTypographies?: unknown;
206
+ };
207
+ getDropTarget: {
208
+ parentId: string;
209
+ };
210
+ keypress: {
211
+ keys: string;
212
+ eventInfo: {
213
+ code: string;
214
+ key: string;
215
+ altKey: boolean;
216
+ ctrlKey: boolean;
217
+ shiftKey: boolean;
218
+ };
219
+ };
220
+ dragstart: Record<string, unknown> & {
221
+ type: string;
222
+ };
223
+ "sb-create-component": {
224
+ componentType: string;
225
+ parent: SourceLocation;
226
+ scopeName: string;
227
+ baseProperties?: Record<string, PropertyInfo>;
228
+ skipSecondaryComponentsCreation?: boolean;
229
+ otherComponentsUpdates?: Record<SbElement, Record<string, PropertyInfo>>;
230
+ };
231
+ "set-interaction-mode": {
232
+ interactionMode: InteractionMode;
233
+ };
234
+ /**
235
+ * Request a route change in the child
236
+ */
237
+ "route-change": RouteChangePayload;
238
+ "ai-updates": AiUpdatesPayload["parentToChild"];
239
+ /**
240
+ * Runtime sync: subscribe and unsubscribe to component updates
241
+ */
242
+ "runtime/subscribe-component": {
243
+ sourceId: SbElement;
244
+ };
245
+ "runtime/unsubscribe-component": {
246
+ sourceId: SbElement;
247
+ };
248
+ "sb-reload-app": void;
249
+ };
250
+ type FromParentToChildMessageTypes = keyof FromParentToChildMessageTypesMap;
251
+ type FromChildToParentMessageTypesMap = {
252
+ "sb-ready": void;
253
+ "sb-load-error": {
254
+ error: string;
255
+ };
256
+ "iframe-action-batch": PayloadAction<unknown>[];
257
+ /**
258
+ * Navigate the parent window to a new URL
259
+ */
260
+ "navigate-to": {
261
+ url: string;
262
+ newWindow?: boolean;
263
+ };
264
+ "sb-iframe-track-changes": Record<string, unknown>;
265
+ "resolve-promise": unknown;
266
+ "reject-promise": unknown;
267
+ "sb-editor-request-bootstrap": void;
268
+ "reload-configs": void;
269
+ "sb-edit-operation-request": EditOperationPayload<EditOperationType>;
270
+ "client:selectWidgets": {
271
+ sourceIds: SbElement[];
272
+ };
273
+ "set-interaction-mode": {
274
+ interactionMode: InteractionMode;
275
+ };
276
+ getDropTargetResult: {
277
+ offset: XYCoord;
278
+ size: {
279
+ height: number;
280
+ width: number;
281
+ };
282
+ };
283
+ keypress: {
284
+ keys: string;
285
+ eventInfo: {
286
+ code: string;
287
+ key: string;
288
+ altKey: boolean;
289
+ ctrlKey: boolean;
290
+ shiftKey: boolean;
291
+ };
292
+ };
293
+ "register-click": {
294
+ type: string;
295
+ context: {
296
+ clientX: number;
297
+ clientY: number;
298
+ sourceId: string;
299
+ insertionIndexes?: {
300
+ sectionInsertionPosition?: number;
301
+ columnInsertionPosition?: number;
302
+ stackInsertionPosition?: number;
303
+ };
304
+ };
305
+ };
306
+ "api/started-execution": {
307
+ apiName: string;
308
+ };
309
+ "api/set-api-response": {
310
+ apiName: string;
311
+ response: unknown;
312
+ };
313
+ "api/stream-event": {
314
+ event: StreamEvent;
315
+ apiName: string;
316
+ };
317
+ "api/stream-message": {
318
+ message: any;
319
+ apiName: string;
320
+ };
321
+ "authenticate-api-request": {
322
+ apiId: string;
323
+ callbackId: string;
324
+ };
325
+ "set-apis-deployed-mode": {
326
+ apis: Array<DeleteMeLibraryApi & {
327
+ scopeId: string;
328
+ }>;
329
+ callbackId: string;
330
+ };
331
+ /**
332
+ * Notify the parent of a route change
333
+ */
334
+ "route-change": RouteChangePayload;
335
+ "ai-updates": AiUpdatesPayload["childToParent"];
336
+ undo: void;
337
+ redo: void;
338
+ "socket/error": {
339
+ message: string;
340
+ };
341
+ "runtime-error": RuntimeErrorData;
342
+ "clear-runtime-error": {
343
+ id: string;
344
+ };
345
+ "logout-integration": {
346
+ callbackId: string;
347
+ };
348
+ } & AppToEditorMessage<PropertiesPanelDefinition$1>;
349
+ type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
350
+ //#endregion
351
+ //#region src/lib/internal-details/lib/features/component-registry.d.ts
352
+ type DefaultTagNames = {
353
+ container: string;
354
+ button: string;
355
+ text: string;
356
+ };
357
+ //#endregion
358
+ //#region src/lib/internal-details/sb-wrapper.d.ts
359
+ type InjectedProps = {
360
+ dropTargetRef?: React$1.Ref<HTMLElement> | LegacyRef<HTMLElement>;
361
+ };
362
+ type ParentInfo = {
363
+ type?: string;
364
+ };
365
+ interface CreationContext {
366
+ parentInfo: ParentInfo;
367
+ defaultTagNames: DefaultTagNames;
368
+ selfTagName: string;
369
+ generateUniqueName: (prefix: string) => string;
370
+ }
371
+ type PropertyValues<P extends React$1.ComponentProps<any>> = { [K in keyof P]?: PropertyInfo | PropertyValues<P[K]> };
372
+ interface EditorTemplate<P extends React$1.ComponentProps<any> = React$1.ComponentProps<any>> {
373
+ catalog?: Catalog;
374
+ /***
375
+ * Config for the newly created component when added to the canvas from the Editor.
376
+ * @returns a single CreateRequest or an array of CreateRequests.
377
+ *
378
+ * When returning Array<CreateRequests>:
379
+ * - The 1st CreateRequest's type must match the componentType passed to createComponent.
380
+ * - The last CreateRequest's will be the selected component after drag & drop.
381
+ *
382
+ * Example: [Modal, Button]
383
+ * A modal that when drag & dropped on the page will add a trigger button.
384
+ * The modal is closed by default, so the selected component after drop will be the trigger button.
385
+ */
386
+ create?: (context: CreationContext) => CreateRequest<P> | Array<CreateRequest<P>>;
387
+ }
388
+ interface CreateRequest<P extends React$1.ComponentProps<any> = React$1.ComponentProps<any>> {
389
+ type: string;
390
+ properties?: PropertyValues<P>;
391
+ createAt?: "root" | "dropLocation";
392
+ children?: CreateChild$1[];
393
+ }
394
+ interface Chainable<PROPS extends React$1.ComponentProps<any> = React$1.ComponentProps<any>> {
395
+ addEditorTemplate: (config: EditorTemplate<PROPS>) => Chainable<PROPS>;
396
+ editorConfig: (config: EditorConfig$1) => Chainable<PROPS>;
397
+ }
398
+ /**
399
+ * Register a component to be used with the framework.
400
+ *
401
+ * @param Component - The React component or HTML element name (e.g., "div") to register. Can be a React functional component, class component, or intrinsic element string.
402
+ * @param propertiesDefinition - The definition of the component's properties, used for property panel generation and validation.
403
+ *
404
+ * @returns A chainable object that provides methods for editor integration (addEditorTemplate and editorConfig).
405
+ */
406
+ declare const registerComponentInternal: <T extends React$1.ElementType>(Component: T, propertiesDefinition: PropertiesDefinition) => Chainable<React$1.ComponentProps<T>>;
407
+ //#endregion
408
+ //#region src/lib/user-facing/component-base/sb-component.d.ts
409
+ type SbComponentProps<El = HTMLElement> = {
410
+ name?: string;
411
+ bind?: WithBindingIdentifier;
412
+ sourceId?: SbElement;
413
+ /**
414
+ * undefined means auto, true means always loading, false means never loading
415
+ */
416
+ loading?: boolean;
417
+ } & Omit<React.HTMLAttributes<El>, "height" | "width">;
418
+ //#endregion
419
+ //#region src/lib/internal-details/lib/evaluator/entity-types.d.ts
420
+ type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = T extends Callback ? Callback<ARGS> : T;
421
+ type NestedInputProp<T, ARGS extends any[] = any[]> = T extends object ? { [K in keyof T]: SingleInputProp<T[K], ARGS> | NestedInputProp<T[K], ARGS> } : never;
422
+ type InputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = SingleInputProp<T, ARGS> | NestedInputProp<T, ARGS>;
423
+ type EntityFunction<ARGS extends any[] = any[], R = EntityOutputProp> = (this: Entity, ...ARGS: ARGS) => R;
424
+ //#endregion
425
+ //#region src/lib/user-facing/properties-panel/props-builder.d.ts
426
+ type Exact<T, Shape> = T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? T : never : never;
427
+ type ManagedProp<T extends DataType = DataType> = PropertyForData<T> & {
428
+ default?: SingleInputProp<T>;
429
+ defaultOnAdd?: SingleInputProp<T>;
430
+ /**
431
+ * Controls binding nesting behavior:
432
+ * - true: Allows bindings to be nested at any depth within this property
433
+ * - false: Only allows bindings at the top level (unless the property is composite)
434
+ */
435
+ nestedBindings?: boolean;
436
+ /**
437
+ * Indicates this property should be evaluated per-context (e.g., per-row in tables)
438
+ * When true, the property value will be evaluated for each context with access to context variables
439
+ */
440
+ contextual?: boolean;
441
+ computedArgs?: EvaluateOrValueComputedArgs;
442
+ };
443
+ /**
444
+ * Merges shared and variant properties for union types without creating intersections
445
+ * Variant properties override shared properties with the same key
446
+ */
447
+ type MergeUnionVariant<SHARED extends Record<string, Prop<any, any>>, VARIANT extends Record<string, Prop<any, any>>> = Omit<SHARED, keyof VARIANT> & VARIANT;
448
+ /**
449
+ * Converts a union type to an intersection type
450
+ * Used to merge multiple section props into a single props type
451
+ */
452
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I extends U) => void) ? I : never;
453
+ /**
454
+ * Controls how default values affect property optionality
455
+ * - RequiredIfDefault: Properties with default values become required
456
+ * - AlwaysOptional: All properties become optional regardless of defaults
457
+ */
458
+ type DefaultValueBehavior = "RequiredIfDefault" | "AlwaysOptional";
459
+ /**
460
+ * Extracts the concrete type from a property definition
461
+ *
462
+ * For evaluated props: returns the actual value type
463
+ *
464
+ * For non-evaluated props: returns InputProp<ValueType>
465
+ */
466
+ /**
467
+ * Extracts the concrete type from a property definition
468
+ * Enhanced to handle contextual properties
469
+ */
470
+ type ExtractPropType<T, DefaultsBehavior extends DefaultValueBehavior, IsEvaluated extends boolean> = T extends Record<string, Prop<any, any, any>> ? ExtractProps<T, DefaultsBehavior, IsEvaluated> : T extends RecordProp<infer U> ? Record<string, ExtractProps<U, DefaultsBehavior, IsEvaluated>> : T extends CompositeProp<infer U> ? IsEvaluated extends true ? ExtractProps<U, DefaultsBehavior, IsEvaluated> : InputProp<ExtractProps<U, DefaultsBehavior, true>> : T extends UnionProp<infer SHARED, infer VARIANTS> ? VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: ExtractProps<MergeUnionVariant<SHARED, VARIANTS[I]>, DefaultsBehavior, IsEvaluated> }[number] : never : T extends Prop<infer V, infer _HasDefault, infer ContextualProps> ? IsEvaluated extends true ? ContextualProps extends undefined ? V extends Callback ? (...args: any[]) => Promise<void> : V : ContextualProps extends any[] ? (...args: ContextualProps) => V : InputProp<V> : InputProp<V> : never;
471
+ /**
472
+ * Extracts a flat props object from a properties definition
473
+ * Handles optionality based on DefaultValueBehavior
474
+ */
475
+ type ExtractProps<T, DefaultsBehavior extends DefaultValueBehavior, IsEvaluated extends boolean> = T extends Record<string, Section> ? ExtractProps<MergeSections<T>, DefaultsBehavior, IsEvaluated> : T extends SectionPropRecord ? DefaultsBehavior extends "AlwaysOptional" ? { [K in keyof T as T[K] extends Prop<any, any, any> ? K : never]?: ExtractPropType<T[K], DefaultsBehavior, IsEvaluated> } : { [K in keyof T as T[K] extends Prop<any, infer HasDefault, any> ? HasDefault extends true ? K : never : never]: ExtractPropType<T[K], DefaultsBehavior, IsEvaluated> } & { [K in keyof T as T[K] extends Prop<any, infer HasDefault, any> ? HasDefault extends false ? K : never : never]?: ExtractPropType<T[K], DefaultsBehavior, IsEvaluated> } : never;
476
+ /**
477
+ * Handles non Prop types, aka our default types and CSS props
478
+ */
479
+
480
+ type SectionPropertiesPanelConfig = {
481
+ showHeader?: boolean;
482
+ isDefaultOpen?: boolean;
483
+ headerType?: HeaderType;
484
+ subHeader?: string;
485
+ };
486
+ /**
487
+ * Merges all sections in a properties definition into a single props type
488
+ */
489
+ type MergeSections<T extends Record<string, Section>, Merged = UnionToIntersection<T[keyof T]>> = Merged extends Section<any, infer U> ? U : never;
490
+ /**
491
+ * Identical to InternalProps but without the base props
492
+ */
493
+ type EntityProps<Definition extends PropertiesDefinition, MergedSections = MergeSections<Definition>> = ExtractProps<MergedSections, "RequiredIfDefault", true>;
494
+ /**
495
+ * Internal props used by the component implementation
496
+ * - Properties with defaults are required
497
+ * - Properties are fully evaluated to their final types
498
+ */
499
+ type InternalProps<Definition extends PropertiesDefinition, FlattenedProps = EntityProps<Definition>, BaseProps = Omit<SbComponentProps, keyof FlattenedProps>> = FlattenedProps & BaseProps & InjectedProps;
500
+ type PropertiesDefinition = Record<string, Section>;
501
+ type SectionDefinition<T extends Record<string, Prop<any, any>>> = {
502
+ props: T;
503
+ showHeader?: boolean;
504
+ isDefaultOpen?: boolean;
505
+ headerType?: HeaderType;
506
+ subHeader?: string;
507
+ };
508
+ type SectionPropRecord<Props = Record<string, any>> = Partial<{ [K in keyof Props]: Prop<Props[K], any> }>;
509
+ declare class Section<TProps = any,
510
+ // Component props type for validation
511
+ T extends SectionPropRecord<TProps> = SectionPropRecord<TProps>> {
512
+ readonly category: PropsCategory;
513
+ props: T;
514
+ propertiesPanelConfig: SectionPropertiesPanelConfig;
515
+ constructor(category: PropsCategory);
516
+ static category<Props = any>(category: PropsCategory): Section<Props, Partial<{ [K in keyof Props]: Prop<Props[K], any, undefined> }>>;
517
+ children<INP extends SectionPropRecord<TProps> | CompositeProp<any> | UnionProp<any, any>, OUT extends (INP extends CompositeProp<infer CU> ? CU : INP extends UnionProp<infer SHARED, infer VARIANTS> ? VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: MergeUnionVariant<SHARED, VARIANTS[I]> }[number] : never : INP)>(props: INP extends CompositeProp<any> | UnionProp<any, any> ? INP : Exact<INP, SectionPropRecord<TProps>>): Section<TProps, T & OUT>;
518
+ add: <INP extends SectionPropRecord<TProps> | CompositeProp<any> | UnionProp<any, any>, OUT extends (INP extends CompositeProp<infer CU> ? CU : INP extends UnionProp<infer SHARED, infer VARIANTS> ? VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: MergeUnionVariant<SHARED, VARIANTS[I]> }[number] : never : INP)>(props: INP extends CompositeProp<any> | UnionProp<any, any> ? INP : Exact<INP, SectionPropRecord<TProps>>) => Section<TProps, T & OUT>;
519
+ propertiesPanel(config: Omit<SectionDefinition<any>, "props">): this;
520
+ get name(): "Content" | "Routing" | "Interaction" | "Styles" | "Layout" | "Appearance" | "Permissions" | "Uncategorized" | "Actions";
521
+ }
522
+ declare class Prop<Type extends DataType, _HasDefault extends boolean = false, _ContextualArgs extends any[] | undefined | ((entity: Entity) => any[] | undefined) = undefined> {
523
+ protected prop: ManagedProp<Type>;
524
+ /**
525
+ * Relations are an array of arrays
526
+ * each sub-array is AND requirements, and each element is an OR requirement
527
+ */
528
+ protected relations: Relation[][];
529
+ protected constructor(typeString: DataTypeString);
530
+ static unset(): Prop<undefined>;
531
+ static string<T extends string>(): Prop<T>;
532
+ static number<T extends number>(): Prop<T>;
533
+ static boolean<T extends boolean>(): Prop<T>;
534
+ static array<T>(): Prop<Array<T>>;
535
+ static any<T = any>(): Prop<T>;
536
+ static jsx<T extends ReactNode>(): Prop<T>;
537
+ static literal<T extends Readonly<string | number | boolean>>(value: T): Prop<T, true>;
538
+ static eventHandler(): Prop<any>;
539
+ static function<ARGS extends any[] = any[], RETURN = any>(implementation: EntityFunction<ARGS, RETURN>): FunctionProp<ARGS, RETURN>;
540
+ /**
541
+ * Creates a composite property, which is a property that contains nested properties. For example,
542
+ * the following composite property:
543
+ *
544
+ * ```ts
545
+ * const prop = Prop.composite({
546
+ * name: Prop.string(),
547
+ * age: Prop.number(),
548
+ * });
549
+ * ```
550
+ *
551
+ * is equivalent to the following type:
552
+ *
553
+ * ```ts
554
+ * type Prop = {
555
+ * name: string;
556
+ * age: number;
557
+ * };
558
+ * ```
559
+ */
560
+ static composite<T extends CompositeInputs>(props: T): CompositeProp<T>;
561
+ /**
562
+ * Creates a record property, which is a record that maps string keys to the nestedproperties. For example,
563
+ * the following record property:
564
+ *
565
+ * ```ts
566
+ * const prop = Prop.record({
567
+ * name: Prop.string(),
568
+ * age: Prop.number(),
569
+ * });
570
+ * ```
571
+ *
572
+ * is equivalent to the following type:
573
+ *
574
+ * ```ts
575
+ * type Prop = Record<string, {
576
+ * name: string;
577
+ * age: number;
578
+ * }>;
579
+ * ```
580
+ */
581
+ 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>;
586
+ default(de: SingleInputProp<DataType>): Prop<Type, true>;
587
+ contextual<TContext extends any[] | undefined = any[]>(computedArgs?: EvaluateOrValueComputedArgs): Prop<Type, _HasDefault, TContext>;
588
+ setName(name: string): this;
589
+ 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;
591
+ docs(docs: Exclude<PropertyForData<DataType>["docs"], undefined>): this;
592
+ build(): ManagedProp<Type>;
593
+ toDefinition(props: Record<string, unknown>): WidgetPropertyDefinition<DataType> | undefined;
594
+ getRelations(): Relation[][];
595
+ dependsOn(relations: Relation[][]): this;
596
+ hasPropertiesPanelDisplay(): boolean;
597
+ get type(): DataTypeString;
598
+ get path(): string;
599
+ }
600
+ type CompositeInputs = Record<string, Section> | Section | Record<string, Prop<unknown, boolean>>;
601
+ /**
602
+ * See {@link Prop.composite}
603
+ */
604
+ declare class CompositeProp<T extends CompositeInputs> extends Prop<unknown, boolean> {
605
+ typeString: "composite";
606
+ nestedProps: T;
607
+ constructor(props: T);
608
+ getProps(): T;
609
+ toDefinition(props: Record<string, unknown>): WidgetPropertyDefinition<DataType> | undefined;
610
+ propertiesPanelChildrenDisplayMode(): ({
611
+ type: "inline";
612
+ } | {
613
+ type: "popover";
614
+ title?: string;
615
+ panelIdPropertyName?: string;
616
+ titlePropertyName?: string;
617
+ addButton?: boolean;
618
+ }) | ((this: any, state: any, path: string) => ({
619
+ type: "inline";
620
+ } | {
621
+ type: "popover";
622
+ title?: string;
623
+ panelIdPropertyName?: string;
624
+ titlePropertyName?: string;
625
+ addButton?: boolean;
626
+ }) | undefined) | undefined;
627
+ }
628
+ /**
629
+ * See {@link Prop.record}
630
+ */
631
+ declare class RecordProp<T extends CompositeInputs> extends Prop<Record<string, any>, boolean> {
632
+ typeString: "recordOf";
633
+ nestedProps: T;
634
+ constructor(props: T);
635
+ getProps(): T;
636
+ toDefinition(props: Record<string, unknown>): WidgetPropertyDefinition<DataType> | undefined;
637
+ }
638
+ interface ActionPanel {
639
+ arguments?: Record<string, Prop<any>>;
640
+ }
641
+ declare class FunctionProp<ARGS extends any[] = any[], RETURN = any> extends Prop<EntityFunction<ARGS, RETURN>, true> {
642
+ typeString: "function";
643
+ private _actionPanel;
644
+ constructor(implementation: EntityFunction<ARGS, RETURN>);
645
+ actionPanel(panel?: ActionPanel): this;
646
+ getActionPanel(): ActionPanel | undefined;
647
+ }
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> {
650
+ typeString: "union";
651
+ shared: SHARED;
652
+ variants: VARIANTS;
653
+ constructor(shared: SHARED, variants: VARIANTS);
654
+ getProps(): SHARED & Record<string, Prop<any, false, undefined>>;
655
+ }
656
+ //#endregion
657
+ //#region src/lib/user-facing/components/app/props.d.ts
658
+ declare const propertiesDefinition: {
659
+ contents: Section<any, Partial<{
660
+ [x: string]: Prop<any, any, undefined>;
661
+ }> & {
662
+ children: Prop<any, false, undefined>;
663
+ }>;
664
+ appearance: Section<{
665
+ className: string;
666
+ }, Partial<{
667
+ className: Prop<string, any, undefined>;
668
+ }>>;
669
+ };
670
+ //#endregion
671
+ //#region src/lib/user-facing/components/app/index.d.ts
672
+ declare const App: (({
673
+ children,
674
+ className,
675
+ context
676
+ }: InternalProps<typeof propertiesDefinition> & {
677
+ context?: SuperblocksAppContext;
678
+ }) => react_jsx_runtime0.JSX.Element) & {
679
+ displayName: string;
680
+ };
681
+ //#endregion
682
+ //#region src/lib/user-facing/components/custom/register-custom-component.d.ts
683
+ type PropertiesPanelDefinition<Props extends React$1.ComponentProps<any>> = SectionPropRecord<Props> | { [K in string]: Section<Props, SectionPropRecord<Props>> };
684
+ /**
685
+ * Registers a custom React component or HTML element with Superblocks.
686
+ *
687
+ * @param component - The React component or HTML element name (e.g., "div") to register
688
+ * @param propertiesDefinition - Optional properties panel definition, either as flat props or organized into sections
689
+ * @returns The registered component
690
+ *
691
+ * @example
692
+ * ```tsx
693
+ * // Register HTML element with just defaults
694
+ * registerComponent("div");
695
+ *
696
+ * // Register HTML element with custom props
697
+ * registerComponent("div", {
698
+ * children: Prop.node(),
699
+ * onClick: Prop.eventHandler(),
700
+ * });
701
+ *
702
+ * // Flat props (auto-categorized into Content and Event sections)
703
+ * registerComponent(MyComponent, {
704
+ * label: Prop.string().default("Click me"),
705
+ * onClick: Prop.eventHandler(),
706
+ * });
707
+ *
708
+ * // Organized into sections
709
+ * registerComponent(MyComponent, {
710
+ * content: Section.category(PropsCategory.Content).children({
711
+ * label: Prop.string().default("Click me"),
712
+ * }),
713
+ * events: Section.category(PropsCategory.EventHandlers).children({
714
+ * onClick: Prop.eventHandler(),
715
+ * }),
716
+ * });
717
+ * ```
718
+ */
719
+ declare function registerComponent<T extends React$1.ElementType>(component: T, propertiesDefinition?: PropertiesPanelDefinition<React$1.ComponentProps<T>>): ReturnType<typeof registerComponentInternal>;
720
+ //#endregion
721
+ //#region src/lib/user-facing/error-pages/page-not-found.d.ts
722
+ declare const PageNotFound: ({
723
+ title,
724
+ errorMessage,
725
+ buttonPath,
726
+ buttonText,
727
+ onButtonClick,
728
+ hideActions
729
+ }: {
730
+ title?: string;
731
+ errorMessage?: string | React$1.ReactElement;
732
+ buttonPath?: string;
733
+ buttonText?: string;
734
+ onButtonClick?: () => void;
735
+ hideActions?: boolean;
736
+ }) => react_jsx_runtime0.JSX.Element;
737
+ //#endregion
738
+ //#region src/lib/internal-details/internal-components/route-load-error.d.ts
739
+ declare function RouteLoadError(): react_jsx_runtime0.JSX.Element;
740
+ //#endregion
741
+ //#region src/lib/internal-details/use-api.d.ts
742
+ declare global {
743
+ interface SuperblocksAPIRegistry {}
744
+ }
745
+ type RegisteredAPINames = keyof SuperblocksAPIRegistry;
746
+ type ApiInterfaces<Name extends string> = Name extends keyof SuperblocksAPIRegistry ? SuperblocksAPIRegistry[Name] extends {
747
+ input: infer I;
748
+ output: infer O;
749
+ } ? {
750
+ input: I;
751
+ output: O;
752
+ } : {
753
+ input: Record<string, unknown>;
754
+ output: any;
755
+ } : {
756
+ input: never;
757
+ output: never;
758
+ };
759
+ declare function useApiStateful<Name extends RegisteredAPINames, Inputs = ApiInterfaces<Name>["input"], Response = ApiInterfaces<Name>["output"]>(name: Name): {
760
+ run: (inputs?: Inputs) => Promise<Response | undefined>;
761
+ cancel: () => Promise<void>;
762
+ };
763
+ //#endregion
764
+ //#region src/lib/user-facing/properties-panel/mixins/styles-category.d.ts
765
+ /**
766
+ * Creates a standardized styles section for use in properties panels.
767
+ * This provides a consistent interface for applying Tailwind CSS classes across components.
768
+ *
769
+ * @example
770
+ * // Basic usage with defaults
771
+ * styles: tailwindStylesCategory()
772
+ *
773
+ * // Override with prioritizedTailwindProperties. These properties will always be shown in the properties panel, event when not set.
774
+ * styles: tailwindStylesCategory({prioritizedTailwindProperties: ["rounded", "text-color"]})
775
+ *
776
+ * @param options - Configuration options to override defaults
777
+ * @returns A Section with PropsCategory.Styles containing a className prop
778
+ */
779
+ declare const tailwindStylesCategory: (props?: {
780
+ prioritizedTailwindProperties?: TailwindPropertyKey[];
781
+ }) => Section<{
782
+ className: string;
783
+ }>;
784
+ //#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 };
786
+ //# sourceMappingURL=index.d.ts.map