@factorialco/f0-react 7.3.0 → 7.4.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.
- package/dist/{ChatPdfThumbnail-D1F-lD9m.js → ChatPdfThumbnail-CTEggd6w.js} +1 -1
- package/dist/{ChatPostComposerDialog-BXvCrhTV.js → ChatPostComposerDialog-PiEnilyS.js} +3 -3
- package/dist/{CoachmarkProvider-Cqcgwnb3.js → CoachmarkProvider-C1PAhGjU.js} +14070 -13500
- package/dist/{DocumentToolbar-Dzl-_XT9.js → DocumentToolbar-mjr_Lecf.js} +2 -2
- package/dist/{DocxViewer-i2Or4Ji4.js → DocxViewer-2JDgpJFw.js} +2 -2
- package/dist/{F0AiProcessingOverlay-CsLaP2GX.js → F0AiProcessingOverlay-D3kjk7rF.js} +1 -1
- package/dist/{F0CanvasPanel-C57zh5Pt.js → F0CanvasPanel-Bpd75kYc.js} +23947 -23868
- package/dist/{F0VideoPlayer-C98XoPBg.js → F0VideoPlayer-BKE5RE90.js} +1 -1
- package/dist/{LocationMap-CvQ00CRW.js → LocationMap-x-jgetRU.js} +1 -1
- package/dist/{SheetViewer-lxY75YY4.js → SheetViewer-z3C4G3Kt.js} +2 -2
- package/dist/{TextViewer-DLPNJVcV.js → TextViewer-A7ILPlXY.js} +2 -2
- package/dist/ai.d.ts +13 -9
- package/dist/ai.js +2 -2
- package/dist/component-status.d.ts +9 -9
- package/dist/component-status.js +1 -1
- package/dist/{experimental-BDB9Zee0.js → experimental-DtoF9Hks.js} +14560 -15081
- package/dist/experimental.d.ts +83 -46
- package/dist/experimental.js +168 -168
- package/dist/f0.d.ts +189 -14
- package/dist/f0.js +206 -206
- package/dist/i18n-provider-defaults.d.ts +13 -9
- package/dist/i18n-provider-defaults.js +4 -0
- package/dist/index-BtJZvGNE.js +4 -0
- package/dist/{index-CPBEhofu.js → index-D9xRxSXF.js} +3 -3
- package/dist/{pdfWorker-Qubgvi6e.js → pdfWorker-BpJp34a9.js} +2 -2
- package/package.json +1 -1
- package/dist/index-B6tKs7JE.js +0 -4
package/dist/f0.d.ts
CHANGED
|
@@ -6142,6 +6142,10 @@ export declare const defaultTranslations: {
|
|
|
6142
6142
|
readonly phone: {
|
|
6143
6143
|
readonly invalid: "Enter a valid phone number";
|
|
6144
6144
|
};
|
|
6145
|
+
readonly location: {
|
|
6146
|
+
readonly empty: "Enter an address";
|
|
6147
|
+
readonly unresolved: "Select an address from the suggestions";
|
|
6148
|
+
};
|
|
6145
6149
|
};
|
|
6146
6150
|
};
|
|
6147
6151
|
readonly graph: {
|
|
@@ -10867,7 +10871,7 @@ export declare interface F0FAQItem {
|
|
|
10867
10871
|
/**
|
|
10868
10872
|
* Union of all F0 field types used for rendering
|
|
10869
10873
|
*/
|
|
10870
|
-
export declare type F0Field = F0TextField | F0NumberField | F0DurationField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0PeriodField | F0PhoneField | F0RichTextField | F0FileField | F0CardSelectField | F0EntitiesListField | F0CustomField;
|
|
10874
|
+
export declare type F0Field = F0TextField | F0NumberField | F0DurationField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0PeriodField | F0PhoneField | F0LocationField | F0RichTextField | F0FileField | F0CardSelectField | F0EntitiesListField | F0CustomField;
|
|
10871
10875
|
|
|
10872
10876
|
/**
|
|
10873
10877
|
* Alert configuration for a field.
|
|
@@ -10907,7 +10911,7 @@ export declare type F0FieldConfig<T extends string | number = string | number, R
|
|
|
10907
10911
|
/**
|
|
10908
10912
|
* Field types for rendering
|
|
10909
10913
|
*/
|
|
10910
|
-
export declare type F0FieldType = "text" | "number" | "percentage" | "money" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "period" | "phone" | "richtext" | "file" | "cardSelect" | "entitiesList" | "custom";
|
|
10914
|
+
export declare type F0FieldType = "text" | "number" | "percentage" | "money" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "period" | "phone" | "location" | "richtext" | "file" | "cardSelect" | "entitiesList" | "custom";
|
|
10911
10915
|
|
|
10912
10916
|
export declare type F0FileAction = {
|
|
10913
10917
|
icon?: IconType;
|
|
@@ -11467,6 +11471,42 @@ export declare namespace f0FormField {
|
|
|
11467
11471
|
export function phone(config: PhoneFieldShortcutConfig & {
|
|
11468
11472
|
optional?: false;
|
|
11469
11473
|
}): PhoneObjectSchema & F0ZodType<PhoneObjectSchema>;
|
|
11474
|
+
export type LocationObjectSchema = z.ZodEffects<z.ZodObject<{
|
|
11475
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
11476
|
+
addressLine1: z.ZodOptional<z.ZodString>;
|
|
11477
|
+
addressLine2: z.ZodOptional<z.ZodString>;
|
|
11478
|
+
city: z.ZodOptional<z.ZodString>;
|
|
11479
|
+
state: z.ZodOptional<z.ZodString>;
|
|
11480
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
11481
|
+
country: z.ZodOptional<z.ZodString>;
|
|
11482
|
+
placeId: z.ZodOptional<z.ZodString>;
|
|
11483
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
11484
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
11485
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
11486
|
+
}>>;
|
|
11487
|
+
export type LocationFieldShortcutConfig = DistributiveOmit<F0LocationFieldConfig, "fieldType"> & {
|
|
11488
|
+
optional?: boolean;
|
|
11489
|
+
/**
|
|
11490
|
+
* Requires a value picked from the suggestions, i.e. one that still
|
|
11491
|
+
* carries a place id and coordinates. Use it when the address feeds a
|
|
11492
|
+
* map or a geofence; a typed address has no coordinates until the
|
|
11493
|
+
* consumer geocodes it. Only satisfiable with `searchPlaces` and
|
|
11494
|
+
* `resolvePlace`, and without `manualEntry`, since nothing else produces
|
|
11495
|
+
* a resolved value.
|
|
11496
|
+
* @default false
|
|
11497
|
+
*/
|
|
11498
|
+
requireResolved?: boolean;
|
|
11499
|
+
/** Message shown when the field is empty and required */
|
|
11500
|
+
emptyMessage?: string;
|
|
11501
|
+
/** Message shown when `requireResolved` is not satisfied */
|
|
11502
|
+
unresolvedMessage?: string;
|
|
11503
|
+
};
|
|
11504
|
+
export function location(config: LocationFieldShortcutConfig & {
|
|
11505
|
+
optional: true;
|
|
11506
|
+
}): z.ZodOptional<LocationObjectSchema> & F0ZodType<z.ZodOptional<LocationObjectSchema>>;
|
|
11507
|
+
export function location(config: LocationFieldShortcutConfig & {
|
|
11508
|
+
optional?: false;
|
|
11509
|
+
}): LocationObjectSchema & F0ZodType<LocationObjectSchema>;
|
|
11470
11510
|
/* Excluded from this release type: RichTextObjectSchema */
|
|
11471
11511
|
/* Excluded from this release type: RichTextConfig */
|
|
11472
11512
|
export function richText(config: RichTextConfig & {
|
|
@@ -12187,6 +12227,131 @@ export declare type F0LinkProps = Omit<ActionLinkProps, "variant" | "href"> & {
|
|
|
12187
12227
|
href?: string;
|
|
12188
12228
|
};
|
|
12189
12229
|
|
|
12230
|
+
/**
|
|
12231
|
+
* F0 config options specific to location fields. The shape props come
|
|
12232
|
+
* straight from the component, so the field inherits its rule: manual entry
|
|
12233
|
+
* is typed rather than searched, and rules out a suggestion provider instead
|
|
12234
|
+
* of accepting one it would never call.
|
|
12235
|
+
*/
|
|
12236
|
+
export declare type F0LocationConfig = {
|
|
12237
|
+
/** Overrides for the per-part labels, which default to translated copy */
|
|
12238
|
+
partLabels?: Partial<Record<LocationPart, string>>;
|
|
12239
|
+
/** Restricts the country selector. A single entry also scopes the search */
|
|
12240
|
+
allowedCountries?: CountryCode[];
|
|
12241
|
+
/** Scopes the search. Never read from the value's own country */
|
|
12242
|
+
defaultCountry?: CountryCode;
|
|
12243
|
+
} & F0LocationInputShapeProps;
|
|
12244
|
+
|
|
12245
|
+
/**
|
|
12246
|
+
* Location field with all properties for rendering
|
|
12247
|
+
*/
|
|
12248
|
+
export declare type F0LocationField = F0BaseField & F0LocationConfig & {
|
|
12249
|
+
type: "location";
|
|
12250
|
+
/** Whether the field can be cleared (derived from optional/nullable) */
|
|
12251
|
+
clearable?: boolean;
|
|
12252
|
+
/** Conditional rendering based on another field's value */
|
|
12253
|
+
renderIf?: LocationFieldRenderIf;
|
|
12254
|
+
};
|
|
12255
|
+
|
|
12256
|
+
/**
|
|
12257
|
+
* Config for location fields (form value is a structured address object)
|
|
12258
|
+
*/
|
|
12259
|
+
export declare type F0LocationFieldConfig = F0BaseConfig & F0LocationConfig & {
|
|
12260
|
+
fieldType: "location";
|
|
12261
|
+
};
|
|
12262
|
+
|
|
12263
|
+
/**
|
|
12264
|
+
* The two shapes a location field takes: a searchable address line, or every
|
|
12265
|
+
* part typed by hand.
|
|
12266
|
+
*/
|
|
12267
|
+
declare type F0LocationInputShapeProps = F0LocationSearchProps | F0LocationManualProps;
|
|
12268
|
+
|
|
12269
|
+
/**
|
|
12270
|
+
* Canonical address shape. Deliberately camelCase with a lowercase ISO-2
|
|
12271
|
+
* country so every consumer stores the same thing.
|
|
12272
|
+
*/
|
|
12273
|
+
declare type F0LocationInputValue = {
|
|
12274
|
+
/** Display string. Comes from `resolvePlace` when picked, assembled locally once edited */
|
|
12275
|
+
formatted?: string;
|
|
12276
|
+
addressLine1?: string;
|
|
12277
|
+
addressLine2?: string;
|
|
12278
|
+
city?: string;
|
|
12279
|
+
/** Region, state or province, as free text */
|
|
12280
|
+
state?: string;
|
|
12281
|
+
postalCode?: string;
|
|
12282
|
+
country?: CountryCode;
|
|
12283
|
+
/**
|
|
12284
|
+
* Provider id of the picked place. Cleared as soon as a part that describes
|
|
12285
|
+
* where the pin is gets edited; `addressLine2` does not, since a floor
|
|
12286
|
+
* number stays inside the same building.
|
|
12287
|
+
*/
|
|
12288
|
+
placeId?: string;
|
|
12289
|
+
latitude?: number;
|
|
12290
|
+
longitude?: number;
|
|
12291
|
+
/** Carried through from `resolvePlace`, never derived here */
|
|
12292
|
+
timezone?: string;
|
|
12293
|
+
};
|
|
12294
|
+
|
|
12295
|
+
/**
|
|
12296
|
+
* Every part typed by hand. Nothing is searched in this shape, so a provider
|
|
12297
|
+
* would never be called: `searchPlaces` and `resolvePlace` are ruled out
|
|
12298
|
+
* rather than quietly ignored.
|
|
12299
|
+
*/
|
|
12300
|
+
declare type F0LocationManualProps = {
|
|
12301
|
+
/**
|
|
12302
|
+
* Renders the whole address as separate fields the user can fill in by
|
|
12303
|
+
* hand: country, address line 1 and 2, city, region and postal code.
|
|
12304
|
+
* Changing the country clears the other parts, since they described a
|
|
12305
|
+
* place in the previous one.
|
|
12306
|
+
*/
|
|
12307
|
+
manualEntry: true;
|
|
12308
|
+
searchPlaces?: never;
|
|
12309
|
+
resolvePlace?: never;
|
|
12310
|
+
manualEntryFallback?: never;
|
|
12311
|
+
};
|
|
12312
|
+
|
|
12313
|
+
declare type F0LocationSearchContext = {
|
|
12314
|
+
/** Country to scope the search to, when one is selected or implied */
|
|
12315
|
+
country?: CountryCode;
|
|
12316
|
+
};
|
|
12317
|
+
|
|
12318
|
+
/**
|
|
12319
|
+
* The address line as an autocomplete. A provider makes the suggestions, and
|
|
12320
|
+
* the user who finds nothing there can still fall back to typing.
|
|
12321
|
+
*/
|
|
12322
|
+
declare type F0LocationSearchProps = {
|
|
12323
|
+
manualEntry?: false;
|
|
12324
|
+
/**
|
|
12325
|
+
* Suggestion provider. Without it there is no autocomplete and the address
|
|
12326
|
+
* line is a plain field. Called with the current country so the consumer
|
|
12327
|
+
* can restrict the provider (e.g. Places `componentRestrictions`).
|
|
12328
|
+
*/
|
|
12329
|
+
searchPlaces?: (query: string, context: F0LocationSearchContext) => Promise<F0LocationSuggestion[]>;
|
|
12330
|
+
/**
|
|
12331
|
+
* Resolves a picked suggestion into a full value. Every field of
|
|
12332
|
+
* `F0LocationInputValue` is optional, so two thresholds are worth knowing:
|
|
12333
|
+
* the value needs `formatted` or `addressLine1` to be shown at all, and
|
|
12334
|
+
* `placeId` plus both coordinates to report `isResolved: true`. Returning a
|
|
12335
|
+
* provider's formatted address without its granular parts is supported.
|
|
12336
|
+
*/
|
|
12337
|
+
resolvePlace?: (id: string) => Promise<F0LocationInputValue | undefined>;
|
|
12338
|
+
/**
|
|
12339
|
+
* Whether a search that comes back empty offers to switch to manual entry.
|
|
12340
|
+
* Turn it off where a typed address is of no use to the consumer, such as a
|
|
12341
|
+
* field that feeds a map or a geofence and needs the coordinates only a
|
|
12342
|
+
* picked place carries.
|
|
12343
|
+
* @default true
|
|
12344
|
+
*/
|
|
12345
|
+
manualEntryFallback?: boolean;
|
|
12346
|
+
};
|
|
12347
|
+
|
|
12348
|
+
declare type F0LocationSuggestion = {
|
|
12349
|
+
id: string;
|
|
12350
|
+
label: string;
|
|
12351
|
+
/** Appended to the label, so each suggestion reads as one line */
|
|
12352
|
+
description?: string;
|
|
12353
|
+
};
|
|
12354
|
+
|
|
12190
12355
|
export declare type F0Message = {
|
|
12191
12356
|
id: string;
|
|
12192
12357
|
role: "user" | "assistant" | "system" | "tool";
|
|
@@ -12366,12 +12531,12 @@ declare type F0NumberSelectConfig<R extends Record<string, unknown> = Record<str
|
|
|
12366
12531
|
};
|
|
12367
12532
|
|
|
12368
12533
|
/**
|
|
12369
|
-
* Config for object fields (richtext, daterange, phone, or custom)
|
|
12534
|
+
* Config for object fields (richtext, daterange, phone, location, or custom)
|
|
12370
12535
|
*
|
|
12371
12536
|
* @typeParam TValue - Type of the field value (for custom fields)
|
|
12372
12537
|
* @typeParam TConfig - Type of the custom configuration object (for custom fields)
|
|
12373
12538
|
*/
|
|
12374
|
-
declare type F0ObjectConfig<TValue = unknown, TConfig = undefined> = F0RichTextFieldConfig | F0DateRangeFieldConfig | F0PhoneFieldConfig | F0CustomFieldConfig<TValue, TConfig>;
|
|
12539
|
+
declare type F0ObjectConfig<TValue = unknown, TConfig = undefined> = F0RichTextFieldConfig | F0DateRangeFieldConfig | F0PhoneFieldConfig | F0LocationFieldConfig | F0CustomFieldConfig<TValue, TConfig>;
|
|
12375
12540
|
|
|
12376
12541
|
export declare const F0OneIcon: ForwardRefExoticComponent<Omit<F0OneIconProps, "ref"> & RefAttributes<SVGSVGElement>>;
|
|
12377
12542
|
|
|
@@ -13982,7 +14147,7 @@ export declare function fieldsToSeconds(fields: DurationFields): number;
|
|
|
13982
14147
|
/**
|
|
13983
14148
|
* Field types for rendering
|
|
13984
14149
|
*/
|
|
13985
|
-
export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "period" | "phone" | "richtext" | "file" | "cardSelect" | "entitiesList" | "custom";
|
|
14150
|
+
export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "period" | "phone" | "location" | "richtext" | "file" | "cardSelect" | "entitiesList" | "custom";
|
|
13986
14151
|
|
|
13987
14152
|
export declare const FILE_TYPES: {
|
|
13988
14153
|
readonly PDF: "pdf";
|
|
@@ -15794,6 +15959,16 @@ declare interface LocalizedOption<T> {
|
|
|
15794
15959
|
value: T;
|
|
15795
15960
|
}
|
|
15796
15961
|
|
|
15962
|
+
/**
|
|
15963
|
+
* All valid renderIf conditions for location fields
|
|
15964
|
+
*/
|
|
15965
|
+
declare type LocationFieldRenderIf = CommonRenderIfCondition | F0BaseFieldRenderIfFunction;
|
|
15966
|
+
|
|
15967
|
+
declare type LocationPart = (typeof locationParts)[number];
|
|
15968
|
+
|
|
15969
|
+
/** Every part the manual entry block renders, in the order it renders them */
|
|
15970
|
+
declare const locationParts: readonly ["country", "addressLine1", "addressLine2", "city", "state", "postalCode"];
|
|
15971
|
+
|
|
15797
15972
|
/**
|
|
15798
15973
|
* The parts of a question that `lockedFields` can freeze on their own, without
|
|
15799
15974
|
* locking the question outright. Both are the question's wording — what it asks
|
|
@@ -21048,10 +21223,9 @@ declare module "@tiptap/core" {
|
|
|
21048
21223
|
|
|
21049
21224
|
declare module "@tiptap/core" {
|
|
21050
21225
|
interface Commands<ReturnType> {
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
outdent: () => ReturnType;
|
|
21226
|
+
fontSize: {
|
|
21227
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
21228
|
+
unsetFontSize: () => ReturnType;
|
|
21055
21229
|
};
|
|
21056
21230
|
}
|
|
21057
21231
|
}
|
|
@@ -21059,8 +21233,10 @@ declare module "@tiptap/core" {
|
|
|
21059
21233
|
|
|
21060
21234
|
declare module "@tiptap/core" {
|
|
21061
21235
|
interface Commands<ReturnType> {
|
|
21062
|
-
|
|
21063
|
-
|
|
21236
|
+
indent: {
|
|
21237
|
+
setIndent: (level: number) => ReturnType;
|
|
21238
|
+
unsetIndent: () => ReturnType;
|
|
21239
|
+
outdent: () => ReturnType;
|
|
21064
21240
|
};
|
|
21065
21241
|
}
|
|
21066
21242
|
}
|
|
@@ -21068,9 +21244,8 @@ declare module "@tiptap/core" {
|
|
|
21068
21244
|
|
|
21069
21245
|
declare module "@tiptap/core" {
|
|
21070
21246
|
interface Commands<ReturnType> {
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
unsetFontSize: () => ReturnType;
|
|
21247
|
+
moodTracker: {
|
|
21248
|
+
insertMoodTracker: (data: MoodTrackerData) => ReturnType;
|
|
21074
21249
|
};
|
|
21075
21250
|
}
|
|
21076
21251
|
}
|