@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
package/dist/index.d.ts DELETED
@@ -1,1339 +0,0 @@
1
- import * as _superblocksteam_library_shared_types7 from "@superblocksteam/library-shared/types";
2
- import { AiContextMode, AiGenerationState, AppToEditorMessage, BindingIdentifier, Catalog, CreateChild, CreateChild as CreateChild$1, DeleteMeLibraryApi, EditOperationPayload, EditOperationType, EditorConfig as EditorConfig$1, Entity, EntityOutputProp, GeneratedTheme, IEventFlow, NotificationPosition, NotificationType, PayloadAction, PerSideBorder, PropertyInfo, RuntimeErrorData, SbElement, SbEvent as SbEvent$1, SbInstance, ScopeOptions, ScopedState, SourceLocation, StateVarPersistence, StepDef, Theme as Theme$1, TransactionInfo, TriggerStepType, UrlState, UserAccessibleTheme, ValueInputProp, WithBindingIdentifier, sbEntitySymbol } from "@superblocksteam/library-shared/types";
3
- import * as react0 from "react";
4
- import React$1, { CSSProperties, LegacyRef, ReactNode } from "react";
5
- import * as react_jsx_runtime0 from "react/jsx-runtime";
6
- import * as _superblocksteam_library_shared0 from "@superblocksteam/library-shared";
7
- import { ComputedProperty, Dim, Dim as Dim$1, DimModes, DimModes as DimModes$1, EditorConfig, EvaluateOrValueComputedArgs, INSTANCE_ID_ATTRIBUTE, NO_CONTENT_ATTRIBUTE, Property, SB } from "@superblocksteam/library-shared";
8
- import { Link, Outlet, generatePath } from "react-router";
9
- import * as _superblocksteam_library_shared_props0 from "@superblocksteam/library-shared/props";
10
- import { Callback, ControlType, DataType, DataTypeString, HeaderType, PropertiesPanelDefinition, PropertiesPanelDisplay, PropertyForData, PropsPanelCategory, Relation, WidgetPropertyDefinition } from "@superblocksteam/library-shared/props";
11
- import { FileMetadataPrivate, OrchestratorViewMode, PlaceholderInfo, Profile, RouteDef } from "@superblocksteam/shared";
12
- import { XYCoord } from "react-dnd";
13
-
14
- //#region src/lib/user-facing/component-base/constants.d.ts
15
- type ContainerLayout = "vertical" | "horizontal";
16
- type ContainerVariant = "none" | "card";
17
- //#endregion
18
- //#region src/lib/user-facing/component-base/use-passthrough-props.d.ts
19
- type ElementPassthroughProps = Record<string, any>;
20
- //#endregion
21
- //#region src/lib/internal-details/lib/types.d.ts
22
- type ExecutionError = {
23
- name?: string;
24
- message: string;
25
- formPath: string;
26
- blockPath: string;
27
- handled?: boolean;
28
- };
29
- type ExecutionEventRequest = {
30
- summary: string;
31
- metadata: {
32
- placeHoldersInfo?: Record<string, PlaceholderInfo>;
33
- };
34
- };
35
- type Resolutions = Record<string,
36
- // name of the field: eg: "range", for the range field let's say the code is {{[1,2,3]}}
37
- {
38
- value: any;
39
- bindings: any[];
40
- }>;
41
- type ExecutionEvent = {
42
- name: string;
43
- type: string;
44
- timestamp: string;
45
- start?: Record<string, unknown>;
46
- end?: {
47
- performance?: {
48
- start: string | number;
49
- finish: string | number;
50
- total: string | number;
51
- execution: string | number;
52
- overhead: string | number;
53
- };
54
- error?: ExecutionError;
55
- output?: {
56
- result?: any;
57
- request?: string;
58
- requestV2?: ExecutionEventRequest;
59
- stdout?: Array<string>;
60
- stderr?: Array<string>;
61
- };
62
- resolved?: Resolutions;
63
- };
64
- parent: string;
65
- };
66
- interface StreamEvent {
67
- result: {
68
- event: ExecutionEvent;
69
- execution: string;
70
- };
71
- }
72
- type RouteChangePayload = Omit<UrlState, "host" | "hostname" | "href" | "pathname" | "port" | "protocol">;
73
- type AiUpdatesPayload = {
74
- parentToChild: {
75
- type: "start-editing";
76
- components?: SbElement[];
77
- } | {
78
- type: "finish-editing";
79
- } | {
80
- type: "update-editing-entities";
81
- components: SbElement[];
82
- } | {
83
- type: "set-ai-context-mode";
84
- mode: AiContextMode;
85
- components?: SbElement[];
86
- } | {
87
- type: "set-tagging-enabled";
88
- isTaggingEnabled: boolean;
89
- };
90
- childToParent: {
91
- type: "add-component-to-context";
92
- component: SbElement;
93
- } | {
94
- type: "toggle-component-in-context";
95
- component: SbElement;
96
- label?: string;
97
- } | {
98
- type: "set-ai-context-mode";
99
- mode: AiContextMode;
100
- } | {
101
- type: "ai-generate";
102
- prompt: string;
103
- } | {
104
- type: "loader-state";
105
- shouldShowLoader: boolean;
106
- };
107
- };
108
- type FromParentToChildMessageTypesMap = {
109
- "sb-init": {
110
- peerId: string;
111
- userId?: string;
112
- appId: string;
113
- sessionRecordingKey?: string;
114
- aiState?: {
115
- generationState: AiGenerationState;
116
- editingComponents: SbElement[];
117
- };
118
- };
119
- "sb-bootstrap-response": {
120
- userId?: string;
121
- appId: string;
122
- token: string;
123
- accessToken: string;
124
- /** @deprecated Use agentUrls instead */
125
- agentUrl?: string;
126
- agentUrls: string[];
127
- logContext: Record<string, unknown>;
128
- featureFlags?: Record<string, unknown>;
129
- sessionRecordingKey?: string;
130
- };
131
- "sb-editor-request-bootstrap": void;
132
- "sb-update-active-agents": {
133
- agentUrls: string[];
134
- };
135
- "sb-update-property-with-effects": {
136
- sourceId: string;
137
- callbackId: string;
138
- updates: Record<string, PropertyInfo<unknown>>;
139
- transaction: TransactionInfo;
140
- };
141
- "sb-edit-operation-acknowledge": EditOperationPayload<EditOperationType>;
142
- "sb-retrieve-property-panel-props": {
143
- sourceId: string;
144
- };
145
- "sb-global-sync": {
146
- global: Record<string, unknown>;
147
- };
148
- "parent-action-batch": PayloadAction<unknown>[];
149
- click: void;
150
- "register-keypress": {
151
- keys: string;
152
- options?: any;
153
- };
154
- "canvas-scale-update": {
155
- canvasScaleFactor: number;
156
- };
157
- "resolve-promise": unknown;
158
- "reject-promise": unknown;
159
- "flash-element": {
160
- elementId: string;
161
- };
162
- "set-theme": {
163
- theme: unknown;
164
- updateRedux?: boolean;
165
- storedTypographies?: unknown;
166
- };
167
- getDropTarget: {
168
- parentId: string;
169
- };
170
- keypress: {
171
- keys: string;
172
- eventInfo: {
173
- code: string;
174
- key: string;
175
- altKey: boolean;
176
- ctrlKey: boolean;
177
- shiftKey: boolean;
178
- };
179
- };
180
- dragstart: Record<string, unknown> & {
181
- type: string;
182
- };
183
- "sb-create-component": {
184
- componentType: string;
185
- parent: SourceLocation;
186
- scopeName: string;
187
- baseProperties?: Record<string, PropertyInfo>;
188
- skipSecondaryComponentsCreation?: boolean;
189
- otherComponentsUpdates?: Record<SbElement, Record<string, PropertyInfo>>;
190
- };
191
- "sb-toggle-live-preview": {
192
- isLivePreview: boolean;
193
- };
194
- /**
195
- * Request a route change in the child
196
- */
197
- "route-change": RouteChangePayload;
198
- "ai-updates": AiUpdatesPayload["parentToChild"];
199
- };
200
- type FromParentToChildMessageTypes = keyof FromParentToChildMessageTypesMap;
201
- type FromChildToParentMessageTypesMap = {
202
- "sb-ready": void;
203
- "iframe-action-batch": PayloadAction<unknown>[];
204
- /**
205
- * Navigate the parent window to a new URL
206
- */
207
- "navigate-to": {
208
- url: string;
209
- newWindow?: boolean;
210
- };
211
- "sb-iframe-track-changes": Record<string, unknown>;
212
- "resolve-promise": unknown;
213
- "reject-promise": unknown;
214
- "sb-editor-request-bootstrap": void;
215
- "reload-configs": void;
216
- "sb-edit-operation-request": EditOperationPayload<EditOperationType>;
217
- "client:selectWidgets": {
218
- sourceIds: SbElement[];
219
- };
220
- getDropTargetResult: {
221
- offset: XYCoord;
222
- size: {
223
- height: number;
224
- width: number;
225
- };
226
- };
227
- keypress: {
228
- keys: string;
229
- eventInfo: {
230
- code: string;
231
- key: string;
232
- altKey: boolean;
233
- ctrlKey: boolean;
234
- shiftKey: boolean;
235
- };
236
- };
237
- "register-click": {
238
- type: string;
239
- context: {
240
- clientX: number;
241
- clientY: number;
242
- sourceId: string;
243
- insertionIndexes?: {
244
- sectionInsertionPosition?: number;
245
- columnInsertionPosition?: number;
246
- stackInsertionPosition?: number;
247
- };
248
- };
249
- };
250
- "api/started-execution": {
251
- apiName: string;
252
- };
253
- "api/set-api-response": {
254
- apiName: string;
255
- response: unknown;
256
- };
257
- "api/stream-event": {
258
- event: StreamEvent;
259
- apiName: string;
260
- };
261
- "api/stream-message": {
262
- message: any;
263
- apiName: string;
264
- };
265
- "authenticate-api-request": {
266
- apiId: string;
267
- callbackId: string;
268
- };
269
- "set-apis-deployed-mode": {
270
- apis: Array<DeleteMeLibraryApi & {
271
- scopeId: string;
272
- }>;
273
- callbackId: string;
274
- };
275
- /**
276
- * Notify the parent of a route change
277
- */
278
- "route-change": RouteChangePayload;
279
- "ai-updates": AiUpdatesPayload["childToParent"];
280
- undo: void;
281
- redo: void;
282
- "socket/error": {
283
- message: string;
284
- };
285
- "runtime-error": RuntimeErrorData;
286
- "clear-runtime-error": {
287
- id: string;
288
- };
289
- "logout-integration": {
290
- callbackId: string;
291
- };
292
- } & AppToEditorMessage<PropertiesPanelDefinition>;
293
- type FromChildToParentMessageTypes = keyof FromChildToParentMessageTypesMap;
294
- //#endregion
295
- //#region src/lib/internal-details/lib/evaluator/names.d.ts
296
- type Name = {
297
- value: string;
298
- isAnonymous: boolean;
299
- };
300
- //#endregion
301
- //#region src/lib/user-facing/event-flow.d.ts
302
- declare class EventFlow implements IEventFlow<StepDef, ScopedState, ValueInputProp> {
303
- steps: StepDef[];
304
- private constructor();
305
- private addStep;
306
- static start(): EventFlow;
307
- static runJS(handler: (s: ScopedState | any, additionalProps?: Record<string, any>) => void): EventFlow;
308
- runJS(handler: (s: ScopedState | any, additionalProps?: Record<string, any>) => void): this;
309
- static navigateTo(url: ValueInputProp<string>, opts?: {
310
- newWindow?: boolean;
311
- replaceHistory?: boolean;
312
- arguments?: string;
313
- }): EventFlow;
314
- navigateTo(url: ValueInputProp<string>, opts?: {
315
- newWindow?: boolean;
316
- replaceHistory?: boolean;
317
- arguments?: string;
318
- }): this;
319
- static navigateToApp(appId: string): EventFlow;
320
- navigateToApp(appId: string): this;
321
- static navigateToRoute(route: string): EventFlow;
322
- navigateToRoute(route: string): this;
323
- static setQueryParams(params: Record<string, ValueInputProp<string>>, opts?: {
324
- keep?: boolean;
325
- }): EventFlow;
326
- setQueryParams(params: Record<string, ValueInputProp<string>>, opts?: {
327
- keep?: boolean;
328
- }): this;
329
- static controlSlideout(slideout: WithBindingIdentifier, opts: {
330
- action: "open" | "close";
331
- }): EventFlow;
332
- controlSlideout(slideout: WithBindingIdentifier, opts: {
333
- action: "open" | "close";
334
- }): this;
335
- static controlModal(modal: WithBindingIdentifier, opts: {
336
- action: "open" | "close";
337
- }): EventFlow;
338
- controlModal(modal: WithBindingIdentifier, opts: {
339
- action: "open" | "close";
340
- }): this;
341
- static controlTimer(stateTimer: WithBindingIdentifier, opts: {
342
- action: "start" | "stop" | "toggle";
343
- }): EventFlow;
344
- controlTimer(stateTimer: WithBindingIdentifier, opts: {
345
- action: "start" | "stop" | "toggle";
346
- }): this;
347
- static runApis(apis: any[], opts?: {
348
- onSuccess?: EventFlow;
349
- onError?: EventFlow;
350
- }): EventFlow;
351
- runApis(apis: any[], opts?: {
352
- onSuccess?: EventFlow;
353
- onError?: EventFlow;
354
- }): this;
355
- static cancelApis(apis: any[], onCancel?: EventFlow): EventFlow;
356
- cancelApis(apis: any[], onCancel?: EventFlow): this;
357
- static resetComponent(component: WithBindingIdentifier, opts?: {
358
- property: string;
359
- }): EventFlow;
360
- resetComponent(component: WithBindingIdentifier, opts?: {
361
- property: string;
362
- }): this;
363
- static resetStateVar(state: WithBindingIdentifier): EventFlow;
364
- resetStateVar(state: WithBindingIdentifier): this;
365
- static setStateVar(stateVarName: WithBindingIdentifier, opts: {
366
- value: ValueInputProp;
367
- }): EventFlow;
368
- setStateVar(stateVar: WithBindingIdentifier, opts: {
369
- value: ValueInputProp;
370
- }): this;
371
- callFunction(component: () => unknown): this;
372
- static callFunction(component: () => unknown): EventFlow;
373
- static setComponentProperty(component: WithBindingIdentifier, opts: {
374
- property: string;
375
- value: ValueInputProp;
376
- }): EventFlow;
377
- setComponentProperty(component: WithBindingIdentifier, opts: {
378
- property: string;
379
- value: ValueInputProp;
380
- }): this;
381
- static showAlert(message: ValueInputProp<string>, opts?: {
382
- type?: NotificationType;
383
- durationMs?: number;
384
- position?: NotificationPosition;
385
- }): EventFlow;
386
- showAlert(_message: ValueInputProp<string>, _opts?: {
387
- type?: NotificationType;
388
- durationMs?: number;
389
- position?: NotificationPosition;
390
- }): this;
391
- static setProfile(profileId: string, opts: {
392
- action: "set" | "unset";
393
- }): EventFlow;
394
- setProfile(profileId: string, opts: {
395
- action: "set" | "unset";
396
- }): this;
397
- static triggerEvent(eventName: string, opts?: {
398
- data: Record<string, string>;
399
- }): EventFlow;
400
- triggerEvent(eventName: string, opts?: {
401
- data: Record<string, string>;
402
- }): this;
403
- static sequence(eventFlows: EventFlow[]): EventFlow;
404
- sequence(eventFlows: EventFlow[]): this;
405
- build(): StepDef[];
406
- }
407
- //#endregion
408
- //#region src/lib/user-facing/properties-panel/validators.d.ts
409
- type ValidationResult<T = any> = {
410
- valid: false;
411
- message: string;
412
- invalidValue: any;
413
- } | {
414
- valid: true;
415
- result: T;
416
- };
417
- type ValidateFn<T> = (value: any, entity: Entity) => ValidationResult<T>;
418
- //#endregion
419
- //#region src/lib/internal-details/lib/evaluator/base-entity-manager.d.ts
420
- type SingleInputProp<T = EntityOutputProp, ARGS extends any[] = any[]> = [T] extends [EntityOutputProp] ? T extends EventFlow ? EventFlow | Callback : ValueInputProp<T, ARGS> : never;
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/edit-mode/features/runtime-widgets-manager.d.ts
426
- type ChildFunction = React$1.FunctionComponent;
427
- type ChildElement = {
428
- isSupportedElement: true;
429
- isSbComponent: boolean;
430
- value: SbInstance;
431
- } | {
432
- isSupportedElement: true;
433
- isSbComponent: false;
434
- value?: SbInstance;
435
- } | {
436
- isSupportedElement: false;
437
- isSbComponent: false;
438
- value: ChildFunction;
439
- };
440
- type RuntimeWidgetMeta = {
441
- instanceId: SbInstance;
442
- sourceId: SbElement;
443
- isRoot: boolean;
444
- isInsideRoot: boolean;
445
- rootInstanceId?: SbInstance;
446
- interactionLayerInstanceId?: SbInstance;
447
- isSbComponent: boolean;
448
- isOptimistic: boolean;
449
- scopeId?: string;
450
- type?: string;
451
- name?: Name;
452
- props?: Record<string, unknown>;
453
- children?: ChildElement[];
454
- parentInstanceId?: SbInstance;
455
- directParentInstanceId?: SbInstance;
456
- isUnmounted?: boolean;
457
- };
458
- //#endregion
459
- //#region src/lib/internal-details/lib/features/component-registry.d.ts
460
- type DefaultTagNames = {
461
- container: string;
462
- button: string;
463
- text: string;
464
- };
465
- //#endregion
466
- //#region src/lib/internal-details/sb-wrapper.d.ts
467
- type InjectedProps = {
468
- dropTargetRef?: React$1.Ref<HTMLElement> | LegacyRef<HTMLElement>;
469
- editorProps?: ElementPassthroughProps;
470
- };
471
- type ParentInfo = {
472
- type?: string;
473
- };
474
- interface CreationContext {
475
- generateUniqueName: (baseName: string) => string;
476
- parentInfo: ParentInfo;
477
- defaultTagNames: DefaultTagNames;
478
- selfTagName: string;
479
- }
480
- type PropertyValues<Def extends PropertiesDefinition> = { [K in keyof GetAllPropsFromDefinition<Def>]?: PropertyInfo | PropertyValues<Def> };
481
- type GetAllPropsFromDefinition<Def extends PropertiesDefinition> = { [SectionKey in keyof Def]: Def[SectionKey] extends {
482
- props: infer Props;
483
- } ? Props extends Record<string, any> ? Props : never : never }[keyof Def];
484
- interface EditorTemplate<Def extends PropertiesDefinition> {
485
- catalog?: Catalog;
486
- /***
487
- * Config for the newly created component when added to the canvas from the Editor.
488
- * @returns a single CreateRequest or an array of CreateRequests.
489
- *
490
- * When returning Array<CreateRequests>:
491
- * - The 1st CreateRequest's type must match the componentType passed to createComponent.
492
- * - The last CreateRequest's will be the selected component after drag & drop.
493
- *
494
- * Example: [Modal, Button]
495
- * A modal that when drag & dropped on the page will add a trigger button.
496
- * The modal is closed by default, so the selected component after drop will be the trigger button.
497
- */
498
- create?: (context: CreationContext) => CreateRequest<Def> | Array<CreateRequest<Def>>;
499
- }
500
- interface CreateRequest<Def extends PropertiesDefinition> {
501
- type: string;
502
- /**
503
- * Should it automatically generate a binding?
504
- * e.g: <Input bind={Input1}>
505
- *
506
- * Default is false (no binding)
507
- *
508
- * `generateBinding` can also receive a string. e.g: "Input1".
509
- * This is useful if you need to create children components that rely on the parent's binding (e.g: a button inside a modal to close the modal).
510
- * To generate these unique names, you can use `context.generateUniqueName` and pass the component type (e.g: "Modal")
511
- *
512
- * A good rule of thumb:
513
- * - Components that expose a user's input should have an automatically generated binding (e.g: Input, Checkbox, Table, etc)
514
- * - Components that don't expose a user's input should not have an automatically generated binding (e.g: Button, Text, etc)
515
- *
516
- * Note:
517
- * Apps builders can always manually set a binding on the editor or source code.
518
- */
519
- generateBinding?: boolean | string;
520
- properties?: PropertyValues<Def>;
521
- createAt?: "root" | "dropLocation";
522
- children?: CreateChild$1[];
523
- }
524
- interface ChainableComponent<PD extends PropertiesDefinition, EP extends ExternalProps<PD>> extends React$1.FC<EP> {
525
- addEditorTemplate: (config: EditorTemplate<PD>) => ChainableComponent<PD, EP>;
526
- editorConfig: (config: EditorConfig$1) => ChainableComponent<PD, EP>;
527
- isSb: symbol;
528
- sbType: string;
529
- displayName: string;
530
- isCustomComponent: boolean;
531
- isDroppable: boolean;
532
- propertiesDefinition: PropertiesDefinition;
533
- }
534
- //#endregion
535
- //#region src/lib/user-facing/component-base/sb-component.d.ts
536
- type SbComponentProps<El = HTMLElement> = {
537
- name?: string;
538
- bind?: WithBindingIdentifier;
539
- width?: Dim$1;
540
- height?: Dim$1;
541
- sourceId?: SbElement;
542
- /**
543
- * undefined means auto, true means always loading, false means never loading
544
- */
545
- loading?: boolean;
546
- } & Omit<React.HTMLAttributes<El>, "height" | "width">;
547
- //#endregion
548
- //#region src/lib/user-facing/properties-panel/props-builder.d.ts
549
- type SideEffectCallback = (params: {
550
- sourceId: SbElement;
551
- updates: Record<string, PropertyInfo<unknown>>;
552
- widgetMeta: RuntimeWidgetMeta;
553
- widgetState: Entity | ScopedState | undefined;
554
- propertiesDefinition: PropertiesDefinition;
555
- }) => Record<SbElement, {
556
- meta?: Record<string, unknown>;
557
- props?: Record<string, PropertyInfo<unknown>>;
558
- }>;
559
- type ManagedProp<T extends DataType = DataType> = PropertyForData<T> & {
560
- validate?: ValidateFn<any>;
561
- default?: SingleInputProp<T>;
562
- defaultOnAdd?: SingleInputProp<T>;
563
- onEditProperty?: SideEffectCallback;
564
- onEvaluateProperty?: SideEffectCallback;
565
- /**
566
- * Controls binding nesting behavior:
567
- * - true: Allows bindings to be nested at any depth within this property
568
- * - false: Only allows bindings at the top level (unless the property is composite)
569
- */
570
- nestedBindings?: boolean;
571
- /**
572
- * Indicates this property should be evaluated per-context (e.g., per-row in tables)
573
- * When true, the property value will be evaluated for each context with access to context variables
574
- */
575
- contextual?: boolean;
576
- computedArgs?: EvaluateOrValueComputedArgs;
577
- /**
578
- * Custom type hint for documentation generation
579
- * When set, this will override the auto-generated type in generated docs
580
- */
581
- typeHint?: string;
582
- isMetaProp?: boolean;
583
- isFunctionProp?: boolean;
584
- hasActionPanel?: boolean;
585
- };
586
- /**
587
- * Merges shared and variant properties for union types without creating intersections
588
- * Variant properties override shared properties with the same key
589
- */
590
- type MergeUnionVariant<SHARED extends Record<string, Prop<any, any>>, VARIANT extends Record<string, Prop<any, any>>> = Omit<SHARED, keyof VARIANT> & VARIANT;
591
- /**
592
- * Converts a union type to an intersection type
593
- * Used to merge multiple section props into a single props type
594
- */
595
- type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends ((x: infer I extends U) => void) ? I : never;
596
- /**
597
- * Controls how default values affect property optionality
598
- * - RequiredIfDefault: Properties with default values become required
599
- * - AlwaysOptional: All properties become optional regardless of defaults
600
- */
601
- type DefaultValueBehavior = "RequiredIfDefault" | "AlwaysOptional";
602
- /**
603
- * Extracts the concrete type from a property definition
604
- *
605
- * For evaluated props: returns the actual value type
606
- *
607
- * For non-evaluated props: returns InputProp<ValueType>
608
- */
609
- /**
610
- * Extracts the concrete type from a property definition
611
- * Enhanced to handle contextual properties
612
- */
613
- 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 EventFlow ? (...args: any[]) => Promise<void> : V : ContextualProps extends any[] ? (...args: ContextualProps) => V : InputProp<V> : InputProp<V> : never;
614
- /**
615
- * Extracts a flat props object from a properties definition
616
- * Handles optionality based on DefaultValueBehavior
617
- */
618
- type ExtractProps<T, DefaultsBehavior extends DefaultValueBehavior, IsEvaluated extends boolean> = T extends Record<string, Section> ? ExtractProps<MergeSections<T>, DefaultsBehavior, IsEvaluated> : T extends Record<string, Prop<any, any, any>> ? DefaultsBehavior extends "AlwaysOptional" ? { [K in keyof T]?: 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;
619
- /**
620
- * Handles non Prop types, aka our default types and CSS props
621
- */
622
- type RawPropsToExternal<T = Record<string, unknown>> = { [K in keyof T as undefined extends T[K] ? never : K]: SingleInputProp<T[K]> } & { [K in keyof T as undefined extends T[K] ? K : never]?: SingleInputProp<Exclude<T[K], undefined>> };
623
- type SectionPropertiesPanelConfig = {
624
- showHeader?: boolean;
625
- isDefaultOpen?: boolean;
626
- headerType?: HeaderType;
627
- subHeader?: string;
628
- };
629
- /**
630
- * Merges all sections in a properties definition into a single props type
631
- */
632
- type MergeSections<T extends Record<string, Section>, Merged = UnionToIntersection<T[keyof T]>> = Merged extends Section<infer U> ? U : never;
633
- /**
634
- * Identical to InternalProps but without the base props
635
- */
636
- type EntityProps<Definition extends PropertiesDefinition, MergedSections = MergeSections<Definition>> = ExtractProps<MergedSections, "RequiredIfDefault", true>;
637
- /**
638
- * Internal props used by the component implementation
639
- * - Properties with defaults are required
640
- * - Properties are fully evaluated to their final types
641
- */
642
- type InternalProps<Definition extends PropertiesDefinition, FlattenedProps = EntityProps<Definition>, BaseProps = Omit<SbComponentProps, keyof FlattenedProps>> = FlattenedProps & BaseProps & InjectedProps;
643
- type MakeOptional<T, K extends string> = Omit<T, K & keyof T> & Partial<Pick<T, K & keyof T>>;
644
- type CleanProps<T> = { [K in keyof T as string extends K ? never : K]: T[K] };
645
- type InternalPropsWithOptional<Definition extends PropertiesDefinition, OptionalProps extends string, InternalPropsWithDefinition = InternalProps<Definition>> = InternalPropsWithDefinition extends infer U ? U extends any ? MakeOptional<CleanProps<U>, OptionalProps> & {
646
- [key: string]: any;
647
- } : never : never;
648
- /**
649
- * External props exposed to component consumers
650
- * - All properties are optional regardless of defaults
651
- * - Properties accept InputProp values (bindings/functions)
652
- */
653
- type ExternalProps<Definition extends PropertiesDefinition, MergedSections = MergeSections<Definition>, FlattenedProps = ExtractProps<MergedSections, "AlwaysOptional", false>, BaseProps = Omit<SbComponentProps, keyof FlattenedProps>> = FlattenedProps & RawPropsToExternal<BaseProps>;
654
- type PropertiesDefinition = Record<string, Section>;
655
- type SectionDefinition<T extends Record<string, Prop<any, any>>> = {
656
- props: T;
657
- showHeader?: boolean;
658
- isDefaultOpen?: boolean;
659
- headerType?: HeaderType;
660
- subHeader?: string;
661
- };
662
- declare class Section<T extends Record<string, Prop<any, any>> = Record<string, Prop<any, any>>> {
663
- readonly category: PropsPanelCategory;
664
- props: T;
665
- propertiesPanelConfig: SectionPropertiesPanelConfig;
666
- constructor(category: PropsPanelCategory);
667
- static category(category: PropsPanelCategory): Section<Record<string, Prop<any, any, undefined>>>;
668
- children<INP extends Record<string, Prop<any, any>> | 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): Section<T & OUT>;
669
- add: <INP extends Record<string, Prop<any, any>> | 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) => Section<T & OUT>;
670
- propertiesPanel(config: Omit<SectionDefinition<any>, "props">): this;
671
- get name(): "Content" | "Routing" | "Interaction" | "Layout" | "Appearance" | "Permissions" | "Uncategorized" | "Event handlers" | "Custom styles";
672
- }
673
- declare class Prop<Type extends DataType, _HasDefault extends boolean = false, _ContextualArgs extends any[] | undefined | ((entity: Entity) => any[] | undefined) = undefined> {
674
- protected prop: ManagedProp<Type>;
675
- /**
676
- * Relations are an array of arrays
677
- * each sub-array is AND requirements, and each element is an OR requirement
678
- */
679
- protected relations: Relation[][];
680
- protected constructor(typeString: DataTypeString, defaultValidator?: ValidateFn<Type | undefined>);
681
- static unset(): Prop<undefined>;
682
- static string<T extends string>(): Prop<T>;
683
- static number<T extends number>(): Prop<T>;
684
- static boolean<T extends boolean>(): Prop<T>;
685
- static array<T = Array<any>>(): Prop<T[]>;
686
- static any<T = any>(): Prop<T>;
687
- static jsx<T extends ReactNode>(): Prop<T>;
688
- static dimension<T extends Dim$1<DimModes$1>>(): Prop<T>;
689
- static literal<T extends Readonly<string | number | boolean>>(value: T): Prop<T, true>;
690
- static event(): Prop<EventFlow>;
691
- static children(): Prop<any>;
692
- static function<ARGS extends any[] = any[], RETURN = any>(implementation: EntityFunction<ARGS, RETURN>): FunctionProp<ARGS, RETURN>;
693
- /**
694
- * Creates an internal property that is not exposed in the entity's public interface,
695
- * not tracked for reactivity/syncing, and not serialized. This is useful for
696
- * storing implementation details like SuspensibleAPI instances that other
697
- * properties can reference via `this._propertyName`.
698
- */
699
- static internal<T = any>(factory: () => T): Prop<T, true>;
700
- /**
701
- * Creates a composite property, which is a property that contains nested properties. For example,
702
- * the following composite property:
703
- *
704
- * ```ts
705
- * const prop = Prop.composite({
706
- * name: Prop.string(),
707
- * age: Prop.number(),
708
- * });
709
- * ```
710
- *
711
- * is equivalent to the following type:
712
- *
713
- * ```ts
714
- * type Prop = {
715
- * name: string;
716
- * age: number;
717
- * };
718
- * ```
719
- */
720
- static composite<T extends CompositeInputs>(props: T): CompositeProp<T>;
721
- /**
722
- * Creates a record property, which is a record that maps string keys to the nestedproperties. For example,
723
- * the following record property:
724
- *
725
- * ```ts
726
- * const prop = Prop.record({
727
- * name: Prop.string(),
728
- * age: Prop.number(),
729
- * });
730
- * ```
731
- *
732
- * is equivalent to the following type:
733
- *
734
- * ```ts
735
- * type Prop = Record<string, {
736
- * name: string;
737
- * age: number;
738
- * }>;
739
- * ```
740
- */
741
- static record<T extends CompositeInputs>(props: T): RecordProp<T>;
742
- static union<SHARED extends Record<string, Prop<unknown, boolean>>, VARIANTS extends UnionVariant<SHARED>[] = UnionVariant<SHARED>[]>(props: {
743
- shared: SHARED;
744
- variants: VARIANTS;
745
- }): UnionProp<SHARED, VARIANTS, VARIANTS extends readonly any[] ? { [I in keyof VARIANTS]: SHARED & VARIANTS[I] }[number] : never>;
746
- readable(): this;
747
- writable(): this;
748
- readAndWrite(): this;
749
- default(de: SingleInputProp<DataType>): Prop<Type, true>;
750
- computed(computeFn: SingleInputProp<DataType>): Prop<Type, true>;
751
- allowNestedBindings(): Prop<Type, true>;
752
- contextual<TContext extends any[] | undefined = any[]>(computedArgs?: EvaluateOrValueComputedArgs): Prop<Type, _HasDefault, TContext>;
753
- validate(validateFn: ((value: any) => ValidationResult<Type>) | ValidateFn<any>): this;
754
- setName(name: string): this;
755
- onEdit(callback: SideEffectCallback): this;
756
- onEvaluate(callback: SideEffectCallback): this;
757
- propertiesPanel<CT extends ControlType>(schema: Omit<Partial<PropertiesPanelDisplay<Type, CT>>, "isTriggerProperty">): this;
758
- setDisplayProperty<K extends keyof PropertiesPanelDisplay<Type>>(property: K, value: PropertiesPanelDisplay<Type>[K]): this;
759
- docs(docs: Exclude<PropertyForData<DataType>["docs"], undefined>): this;
760
- /**
761
- * Sets a custom type hint for documentation generation.
762
- * This will override the auto-generated type in generated docs.
763
- *
764
- * @param typeHint The TypeScript type string to display in documentation
765
- * @example .typeHint("CSSProperties")
766
- * @example .typeHint("Record<string, { color: string; backgroundColor?: string }>")
767
- */
768
- typeHint(typeHint: string): this;
769
- build(): ManagedProp<Type>;
770
- toDefinition(entity?: Entity, scopedState?: ScopedState): WidgetPropertyDefinition<DataType> | undefined;
771
- getRelations(): Relation[][];
772
- dependsOn(relations: Relation[][]): this;
773
- hasPropertiesPanelDisplay(): boolean;
774
- get type(): DataTypeString;
775
- get path(): string;
776
- get onEditProperty(): SideEffectCallback | undefined;
777
- get onEvaluateProperty(): SideEffectCallback | undefined;
778
- }
779
- type CompositeInputs = Record<string, Section> | Section | Record<string, Prop<unknown, boolean>>;
780
- /**
781
- * See {@link Prop.composite}
782
- */
783
- declare class CompositeProp<T extends CompositeInputs> extends Prop<unknown, boolean> {
784
- typeString: "composite";
785
- nestedProps: T;
786
- constructor(props: T);
787
- getProps(): T;
788
- toDefinition(entity: Entity, scopedState: ScopedState): WidgetPropertyDefinition<DataType> | undefined;
789
- propertiesPanelChildrenDisplayMode(): ({
790
- type: "inline";
791
- } | {
792
- type: "popover";
793
- title?: string;
794
- panelIdPropertyName?: string;
795
- titlePropertyName?: string;
796
- addButton?: boolean;
797
- }) | ((this: any, state: any, path: string) => ({
798
- type: "inline";
799
- } | {
800
- type: "popover";
801
- title?: string;
802
- panelIdPropertyName?: string;
803
- titlePropertyName?: string;
804
- addButton?: boolean;
805
- }) | undefined) | undefined;
806
- typeHint(typeHint: string): this;
807
- }
808
- /**
809
- * See {@link Prop.record}
810
- */
811
- declare class RecordProp<T extends CompositeInputs> extends Prop<unknown, boolean> {
812
- typeString: "recordOf";
813
- nestedProps: T;
814
- constructor(props: T);
815
- getProps(): T;
816
- toDefinition(entity: Entity, scopedState: ScopedState): WidgetPropertyDefinition<DataType> | undefined;
817
- typeHint(typeHint: string): this;
818
- }
819
- interface ActionPanel {
820
- arguments?: Record<string, Prop<any>>;
821
- }
822
- declare class FunctionProp<ARGS extends any[] = any[], RETURN = any> extends Prop<EntityFunction<ARGS, RETURN>, true> {
823
- typeString: "function";
824
- private _actionPanel;
825
- constructor(implementation: EntityFunction<ARGS, RETURN>);
826
- actionPanel(panel?: ActionPanel): this;
827
- getActionPanel(): ActionPanel | undefined;
828
- hasActionPanel(): boolean;
829
- }
830
- type UnionVariant<SHARED extends Record<string, Prop<any>>> = { [K in keyof SHARED]: Prop<any> };
831
- 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> {
832
- typeString: "union";
833
- shared: SHARED;
834
- variants: VARIANTS;
835
- constructor(shared: SHARED, variants: VARIANTS);
836
- getProps(): SHARED & Record<string, Prop<any, false, undefined>>;
837
- }
838
- //#endregion
839
- //#region src/lib/user-facing/components/container/props.d.ts
840
- /**
841
- * TODO:
842
- * - make default and options dynamic for distribution and alignment
843
- * - enable tooltip for radio group options
844
- * - the alignments props only show when explicitly set layout in code because of using Union
845
- * - use default func once supported for composite props, apply it to padding, border, borderRadius, and backgroundColor. Otherwise, prop panel control will not show the correct value
846
- */
847
- declare const propertiesDefinition: {
848
- contents: Section<Record<string, Prop<any, any, undefined>> & {
849
- children: Prop<any, false, undefined>;
850
- }>;
851
- layout: Section<((Record<string, Prop<any, any, undefined>> & ((Omit<{
852
- layout: Prop<ContainerLayout, true, undefined>;
853
- }, "layout" | "verticalAlign" | "horizontalAlign"> & {
854
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "space-between" | "space-around", true, undefined>;
855
- readonly horizontalAlign: Prop<"center" | "stretch" | "left" | "right", true, undefined>;
856
- readonly layout: Prop<"vertical", true, undefined>;
857
- }) | (Omit<{
858
- layout: Prop<ContainerLayout, true, undefined>;
859
- }, "layout" | "verticalAlign" | "horizontalAlign"> & {
860
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "stretch", true, undefined>;
861
- readonly horizontalAlign: Prop<"center" | "space-between" | "space-around" | "left" | "right", true, undefined>;
862
- readonly layout: Prop<"horizontal", true, undefined>;
863
- }))) & {
864
- shouldScrollContents: Prop<boolean, true, undefined>;
865
- }) & {
866
- isVisible: Prop<boolean, true, undefined>;
867
- }>;
868
- appearance: Section<Record<string, Prop<any, any, undefined>> & {
869
- variant: Prop<ContainerVariant, true, undefined>;
870
- backgroundColor: Prop<string, true, undefined>;
871
- border: Prop<_superblocksteam_library_shared_types7.PerSideBorder, true, undefined>;
872
- borderRadius: Prop<_superblocksteam_library_shared_types7.PerCornerBorderRadius, true, undefined>;
873
- loading: Prop<boolean, true, undefined>;
874
- }>;
875
- };
876
- //#endregion
877
- //#region src/lib/user-facing/components/container/index.d.ts
878
- type OptionalProps$1 = "backgroundColor" | "border" | "borderRadius" | "loading";
879
- type ContainerProps<T> = Omit<InternalPropsWithOptional<typeof propertiesDefinition, OptionalProps$1>, "layout"> & {
880
- layout: T;
881
- };
882
- type UnstyledContainerProps = {
883
- layout: ContainerLayout;
884
- style?: CSSProperties;
885
- className?: string;
886
- children?: ReactNode;
887
- isVisible?: boolean;
888
- spacing?: Dim$1<"px">;
889
- columns?: number;
890
- rowHeight?: Dim$1<"px">;
891
- border?: PerSideBorder;
892
- };
893
- declare const UnstyledInternalContainer: (props: UnstyledContainerProps) => react_jsx_runtime0.JSX.Element;
894
- /**
895
- * TODO:
896
- * - interaciton rect of children will show outside of container if overflow
897
- * - move card style related defaultprops to props file and update dynamically when supported
898
- * - the spacing prop is not same type between stack and grid, enable when we clean it up
899
- * - consider border and padding for grid layout
900
- * - border style are showing some control default value even actually undefined. styles are coming from container classes but ideally we should set them as default props?
901
- * - move more props to inner layout component
902
- */
903
- declare const InternalContainer: <T extends ContainerLayout>(props: ContainerProps<T>) => react_jsx_runtime0.JSX.Element;
904
- //#endregion
905
- //#region src/lib/user-facing/components/page/index.d.ts
906
- declare const Page: ChainableComponent<{
907
- contents: Section<Record<string, Prop<any, any, undefined>> & {
908
- children: Prop<any, false, undefined>;
909
- }>;
910
- layout: Section<Record<string, Prop<any, any, undefined>> & {
911
- width: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
912
- height: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
913
- }>;
914
- appearance: Section<Record<string, Prop<any, any, undefined>> & {
915
- loading: Prop<boolean, true, undefined>;
916
- }>;
917
- events: Section<Record<string, Prop<any, any, undefined>> & {
918
- onLoad: Prop<EventFlow, false, undefined>;
919
- }>;
920
- }, ExternalProps<{
921
- contents: Section<Record<string, Prop<any, any, undefined>> & {
922
- children: Prop<any, false, undefined>;
923
- }>;
924
- layout: Section<Record<string, Prop<any, any, undefined>> & {
925
- width: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
926
- height: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
927
- }>;
928
- appearance: Section<Record<string, Prop<any, any, undefined>> & {
929
- loading: Prop<boolean, true, undefined>;
930
- }>;
931
- events: Section<Record<string, Prop<any, any, undefined>> & {
932
- onLoad: Prop<EventFlow, false, undefined>;
933
- }>;
934
- }>>;
935
- //#endregion
936
- //#region src/lib/user-facing/components/app/index.d.ts
937
- declare const App: ChainableComponent<{
938
- contents: Section<Record<string, Prop<any, any, undefined>> & {
939
- children: Prop<any, false, undefined>;
940
- }>;
941
- events: Section<Record<string, Prop<any, any, undefined>> & {
942
- onLoad: Prop<EventFlow, false, undefined>;
943
- }>;
944
- }, ExternalProps<{
945
- contents: Section<Record<string, Prop<any, any, undefined>> & {
946
- children: Prop<any, false, undefined>;
947
- }>;
948
- events: Section<Record<string, Prop<any, any, undefined>> & {
949
- onLoad: Prop<EventFlow, false, undefined>;
950
- }>;
951
- }>>;
952
- //#endregion
953
- //#region src/lib/user-facing/components/custom/register-custom-component.d.ts
954
- declare const defaultSectionsTemplate: () => {
955
- appearance: Section<Record<string, Prop<any, any, undefined>> & {
956
- loading: Prop<boolean, true, undefined>;
957
- className: Prop<string, false, undefined>;
958
- }>;
959
- layout: Section<Record<string, Prop<any, any, undefined>> & {
960
- width: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
961
- height: Prop<_superblocksteam_library_shared0.Dim<_superblocksteam_library_shared0.DimModes>, false, undefined>;
962
- } & {
963
- isVisible: Prop<boolean, true, undefined>;
964
- }>;
965
- };
966
- type CustomComponentPropertiesDefinition = {
967
- [key: string]: Prop<any>;
968
- } | {
969
- [key: string]: Section<any>;
970
- };
971
- type StrictExtractProps<T, DefaultsBehavior extends "AlwaysOptional" | "RequiredIfDefault", IsEvaluated extends boolean> = { [K in keyof ExtractProps<T, DefaultsBehavior, IsEvaluated> as string extends K ? never : K]: ExtractProps<T, DefaultsBehavior, IsEvaluated>[K] };
972
- type WrappedEventProps<IP extends InternalProps<any>> = { [K in keyof IP]: IP[K] extends EventFlow | undefined ? () => Promise<void> : IP[K] };
973
- type SectionProps<PD extends Record<string, Prop<any>> | Record<string, Section<any>>> = PD extends Record<string, Prop<any>> ? Record<string, Section<any>> & ReturnType<typeof defaultSectionsTemplate> : PD;
974
- type CustomComponentProps<PD extends Record<string, Prop<any>> | Record<string, Section<any>>, SP extends SectionProps<PD> = SectionProps<PD>, IP extends InternalProps<SP> = InternalProps<SP>> = WrappedEventProps<IP>;
975
- type CustomComponentOutputProps<PD extends CustomComponentPropertiesDefinition> = StrictExtractProps<PD, "AlwaysOptional", false> & {
976
- bind?: WithBindingIdentifier;
977
- } & StrictExtractProps<ReturnType<typeof defaultSectionsTemplate>, "AlwaysOptional", false>;
978
- declare function registerComponent<PD extends CustomComponentPropertiesDefinition>(name: string, propertiesDefinition: PD, component: React$1.FC<CustomComponentProps<PD>>): ChainableComponent<any, CustomComponentOutputProps<PD>>;
979
- //#endregion
980
- //#region src/lib/user-facing/components/types.d.ts
981
- type UnknownOption = string | Record<string, unknown> | {
982
- label: string;
983
- value: string;
984
- };
985
- //#endregion
986
- //#region src/lib/user-facing/entities/variable/index.d.ts
987
- type Props$3<T = any> = {
988
- defaultValue: T;
989
- persistence?: StateVarPersistence;
990
- };
991
- declare const StateVar: (args: RawPropsToExternal<Props$3<any>>) => {
992
- [sbEntitySymbol]: true;
993
- type: "StateVar";
994
- defaultValue: any;
995
- value: any;
996
- persistence: _superblocksteam_library_shared_types7.ValueInputProp<StateVarPersistence, any[]> | undefined;
997
- } & _superblocksteam_library_shared_types7.AnonymousSbEntity;
998
- //#endregion
999
- //#region src/lib/user-facing/entities/timer/index.d.ts
1000
- type Props$2 = {
1001
- intervalMs?: number;
1002
- startOnPageLoad?: boolean;
1003
- onFire?: EventFlow;
1004
- };
1005
- declare const Timer: (args: RawPropsToExternal<Props$2>) => {
1006
- [sbEntitySymbol]: true;
1007
- type: "Timer";
1008
- intervalMs: _superblocksteam_library_shared_types7.ValueInputProp<number, any[]> | undefined;
1009
- startOnPageLoad: _superblocksteam_library_shared_types7.ValueInputProp<boolean, any[]> | undefined;
1010
- onFire: _superblocksteam_library_shared_props0.Callback | EventFlow | undefined;
1011
- } & _superblocksteam_library_shared_types7.AnonymousSbEntity;
1012
- //#endregion
1013
- //#region src/lib/user-facing/entities/api/index.d.ts
1014
- type Props$1 = {
1015
- onSuccess?: EventFlow;
1016
- onError?: EventFlow;
1017
- };
1018
- declare const SbApi: (args: RawPropsToExternal<Props$1>) => {
1019
- [sbEntitySymbol]: true;
1020
- type: "SbApi";
1021
- onSuccess: _superblocksteam_library_shared_props0.Callback | EventFlow | undefined;
1022
- onError: _superblocksteam_library_shared_props0.Callback | EventFlow | undefined;
1023
- } & _superblocksteam_library_shared_types7.AnonymousSbEntity;
1024
- //#endregion
1025
- //#region src/lib/user-facing/sb-provider.d.ts
1026
- declare const SbProvider: ({
1027
- name,
1028
- settings,
1029
- children
1030
- }: {
1031
- name: string;
1032
- settings?: Record<string, any> & {
1033
- theme?: Theme$1;
1034
- themeOverrides?: Partial<GeneratedTheme>;
1035
- };
1036
- children?: React$1.ReactNode;
1037
- }) => react_jsx_runtime0.JSX.Element;
1038
- //#endregion
1039
- //#region src/lib/user-facing/global-functions.d.ts
1040
- declare function copyToClipboard(text: string, options?: {
1041
- debug?: boolean;
1042
- format?: string;
1043
- }): void;
1044
- declare function navigateTo(urlOrRoute: string, queryParams?: Record<string, any>, target?: string): boolean;
1045
- declare function setQueryParams(queryParams?: Record<string, any>, preserveExistingQueryParams?: boolean): boolean;
1046
- declare function download(data: any, fileName?: string, fileType?: string): void;
1047
- declare function logoutIntegrations(): Promise<void>;
1048
- //#endregion
1049
- //#region src/lib/user-facing/properties-panel/mixins/loading.d.ts
1050
- declare const loading: () => Prop<boolean, true, undefined>;
1051
- //#endregion
1052
- //#region src/lib/user-facing/properties-panel/mixins/layout-section.d.ts
1053
- /**
1054
- * Sets width default to `fill` if no default width config provided.
1055
- * Sets height default to `fit` if no default height config provided.
1056
- */
1057
- declare const size: ({
1058
- defaults,
1059
- showWidth,
1060
- showHeight
1061
- }?: {
1062
- defaults?: {
1063
- width?: Dim$1<DimModes$1>;
1064
- height?: Dim$1<DimModes$1>;
1065
- };
1066
- showWidth?: (this: any, s: ScopedState) => boolean;
1067
- showHeight?: (this: any, s: ScopedState) => boolean;
1068
- }) => {
1069
- width: Prop<Dim$1<DimModes$1>, false, undefined>;
1070
- height: Prop<Dim$1<DimModes$1>, false, undefined>;
1071
- };
1072
- /** @deprecated Using it will override the defaults values defined in size() for width */
1073
- declare const widthWithoutFit: () => {
1074
- width: Prop<Dim$1<"px" | "columns" | "rows" | "fill" | "%">, false, undefined>;
1075
- };
1076
- declare const shouldScrollContents: (defaultValue?: boolean) => {
1077
- shouldScrollContents: Prop<boolean, true, undefined>;
1078
- };
1079
- declare const visible: () => {
1080
- isVisible: Prop<boolean, true, undefined>;
1081
- };
1082
- declare const margin: () => {
1083
- margin: Prop<{
1084
- top: Dim$1<"px">;
1085
- bottom: Dim$1<"px">;
1086
- left: Dim$1<"px">;
1087
- right: Dim$1<"px">;
1088
- } | undefined, true, undefined>;
1089
- };
1090
- declare const containerLayout: (sizeProps?: Record<string, Prop<any, any>>) => UnionProp<{
1091
- layout: Prop<ContainerLayout, true, undefined>;
1092
- }, [{
1093
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "space-between" | "space-around", true, undefined>;
1094
- readonly horizontalAlign: Prop<"center" | "stretch" | "left" | "right", true, undefined>;
1095
- readonly layout: Prop<"vertical", true, undefined>;
1096
- }, {
1097
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "stretch", true, undefined>;
1098
- readonly horizontalAlign: Prop<"center" | "space-between" | "space-around" | "left" | "right", true, undefined>;
1099
- readonly layout: Prop<"horizontal", true, undefined>;
1100
- }], ({
1101
- layout: Prop<ContainerLayout, true, undefined>;
1102
- } & {
1103
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "space-between" | "space-around", true, undefined>;
1104
- readonly horizontalAlign: Prop<"center" | "stretch" | "left" | "right", true, undefined>;
1105
- readonly layout: Prop<"vertical", true, undefined>;
1106
- }) | ({
1107
- layout: Prop<ContainerLayout, true, undefined>;
1108
- } & {
1109
- readonly verticalAlign: Prop<"top" | "center" | "bottom" | "stretch", true, undefined>;
1110
- readonly horizontalAlign: Prop<"center" | "space-between" | "space-around" | "left" | "right", true, undefined>;
1111
- readonly layout: Prop<"horizontal", true, undefined>;
1112
- })>;
1113
- //#endregion
1114
- //#region src/lib/user-facing/hooks/use-editor.d.ts
1115
- type EditorFeatures = {
1116
- /**
1117
- * Whether drag and drop functionality is enabled
1118
- */
1119
- dragAndDrop: boolean;
1120
- /**
1121
- * Whether nudging elements with arrow keys is enabled
1122
- */
1123
- nudging: boolean;
1124
- /**
1125
- * The currently selected widget
1126
- */
1127
- selectWidget: SbInstance | null;
1128
- };
1129
- type FeatureState<T> = {
1130
- value: T;
1131
- set: (value: T) => void;
1132
- };
1133
- type RecordFeatureState<T> = { [K in keyof T]: FeatureState<T[K]> };
1134
- type HookResult = {
1135
- features: RecordFeatureState<EditorFeatures>;
1136
- isEditing: boolean;
1137
- };
1138
- /**
1139
- * Hook that provides access to editor-specific features.
1140
- *
1141
- * This hook allows you to control editor-only functionality on a per-widget basis.
1142
- * Note: These features only work in editor mode and have no effect in deployed apps.
1143
- *
1144
- * @example
1145
- * // Disable drag and drop for a widget
1146
- * const { features } = useEditor();
1147
- * features.dragAndDrop.set(false);
1148
- *
1149
- * // Disable nudging with arrow keys
1150
- * features.nudging.set(false);
1151
- */
1152
- declare const useEditor: () => HookResult;
1153
- //#endregion
1154
- //#region src/lib/user-facing/hooks/use-popover-roots.d.ts
1155
- declare const usePopoverRootElement: () => react0.MutableRefObject<HTMLElement | null>;
1156
- //#endregion
1157
- //#region src/lib/user-facing/state/types.d.ts
1158
- type ScopeInstance<_Bindables extends Record<string, any>> = {
1159
- entities: Record<string, WithBindingIdentifier>;
1160
- initialEntities: Record<string, any>;
1161
- scopeInfo: {
1162
- scopeId: string;
1163
- name: string;
1164
- parentScopeId?: string;
1165
- };
1166
- };
1167
- //#endregion
1168
- //#region src/lib/internal-details/entities.d.ts
1169
- declare function SbEvent({
1170
- payload
1171
- }: {
1172
- payload: string;
1173
- }): Omit<SbEvent$1, "name" | "id">;
1174
- //#endregion
1175
- //#region src/lib/internal-details/scope/scope.d.ts
1176
- declare function registerScope<T>(Component: React$1.FC<T>, scopeDef: ScopeInstance<any>, options?: ScopeOptions): React$1.FC<React$1.JSX.IntrinsicAttributes & T>;
1177
- //#endregion
1178
- //#region src/lib/user-facing/components/page/register-page.d.ts
1179
- declare function registerPage<T>(Component: React.FC<T>, scope: ScopeInstance<any>): react0.FC<react0.JSX.IntrinsicAttributes & T>;
1180
- //#endregion
1181
- //#region src/lib/user-facing/components/app/register-app.d.ts
1182
- declare function registerApp<T, Bindables extends Record<string, any>>(Component: React$1.FC<T>, scope: ScopeInstance<Bindables>): React$1.FC<React$1.JSX.IntrinsicAttributes & T>;
1183
- //#endregion
1184
- //#region src/lib/user-facing/state/create-scope.d.ts
1185
- type ScopeOptions$1 = {
1186
- parentScopeId?: string;
1187
- name: string;
1188
- };
1189
- declare function createScope<_Bindables extends Record<string, any>, SO extends ScopeOptions$1 = ScopeOptions$1>(getInitialEntities: ({
1190
- entities
1191
- }: {
1192
- entities: Record<string, any>;
1193
- }) => Record<string, any>,
1194
- // TODO later, like variables, apis
1195
- options: SO): ScopeInstance<_Bindables>;
1196
- //#endregion
1197
- //#region src/lib/internal-details/scope/types.d.ts
1198
- declare const AppMode: {
1199
- readonly EDIT: "EDIT";
1200
- readonly PUBLISHED: "PUBLISHED";
1201
- readonly PREVIEW: "PREVIEW";
1202
- };
1203
- type AppMode = (typeof AppMode)[keyof typeof AppMode];
1204
- interface Global$1 {
1205
- mode?: AppMode;
1206
- user?: User;
1207
- URL?: UrlState;
1208
- groups?: Group[];
1209
- deployedAt?: string;
1210
- createdAt?: string;
1211
- selectedProfileId?: string;
1212
- profiles?: Profiles;
1213
- routes?: {
1214
- [id: string]: RouteDef;
1215
- };
1216
- currentRoute?: {
1217
- routeDef: RouteDef;
1218
- params: Record<string, string>;
1219
- };
1220
- app?: {
1221
- id: string;
1222
- name: string;
1223
- };
1224
- }
1225
- type User = {
1226
- name: string;
1227
- email: string;
1228
- id: string;
1229
- groups: Group[];
1230
- username: string;
1231
- metadata: Record<string, unknown>;
1232
- };
1233
- type Group = {
1234
- id: string;
1235
- name: string;
1236
- size: number;
1237
- };
1238
- type Profiles = {
1239
- available: Profile[];
1240
- selected?: Profile;
1241
- default: Profile;
1242
- };
1243
- //#endregion
1244
- //#region src/lib/internal-details/scope/global.d.ts
1245
- type AppTheme = Theme$1;
1246
- declare const Theme: UserAccessibleTheme;
1247
- declare const Global: Global$1;
1248
- declare const Embed: any;
1249
- declare const Env: any;
1250
- //#endregion
1251
- //#region src/lib/user-facing/hooks/use-update-properties.d.ts
1252
- declare function useUpdateProperties(): (props: Record<string, any>) => void;
1253
- //#endregion
1254
- //#region src/lib/user-facing/hooks/use-theme.d.ts
1255
- declare const useTheme: () => {
1256
- theme: _superblocksteam_library_shared_types7.UserAccessibleTheme;
1257
- };
1258
- //#endregion
1259
- //#region src/lib/user-facing/state/computed.d.ts
1260
- declare function computed<T = any>(fn: (...args: any[]) => T): ComputedProperty<T>;
1261
- //#endregion
1262
- //#region src/lib/user-facing/hooks/use-dialog-editing.d.ts
1263
- /**
1264
- * A hook to enable editing dialogs.
1265
- *
1266
- * Dialog: A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
1267
- * E.g: Modal, Slideout, etc
1268
- *
1269
- * The hook expects an `isOpen` property on the component, but can be customized by passing a `isOpenPropertyName`.
1270
- */
1271
- /**
1272
- * Hook that makes dialogs interact with the editor.
1273
- * - enable/disable the dialog's interaction layer depending on the open state.
1274
- * - select the dialog when it is open or any of the nested components are selected through the navigation side bar.
1275
- *
1276
- * Note: This hook only works in editor mode and has no effect in deployed apps.
1277
- *
1278
- * @example
1279
- * useDialogEditing({
1280
- * isOpen,
1281
- * });
1282
- */
1283
- declare function useDialogEditing(props: {
1284
- isOpen: boolean;
1285
- isOpenPropertyName?: string;
1286
- }): void;
1287
- //#endregion
1288
- //#region src/edit-mode/interaction-layer/interaction-layer.d.ts
1289
- type RootType = "App" | "Page" | string;
1290
- declare const InteractionLayer: ((props: {
1291
- rootType: RootType;
1292
- rootInstanceId: SbInstance;
1293
- rootName?: string;
1294
- }) => react_jsx_runtime0.JSX.Element | null) & {
1295
- displayName: string;
1296
- };
1297
- //#endregion
1298
- //#region src/lib/user-facing/component-base/droppable-container.d.ts
1299
- declare function DroppableContainer({
1300
- name,
1301
- componentType,
1302
- isOpen,
1303
- children,
1304
- layout,
1305
- className,
1306
- dropTargetRef
1307
- }: {
1308
- name: string;
1309
- componentType: string;
1310
- isOpen: boolean;
1311
- children: React.ReactNode;
1312
- layout: ContainerLayout;
1313
- className: string;
1314
- dropTargetRef?: React.Ref<HTMLElement> | LegacyRef<HTMLElement>;
1315
- }): react_jsx_runtime0.JSX.Element;
1316
- //#endregion
1317
- //#region src/lib/user-facing/constants.d.ts
1318
- /**
1319
- * The ID of the element used to target detached components (e.g: modals, slideouts) when they are opened in the app.
1320
- */
1321
- declare const PORTAL_ROOT_ID = "portal-root";
1322
- //#endregion
1323
- //#region src/lib/internal-details/lib/evaluator/file-utils.d.ts
1324
- declare class FileManagerClass {
1325
- private static instance;
1326
- private storage;
1327
- private constructor();
1328
- static getInstance(): FileManagerClass;
1329
- store(componentName: string, file: File): void;
1330
- get(componentName: string, fileId: string): File | undefined;
1331
- remove(componentName: string, file: File): void;
1332
- clearComponent(componentName: string): void;
1333
- clear(): void;
1334
- }
1335
- declare const FileManager: FileManagerClass;
1336
- declare function getFileWithUploadId(f: File): File;
1337
- //#endregion
1338
- export { App, type AppTheme, type BindingIdentifier, type CreateChild, type CreationContext, type CustomComponentPropertiesDefinition, type CustomComponentProps, Dim, type DimModes, DroppableContainer, type EditorConfig, type EditorTemplate, type ElementPassthroughProps, Embed, Env, EventFlow, FileManager, type FileMetadataPrivate, type FromChildToParentMessageTypes, type FromChildToParentMessageTypesMap, type FromParentToChildMessageTypes, type FromParentToChildMessageTypesMap, Global, INSTANCE_ID_ATTRIBUTE, InteractionLayer, InternalContainer, Link, SbProvider as MakeEditableWithSuperblocks, SbProvider, NO_CONTENT_ATTRIBUTE, Outlet, PORTAL_ROOT_ID, Page, Prop, Property, Section as PropertyPanelSection, PropsPanelCategory, SB, SbApi, SbEvent, StateVar, StateVarPersistence, Theme, Timer, TriggerStepType, type UnknownOption, UnstyledInternalContainer, computed, containerLayout as containerLayoutProps, copyToClipboard, createScope, download, generatePath, getFileWithUploadId, loading as loadingProp, logoutIntegrations, margin as marginProp, navigateTo, registerApp, registerComponent, registerPage, registerScope, setQueryParams, shouldScrollContents as shouldScrollContentsProps, size as sizeProp, useDialogEditing, useEditor, usePopoverRootElement, useTheme, useUpdateProperties, visible as visibleProp, widthWithoutFit as widthWithoutFitProp };
1339
- //# sourceMappingURL=index.d.ts.map