@pipedream/connect-react 2.4.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,6 @@ import { ComponentProps } from 'react';
8
8
  import { ComponentsListRequest } from '@pipedream/sdk';
9
9
  import { ConfigurableProp } from '@pipedream/sdk';
10
10
  import { ConfigurablePropAlert } from '@pipedream/sdk';
11
- import { ConfigurablePropApp } from '@pipedream/sdk';
12
- import { ConfigurablePropBoolean } from '@pipedream/sdk';
13
11
  import { ConfigurableProps } from '@pipedream/sdk';
14
12
  import { ConfiguredProps } from '@pipedream/sdk';
15
13
  import { Context } from 'react';
@@ -128,6 +126,57 @@ declare type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps
128
126
 
129
127
  export declare type ComponentLibrary = typeof defaultComponents;
130
128
 
129
+ /**
130
+ * A file picker component that uses the Pipedream SDK's configure endpoint
131
+ * to fetch options for component props, rendering them in a file browser UI.
132
+ */
133
+ export declare const ConfigureFilePicker: FC<ConfigureFilePickerProps>;
134
+
135
+ export declare const ConfigureFilePickerModal: FC<ConfigureFilePickerModalProps>;
136
+
137
+ export declare interface ConfigureFilePickerModalProps extends ConfigureFilePickerProps {
138
+ isOpen: boolean;
139
+ title?: string;
140
+ }
141
+
142
+ /**
143
+ * Props for the ConfigureFilePicker component
144
+ */
145
+ export declare interface ConfigureFilePickerProps {
146
+ /** Component key to use for the file picker (e.g., "sharepoint-select-file") */
147
+ componentKey: string;
148
+ /** App slug (e.g., "sharepoint") - used for app-specific config */
149
+ app: string;
150
+ /** Connected account ID */
151
+ accountId: string;
152
+ /** External user ID for the Pipedream Connect session */
153
+ externalUserId: string;
154
+ /** Callback when user confirms their selection */
155
+ onSelect: (items: FilePickerItem[], configuredProps: Record<string, unknown>) => void;
156
+ /** Callback when user cancels */
157
+ onCancel?: () => void;
158
+ /** Initial configured props (for restoring previous selection) */
159
+ initialConfiguredProps?: Record<string, unknown>;
160
+ /** Confirm button text */
161
+ confirmText?: string;
162
+ /** Cancel button text */
163
+ cancelText?: string;
164
+ /** Allow selecting folders (default: true) */
165
+ selectFolders?: boolean;
166
+ /** Allow selecting files (default: true) */
167
+ selectFiles?: boolean;
168
+ /** Allow selecting multiple items (default: false) */
169
+ multiSelect?: boolean;
170
+ /** Custom app configuration (overrides built-in config for the app) */
171
+ appConfig?: FilePickerAppConfig;
172
+ /** Enable debug logging (default: false) */
173
+ debug?: boolean;
174
+ /** Whether to show file/folder icons (default: true) */
175
+ showIcons?: boolean;
176
+ /** Custom icons for files and folders. Can be strings (emoji) or ReactNodes. */
177
+ icons?: FilePickerIcons;
178
+ }
179
+
131
180
  export declare function Control<T extends ConfigurableProps, U extends ConfigurableProp>(props: ControlProps<T, U>): JSX_2.Element;
132
181
 
133
182
  export declare function ControlAny(): JSX_2.Element;
@@ -190,11 +239,11 @@ export declare type CustomComponentsConfig<T, U extends boolean, V extends Group
190
239
 
