@panneau/fields 5.0.0-alpha.7 → 5.0.0-alpha.9
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/boolean/BooleanField.d.ts +1 -1
- package/dist/boolean/index.d.ts +1 -1
- package/dist/color/ColorField.d.ts +2 -2
- package/dist/color/index.d.ts +1 -1
- package/dist/date/DateField.d.ts +1 -1
- package/dist/date/index.d.ts +1 -1
- package/dist/datetime/DateTimeField.d.ts +1 -1
- package/dist/datetime/index.d.ts +1 -1
- package/dist/duration/DurationField.d.ts +1 -1
- package/dist/duration/index.d.ts +1 -1
- package/dist/email/EmailField.d.ts +2 -2
- package/dist/email/index.d.ts +1 -1
- package/dist/embed/EmbedField.d.ts +2 -2
- package/dist/embed/index.d.ts +2 -2
- package/dist/file/FileField.d.ts +2 -2
- package/dist/file/index.d.ts +2 -2
- package/dist/group/GroupField.d.ts +1 -1
- package/dist/group/index.d.ts +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/json/JsonField.d.ts +1 -1
- package/dist/json/index.d.ts +1 -1
- package/dist/localized/LocalizedField.d.ts +1 -1
- package/dist/localized/index.d.ts +1 -1
- package/dist/location/LocationField.d.ts +3 -3
- package/dist/location/LocationMap.d.ts +1 -1
- package/dist/location/index.d.ts +4 -4
- package/dist/location/nominatim.d.ts +1 -1
- package/dist/missing/MissingField.d.ts +1 -1
- package/dist/number/NumberField.d.ts +1 -1
- package/dist/number/index.d.ts +1 -1
- package/dist/range/RangeField.d.ts +1 -1
- package/dist/range/index.d.ts +1 -1
- package/dist/relation/RelationField.d.ts +2 -2
- package/dist/relation/index.d.ts +2 -2
- package/dist/repeater/RepeaterField.d.ts +1 -1
- package/dist/repeater/index.d.ts +1 -1
- package/dist/select/SelectField.d.ts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/shared/DefinitionField.d.ts +1 -1
- package/dist/shared/builtIn.d.ts +1 -1
- package/dist/shared/context.d.ts +6 -6
- package/dist/shared/entry.d.ts +2 -1
- package/dist/shared/entry.d.ts.map +1 -1
- package/dist/shared/entry.js +2 -1
- package/dist/shared/entry.js.map +1 -1
- package/dist/slug/SlugField.d.ts +2 -2
- package/dist/slug/index.d.ts +1 -1
- package/dist/tags/TagsField.d.ts +1 -1
- package/dist/tags/index.d.ts +1 -1
- package/dist/tel/TelField.d.ts +2 -2
- package/dist/tel/index.d.ts +1 -1
- package/dist/text/TextField.d.ts +12 -4
- package/dist/text/TextField.d.ts.map +1 -1
- package/dist/text/TextField.js +104 -60
- package/dist/text/TextField.js.map +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/textarea/TextAreaField.d.ts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/time/TimeField.d.ts +1 -1
- package/dist/time/index.d.ts +1 -1
- package/dist/upload/UploadList.d.ts +1 -1
- package/dist/upload/useRejectionMessage.d.ts +1 -1
- package/dist/upload/useUploads.d.ts +1 -1
- package/dist/uppy/index.d.ts +2 -2
- package/dist/uppy/uploader.d.ts +1 -1
- package/dist/url/UrlField.d.ts +2 -2
- package/dist/url/index.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface BooleanFieldProps extends Omit<FieldProps<boolean>, 'labelClassName'> {
|
|
3
3
|
/** `checkbox` (default) for a choice saved with the form, `switch` for an on and off setting. */
|
|
4
4
|
widget?: 'checkbox' | 'switch';
|
package/dist/boolean/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BooleanField, BooleanFieldEntry, type BooleanFieldProps } from './BooleanField';
|
|
1
|
+
export { BooleanField, BooleanFieldEntry, type BooleanFieldProps } from './BooleanField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export type ColorFieldProps = Omit<TextFieldProps, 'type' | 'prefix' | 'maxLength'>;
|
|
4
4
|
/**
|
|
5
5
|
* Normalizes a hexadecimal color: `#` prefix, lowercase, and 3 digits expanded to 6. Returns the
|
package/dist/color/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ColorField, ColorFieldEntry, type ColorFieldProps, normalizeColor } from './ColorField';
|
|
1
|
+
export { ColorField, ColorFieldEntry, type ColorFieldProps, normalizeColor } from './ColorField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/date/DateField.d.ts
CHANGED
package/dist/date/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateField, DateFieldEntry, type DateFieldProps } from './DateField';
|
|
1
|
+
export { DateField, DateFieldEntry, type DateFieldProps } from './DateField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface DateTimeFieldProps extends FieldProps<string> {
|
|
3
3
|
/**
|
|
4
4
|
* Time zone the date and time are shown and typed in, for values with an offset. Defaults to
|
package/dist/datetime/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateTimeField, DateTimeFieldEntry, type DateTimeFieldProps } from './DateTimeField';
|
|
1
|
+
export { DateTimeField, DateTimeFieldEntry, type DateTimeFieldProps } from './DateTimeField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface DurationFieldProps extends FieldProps<number> {
|
|
3
3
|
/** `seconds` (the default) shows hours, minutes and seconds; `minutes` hides the seconds. */
|
|
4
4
|
precision?: 'seconds' | 'minutes';
|
package/dist/duration/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DurationField, DurationFieldEntry, type DurationFieldProps, formatDuration, splitDuration, } from './DurationField';
|
|
1
|
+
export { DurationField, DurationFieldEntry, type DurationFieldProps, formatDuration, splitDuration, } from './DurationField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export type EmailFieldProps = Omit<TextFieldProps, 'type' | 'inputMode'>;
|
|
4
4
|
/** An email address, with the email keyboard on phones. Spaces around it are removed on blur. */
|
|
5
5
|
export declare function EmailField({ value, onChange, onBlur, ...props }: EmailFieldProps): import("react").JSX.Element;
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { EmailField, EmailFieldEntry, type EmailFieldProps } from './EmailField';
|
|
1
|
+
export { EmailField, EmailFieldEntry, type EmailFieldProps } from './EmailField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmbedValue } from '@panneau/protocol';
|
|
2
|
-
import type { EmbedSource } from '../shared/embed';
|
|
3
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { EmbedSource } from '../shared/embed.js';
|
|
3
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
4
4
|
export type { EmbedValue };
|
|
5
5
|
export interface EmbedFieldProps extends FieldProps<EmbedValue> {
|
|
6
6
|
placeholder?: string;
|
package/dist/embed/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { EmbedField, EmbedFieldEntry, type EmbedFieldProps, type EmbedValue, isEmbed, } from './EmbedField';
|
|
2
|
-
export { type EmbedAdapter, type EmbedSource, createEmbedSource } from '../shared/embed';
|
|
1
|
+
export { EmbedField, EmbedFieldEntry, type EmbedFieldProps, type EmbedValue, isEmbed, } from './EmbedField.js';
|
|
2
|
+
export { type EmbedAdapter, type EmbedSource, createEmbedSource } from '../shared/embed.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/file/FileField.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StoredFile } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
3
|
-
import type { UploadSource, UploadedFile } from '../upload/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
|
+
import type { UploadSource, UploadedFile } from '../upload/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* A file of a `file` value: a stored file, as items give it; an upload, once the browser sent the
|
|
6
6
|
* file to storage; or the file itself, sent in a multipart request without direct uploads.
|
package/dist/file/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type FileFieldBaseProps, FileField, FileFieldEntry, type FileFieldProps, type FileValue, type MultipleFileFieldProps, type SingleFileFieldProps, isFileValue, toFiles, } from './FileField';
|
|
2
|
-
export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types';
|
|
1
|
+
export { type FileFieldBaseProps, FileField, FileFieldEntry, type FileFieldProps, type FileValue, type MultipleFileFieldProps, type SingleFileFieldProps, isFileValue, toFiles, } from './FileField.js';
|
|
2
|
+
export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Field } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export type GroupValue = Record<string, unknown>;
|
|
4
4
|
export interface GroupFieldProps extends FieldProps<GroupValue> {
|
|
5
5
|
/** The nested fields, rendered with the entries of the fields context. */
|
package/dist/group/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GroupField, GroupFieldEntry, type GroupFieldProps, type GroupValue } from './GroupField';
|
|
1
|
+
export { GroupField, GroupFieldEntry, type GroupFieldProps, type GroupValue } from './GroupField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { DefinitionField, NestedField, type NestedFieldProps } from './shared/DefinitionField';
|
|
2
|
-
export { builtInFields, fieldsPlugin } from './shared/builtIn';
|
|
3
|
-
export { type BoundFieldProps, type FieldBinding, type FieldBindingProps, FieldsProvider, type FieldsContextValue, type FieldsProviderProps, getParentPath, useFieldsContext, } from './shared/context';
|
|
4
|
-
export { findRule, getAccept, getFieldProps, getMaxSize, getRuleNumber, isRequired, } from './shared/entry';
|
|
5
|
-
export { type RelationListAdapter, type RelationReference, type RelationSource, type RelationSourceOptions, createRelationSource, toReferences, useRelationReferences, } from './shared/relation';
|
|
6
|
-
export { type FieldCheckAdapter, type FieldCheckSource, createFieldCheckSource, } from './shared/check';
|
|
7
|
-
export { type EmbedAdapter, type EmbedSource, createEmbedSource } from './shared/embed';
|
|
8
|
-
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './location/types';
|
|
9
|
-
export { type NominatimSourceOptions, createNominatimSource } from './location/nominatim';
|
|
10
|
-
export type { FieldEntry, FieldEntryProps, FieldProps } from './shared/types';
|
|
11
|
-
export { MissingFieldEntry } from './missing/MissingField';
|
|
12
|
-
export { type FileFieldBaseProps, FileField, FileFieldEntry, type FileFieldProps, type FileValue, type MultipleFileFieldProps, type SingleFileFieldProps, isFileValue, toFiles, } from './file/FileField';
|
|
13
|
-
export { FilePicker, type FilePickerProps } from './upload/FilePicker';
|
|
14
|
-
export { UploadList, type UploadListProps } from './upload/UploadList';
|
|
15
|
-
export { formatSize, matchesMime } from './upload/files';
|
|
16
|
-
export { type UploadItem, type UploadItemStatus, type UploadRejection, type UploadSource, type UploadedFile, type Uploader, } from './upload/types';
|
|
17
|
-
export { useRejectionMessage } from './upload/useRejectionMessage';
|
|
18
|
-
export { type UseUploadsOptions, type UseUploadsResult, useUploads } from './upload/useUploads';
|
|
1
|
+
export { DefinitionField, NestedField, type NestedFieldProps } from './shared/DefinitionField.js';
|
|
2
|
+
export { builtInFields, fieldsPlugin } from './shared/builtIn.js';
|
|
3
|
+
export { type BoundFieldProps, type FieldBinding, type FieldBindingProps, FieldsProvider, type FieldsContextValue, type FieldsProviderProps, getParentPath, useFieldsContext, } from './shared/context.js';
|
|
4
|
+
export { findRule, getAccept, getFieldProps, getMaxSize, getRuleNumber, isRequired, } from './shared/entry.js';
|
|
5
|
+
export { type RelationListAdapter, type RelationReference, type RelationSource, type RelationSourceOptions, createRelationSource, toReferences, useRelationReferences, } from './shared/relation.js';
|
|
6
|
+
export { type FieldCheckAdapter, type FieldCheckSource, createFieldCheckSource, } from './shared/check.js';
|
|
7
|
+
export { type EmbedAdapter, type EmbedSource, createEmbedSource } from './shared/embed.js';
|
|
8
|
+
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './location/types.js';
|
|
9
|
+
export { type NominatimSourceOptions, createNominatimSource } from './location/nominatim.js';
|
|
10
|
+
export type { FieldEntry, FieldEntryProps, FieldProps } from './shared/types.js';
|
|
11
|
+
export { MissingFieldEntry } from './missing/MissingField.js';
|
|
12
|
+
export { type FileFieldBaseProps, FileField, FileFieldEntry, type FileFieldProps, type FileValue, type MultipleFileFieldProps, type SingleFileFieldProps, isFileValue, toFiles, } from './file/FileField.js';
|
|
13
|
+
export { FilePicker, type FilePickerProps } from './upload/FilePicker.js';
|
|
14
|
+
export { UploadList, type UploadListProps } from './upload/UploadList.js';
|
|
15
|
+
export { formatSize, matchesMime } from './upload/files.js';
|
|
16
|
+
export { type UploadItem, type UploadItemStatus, type UploadRejection, type UploadSource, type UploadedFile, type Uploader, } from './upload/types.js';
|
|
17
|
+
export { useRejectionMessage } from './upload/useRejectionMessage.js';
|
|
18
|
+
export { type UseUploadsOptions, type UseUploadsResult, useUploads } from './upload/useUploads.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/json/JsonField.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
/** The value of a `json` field: an object or an array, or the text while it doesn't parse. */
|
|
3
3
|
export type JsonValue = Record<string, unknown> | unknown[] | string;
|
|
4
4
|
export interface JsonFieldProps extends FieldProps<JsonValue> {
|
package/dist/json/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { JsonField, JsonFieldEntry, type JsonFieldProps, type JsonValue, parseJson, } from './JsonField';
|
|
1
|
+
export { JsonField, JsonFieldEntry, type JsonFieldProps, type JsonValue, parseJson, } from './JsonField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
/** A localized value: a value per locale (`{ fr: 'Été', en: 'Summer' }`). */
|
|
4
4
|
export type LocalizedValue<V> = Partial<Record<string, V | null>>;
|
|
5
5
|
/** What `LocalizedField` gives the input of each locale. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { LocalizedField, LocalizedFieldEntry, type LocalizedFieldProps, type LocalizedInputProps, type LocalizedValue, useLocaleName, } from './LocalizedField';
|
|
1
|
+
export { LocalizedField, LocalizedFieldEntry, type LocalizedFieldProps, type LocalizedInputProps, type LocalizedValue, useLocaleName, } from './LocalizedField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LocationValue } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
3
|
-
import { type Point } from './LocationMap';
|
|
4
|
-
import type { GeocodingSource, MapTiles } from './types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
|
+
import { type Point } from './LocationMap.js';
|
|
4
|
+
import type { GeocodingSource, MapTiles } from './types.js';
|
|
5
5
|
export type { LocationValue };
|
|
6
6
|
/** OpenStreetMap's standard tiles: fine for an admin panel, with their credit. */
|
|
7
7
|
export declare const OPEN_STREET_MAP_TILES: MapTiles;
|
package/dist/location/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { LocationField, LocationFieldEntry, type LocationFieldProps, type LocationValue, OPEN_STREET_MAP_TILES, isLocation, } from './LocationField';
|
|
2
|
-
export { LocationMap, type LocationMapProps, type Point } from './LocationMap';
|
|
3
|
-
export { createNominatimSource, type NominatimSourceOptions } from './nominatim';
|
|
4
|
-
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './types';
|
|
1
|
+
export { LocationField, LocationFieldEntry, type LocationFieldProps, type LocationValue, OPEN_STREET_MAP_TILES, isLocation, } from './LocationField.js';
|
|
2
|
+
export { LocationMap, type LocationMapProps, type Point } from './LocationMap.js';
|
|
3
|
+
export { createNominatimSource, type NominatimSourceOptions } from './nominatim.js';
|
|
4
|
+
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './types.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
2
|
/**
|
|
3
3
|
* The slot of a field type that no plugin provides, such as `richtext` and `media` without
|
|
4
4
|
* `@panneau/editor` and `@panneau/media`: it keeps the field's place in the form and names the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export interface NumberFieldProps extends FieldProps<number> {
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
min?: number;
|
package/dist/number/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NumberField, NumberFieldEntry, type NumberFieldProps } from './NumberField';
|
|
1
|
+
export { NumberField, NumberFieldEntry, type NumberFieldProps } from './NumberField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export interface RangeFieldProps extends FieldProps<number> {
|
|
4
4
|
/** The start of the slider. Defaults to 0. */
|
|
5
5
|
min?: number;
|
package/dist/range/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RangeField, RangeFieldEntry, type RangeFieldProps } from './RangeField';
|
|
1
|
+
export { RangeField, RangeFieldEntry, type RangeFieldProps } from './RangeField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type RelationReference, type RelationSource } from '../shared/relation';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import { type RelationReference, type RelationSource } from '../shared/relation.js';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
/** Results of a search in a relation source, as it types. */
|
|
4
4
|
export declare function useRelationSearch(source: RelationSource | null, resource: string, query: string, { enabled, delay }?: {
|
|
5
5
|
enabled?: boolean;
|
package/dist/relation/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type MultipleRelationFieldProps, type RelationFieldBaseProps, RelationField, RelationFieldEntry, type RelationFieldProps, type SingleRelationFieldProps, useRelationSearch, } from './RelationField';
|
|
2
|
-
export { type RelationListAdapter, type RelationReference, type RelationSource, type RelationSourceOptions, createRelationSource, useRelationReferences, } from '../shared/relation';
|
|
1
|
+
export { type MultipleRelationFieldProps, type RelationFieldBaseProps, RelationField, RelationFieldEntry, type RelationFieldProps, type SingleRelationFieldProps, useRelationSearch, } from './RelationField.js';
|
|
2
|
+
export { type RelationListAdapter, type RelationReference, type RelationSource, type RelationSourceOptions, createRelationSource, useRelationReferences, } from '../shared/relation.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlockType, Field } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
/** An item of a repeater. Typed blocks have their type in `type`. */
|
|
4
4
|
export type RepeaterItem = Record<string, unknown>;
|
|
5
5
|
export interface RepeaterFieldProps extends FieldProps<RepeaterItem[]> {
|
package/dist/repeater/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RepeaterField, RepeaterFieldEntry, type RepeaterFieldProps, type RepeaterItem, } from './RepeaterField';
|
|
1
|
+
export { RepeaterField, RepeaterFieldEntry, type RepeaterFieldProps, type RepeaterItem, } from './RepeaterField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Option } from '@panneau/protocol';
|
|
2
2
|
import { type OptionValue } from '@panneau/ui';
|
|
3
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
3
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
4
4
|
export type { OptionValue };
|
|
5
5
|
/** Props of both single and multiple select fields. */
|
|
6
6
|
export interface SelectFieldBaseProps extends Omit<FieldProps<never>, 'value' | 'onChange'> {
|
package/dist/select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type MultipleSelectFieldProps, type SelectFieldBaseProps, type OptionValue, SelectField, SelectFieldEntry, type SelectFieldProps, type SingleSelectFieldProps, } from './SelectField';
|
|
1
|
+
export { type MultipleSelectFieldProps, type SelectFieldBaseProps, type OptionValue, SelectField, SelectFieldEntry, type SelectFieldProps, type SingleSelectFieldProps, } from './SelectField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/shared/builtIn.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntry } from './types';
|
|
1
|
+
import type { FieldEntry } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* The entries of the built-in field types. `richtext` and `media` come with their plugins
|
|
4
4
|
* (`@panneau/editor` and `@panneau/media`): without them, `DefinitionField` renders a placeholder.
|
package/dist/shared/context.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import type { Field } from '@panneau/protocol';
|
|
3
|
-
import type { MapsConfig } from '../location/types';
|
|
4
|
-
import type { UploadSource } from '../upload/types';
|
|
5
|
-
import type { FieldCheckSource } from './check';
|
|
6
|
-
import type { EmbedSource } from './embed';
|
|
7
|
-
import type { RelationSource } from './relation';
|
|
8
|
-
import type { FieldEntry } from './types';
|
|
3
|
+
import type { MapsConfig } from '../location/types.js';
|
|
4
|
+
import type { UploadSource } from '../upload/types.js';
|
|
5
|
+
import type { FieldCheckSource } from './check.js';
|
|
6
|
+
import type { EmbedSource } from './embed.js';
|
|
7
|
+
import type { RelationSource } from './relation.js';
|
|
8
|
+
import type { FieldEntry } from './types.js';
|
|
9
9
|
/** What a binding gives a field: its value, handlers and errors at a path. */
|
|
10
10
|
export interface BoundFieldProps {
|
|
11
11
|
value: unknown;
|
package/dist/shared/entry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Field, Rule } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from './types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from './types.js';
|
|
3
3
|
/** The rule of a field with this name, if any. */
|
|
4
4
|
export declare function findRule(field: Field, rule: Rule['rule']): Rule | undefined;
|
|
5
5
|
/** The number of a `min` or `max` rule of a field, if any. */
|
|
@@ -9,6 +9,7 @@ export declare function isRequired(field: Field): boolean;
|
|
|
9
9
|
/** A setting of a field (`settings.<name>`), when it has the expected type. */
|
|
10
10
|
export declare function getSetting<T>(field: Field, name: string, guard: (value: unknown) => value is T): T | undefined;
|
|
11
11
|
export declare const isString: (value: unknown) => value is string;
|
|
12
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
12
13
|
export declare const isNumber: (value: unknown) => value is number;
|
|
13
14
|
/**
|
|
14
15
|
* The props that every field takes, from a registry entry's props: label (the field's name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/shared/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAE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
|
|
18
18
|
return guard(value) ? value : void 0;
|
|
19
19
|
}
|
|
20
20
|
var isString = (value) => typeof value === "string";
|
|
21
|
+
var isBoolean = (value) => typeof value === "boolean";
|
|
21
22
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
22
23
|
/**
|
|
23
24
|
* The props that every field takes, from a registry entry's props: label (the field's name
|
|
@@ -51,6 +52,6 @@ function getMaxSize(field) {
|
|
|
51
52
|
return rule !== void 0 && "value" in rule && isNumber(rule.value) ? rule.value : null;
|
|
52
53
|
}
|
|
53
54
|
//#endregion
|
|
54
|
-
export { findRule, getAccept, getFieldProps, getMaxSize, getRuleNumber, getSetting, isNumber, isRequired, isString };
|
|
55
|
+
export { findRule, getAccept, getFieldProps, getMaxSize, getRuleNumber, getSetting, isBoolean, isNumber, isRequired, isString };
|
|
55
56
|
|
|
56
57
|
//# sourceMappingURL=entry.js.map
|
package/dist/shared/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","names":["Field","Rule","FieldEntryProps","FieldProps","findRule","field","rule","rules","find","candidate","getRuleNumber","found","undefined","value","isRequired","getSetting","name","guard","T","settings","isString","isNumber","Number","isNaN","getFieldProps","props","Omit","placeholder","path","label","description","help","required","readOnly","disabled","errors","onBlur","className","asString","getAccept","accept","length","Array","isArray","filter","getMaxSize"],"sources":["../../src/shared/entry.ts"],"sourcesContent":["import type { Field, Rule } from '@panneau/protocol';\n\nimport type { FieldEntryProps, FieldProps } from './types';\n\n/** The rule of a field with this name, if any. */\nexport function findRule(field: Field, rule: Rule['rule']): Rule | undefined {\n return field.rules?.find((candidate) => candidate.rule === rule);\n}\n\n/** The number of a `min` or `max` rule of a field, if any. */\nexport function getRuleNumber(field: Field, rule: 'min' | 'max'): number | undefined {\n const found = findRule(field, rule);\n return found !== undefined && 'value' in found && typeof found.value === 'number'\n ? found.value\n : undefined;\n}\n\n/** Whether a field has the `required` rule. */\nexport function isRequired(field: Field): boolean {\n return findRule(field, 'required') !== undefined;\n}\n\n/** A setting of a field (`settings.<name>`), when it has the expected type. */\nexport function getSetting<T>(field: Field, name: string, guard: (value: unknown) => value is T) {\n const value = field.settings?.[name];\n return guard(value) ? value : undefined;\n}\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * The props that every field takes, from a registry entry's props: label (the field's name\n * without one), help, required mark, read-only, errors and handlers. Plugins use it to write their\n * own entries.\n */\nexport function getFieldProps(\n props: FieldEntryProps,\n): Omit<FieldProps<never>, 'value' | 'onChange'> & { placeholder?: string } {\n const { field } = props;\n return {\n name: props.path,\n // A field always has a label: its name when the definition gives none.\n label: field.label ?? field.name,\n description: field.help,\n ...(field.placeholder !== undefined ? { placeholder: field.placeholder } : {}),\n required: isRequired(field),\n readOnly: props.readOnly === true || field.readOnly === true,\n disabled: props.disabled === true,\n errors: props.errors ?? [],\n ...(props.onBlur !== undefined ? { onBlur: props.onBlur } : {}),\n ...(props.className !== undefined ? { className: props.className } : {}),\n };\n}\n\n/** The value as a string, or `null`. */\nexport function asString(value: unknown): string | null {\n return typeof value === 'string' ? value : null;\n}\n\n/** The accepted MIME types of a field that takes files: its `accept`, or its `accept` rule. */\nexport function getAccept(field: Field): string[] | null {\n if (field.accept !== undefined && field.accept.length > 0) {\n return field.accept;\n }\n const rule = findRule(field, 'accept');\n return rule !== undefined && 'value' in rule && Array.isArray(rule.value)\n ? rule.value.filter(isString)\n : null;\n}\n\n/** The largest file of a field, in bytes: its `maxSize` rule. */\nexport function getMaxSize(field: Field): number | null {\n const rule = findRule(field, 'maxSize');\n return rule !== undefined && 'value' in rule && isNumber(rule.value) ? rule.value : null;\n}\n"],"mappings":";;AAKA,SAAgBI,SAASC,OAAcC,MAAsC;CACzE,OAAOD,MAAME,OAAOC,MAAMC,cAAcA,UAAUH,SAASA,IAAI;AACnE;;AAGA,SAAgBI,cAAcL,OAAcC,MAAyC;CACjF,MAAMK,QAAQP,SAASC,OAAOC,IAAI;CAClC,OAAOK,UAAUC,KAAAA,KAAa,WAAWD,SAAS,OAAOA,MAAME,UAAU,WACnEF,MAAME,QACND,KAAAA;AACV;;AAGA,SAAgBE,WAAWT,OAAuB;CAC9C,OAAOD,SAASC,OAAO,UAAU,MAAMO,KAAAA;AAC3C;;AAGA,SAAgBG,WAAcV,OAAcW,MAAcC,OAAuC;CAC7F,MAAMJ,QAAQR,MAAMc,WAAWH;CAC/B,OAAOC,MAAMJ,KAAK,IAAIA,QAAQD,KAAAA;AAClC;AAEA,IAAaQ,YAAYP,UAAoC,OAAOA,UAAU;AAC9E,IAAaQ,
|
|
1
|
+
{"version":3,"file":"entry.js","names":["Field","Rule","FieldEntryProps","FieldProps","findRule","field","rule","rules","find","candidate","getRuleNumber","found","undefined","value","isRequired","getSetting","name","guard","T","settings","isString","isBoolean","isNumber","Number","isNaN","getFieldProps","props","Omit","placeholder","path","label","description","help","required","readOnly","disabled","errors","onBlur","className","asString","getAccept","accept","length","Array","isArray","filter","getMaxSize"],"sources":["../../src/shared/entry.ts"],"sourcesContent":["import type { Field, Rule } from '@panneau/protocol';\n\nimport type { FieldEntryProps, FieldProps } from './types';\n\n/** The rule of a field with this name, if any. */\nexport function findRule(field: Field, rule: Rule['rule']): Rule | undefined {\n return field.rules?.find((candidate) => candidate.rule === rule);\n}\n\n/** The number of a `min` or `max` rule of a field, if any. */\nexport function getRuleNumber(field: Field, rule: 'min' | 'max'): number | undefined {\n const found = findRule(field, rule);\n return found !== undefined && 'value' in found && typeof found.value === 'number'\n ? found.value\n : undefined;\n}\n\n/** Whether a field has the `required` rule. */\nexport function isRequired(field: Field): boolean {\n return findRule(field, 'required') !== undefined;\n}\n\n/** A setting of a field (`settings.<name>`), when it has the expected type. */\nexport function getSetting<T>(field: Field, name: string, guard: (value: unknown) => value is T) {\n const value = field.settings?.[name];\n return guard(value) ? value : undefined;\n}\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isNumber = (value: unknown): value is number =>\n typeof value === 'number' && !Number.isNaN(value);\n\n/**\n * The props that every field takes, from a registry entry's props: label (the field's name\n * without one), help, required mark, read-only, errors and handlers. Plugins use it to write their\n * own entries.\n */\nexport function getFieldProps(\n props: FieldEntryProps,\n): Omit<FieldProps<never>, 'value' | 'onChange'> & { placeholder?: string } {\n const { field } = props;\n return {\n name: props.path,\n // A field always has a label: its name when the definition gives none.\n label: field.label ?? field.name,\n description: field.help,\n ...(field.placeholder !== undefined ? { placeholder: field.placeholder } : {}),\n required: isRequired(field),\n readOnly: props.readOnly === true || field.readOnly === true,\n disabled: props.disabled === true,\n errors: props.errors ?? [],\n ...(props.onBlur !== undefined ? { onBlur: props.onBlur } : {}),\n ...(props.className !== undefined ? { className: props.className } : {}),\n };\n}\n\n/** The value as a string, or `null`. */\nexport function asString(value: unknown): string | null {\n return typeof value === 'string' ? value : null;\n}\n\n/** The accepted MIME types of a field that takes files: its `accept`, or its `accept` rule. */\nexport function getAccept(field: Field): string[] | null {\n if (field.accept !== undefined && field.accept.length > 0) {\n return field.accept;\n }\n const rule = findRule(field, 'accept');\n return rule !== undefined && 'value' in rule && Array.isArray(rule.value)\n ? rule.value.filter(isString)\n : null;\n}\n\n/** The largest file of a field, in bytes: its `maxSize` rule. */\nexport function getMaxSize(field: Field): number | null {\n const rule = findRule(field, 'maxSize');\n return rule !== undefined && 'value' in rule && isNumber(rule.value) ? rule.value : null;\n}\n"],"mappings":";;AAKA,SAAgBI,SAASC,OAAcC,MAAsC;CACzE,OAAOD,MAAME,OAAOC,MAAMC,cAAcA,UAAUH,SAASA,IAAI;AACnE;;AAGA,SAAgBI,cAAcL,OAAcC,MAAyC;CACjF,MAAMK,QAAQP,SAASC,OAAOC,IAAI;CAClC,OAAOK,UAAUC,KAAAA,KAAa,WAAWD,SAAS,OAAOA,MAAME,UAAU,WACnEF,MAAME,QACND,KAAAA;AACV;;AAGA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1B;AACV;;AAGA,SAAgB0B,WAAWzC,OAA6B;CACpD,MAAMC,OAAOF,SAASC,OAAO,SAAS;CACtC,OAAOC,SAASM,KAAAA,KAAa,WAAWN,QAAQgB,SAAShB,KAAKO,KAAK,IAAIP,KAAKO,QAAQ;AACxF"}
|
package/dist/slug/SlugField.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FieldCheckResponse } from '@panneau/protocol';
|
|
2
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
3
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
2
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
3
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
4
4
|
/**
|
|
5
5
|
* Turns a text into a slug: lowercase ASCII letters and digits separated by dashes, without
|
|
6
6
|
* accents (`Été à Montréal` gives `ete-a-montreal`).
|
package/dist/slug/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SlugField, SlugFieldEntry, type SlugCheck, type SlugFieldProps, slugify, sourceText, } from './SlugField';
|
|
1
|
+
export { SlugField, SlugFieldEntry, type SlugCheck, type SlugFieldProps, slugify, sourceText, } from './SlugField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/tags/TagsField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TagSuggestion } from '@panneau/ui';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export interface TagsFieldProps extends FieldProps<string[]> {
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
/** Tags offered as the user types. */
|
package/dist/tags/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TagsField, TagsFieldEntry, type TagsFieldProps } from './TagsField';
|
|
1
|
+
export { TagsField, TagsFieldEntry, type TagsFieldProps } from './TagsField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/tel/TelField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export type TelFieldProps = Omit<TextFieldProps, 'type' | 'inputMode'>;
|
|
4
4
|
/**
|
|
5
5
|
* A phone number, as typed, with the phone keyboard on phones. Spaces around it are removed on
|
package/dist/tel/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TelField, TelFieldEntry, type TelFieldProps } from './TelField';
|
|
1
|
+
export { TelField, TelFieldEntry, type TelFieldProps } from './TelField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/text/TextField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export interface TextFieldProps extends FieldProps<string> {
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
/** Shows a count of characters against this maximum. It doesn't stop typing. */
|
|
@@ -12,13 +12,21 @@ export interface TextFieldProps extends FieldProps<string> {
|
|
|
12
12
|
type?: 'text' | 'email' | 'url' | 'tel' | 'password' | 'search';
|
|
13
13
|
inputMode?: 'text' | 'email' | 'url' | 'tel' | 'search' | 'numeric' | 'decimal' | 'none';
|
|
14
14
|
autoComplete?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A secret, such as an access key: typed in a password input, hidden until a button shows it,
|
|
17
|
+
* and never filled in by the browser.
|
|
18
|
+
*/
|
|
19
|
+
secret?: boolean;
|
|
15
20
|
controlClassName?: string;
|
|
16
21
|
inputClassName?: string;
|
|
17
22
|
}
|
|
18
23
|
/** The description of a text field, with its character count. */
|
|
19
24
|
export declare function useCountedDescription(description: ReactNode, value: string | null | undefined, maxLength: number | undefined): ReactNode;
|
|
20
25
|
/** A single-line text. An empty text is `null`. */
|
|
21
|
-
export declare function TextField({ value, onChange, description, maxLength, disabled, readOnly, required, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
22
|
-
/**
|
|
26
|
+
export declare function TextField({ value, onChange, description, maxLength, disabled, readOnly, required, secret, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* The `text` type: settings `prefix`, `suffix` and `secret`, and a character count from the `max`
|
|
29
|
+
* rule.
|
|
30
|
+
*/
|
|
23
31
|
export declare function TextFieldEntry(props: FieldEntryProps): import("react").JSX.Element;
|
|
24
32
|
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/text/TextField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/text/TextField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAMjD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,MAAM,CAAC;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CACjC,WAAW,EAAE,SAAS,EACtB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC9B,SAAS,CAiBX;AAED,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAc,EACd,GAAG,KAAK,EACX,EAAE,cAAc,+BAkChB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,+BAiBpD"}
|
package/dist/text/TextField.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { getFieldProps, getRuleNumber, getSetting, isString } from "../shared/entry.js";
|
|
1
|
+
import { getFieldProps, getRuleNumber, getSetting, isBoolean, isString } from "../shared/entry.js";
|
|
2
2
|
import { messages } from "../shared/messages.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { TextInput, usePanneauIntl } from "@panneau/ui";
|
|
4
|
+
import { IconButton, TextInput, usePanneauIntl } from "@panneau/ui";
|
|
5
|
+
import { useState } from "react";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Eye, EyeOff } from "lucide-react";
|
|
6
8
|
//#region src/text/TextField.tsx
|
|
7
9
|
/** The description of a text field, with its character count. */
|
|
8
10
|
function useCountedDescription(description, value, maxLength) {
|
|
@@ -43,7 +45,7 @@ function useCountedDescription(description, value, maxLength) {
|
|
|
43
45
|
}
|
|
44
46
|
/** A single-line text. An empty text is `null`. */
|
|
45
47
|
function TextField(t0) {
|
|
46
|
-
const $ = c(
|
|
48
|
+
const $ = c(26);
|
|
47
49
|
let description;
|
|
48
50
|
let disabled;
|
|
49
51
|
let maxLength;
|
|
@@ -51,9 +53,10 @@ function TextField(t0) {
|
|
|
51
53
|
let props;
|
|
52
54
|
let readOnly;
|
|
53
55
|
let required;
|
|
56
|
+
let t1;
|
|
54
57
|
let value;
|
|
55
58
|
if ($[0] !== t0) {
|
|
56
|
-
({value, onChange, description, maxLength, disabled, readOnly, required, ...props} = t0);
|
|
59
|
+
({value, onChange, description, maxLength, disabled, readOnly, required, secret: t1, ...props} = t0);
|
|
57
60
|
$[0] = t0;
|
|
58
61
|
$[1] = description;
|
|
59
62
|
$[2] = disabled;
|
|
@@ -62,7 +65,8 @@ function TextField(t0) {
|
|
|
62
65
|
$[5] = props;
|
|
63
66
|
$[6] = readOnly;
|
|
64
67
|
$[7] = required;
|
|
65
|
-
$[8] =
|
|
68
|
+
$[8] = t1;
|
|
69
|
+
$[9] = value;
|
|
66
70
|
} else {
|
|
67
71
|
description = $[1];
|
|
68
72
|
disabled = $[2];
|
|
@@ -71,41 +75,72 @@ function TextField(t0) {
|
|
|
71
75
|
props = $[5];
|
|
72
76
|
readOnly = $[6];
|
|
73
77
|
required = $[7];
|
|
74
|
-
|
|
78
|
+
t1 = $[8];
|
|
79
|
+
value = $[9];
|
|
75
80
|
}
|
|
81
|
+
const secret = t1 === void 0 ? false : t1;
|
|
82
|
+
const intl = usePanneauIntl();
|
|
76
83
|
const shownDescription = useCountedDescription(description, value, maxLength);
|
|
77
|
-
const
|
|
84
|
+
const [shown, setShown] = useState(false);
|
|
78
85
|
let t2;
|
|
79
|
-
if ($[
|
|
80
|
-
t2 =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
if ($[10] !== disabled || $[11] !== intl || $[12] !== secret || $[13] !== shown) {
|
|
87
|
+
t2 = secret ? {
|
|
88
|
+
type: shown ? "text" : "password",
|
|
89
|
+
autoComplete: "new-password",
|
|
90
|
+
spellCheck: "false",
|
|
91
|
+
suffix: /* @__PURE__ */ jsx(IconButton, {
|
|
92
|
+
icon: shown ? EyeOff : Eye,
|
|
93
|
+
label: intl.formatMessage(shown ? messages.hideSecret : messages.showSecret),
|
|
94
|
+
size: "sm",
|
|
95
|
+
"aria-pressed": shown,
|
|
96
|
+
isDisabled: disabled,
|
|
97
|
+
onPress: () => setShown(!shown)
|
|
98
|
+
})
|
|
99
|
+
} : {};
|
|
100
|
+
$[10] = disabled;
|
|
101
|
+
$[11] = intl;
|
|
102
|
+
$[12] = secret;
|
|
103
|
+
$[13] = shown;
|
|
104
|
+
$[14] = t2;
|
|
105
|
+
} else t2 = $[14];
|
|
106
|
+
const secretProps = t2;
|
|
107
|
+
const t3 = value ?? "";
|
|
108
|
+
let t4;
|
|
109
|
+
if ($[15] !== onChange) {
|
|
110
|
+
t4 = (next) => onChange?.(next === "" ? null : next);
|
|
111
|
+
$[15] = onChange;
|
|
112
|
+
$[16] = t4;
|
|
113
|
+
} else t4 = $[16];
|
|
114
|
+
let t5;
|
|
115
|
+
if ($[17] !== disabled || $[18] !== props || $[19] !== readOnly || $[20] !== required || $[21] !== secretProps || $[22] !== shownDescription || $[23] !== t3 || $[24] !== t4) {
|
|
116
|
+
t5 = /* @__PURE__ */ jsx(TextInput, {
|
|
87
117
|
...props,
|
|
88
|
-
|
|
89
|
-
|
|
118
|
+
...secretProps,
|
|
119
|
+
value: t3,
|
|
120
|
+
onChange: t4,
|
|
90
121
|
description: shownDescription,
|
|
91
122
|
isDisabled: disabled,
|
|
92
123
|
isReadOnly: readOnly,
|
|
93
124
|
isRequired: required
|
|
94
125
|
});
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
|
|
104
|
-
|
|
126
|
+
$[17] = disabled;
|
|
127
|
+
$[18] = props;
|
|
128
|
+
$[19] = readOnly;
|
|
129
|
+
$[20] = required;
|
|
130
|
+
$[21] = secretProps;
|
|
131
|
+
$[22] = shownDescription;
|
|
132
|
+
$[23] = t3;
|
|
133
|
+
$[24] = t4;
|
|
134
|
+
$[25] = t5;
|
|
135
|
+
} else t5 = $[25];
|
|
136
|
+
return t5;
|
|
105
137
|
}
|
|
106
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* The `text` type: settings `prefix`, `suffix` and `secret`, and a character count from the `max`
|
|
140
|
+
* rule.
|
|
141
|
+
*/
|
|
107
142
|
function TextFieldEntry(props) {
|
|
108
|
-
const $ = c(
|
|
143
|
+
const $ = c(24);
|
|
109
144
|
const { field } = props;
|
|
110
145
|
let t0;
|
|
111
146
|
if ($[0] !== field) {
|
|
@@ -129,49 +164,58 @@ function TextFieldEntry(props) {
|
|
|
129
164
|
} else t2 = $[5];
|
|
130
165
|
const max = t2;
|
|
131
166
|
let t3;
|
|
132
|
-
if ($[6] !==
|
|
133
|
-
t3 =
|
|
134
|
-
$[6] =
|
|
167
|
+
if ($[6] !== field) {
|
|
168
|
+
t3 = getSetting(field, "secret", isBoolean) ?? false;
|
|
169
|
+
$[6] = field;
|
|
135
170
|
$[7] = t3;
|
|
136
171
|
} else t3 = $[7];
|
|
137
|
-
const
|
|
138
|
-
let
|
|
139
|
-
if ($[8] !==
|
|
140
|
-
|
|
141
|
-
$[8] =
|
|
142
|
-
$[9] =
|
|
143
|
-
} else
|
|
172
|
+
const secret = t3;
|
|
173
|
+
let t4;
|
|
174
|
+
if ($[8] !== props) {
|
|
175
|
+
t4 = getFieldProps(props);
|
|
176
|
+
$[8] = props;
|
|
177
|
+
$[9] = t4;
|
|
178
|
+
} else t4 = $[9];
|
|
179
|
+
const t5 = isString(props.value) ? props.value : null;
|
|
144
180
|
let t6;
|
|
145
|
-
if ($[10] !==
|
|
146
|
-
t6 =
|
|
147
|
-
$[10] =
|
|
181
|
+
if ($[10] !== max) {
|
|
182
|
+
t6 = max !== void 0 ? { maxLength: max } : {};
|
|
183
|
+
$[10] = max;
|
|
148
184
|
$[11] = t6;
|
|
149
185
|
} else t6 = $[11];
|
|
150
186
|
let t7;
|
|
151
|
-
if ($[12] !==
|
|
152
|
-
t7 =
|
|
153
|
-
$[12] =
|
|
187
|
+
if ($[12] !== prefix) {
|
|
188
|
+
t7 = prefix !== void 0 ? { prefix } : {};
|
|
189
|
+
$[12] = prefix;
|
|
154
190
|
$[13] = t7;
|
|
155
191
|
} else t7 = $[13];
|
|
156
192
|
let t8;
|
|
157
|
-
if ($[14] !==
|
|
158
|
-
t8 =
|
|
159
|
-
|
|
160
|
-
|
|
193
|
+
if ($[14] !== suffix) {
|
|
194
|
+
t8 = suffix !== void 0 ? { suffix } : {};
|
|
195
|
+
$[14] = suffix;
|
|
196
|
+
$[15] = t8;
|
|
197
|
+
} else t8 = $[15];
|
|
198
|
+
let t9;
|
|
199
|
+
if ($[16] !== props.onChange || $[17] !== secret || $[18] !== t4 || $[19] !== t5 || $[20] !== t6 || $[21] !== t7 || $[22] !== t8) {
|
|
200
|
+
t9 = /* @__PURE__ */ jsx(TextField, {
|
|
201
|
+
...t4,
|
|
202
|
+
value: t5,
|
|
161
203
|
onChange: props.onChange,
|
|
162
|
-
...t5,
|
|
163
204
|
...t6,
|
|
164
|
-
...t7
|
|
205
|
+
...t7,
|
|
206
|
+
...t8,
|
|
207
|
+
secret
|
|
165
208
|
});
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
|
|
174
|
-
|
|
209
|
+
$[16] = props.onChange;
|
|
210
|
+
$[17] = secret;
|
|
211
|
+
$[18] = t4;
|
|
212
|
+
$[19] = t5;
|
|
213
|
+
$[20] = t6;
|
|
214
|
+
$[21] = t7;
|
|
215
|
+
$[22] = t8;
|
|
216
|
+
$[23] = t9;
|
|
217
|
+
} else t9 = $[23];
|
|
218
|
+
return t9;
|
|
175
219
|
}
|
|
176
220
|
//#endregion
|
|
177
221
|
export { TextField, TextFieldEntry, useCountedDescription };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["ReactNode","TextInput","usePanneauIntl","getFieldProps","getRuleNumber","getSetting","isString","messages","FieldEntryProps","FieldProps","TextFieldProps","placeholder","maxLength","prefix","suffix","type","inputMode","autoComplete","controlClassName","inputClassName","useCountedDescription","description","value","$","_c","intl","undefined","t0","formatMessage","characterCount","count","length","max","t1","t2","TextField","disabled","onChange","props","readOnly","required","shownDescription","
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["Eye","EyeOff","ReactNode","useState","IconButton","TextInput","usePanneauIntl","getFieldProps","getRuleNumber","getSetting","isBoolean","isString","messages","FieldEntryProps","FieldProps","TextFieldProps","placeholder","maxLength","prefix","suffix","type","inputMode","autoComplete","secret","controlClassName","inputClassName","useCountedDescription","description","value","$","_c","intl","undefined","t0","formatMessage","characterCount","count","length","max","t1","t2","TextField","disabled","onChange","props","readOnly","required","shownDescription","shown","setShown","const","spellCheck","hideSecret","showSecret","secretProps","t3","t4","next","t5","TextFieldEntry","field","t6","t7","t8","t9","_c","_Fragment"],"sources":["../../src/text/TextField.tsx"],"sourcesContent":["import { Eye, EyeOff } from 'lucide-react';\nimport { type ReactNode, useState } from 'react';\n\nimport { IconButton, TextInput, usePanneauIntl } from '@panneau/ui';\n\nimport { getFieldProps, getRuleNumber, getSetting, isBoolean, isString } from '../shared/entry';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface TextFieldProps extends FieldProps<string> {\n placeholder?: string;\n /** Shows a count of characters against this maximum. It doesn't stop typing. */\n maxLength?: number;\n /** Content before the text, inside the control. */\n prefix?: ReactNode;\n /** Content after the text, inside the control. */\n suffix?: ReactNode;\n /** Type of the input. Defaults to `text`. */\n type?: 'text' | 'email' | 'url' | 'tel' | 'password' | 'search';\n inputMode?: 'text' | 'email' | 'url' | 'tel' | 'search' | 'numeric' | 'decimal' | 'none';\n autoComplete?: string;\n /**\n * A secret, such as an access key: typed in a password input, hidden until a button shows it,\n * and never filled in by the browser.\n */\n secret?: boolean;\n controlClassName?: string;\n inputClassName?: string;\n}\n\n/** The description of a text field, with its character count. */\nexport function useCountedDescription(\n description: ReactNode,\n value: string | null | undefined,\n maxLength: number | undefined,\n): ReactNode {\n const intl = usePanneauIntl();\n if (maxLength === undefined) {\n return description;\n }\n const count = intl.formatMessage(messages.characterCount, {\n count: (value ?? '').length,\n max: maxLength,\n });\n if (description === undefined || description === null) {\n return count;\n }\n return (\n <>\n {description} <span>{count}</span>\n </>\n );\n}\n\n/** A single-line text. An empty text is `null`. */\nexport function TextField({\n value,\n onChange,\n description,\n maxLength,\n disabled,\n readOnly,\n required,\n secret = false,\n ...props\n}: TextFieldProps) {\n const intl = usePanneauIntl();\n const shownDescription = useCountedDescription(description, value, maxLength);\n const [shown, setShown] = useState(false);\n const secretProps = secret\n ? {\n type: shown ? ('text' as const) : ('password' as const),\n // Keeps password managers from filling in the user's own password\n autoComplete: 'new-password',\n spellCheck: 'false',\n suffix: (\n <IconButton\n icon={shown ? EyeOff : Eye}\n label={intl.formatMessage(shown ? messages.hideSecret : messages.showSecret)}\n size=\"sm\"\n aria-pressed={shown}\n isDisabled={disabled}\n onPress={() => setShown(!shown)}\n />\n ),\n }\n : {};\n return (\n <TextInput\n {...props}\n {...secretProps}\n value={value ?? ''}\n onChange={(next) => onChange?.(next === '' ? null : next)}\n description={shownDescription}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n />\n );\n}\n\n/**\n * The `text` type: settings `prefix`, `suffix` and `secret`, and a character count from the `max`\n * rule.\n */\nexport function TextFieldEntry(props: FieldEntryProps) {\n const { field } = props;\n const prefix = getSetting(field, 'prefix', isString);\n const suffix = getSetting(field, 'suffix', isString);\n const max = getRuleNumber(field, 'max');\n const secret = getSetting(field, 'secret', isBoolean) ?? false;\n return (\n <TextField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n {...(max !== undefined ? { maxLength: max } : {})}\n {...(prefix !== undefined ? { prefix } : {})}\n {...(suffix !== undefined ? { suffix } : {})}\n secret={secret}\n />\n );\n}\n"],"mappings":";;;;;;;;;AA+BA,SAAO0B,sBAAAC,aAAAC,OAAAX,WAAA;CAAA,MAAAY,IAAAC,EAAA,CAAA;CAKH,MAAAC,OAAazB,eAAe;CAC5B,IAAIW,cAAce,KAAAA,GAAS,OAChBL;CACV,IAAAM;CAAA,IAAAJ,EAAA,OAAAE,QAAAF,EAAA,OAAAZ,aAAAY,EAAA,OAAAD,OAAA;EACaK,KAAAF,KAAIG,cAAetB,SAAQuB,gBAAiB;GAAAC,QAC9CR,SAAA,GAAA,CAAWS;GAAQC,KACtBrB;EACT,CAAC;EAACY,EAAA,KAAAE;EAAAF,EAAA,KAAAZ;EAAAY,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAHF,MAAAO,QAAcH;CAId,IAAIN,gBAAgBK,KAAAA,KAAaL,gBAAgB,MAAI,OAC1CS;CACV,IAAAG;CAAA,IAAAV,EAAA,OAAAO,OAAA;EAGqBG,KAAA,oBAAA,QAAA,EAAA,UAAOH,MAAa,CAAA;EAAAP,EAAA,KAAAO;EAAAP,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAF,eAAAE,EAAA,OAAAU,IAAA;EADtCC,KAAA,qBAAA0B,UAAA,EAAA,UAAA;GACKvC;GAAY;GAACY;EAAoB,EAAA,CAAA;EACnCV,EAAA,KAAAF;EAAAE,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,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AAW,EAAA,MAAAiC;CAAA,OAAAA,KAAAjC,EAAA;CAAA,IAAAkC;CAAA,IAAAlC,EAAA,QAAAV,QAAA;EACtC4C,KAAA5C,WAAWa,KAAAA,IAAX,EAAAb,OAAqC,IAArC,CAAqC;EAACU,EAAA,MAAAV;EAAAU,EAAA,MAAAkC;CAAA,OAAAA,KAAAlC,EAAA;CAAA,IAAAmC;CAAA,IAAAnC,EAAA,QAAAe,MAAAD,YAAAd,EAAA,QAAAN,UAAAM,EAAA,QAAA2B,MAAA3B,EAAA,QAAA6B,MAAA7B,EAAA,QAAAgC,MAAAhC,EAAA,QAAAiC,MAAAjC,EAAA,QAAAkC,IAAA;EAN/CC,KAAA,oBAAC,WAAD;GAAU,GACFR;GACG,OAAAE;GACG,UAAAd,MAAKD;GAAS,GACnBkB;GAA2C,GAC3CC;GAAsC,GACtCC;GACGxC;EAAM,CAAA;EAChBM,EAAA,MAAAe,MAAAD;EAAAd,EAAA,MAAAN;EAAAM,EAAA,MAAA2B;EAAA3B,EAAA,MAAA6B;EAAA7B,EAAA,MAAAgC;EAAAhC,EAAA,MAAAiC;EAAAjC,EAAA,MAAAkC;EAAAlC,EAAA,MAAAmC;CAAA,OAAAA,KAAAnC,EAAA;CAAA,OARFmC;AAQE"}
|
package/dist/text/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TextField, TextFieldEntry, type TextFieldProps } from './TextField';
|
|
1
|
+
export { TextField, TextFieldEntry, type TextFieldProps } from './TextField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface TextAreaFieldProps extends FieldProps<string> {
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
/** Shows a count of characters against this maximum. It doesn't stop typing. */
|
package/dist/textarea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TextAreaField, TextAreaFieldEntry, type TextAreaFieldProps } from './TextAreaField';
|
|
1
|
+
export { TextAreaField, TextAreaFieldEntry, type TextAreaFieldProps } from './TextAreaField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/time/TimeField.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface TimeFieldProps extends FieldProps<string> {
|
|
3
3
|
/** Shows and writes seconds (`09:30:15`). */
|
|
4
4
|
withSeconds?: boolean;
|
package/dist/time/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TimeField, TimeFieldEntry, type TimeFieldProps } from './TimeField';
|
|
1
|
+
export { TimeField, TimeFieldEntry, type TimeFieldProps } from './TimeField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UploadRejection } from './types';
|
|
1
|
+
import type { UploadRejection } from './types.js';
|
|
2
2
|
/** The message of a file refused before it was sent, for a field's errors. */
|
|
3
3
|
export declare function useRejectionMessage(maxSize: number | null | undefined): (file: File, reason: UploadRejection) => string;
|
|
4
4
|
//# sourceMappingURL=useRejectionMessage.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UploadItem, UploadRejection, UploadSource, UploadedFile } from './types';
|
|
1
|
+
import type { UploadItem, UploadRejection, UploadSource, UploadedFile } from './types.js';
|
|
2
2
|
export interface UseUploadsOptions {
|
|
3
3
|
/** Where files are uploaded. Without one, `add()` gives the files themselves. */
|
|
4
4
|
source: UploadSource | null;
|
package/dist/uppy/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { type PresignedUploadsLike, type UppyUploadSourceOptions, createUppyUploadSource, createUppyUploader, } from './uploader';
|
|
2
|
-
export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types';
|
|
1
|
+
export { type PresignedUploadsLike, type UppyUploadSourceOptions, createUppyUploadSource, createUppyUploader, } from './uploader.js';
|
|
2
|
+
export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/uppy/uploader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Uppy, { type Body, type Meta } from '@uppy/core';
|
|
2
2
|
import type { Upload, UploadSignRequest } from '@panneau/protocol';
|
|
3
|
-
import type { UploadSource, UploadedFile, Uploader } from '../upload/types';
|
|
3
|
+
import type { UploadSource, UploadedFile, Uploader } from '../upload/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Signs and completes direct uploads: `adapter.presignedUploads()` of `@panneau/data` (or
|
|
6
6
|
* `createPresignedUploads()`) gives one.
|
package/dist/url/UrlField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export interface UrlFieldProps extends Omit<TextFieldProps, 'type' | 'inputMode' | 'suffix'> {
|
|
4
4
|
/** Scheme added on blur to a URL without one (`example.com`). Defaults to `https://`. */
|
|
5
5
|
defaultScheme?: string;
|
package/dist/url/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { UrlField, UrlFieldEntry, type UrlFieldProps, withScheme } from './UrlField';
|
|
1
|
+
export { UrlField, UrlFieldEntry, type UrlFieldProps, withScheme } from './UrlField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/fields",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.9",
|
|
4
4
|
"description": "Controlled field components of Panneau for the protocol's built-in field types, one subpath per field, and uploads to storage (Uppy 6 in its own entry point).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
"dist"
|
|
155
155
|
],
|
|
156
156
|
"scripts": {
|
|
157
|
-
"build": "vite build &&
|
|
157
|
+
"build": "vite build && node ../../scripts/declarations.js",
|
|
158
158
|
"typecheck": "tsc --noEmit",
|
|
159
|
-
"api": "
|
|
159
|
+
"api": "node ../../scripts/declarations.js && node ../../scripts/api-report.js"
|
|
160
160
|
},
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"access": "public"
|
|
@@ -178,9 +178,9 @@
|
|
|
178
178
|
},
|
|
179
179
|
"dependencies": {
|
|
180
180
|
"@internationalized/date": "^3.12.4",
|
|
181
|
-
"@panneau/intl": "5.0.0-alpha.
|
|
182
|
-
"@panneau/protocol": "5.0.0-alpha.
|
|
183
|
-
"@panneau/ui": "5.0.0-alpha.
|
|
181
|
+
"@panneau/intl": "5.0.0-alpha.9",
|
|
182
|
+
"@panneau/protocol": "5.0.0-alpha.9",
|
|
183
|
+
"@panneau/ui": "5.0.0-alpha.9",
|
|
184
184
|
"leaflet": "^1.9.4",
|
|
185
185
|
"lucide-react": "^1.57.0"
|
|
186
186
|
},
|