@factorialco/rjsf-f0 2.5.0 → 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.
@@ -10,6 +10,20 @@ import { WidgetProps } from '@rjsf/utils';
10
10
  * available to this package.
11
11
  */
12
12
  export declare function formatFileSize(bytes: number): string;
13
+ /**
14
+ * Files above this size are held aside instead of being read into a `data:`
15
+ * URL, when the form offers a place to hold them (see `keptFilesOf`).
16
+ *
17
+ * 50 MiB because that is the most any path that carries the file *inside* the
18
+ * submission accepts — the platform's multipart relay and the largest plan's
19
+ * file limit — so a file this big can only reach a process through an upload
20
+ * grant, which sends the `File` as it is. Below it the `data:` URL stays: a
21
+ * host whose grant is refused still sends the file inline, as before grants.
22
+ * Above it the `data:` URL is what broke: base64 of a file approaching 1 GB is
23
+ * longer than the longest string the browser can hold, so reading it fails
24
+ * before the form is even submitted.
25
+ */
26
+ export declare const LARGE_FILE_BYTES: number;
13
27
  /**
14
28
  * The f0 file control.
15
29
  *
@@ -20,9 +34,14 @@ export declare function formatFileSize(bytes: number): string;
20
34
  * locale — English chrome inside a Spanish form, which no amount of locale
21
35
  * propagation on our side can reach.
22
36
  *
23
- * The file/`data:` URL exchange is untouched: `useFileWidgetProps` (core's own
24
- * hook) still owns reading the `File`, encoding it and accumulating the list,
25
- * so the value RJSF sees is byte-identical to before.
37
+ * The value RJSF sees is byte-identical to core's: `useFileWidgetProps` (core's
38
+ * own hook) owns multiple-file fields and the chips of encoded values, and a
39
+ * single file is read into the same `data:` URL here (`readAsDataUrl`), only so
40
+ * a slow read cannot overwrite a newer pick. The one exception is a
41
+ * single file above `LARGE_FILE_BYTES` in a root field of a form that holds
42
+ * large files (`keptFilesOf`): its value is the form's placeholder instead.
43
+ * Multiple-file fields and fields nested in an object or array always encode:
44
+ * the submit paths only lift top-level files out of the submission.
26
45
  *
27
46
  * The native input is kept — transparent, stretched over the whole dropzone —
28
47
  * rather than hidden behind a JS click handler. It stays the labelled control
package/dist/styles.css CHANGED
@@ -1049,3 +1049,10 @@
1049
1049
  .fcode-steps-actions .rjsf-f0-submit {
1050
1050
  margin-top: 0;
1051
1051
  }
1052
+
1053
+ /* Same colour and weight as a field error (`.rjsf-f0-errors`). */
1054
+ .rjsf-f0-file-error {
1055
+ margin: 0;
1056
+ color: hsl(var(--critical-70, 3 71% 41%));
1057
+ font-weight: 500;
1058
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/rjsf-f0",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Factorial f0 theme for react-jsonschema-form: renders RJSF forms with f0 components.",
5
5
  "type": "module",
6
6
  "homepage": "https://code.factorialhr.com/docs/forms/",