191
240
  export declare type CustomizableProps = {
192
241
  componentForm: ComponentProps<typeof ComponentForm>;
193
- connectButton: ComponentProps<typeof ControlApp> & FormFieldContext<ConfigurablePropApp>;
242
+ connectButton: ComponentProps<typeof ControlApp> & FormFieldContext<ConfigurableProp.App>;
194
243
  controlAny: ComponentProps<typeof ControlAny> & FormFieldContext<ConfigurableProp>;
195
- controlApp: ComponentProps<typeof ControlApp> & FormFieldContext<ConfigurablePropApp>;
244
+ controlApp: ComponentProps<typeof ControlApp> & FormFieldContext<ConfigurableProp.App>;
196
245
  controlArray: ComponentProps<typeof ControlArray> & FormFieldContext<ConfigurableProp>;
197
- controlBoolean: ComponentProps<typeof ControlBoolean> & FormFieldContext<ConfigurablePropBoolean>;
246
+ controlBoolean: ComponentProps<typeof ControlBoolean> & FormFieldContext<ConfigurableProp.Boolean>;
198
247
  controlHttpRequest: ComponentProps<typeof ControlHttpRequest> & FormFieldContext<ConfigurableProp>;
199
248
  controlInput: ComponentProps<typeof ControlInput> & FormFieldContext<ConfigurableProp>;
200
249
  controlObject: ComponentProps<typeof ControlObject> & FormFieldContext<ConfigurableProp>;
@@ -322,6 +371,51 @@ declare type FieldProps<T extends ConfigurableProp> = {
322
371
  field: FormFieldContext<T>;
323
372
  };
324
373
 
374
+ /**
375
+ * Pre-built app configurations
376
+ */
377
+ export declare const FILE_PICKER_APPS: Record<string, FilePickerAppConfig>;
378
+
379
+ /**
380
+ * App-specific configuration for the file picker
381
+ */
382
+ export declare interface FilePickerAppConfig {
383
+ /** App slug (e.g., "sharepoint", "google_drive", "dropbox") */
384
+ app: string;
385
+ /** The camelCase prop name used in the component (e.g., "sharepoint") */
386
+ appPropName: string;
387
+ /** Prop hierarchy to navigate through (e.g., ["siteId", "driveId", "fileOrFolderIds"]) */
388
+ propHierarchy: string[];
389
+ /** Prop labels for display (e.g., { siteId: "Sites", driveId: "Drives" }) */
390
+ propLabels: Record<string, string>;
391
+ /** The prop name that shows selectable files/folders */
392
+ fileOrFolderProp: string;
393
+ /** The prop name used for folder navigation (set when drilling into folders) */
394
+ folderProp?: string;
395
+ }
396
+
397
+ /**
398
+ * Icon configuration for the file picker
399
+ */
400
+ export declare interface FilePickerIcons {
401
+ /** Icon for folders (string emoji or ReactNode) */
402
+ folder?: ReactNode;
403
+ /** Icon for files (string emoji or ReactNode) */
404
+ file?: ReactNode;
405
+ }
406
+
407
+ /**
408
+ * Represents an item (file or folder) in the file picker
409
+ */
410
+ export declare interface FilePickerItem {
411
+ id: string;
412
+ label: string;
413
+ value: unknown;
414
+ isFolder?: boolean;
415
+ size?: number;
416
+ raw?: unknown;
417
+ }
418
+
325
419
  export declare type FormContext<T extends ConfigurableProps> = {
326
420
  component: Component;
327
421
  configurableProps: T;
@@ -372,7 +466,7 @@ export declare type FormFieldContext<T extends ConfigurableProp> = {
372
466
 
373
467
  export declare const FormFieldContext: Context<FormFieldContext<any> | undefined>;
374
468
 
375
- export declare type FormFieldContextExtra<T extends ConfigurableProp> = T extends ConfigurablePropApp ? {
469
+ export declare type FormFieldContextExtra<T extends ConfigurableProp> = T extends ConfigurableProp.App ? {
376
470
  app?: App;
377
471
  } : object;
378
472
 
@@ -405,6 +499,15 @@ declare const LoadMoreButton: (props: ButtonProps) => JSX_2.Element;
405
499
 
406
500
  export declare function mergeTheme(target: Theme, ...sources: (PartialTheme | undefined)[]): Theme;
407
501
 
502
+ /**
503
+ * Represents a navigation level in the picker hierarchy
504
+ */
505
+ export declare interface NavigationLevel {
506
+ propName: string;
507
+ label: string;
508
+ value: unknown;
509
+ }
510
+
408
511
  export declare const OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
409
512
 
410
513
  declare type OptionalFieldButtonProps = {
@@ -456,7 +559,7 @@ declare type SelectAppProps = {
456
559
  appsOptions?: Omit<AppsListRequest, "q">;
457
560
  };
458
561
 
459
- export declare function SelectComponent({ app, componentType, value, onChange, }: SelectComponentProps): JSX_2.Element;
562
+ export declare function SelectComponent({ app, componentType, value, onChange, componentsOptions, }: SelectComponentProps): JSX_2.Element;
460
563
 
461
564
  declare type SelectComponentProps = {
462
565
  app?: Partial<App> & {
@@ -467,6 +570,10 @@ declare type SelectComponentProps = {
467
570
  key: string;
468
571
  };
469
572
  onChange?: (component?: Component) => void;
573
+ /**
574
+ * Additional options for fetching components (e.g., registry)
575
+ */
576
+ componentsOptions?: Omit<ComponentsListRequest, "app" | "componentType">;
470
577
  };
471
578
 
472
579
  export declare type Shadows = {