@factorialco/f0-react 1.436.0 → 1.436.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 (3) hide show
  1. package/dist/f0.d.ts +27 -4
  2. package/dist/f0.js +4160 -4140
  3. package/package.json +1 -1
package/dist/f0.d.ts CHANGED
@@ -5899,8 +5899,15 @@ export declare interface F0FileConfig {
5899
5899
  multiple?: boolean;
5900
5900
  /** Helper text shown in the dropzone area */
5901
5901
  description?: string;
5902
- /** Consumer-provided hook that returns upload capabilities */
5903
- useUpload: UseFileUpload;
5902
+ /**
5903
+ * Consumer-provided upload hook.
5904
+ *
5905
+ * When used inside `<F0Form>`, the form-level `useUpload` is preferred.
5906
+ * This prop is primarily for standalone file fields rendered outside of
5907
+ * `<F0Form>` / `F0FormContext.Provider`, where the upload hook cannot be
5908
+ * supplied via context.
5909
+ */
5910
+ useUpload?: UseFileUpload;
5904
5911
  }
5905
5912
 
5906
5913
  /**
@@ -5916,8 +5923,11 @@ export declare type F0FileField = F0BaseField & {
5916
5923
  multiple?: boolean;
5917
5924
  /** Dropzone description text */
5918
5925
  description?: string;
5919
- /** Consumer-provided upload hook */
5920
- useUpload: UseFileUpload;
5926
+ /**
5927
+ * Consumer-provided upload hook for standalone usage.
5928
+ * When inside `<F0Form>`, the form-level `useUpload` takes precedence.
5929
+ */
5930
+ useUpload?: UseFileUpload;
5921
5931
  /** Conditional rendering */
5922
5932
  renderIf?: FileFieldRenderIf;
5923
5933
  };
@@ -6217,6 +6227,8 @@ export declare interface F0FormPropsWithPerSectionDefinition<T extends F0PerSect
6217
6227
  styling?: F0FormStylingConfig;
6218
6228
  formRef?: React.MutableRefObject<F0FormRef | null>;
6219
6229
  initialFiles?: InitialFile[];
6230
+ /** Upload hook shared by all file fields in the form. */
6231
+ useUpload?: UseFileUpload;
6220
6232
  /**
6221
6233
  * Callback that renders custom fields identified by `customFieldName`.
6222
6234
  * When a field has `customFieldName`, this function is called instead of the inline `render`.
@@ -6271,6 +6283,10 @@ export declare interface F0FormPropsWithPerSectionSchema<T extends F0PerSectionS
6271
6283
  * `defaultValues` against `InitialFile.value`.
6272
6284
  */
6273
6285
  initialFiles?: InitialFile[];
6286
+ /**
6287
+ * Upload hook shared by all file fields in the form.
6288
+ */
6289
+ useUpload?: UseFileUpload;
6274
6290
  /**
6275
6291
  * Callback that renders custom fields identified by `customFieldName`.
6276
6292
  * When a field has `customFieldName`, this function is called instead of the inline `render`.
@@ -6326,6 +6342,11 @@ export declare interface F0FormPropsWithSingleSchema<TSchema extends F0FormSchem
6326
6342
  * `defaultValues` against `InitialFile.value`.
6327
6343
  */
6328
6344
  initialFiles?: InitialFile[];
6345
+ /**
6346
+ * Upload hook shared by all file fields in the form.
6347
+ * Called once per file to obtain an independent upload instance.
6348
+ */
6349
+ useUpload?: UseFileUpload;
6329
6350
  /**
6330
6351
  * Callback that renders custom fields identified by `customFieldName`.
6331
6352
  * When a field has `customFieldName`, this function is called instead of the inline `render`.
@@ -6360,6 +6381,8 @@ export declare interface F0FormPropsWithSingleSchemaDefinition<TSchema extends F
6360
6381
  styling?: F0FormStylingConfig;
6361
6382
  formRef?: React.MutableRefObject<F0FormRef | null>;
6362
6383
  initialFiles?: InitialFile[];
6384
+ /** Upload hook shared by all file fields in the form. */
6385
+ useUpload?: UseFileUpload;
6363
6386
  /**
6364
6387
  * Callback that renders custom fields identified by `customFieldName`.
6365
6388
  * When a field has `customFieldName`, this function is called instead of the inline `render`.