@pipelex/mthds-form 0.23.0 → 0.23.2
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.
- package/dist/{chunk-EQJBM3NS.js → chunk-O2VIVDHO.js} +2 -2
- package/dist/chunk-O2VIVDHO.js.map +1 -0
- package/dist/{chunk-NOSHTDID.js → chunk-W5MYXDLO.js} +15 -5
- package/dist/chunk-W5MYXDLO.js.map +1 -0
- package/dist/core/index.js +1 -1
- package/dist/core/sources.d.ts +21 -7
- package/dist/core/sources.js +1 -1
- package/dist/{field-renderer-lNhtw-Cz.d.ts → field-renderer-CH-biG8C.d.ts} +111 -5
- package/dist/generative/index.d.ts +1 -1
- package/dist/generative/index.js +2 -2
- package/dist/react/index.d.ts +11 -82
- package/dist/react/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunk-EQJBM3NS.js.map +0 -1
- package/dist/chunk-NOSHTDID.js.map +0 -1
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { planFileSave, planStuffSave } from '../chunk-ICUEHNEH.js';
|
|
2
2
|
export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-VH5CDQDR.js';
|
|
3
|
-
export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-
|
|
3
|
+
export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-O2VIVDHO.js';
|
|
4
4
|
export { collectStuffFiles } from '../chunk-RRTI7AIR.js';
|
|
5
5
|
export { describeValidationError, displayValue, valueAtProperty } from '../chunk-RPA7DNSK.js';
|
|
6
6
|
export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-ZX52CQJ4.js';
|
package/dist/core/sources.d.ts
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Shapes and pure functions only, so a host's server can import the types it
|
|
13
13
|
* answers with, and the rules that write an answer into a value are tested in
|
|
14
|
-
* node. No React, no fetch.
|
|
14
|
+
* node. No React, no fetch. What a row SAYS is data here (`SourceFile`'s
|
|
15
|
+
* `typeLabel` and `origin` are the host's words); how a row DRAWS is a
|
|
16
|
+
* rendering, so the glyph a host draws on a row is `./react`'s
|
|
17
|
+
* (`FilePickerSource.renderGlyph`), never a field of these shapes.
|
|
15
18
|
*/
|
|
16
19
|
/** Whose files a file source lists: the person's own, or the whole team's. */
|
|
17
20
|
type FileSourceScope = 'mine' | 'everyone';
|
|
@@ -45,8 +48,19 @@ interface SourceFile {
|
|
|
45
48
|
url: string;
|
|
46
49
|
/** The file's name, shown on the row and written into the field as its `filename`. */
|
|
47
50
|
name: string;
|
|
48
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The file's MIME type, which picks the field's format the row's file is:
|
|
53
|
+
* the row names that format's label ("PNG") unless `typeLabel` words the
|
|
54
|
+
* type, and draws an image's glyph or a document's from it unless the
|
|
55
|
+
* host draws its own.
|
|
56
|
+
*/
|
|
49
57
|
mediaType?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The file's type in the host's own words ("Picture", "PDF document"), said
|
|
60
|
+
* on the row's second line in place of the format's label, so a row reads
|
|
61
|
+
* as the host's own list of files does. An empty string counts as none.
|
|
62
|
+
*/
|
|
63
|
+
typeLabel?: string;
|
|
50
64
|
/** The file's size in bytes. */
|
|
51
65
|
size?: number;
|
|
52
66
|
/** How the file came to be. A `test` file is marked "Test file" at the head of its row's second line. */
|
|
@@ -144,11 +158,6 @@ declare function sourceFileValue(file: SourceFile): {
|
|
|
144
158
|
* a new array and leaves `held` as it was.
|
|
145
159
|
*/
|
|
146
160
|
declare function addChosenFiles(held: readonly unknown[] | undefined, chosen: readonly SourceFile[]): unknown[];
|
|
147
|
-
/**
|
|
148
|
-
* How many files a list may still take from a source: its bound less the files
|
|
149
|
-
* it holds, since `addChosenFiles` writes into its empty rows before adding
|
|
150
|
-
* any. `undefined` when the list has no bound.
|
|
151
|
-
*/
|
|
152
161
|
/**
|
|
153
162
|
* How many files `addChosenFiles` writes for `chosen` into `held`: the choices
|
|
154
163
|
* whose address the list does not hold yet, each address once. This is what a
|
|
@@ -156,6 +165,11 @@ declare function addChosenFiles(held: readonly unknown[] | undefined, chosen: re
|
|
|
156
165
|
* second row naming a chosen file, takes no room.
|
|
157
166
|
*/
|
|
158
167
|
declare function chosenFilesAdded(held: readonly unknown[] | undefined, chosen: readonly SourceFile[]): number;
|
|
168
|
+
/**
|
|
169
|
+
* How many files a list may still take from a source: its bound less the files
|
|
170
|
+
* it holds, since `addChosenFiles` writes into its empty rows before adding
|
|
171
|
+
* any. `undefined` when the list has no bound.
|
|
172
|
+
*/
|
|
159
173
|
declare function roomForChosenFiles(held: readonly unknown[] | undefined, maxItemCount: number | undefined): number | undefined;
|
|
160
174
|
|
|
161
175
|
export { type ExampleSource, type ExampleSourcePage, type ExampleSourceQuery, type FileSource, type FileSourcePage, type FileSourceQuery, type FileSourceScope, type FormExample, type SourceFile, addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue };
|
package/dist/core/sources.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-
|
|
1
|
+
export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-O2VIVDHO.js';
|
|
2
2
|
//# sourceMappingURL=sources.js.map
|
|
3
3
|
//# sourceMappingURL=sources.js.map
|
|
@@ -1,6 +1,111 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { ReactNode, RefObject, Ref } from 'react';
|
|
2
3
|
import { FileRunField, RunField } from './core/descriptor.js';
|
|
3
|
-
import {
|
|
4
|
+
import { FileFormat } from './core/file-formats.js';
|
|
5
|
+
import { SourceFile, FileSource, FileSourceQuery, FileSourcePage } from './core/sources.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A file source as the control set takes it: the kernel's `FileSource`, which
|
|
9
|
+
* lists the files, and how a row draws, which only a renderer can say. Every
|
|
10
|
+
* `FileSource` is one, so a host that draws nothing passes its source as it is.
|
|
11
|
+
*
|
|
12
|
+
* `F` is the host's own row: a host may carry its own fields on the rows its
|
|
13
|
+
* `list` answers with (the format key its glyphs are chosen by, for instance)
|
|
14
|
+
* and read them back in `renderGlyph`, which receives each row exactly as
|
|
15
|
+
* `list` returned it. A source typed over its own row is accepted wherever a
|
|
16
|
+
* `FilePickerSource` is, because `renderGlyph` is declared as a method, whose
|
|
17
|
+
* parameter TypeScript compares both ways. Declared as a function-typed
|
|
18
|
+
* property it would be compared strictly, and a host's typed source would
|
|
19
|
+
* stop being accepted by `useMethodForm`, `FieldEnv` and `FilePicker`.
|
|
20
|
+
*/
|
|
21
|
+
interface FilePickerSource<F extends SourceFile = SourceFile> extends FileSource {
|
|
22
|
+
list: (query: FileSourceQuery) => Promise<FileSourcePage & {
|
|
23
|
+
files: readonly F[];
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Draws a row's glyph in place of the kernel's own, a 24px document or
|
|
27
|
+
* picture outline. What it returns sits at the row's start at its own size
|
|
28
|
+
* (the row is at least 64px tall and grows with a larger glyph), and is
|
|
29
|
+
* hidden from assistive technology, since the row's second line says the
|
|
30
|
+
* type. A row it returns what React renders nothing for keeps the kernel's
|
|
31
|
+
* glyph: `null`, `undefined`, `true`, `false` or `''`, so a
|
|
32
|
+
* `cond && <Tile />` whose condition is false falls back as it reads. A
|
|
33
|
+
* number is drawn, `0` included, because React draws it as text, so a
|
|
34
|
+
* condition that is a count is the host's to turn into a boolean.
|
|
35
|
+
*/
|
|
36
|
+
renderGlyph?(file: F): ReactNode;
|
|
37
|
+
}
|
|
38
|
+
interface FilePickerEntryProps {
|
|
39
|
+
/** Opens the sheet. */
|
|
40
|
+
onOpen: () => void;
|
|
41
|
+
/** The field's label as the form shows it, which names the row for assistive technology. */
|
|
42
|
+
label: string;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** The row's button, which the sheet hands focus back to (`FilePicker`'s `returnFocusTo`). */
|
|
45
|
+
ref?: Ref<HTMLButtonElement>;
|
|
46
|
+
/** The button's id, for a field whose label names this row, when it is the field's only way in. */
|
|
47
|
+
id?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* "Choose from your team's files": a full-width row with a folder icon, under
|
|
51
|
+
* the field's own controls.
|
|
52
|
+
*/
|
|
53
|
+
declare function FilePickerEntry({ onOpen, label, disabled, ref, id }: FilePickerEntryProps): react.JSX.Element;
|
|
54
|
+
interface FilePickerProps {
|
|
55
|
+
/** The host's list, and how its rows draw. */
|
|
56
|
+
source: FilePickerSource;
|
|
57
|
+
/** What the field accepts: the list is narrowed to these types, and the sheet names them. */
|
|
58
|
+
formats: readonly FileFormat[];
|
|
59
|
+
/** A list field's picker: several rows may be chosen. One otherwise. */
|
|
60
|
+
multiple?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The most files a choice may add, a list's remaining room; unbounded when
|
|
63
|
+
* absent. Counted as `chosenFilesAdded` counts them, against `held`.
|
|
64
|
+
*/
|
|
65
|
+
maxChoices?: number;
|
|
66
|
+
/**
|
|
67
|
+
* The list's items. A chosen file whose address they hold adds nothing to
|
|
68
|
+
* the list, nor does a second row naming a chosen file, so neither takes
|
|
69
|
+
* any of `maxChoices`.
|
|
70
|
+
*/
|
|
71
|
+
held?: readonly unknown[];
|
|
72
|
+
open: boolean;
|
|
73
|
+
onOpenChange: (open: boolean) => void;
|
|
74
|
+
/** What was chosen, in the order it was chosen. The sheet closes after. */
|
|
75
|
+
onUse: (files: SourceFile[]) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Offered as "Upload a file" when the person holds no file of the field's
|
|
78
|
+
* formats: the sheet closes, and this starts the field's own upload.
|
|
79
|
+
*/
|
|
80
|
+
onUpload?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* What focus goes back to when the sheet closes: the row that opened it, as
|
|
83
|
+
* a rule. Without it, focus goes back to whatever held it as the sheet
|
|
84
|
+
* opened, which a browser that does not focus a clicked button leaves unset.
|
|
85
|
+
*/
|
|
86
|
+
returnFocusTo?: RefObject<HTMLElement | null>;
|
|
87
|
+
/**
|
|
88
|
+
* Runs as the sheet closes, before focus goes back: `preventDefault()` on the
|
|
89
|
+
* event and focus something else, as a field does with the file it now holds.
|
|
90
|
+
*/
|
|
91
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Holds the sheet shut, as the field is while it is disabled or a file is
|
|
94
|
+
* arriving: an open sheet closes, writing nothing, and `onOpenChange` is
|
|
95
|
+
* told so.
|
|
96
|
+
*/
|
|
97
|
+
disabled?: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* "Your team's files": a bottom sheet below 1280px and a dialog from 1280px,
|
|
101
|
+
* with the field's formats named under its title, the search, the Mine and
|
|
102
|
+
* Everyone switch, the rows newest first, and one primary button at the foot.
|
|
103
|
+
*
|
|
104
|
+
* Closing it, by its close button, Escape, the backdrop or a swipe down, leaves
|
|
105
|
+
* the field as it was: only Use writes. The sheet's state lives in its body,
|
|
106
|
+
* which mounts when it opens, so it always opens on a fresh choice.
|
|
107
|
+
*/
|
|
108
|
+
declare function FilePicker({ open, onOpenChange, returnFocusTo, onCloseAutoFocus, disabled, ...props }: FilePickerProps): react.JSX.Element;
|
|
4
109
|
|
|
5
110
|
/** The serializable value of a file field. URL is what the runner sends. */
|
|
6
111
|
interface FileValue {
|
|
@@ -56,7 +161,7 @@ interface FileFieldProps {
|
|
|
56
161
|
* and the chosen file is written through `onChange` as `{ url, filename }`,
|
|
57
162
|
* the value an upload writes. See docs/sources.md.
|
|
58
163
|
*/
|
|
59
|
-
fileSource?:
|
|
164
|
+
fileSource?: FilePickerSource;
|
|
60
165
|
error?: string;
|
|
61
166
|
disabled?: boolean;
|
|
62
167
|
}
|
|
@@ -192,9 +297,10 @@ interface FieldEnv {
|
|
|
192
297
|
* is the capability, as `onDropFile`'s is: every empty file field then
|
|
193
298
|
* offers "Choose from your team's files", and a list of files offers it for
|
|
194
299
|
* several at once. The choice is written as `{ url, filename }`, exactly as
|
|
195
|
-
* an upload's result is.
|
|
300
|
+
* an upload's result is. Its `renderGlyph`, when given, draws each row's
|
|
301
|
+
* glyph in the sheet. See docs/sources.md.
|
|
196
302
|
*/
|
|
197
|
-
fileSource?:
|
|
303
|
+
fileSource?: FilePickerSource;
|
|
198
304
|
}
|
|
199
305
|
interface FieldRendererProps {
|
|
200
306
|
field: RunField;
|
|
@@ -212,4 +318,4 @@ interface FieldRendererProps {
|
|
|
212
318
|
*/
|
|
213
319
|
declare function FieldRenderer({ field, value, onChange, id, error, env }: FieldRendererProps): react.JSX.Element;
|
|
214
320
|
|
|
215
|
-
export { DocumentField as D, type FieldEnv as F, ImageField as I, type RowMove as R, type UploadedFile as U,
|
|
321
|
+
export { DocumentField as D, type FieldEnv as F, ImageField as I, type RowMove as R, type UploadedFile as U, type FilePickerSource as a, FieldRenderer as b, type FieldRendererProps as c, FilePicker as d, FilePickerEntry as e, type FilePickerEntryProps as f, type FilePickerProps as g, type FileValue as h };
|
|
@@ -9,7 +9,7 @@ import { Components, Renderer } from '@json-render/react';
|
|
|
9
9
|
import { B as BrandManifest } from '../manifest-DUeAWeqa.js';
|
|
10
10
|
export { b as brandManifestSchema } from '../manifest-DUeAWeqa.js';
|
|
11
11
|
import * as zod_v4_core from 'zod/v4/core';
|
|
12
|
-
import { F as FieldEnv } from '../field-renderer-
|
|
12
|
+
import { F as FieldEnv } from '../field-renderer-CH-biG8C.js';
|
|
13
13
|
export { seedInputs } from '../core/seed.js';
|
|
14
14
|
import '../core/contracts.js';
|
|
15
15
|
import 'mthds/protocol';
|
package/dist/generative/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn, checkedAccentClass, focusOutlineClass, linkTextClass, selectedBorderClass, selectedFillClass, fieldControlClass, ResultRoot, ResultField, FieldRenderer, ToggleGroup, ToggleGroupItem, selectedFillStrongClass, Switch, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../chunk-
|
|
2
|
+
import { cn, checkedAccentClass, focusOutlineClass, linkTextClass, selectedBorderClass, selectedFillClass, fieldControlClass, ResultRoot, ResultField, FieldRenderer, ToggleGroup, ToggleGroupItem, selectedFillStrongClass, Switch, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../chunk-W5MYXDLO.js';
|
|
3
3
|
import '../chunk-ICUEHNEH.js';
|
|
4
4
|
export { seedInputs } from '../chunk-VH5CDQDR.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-O2VIVDHO.js';
|
|
6
6
|
import '../chunk-RRTI7AIR.js';
|
|
7
7
|
import '../chunk-ZX52CQJ4.js';
|
|
8
8
|
import { isNativeValueNode, readDateContent, formatDateContent, isNativeHtmlNode, isNativeDateNode, isNativeCompositeNode } from '../chunk-CM4KVG53.js';
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { F as FieldEnv, R as RowMove, U as UploadedFile } from '../field-renderer-
|
|
2
|
-
export { D as DocumentField,
|
|
1
|
+
import { F as FieldEnv, R as RowMove, a as FilePickerSource, U as UploadedFile } from '../field-renderer-CH-biG8C.js';
|
|
2
|
+
export { D as DocumentField, b as FieldRenderer, c as FieldRendererProps, d as FilePicker, e as FilePickerEntry, f as FilePickerEntryProps, g as FilePickerProps, h as FileValue, I as ImageField } from '../field-renderer-CH-biG8C.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
5
|
import { BooleanRunField, DateRunField, EnumRunField, ListRunField, NumberRunField, ObjectRunField, ProseRunField, TextRunField, UnknownRunField, RunField, ConceptCategory } from '../core/descriptor.js';
|
|
6
6
|
import { PipeInputFormDescriptor, PipeIOContract } from 'mthds/protocol';
|
|
7
7
|
import { Readiness } from '../core/readiness.js';
|
|
8
|
-
import {
|
|
9
|
-
export { ExampleSourcePage, ExampleSourceQuery, FileSourcePage, FileSourceQuery, FileSourceScope } from '../core/sources.js';
|
|
10
|
-
import { FileFormat } from '../core/file-formats.js';
|
|
8
|
+
import { ExampleSource, FormExample } from '../core/sources.js';
|
|
9
|
+
export { ExampleSourcePage, ExampleSourceQuery, FileSource, FileSourcePage, FileSourceQuery, FileSourceScope, SourceFile } from '../core/sources.js';
|
|
11
10
|
import { SaveFiles, SaveFile, SaveResult } from '../core/save-plan.js';
|
|
12
11
|
import { StuffFileKind } from '../core/stuff-files.js';
|
|
13
12
|
import { HtmlContentView } from '../core/native-content.js';
|
|
13
|
+
import '../core/file-formats.js';
|
|
14
14
|
import '../core/contracts.js';
|
|
15
15
|
|
|
16
16
|
interface BooleanFieldProps {
|
|
@@ -556,9 +556,10 @@ interface UseMethodFormOptions {
|
|
|
556
556
|
* is the capability, as `uploadFile`'s is: every empty file field then offers
|
|
557
557
|
* "Choose from your team's files", and a list of files offers it for several
|
|
558
558
|
* at once. The choice is written as `{ url, filename }`, as an upload's
|
|
559
|
-
* result is.
|
|
559
|
+
* result is. Its `renderGlyph`, when given, draws each row's glyph in the
|
|
560
|
+
* sheet. See docs/sources.md.
|
|
560
561
|
*/
|
|
561
|
-
fileSource?:
|
|
562
|
+
fileSource?: FilePickerSource;
|
|
562
563
|
/**
|
|
563
564
|
* Where the form can take a saved example of the method. When given,
|
|
564
565
|
* `MethodForm` offers "Fill with an example" above the fields, which sets
|
|
@@ -686,7 +687,7 @@ interface MethodFormController extends MethodFormState {
|
|
|
686
687
|
filename: string;
|
|
687
688
|
}>) | undefined;
|
|
688
689
|
/** The host's file source, which `MethodForm` hands its file fields. */
|
|
689
|
-
fileSource:
|
|
690
|
+
fileSource: FilePickerSource | undefined;
|
|
690
691
|
/** The host's example source, which `MethodForm` offers above the fields. */
|
|
691
692
|
exampleSource: ExampleSource | undefined;
|
|
692
693
|
}
|
|
@@ -741,78 +742,6 @@ interface MethodFormProps {
|
|
|
741
742
|
*/
|
|
742
743
|
declare function MethodForm({ locale, strings, presentation, ...props }: MethodFormProps): react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
743
744
|
|
|
744
|
-
interface FilePickerEntryProps {
|
|
745
|
-
/** Opens the sheet. */
|
|
746
|
-
onOpen: () => void;
|
|
747
|
-
/** The field's label as the form shows it, which names the row for assistive technology. */
|
|
748
|
-
label: string;
|
|
749
|
-
disabled?: boolean;
|
|
750
|
-
/** The row's button, which the sheet hands focus back to (`FilePicker`'s `returnFocusTo`). */
|
|
751
|
-
ref?: Ref<HTMLButtonElement>;
|
|
752
|
-
/** The button's id, for a field whose label names this row, when it is the field's only way in. */
|
|
753
|
-
id?: string;
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* "Choose from your team's files": a full-width row with a folder icon, under
|
|
757
|
-
* the field's own controls.
|
|
758
|
-
*/
|
|
759
|
-
declare function FilePickerEntry({ onOpen, label, disabled, ref, id }: FilePickerEntryProps): react.JSX.Element;
|
|
760
|
-
interface FilePickerProps {
|
|
761
|
-
/** The host's list. */
|
|
762
|
-
source: FileSource;
|
|
763
|
-
/** What the field accepts: the list is narrowed to these types, and the sheet names them. */
|
|
764
|
-
formats: readonly FileFormat[];
|
|
765
|
-
/** A list field's picker: several rows may be chosen. One otherwise. */
|
|
766
|
-
multiple?: boolean;
|
|
767
|
-
/**
|
|
768
|
-
* The most files a choice may add, a list's remaining room; unbounded when
|
|
769
|
-
* absent. Counted as `chosenFilesAdded` counts them, against `held`.
|
|
770
|
-
*/
|
|
771
|
-
maxChoices?: number;
|
|
772
|
-
/**
|
|
773
|
-
* The list's items. A chosen file whose address they hold adds nothing to
|
|
774
|
-
* the list, nor does a second row naming a chosen file, so neither takes
|
|
775
|
-
* any of `maxChoices`.
|
|
776
|
-
*/
|
|
777
|
-
held?: readonly unknown[];
|
|
778
|
-
open: boolean;
|
|
779
|
-
onOpenChange: (open: boolean) => void;
|
|
780
|
-
/** What was chosen, in the order it was chosen. The sheet closes after. */
|
|
781
|
-
onUse: (files: SourceFile[]) => void;
|
|
782
|
-
/**
|
|
783
|
-
* Offered as "Upload a file" when the person holds no file of the field's
|
|
784
|
-
* formats: the sheet closes, and this starts the field's own upload.
|
|
785
|
-
*/
|
|
786
|
-
onUpload?: () => void;
|
|
787
|
-
/**
|
|
788
|
-
* What focus goes back to when the sheet closes: the row that opened it, as
|
|
789
|
-
* a rule. Without it, focus goes back to whatever held it as the sheet
|
|
790
|
-
* opened, which a browser that does not focus a clicked button leaves unset.
|
|
791
|
-
*/
|
|
792
|
-
returnFocusTo?: RefObject<HTMLElement | null>;
|
|
793
|
-
/**
|
|
794
|
-
* Runs as the sheet closes, before focus goes back: `preventDefault()` on the
|
|
795
|
-
* event and focus something else, as a field does with the file it now holds.
|
|
796
|
-
*/
|
|
797
|
-
onCloseAutoFocus?: (event: Event) => void;
|
|
798
|
-
/**
|
|
799
|
-
* Holds the sheet shut, as the field is while it is disabled or a file is
|
|
800
|
-
* arriving: an open sheet closes, writing nothing, and `onOpenChange` is
|
|
801
|
-
* told so.
|
|
802
|
-
*/
|
|
803
|
-
disabled?: boolean;
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* "Your team's files": a bottom sheet below 1280px and a dialog from 1280px,
|
|
807
|
-
* with the field's formats named under its title, the search, the Mine and
|
|
808
|
-
* Everyone switch, the rows newest first, and one primary button at the foot.
|
|
809
|
-
*
|
|
810
|
-
* Closing it, by its close button, Escape, the backdrop or a swipe down, leaves
|
|
811
|
-
* the field as it was: only Use writes. The sheet's state lives in its body,
|
|
812
|
-
* which mounts when it opens, so it always opens on a fresh choice.
|
|
813
|
-
*/
|
|
814
|
-
declare function FilePicker({ open, onOpenChange, returnFocusTo, onCloseAutoFocus, disabled, ...props }: FilePickerProps): react.JSX.Element;
|
|
815
|
-
|
|
816
745
|
interface FillWithExampleProps {
|
|
817
746
|
/** The host's examples of this method. */
|
|
818
747
|
source: ExampleSource;
|
|
@@ -1648,4 +1577,4 @@ declare function FieldDomIdProvider({ prefix, children, }: {
|
|
|
1648
1577
|
*/
|
|
1649
1578
|
declare function useFieldDomId(path: string): string;
|
|
1650
1579
|
|
|
1651
|
-
export { BooleanField, ConceptPill, DEFAULT_FIELD_STRINGS, DateField, type DownloadDisplay, EN_FIELD_STRINGS, EnumField, ExampleSource, FIELD_STRINGS_BY_LOCALE, FR_FIELD_STRINGS, FieldDomIdProvider, FieldEnv, type FieldPresentation, FieldPresentationProvider, FieldShell, type FieldStrings, FieldStringsProvider,
|
|
1580
|
+
export { BooleanField, ConceptPill, DEFAULT_FIELD_STRINGS, DateField, type DownloadDisplay, EN_FIELD_STRINGS, EnumField, ExampleSource, FIELD_STRINGS_BY_LOCALE, FR_FIELD_STRINGS, FieldDomIdProvider, FieldEnv, type FieldPresentation, FieldPresentationProvider, FieldShell, type FieldStrings, FieldStringsProvider, FilePickerSource, FillWithExample, type FillWithExampleProps, FormExample, type HtmlPdf, type HtmlPdfOptions, HtmlPreview, type HtmlPreviewProps, JsonView, ListField, Markdown, type MarkdownProps, type MarkupResolvers, MethodForm, type MethodFormController, type MethodFormProps, type MethodFormState, type MethodFormUploadContext, type MethodFormValues, NumberField, ObjectField, OptionalToggle, PdfDownloadButton, type PdfDownloadButtonProps, type PdfPage, ProseField, type ProseImages, type RenderPdf, type ResolveShareUrl, type ResolveUrl, type ResolveUrls, ResultEnvProvider, ResultField, type ResultFieldProps, RowMove, SUPPORTED_LOCALES, StuffViewer, type StuffViewerProps, type StuffViewerView, type TableLayout, TextField, UnknownField, UploadedFile, type UseMethodFormOptions, fieldControlClass, fieldStringsFor, humanizeFieldName, renderHtmlPdf, resolveHtmlStorageUrls, saveInBrowser, useFieldDomId, useFieldPresentation, useFieldStrings, useMethodForm, useProseImages, useResolveShareUrl, useResolveUrl, useResolvedUrl };
|
package/dist/react/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { BooleanField, ConceptPill, DEFAULT_FIELD_STRINGS, DateField, DocumentField, EN_FIELD_STRINGS, EnumField, FIELD_STRINGS_BY_LOCALE, FR_FIELD_STRINGS, FieldDomIdProvider, FieldPresentationProvider, FieldRenderer, FieldShell, FieldStringsProvider, FilePicker, FilePickerEntry, FillWithExample, HtmlPreview, ImageField, JsonView, ListField, Markdown, MethodForm, NumberField, ObjectField, OptionalToggle, PdfDownloadButton, ProseField, ResultEnvProvider, ResultField, SUPPORTED_LOCALES, StuffViewer, TextField, UnknownField, fieldControlClass, fieldStringsFor, humanizeFieldName, renderHtmlPdf, resolveHtmlStorageUrls, saveInBrowser, useFieldDomId, useFieldPresentation, useFieldStrings, useMethodForm, useProseImages, useResolveShareUrl, useResolveUrl, useResolvedUrl } from '../chunk-
|
|
2
|
+
export { BooleanField, ConceptPill, DEFAULT_FIELD_STRINGS, DateField, DocumentField, EN_FIELD_STRINGS, EnumField, FIELD_STRINGS_BY_LOCALE, FR_FIELD_STRINGS, FieldDomIdProvider, FieldPresentationProvider, FieldRenderer, FieldShell, FieldStringsProvider, FilePicker, FilePickerEntry, FillWithExample, HtmlPreview, ImageField, JsonView, ListField, Markdown, MethodForm, NumberField, ObjectField, OptionalToggle, PdfDownloadButton, ProseField, ResultEnvProvider, ResultField, SUPPORTED_LOCALES, StuffViewer, TextField, UnknownField, fieldControlClass, fieldStringsFor, humanizeFieldName, renderHtmlPdf, resolveHtmlStorageUrls, saveInBrowser, useFieldDomId, useFieldPresentation, useFieldStrings, useMethodForm, useProseImages, useResolveShareUrl, useResolveUrl, useResolvedUrl } from '../chunk-W5MYXDLO.js';
|
|
3
3
|
import '../chunk-ICUEHNEH.js';
|
|
4
4
|
import '../chunk-VH5CDQDR.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-O2VIVDHO.js';
|
|
6
6
|
import '../chunk-RRTI7AIR.js';
|
|
7
7
|
import '../chunk-ZX52CQJ4.js';
|
|
8
8
|
import '../chunk-CM4KVG53.js';
|