@factorialco/f0-react 6.88.5 → 6.90.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/{ChatDocxThumbnail-DhzoVI1K.js → ChatDocxThumbnail-D5hDwmp7.js} +18 -21
- package/dist/{ChatPdfThumbnail-DTUuStMh.js → ChatPdfThumbnail-fgWjO4FR.js} +1 -1
- package/dist/{CoachmarkProvider-FhruFtJe.js → CoachmarkProvider-DapfXmFz.js} +5866 -5879
- package/dist/{DocumentToolbar-DUvkpuLz.js → DocumentToolbar-HaFkdnUm.js} +2 -2
- package/dist/{DocxViewer-CcY7eUEM.js → DocxViewer-B9t0m281.js} +20 -23
- package/dist/{F0AiProcessingOverlay-ByIJjCN4.js → F0AiProcessingOverlay-osUG6362.js} +737 -761
- package/dist/{F0CanvasPanel-VDUWMSmw.js → F0CanvasPanel-Dtc7dfno.js} +18102 -18069
- package/dist/{F0VideoPlayer-CxWjT4fA.js → F0VideoPlayer-Bo3mtwsY.js} +1 -1
- package/dist/{LocationMap-D6lqT6Gn.js → LocationMap-DL8tH3eN.js} +1 -1
- package/dist/{SheetViewer-CrvzW594.js → SheetViewer-D9vdb9iE.js} +2 -2
- package/dist/{TextViewer-GmdvBh9P.js → TextViewer-BF2KFkTF.js} +2 -2
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{experimental-CLNsFHrX.js → experimental-CdbvaHnA.js} +22093 -20656
- package/dist/experimental.d.ts +490 -0
- package/dist/experimental.js +215 -212
- package/dist/f0.d.ts +6 -0
- package/dist/f0.js +111 -100
- package/dist/index-BtYreoci.js +4 -0
- package/dist/{index-DfeNTo6-.js → index-Dk9HOdOi.js} +3 -3
- package/dist/{pdfWorker-38_nmvOc.js → pdfWorker-B06lOcCa.js} +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/index-DJGcz9TP.js +0 -4
package/dist/experimental.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { DotTagCellValue } from './types/dotTag';
|
|
|
39
39
|
import { DotTagCellValue as DotTagCellValue_2 } from './experimental';
|
|
40
40
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
41
41
|
import { EmployeeItemProps } from './types';
|
|
42
|
+
import { F0CommandPaletteProviderProps as F0CommandPaletteProviderProps_2 } from './types';
|
|
42
43
|
import { F0EmojiPickerProps as F0EmojiPickerProps_2 } from './types';
|
|
43
44
|
import { F0ENPSButtonProps as F0ENPSButtonProps_2 } from './types';
|
|
44
45
|
import { F0PhoneInputProps as F0PhoneInputProps_2 } from './types';
|
|
@@ -3291,6 +3292,430 @@ values: {
|
|
|
3291
3292
|
}) => void) | undefined;
|
|
3292
3293
|
} & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>>;
|
|
3293
3294
|
|
|
3295
|
+
/** A flat global command: a shortcut, a jump, a thing to create. */
|
|
3296
|
+
export declare type CommandAction = CommandActionBase & CommandDoes<(context: CommandRunContext) => void>;
|
|
3297
|
+
|
|
3298
|
+
/** A flat global command: a shortcut, a jump, a thing to create. */
|
|
3299
|
+
declare type CommandActionBase = {
|
|
3300
|
+
id: string;
|
|
3301
|
+
label: string;
|
|
3302
|
+
icon?: IconType;
|
|
3303
|
+
/** Extra terms the ranker should match on. */
|
|
3304
|
+
keywords?: string;
|
|
3305
|
+
/** Second line. Leave it out unless it says something the label cannot. */
|
|
3306
|
+
description?: string;
|
|
3307
|
+
};
|
|
3308
|
+
|
|
3309
|
+
export declare type CommandActionRisk = (typeof commandActionRisks)[number];
|
|
3310
|
+
|
|
3311
|
+
/**
|
|
3312
|
+
* Friction tier of an action.
|
|
3313
|
+
*
|
|
3314
|
+
* It is a claim about CONSEQUENCE, not a confirmation step — the palette never
|
|
3315
|
+
* asks. `danger` keeps a row out of the default selection and stops a bare
|
|
3316
|
+
* `Enter` from reaching it, so the reader has to arrive on it deliberately; the
|
|
3317
|
+
* confirmation itself belongs to the dialog the consumer already owns.
|
|
3318
|
+
*/
|
|
3319
|
+
export declare const commandActionRisks: readonly ["none", "confirm", "danger"];
|
|
3320
|
+
|
|
3321
|
+
/**
|
|
3322
|
+
* The assistant escape hatch — the way out of the list when nothing in it fit.
|
|
3323
|
+
*
|
|
3324
|
+
* Optional by design: with no `assistant`, the bar button, the trailing row and
|
|
3325
|
+
* the `mod+Enter` binding all disappear rather than degrading into dead
|
|
3326
|
+
* affordances. The palette does not know or care WHICH assistant this is; it
|
|
3327
|
+
* hands over a prompt and the scope it was built from.
|
|
3328
|
+
*/
|
|
3329
|
+
export declare type CommandAssistant = {
|
|
3330
|
+
/** The bar button's label, e.g. "Ask One". */
|
|
3331
|
+
label: string;
|
|
3332
|
+
/** The assistant's own mark. Rendered as given — not tinted to a control glyph. */
|
|
3333
|
+
icon?: IconType;
|
|
3334
|
+
/**
|
|
3335
|
+
* Receives the prompt the reader built. `ref` is the scope it was asked
|
|
3336
|
+
* inside, when there was one.
|
|
3337
|
+
*/
|
|
3338
|
+
onAsk: (prompt: string, ref?: CommandEntityRef) => void;
|
|
3339
|
+
};
|
|
3340
|
+
|
|
3341
|
+
/**
|
|
3342
|
+
* Whether an action can run on the current scope, and why not.
|
|
3343
|
+
*
|
|
3344
|
+
* A gated action is never hidden: it stays listed, sinks below the runnable
|
|
3345
|
+
* ones, and shows its reason. Policy changes an action's behaviour, never its
|
|
3346
|
+
* presence — a row that vanishes teaches the reader nothing.
|
|
3347
|
+
*/
|
|
3348
|
+
export declare type CommandAvailability = {
|
|
3349
|
+
disabled: boolean;
|
|
3350
|
+
reason?: string;
|
|
3351
|
+
};
|
|
3352
|
+
|
|
3353
|
+
/**
|
|
3354
|
+
* A row has to DO something, and there are exactly two things it can be: a
|
|
3355
|
+
* DESTINATION or a BEHAVIOUR. `href` for the first, `run` for the second, and
|
|
3356
|
+
* the union is what makes "one of them, never neither" a type error rather than
|
|
3357
|
+
* a row that silently does nothing when pressed.
|
|
3358
|
+
*
|
|
3359
|
+
* Most rows are destinations, so most rows want a plain string and no callback:
|
|
3360
|
+
* writing `run: () => navigate("/x")` to express "go to /x" buries a link inside
|
|
3361
|
+
* a function, and the palette then cannot know it IS a link — which is what
|
|
3362
|
+
* lets a destination row offer `Copy link` and open in a new tab.
|
|
3363
|
+
*
|
|
3364
|
+
* `TRun` is the callback's own shape, because a global command is handed the
|
|
3365
|
+
* context while an entity action is handed its target as well.
|
|
3366
|
+
*/
|
|
3367
|
+
declare type CommandDoes<TRun, THref = string> = {
|
|
3368
|
+
href: THref;
|
|
3369
|
+
run?: never;
|
|
3370
|
+
} | {
|
|
3371
|
+
run: TRun;
|
|
3372
|
+
href?: never;
|
|
3373
|
+
};
|
|
3374
|
+
|
|
3375
|
+
/**
|
|
3376
|
+
* An action that applies to a scoped record or selection.
|
|
3377
|
+
*
|
|
3378
|
+
* Either a destination or a behaviour, never neither. The destination may be a
|
|
3379
|
+
* plain string when it is the same wherever you came from, or a function of the
|
|
3380
|
+
* target when it is not — `(ref) => \`/devices/${ref.id}/history\`` — and it
|
|
3381
|
+
* receives the collected parameters too, so a step's answer can end up in the
|
|
3382
|
+
* URL.
|
|
3383
|
+
*/
|
|
3384
|
+
export declare type CommandEntityAction = CommandEntityActionBase & CommandDoes<(ref: CommandEntityRef, values: CommandParamValues, context: CommandRunContext) => void, string | ((ref: CommandEntityRef, values: CommandParamValues) => string)>;
|
|
3385
|
+
|
|
3386
|
+
/** An action that applies to a scoped record or selection. */
|
|
3387
|
+
declare type CommandEntityActionBase = {
|
|
3388
|
+
/** Unique within its provider. */
|
|
3389
|
+
key: string;
|
|
3390
|
+
/** Verb-first, so scanning and search both work: "Lock screen". */
|
|
3391
|
+
label: string;
|
|
3392
|
+
description?: string;
|
|
3393
|
+
icon: IconType;
|
|
3394
|
+
/** Origin as metadata, never as navigation: "Script", "Query". */
|
|
3395
|
+
badge?: string;
|
|
3396
|
+
risk: CommandActionRisk;
|
|
3397
|
+
/** Extra terms the ranker should match on. */
|
|
3398
|
+
keywords?: string;
|
|
3399
|
+
availability?: (ref: CommandEntityRef) => CommandAvailability;
|
|
3400
|
+
impact?: (ref: CommandEntityRef) => CommandImpact | undefined;
|
|
3401
|
+
/** Floats the action into "Suggested" while the query is empty. */
|
|
3402
|
+
suggested?: (ref: CommandEntityRef) => boolean;
|
|
3403
|
+
params?: CommandParamStep[];
|
|
3404
|
+
};
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* A named set of actions on one record: "Security", "Maintenance", "Lifecycle".
|
|
3408
|
+
*
|
|
3409
|
+
* The heading sits HERE rather than on each action, for the same reason it sits
|
|
3410
|
+
* on `CommandGroup` rather than on each command. Three maintenance actions used
|
|
3411
|
+
* to write `group: "Maintenance"` three times — three chances to disagree — and
|
|
3412
|
+
* because the heading was per-row the palette then had to re-sort the list so
|
|
3413
|
+
* that rows of one intent came out contiguous, or a straggler re-emitted a
|
|
3414
|
+
* heading that had already appeared. A group cannot be non-contiguous.
|
|
3415
|
+
*/
|
|
3416
|
+
export declare type CommandEntityActionGroup = {
|
|
3417
|
+
label: string;
|
|
3418
|
+
items: CommandEntityAction[];
|
|
3419
|
+
};
|
|
3420
|
+
|
|
3421
|
+
/**
|
|
3422
|
+
* The public surface of `F0CommandPalette` (SPEC-006 / SPEC-039).
|
|
3423
|
+
*
|
|
3424
|
+
* The palette has ONE grammar — `[scope] › [action] › [params]` — and every type
|
|
3425
|
+
* here is a piece of it. Read them in that order: an `CommandEntityRef` is the
|
|
3426
|
+
* scope, a `CommandEntityAction` is the verb, a `CommandParamStep` is a value the
|
|
3427
|
+
* verb still needs.
|
|
3428
|
+
*/
|
|
3429
|
+
/** A person rendered as a real avatar instead of an icon. */
|
|
3430
|
+
export declare type CommandEntityAvatar = {
|
|
3431
|
+
firstName: string;
|
|
3432
|
+
lastName: string;
|
|
3433
|
+
src?: string;
|
|
3434
|
+
};
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* One domain's contribution to the palette: how to find its records, and what
|
|
3438
|
+
* can be done to one.
|
|
3439
|
+
*
|
|
3440
|
+
* Declaring an action here once is what keeps a row menu, a bulk bar and the
|
|
3441
|
+
* palette projections of a single list instead of N×M surfaces.
|
|
3442
|
+
*/
|
|
3443
|
+
export declare type CommandEntityProvider = {
|
|
3444
|
+
/** Stable discriminator, and the value of `CommandEntityRef.type`. */
|
|
3445
|
+
type: string;
|
|
3446
|
+
/** Group heading in the global list, e.g. "Devices". */
|
|
3447
|
+
label: string;
|
|
3448
|
+
/**
|
|
3449
|
+
* Record lookup. Ranking across providers is the palette's job.
|
|
3450
|
+
*
|
|
3451
|
+
* MAY BE ASYNC, because real entity search is remote. Return an array when the
|
|
3452
|
+
* records are already in hand and a promise when they are not — the palette
|
|
3453
|
+
* renders skeleton rows in this provider's group while one is outstanding, and
|
|
3454
|
+
* a reason row if it rejects.
|
|
3455
|
+
*
|
|
3456
|
+
* The palette calls this on every query change and applies only the NEWEST
|
|
3457
|
+
* response, so a slow answer to `mac` can never overwrite a fast one to
|
|
3458
|
+
* `macbook`. It does not debounce: a provider that wants fewer round trips
|
|
3459
|
+
* should debounce inside its own `search`, since only it knows what a
|
|
3460
|
+
* round trip costs.
|
|
3461
|
+
*/
|
|
3462
|
+
search: (query: string, limit: number) => CommandEntityRef[] | Promise<CommandEntityRef[]>;
|
|
3463
|
+
/**
|
|
3464
|
+
* The actions a ref can run. Omit it while a domain has not adopted the
|
|
3465
|
+
* registry: its records stay findable, they are just not yet actionable —
|
|
3466
|
+
* a valid state, since the palette still offers navigation.
|
|
3467
|
+
*/
|
|
3468
|
+
actions?: (ref: CommandEntityRef) => CommandEntityActionGroup[];
|
|
3469
|
+
/**
|
|
3470
|
+
* The records that live INSIDE a ref, so the palette can narrow before it
|
|
3471
|
+
* acts: a team's people, a project's tasks, a folder's documents.
|
|
3472
|
+
*
|
|
3473
|
+
* Named `inside` and not `children` on purpose: this returns REFS, and a prop
|
|
3474
|
+
* called `children` on anything React-shaped reads as a `ReactNode` slot.
|
|
3475
|
+
* Props here are data, strongly typed — never rendered nodes handed in.
|
|
3476
|
+
*
|
|
3477
|
+
* Return refs of any `type`. The palette resolves each one's actions from the
|
|
3478
|
+
* provider matching that type, so a team provider hands back `person` refs and
|
|
3479
|
+
* the person provider supplies what can be done to them — nothing has to know
|
|
3480
|
+
* about both.
|
|
3481
|
+
*
|
|
3482
|
+
* `query` is what has been typed inside the scope, and `limit` caps the rows:
|
|
3483
|
+
* a team of forty is a list to filter, not a list to print.
|
|
3484
|
+
*/
|
|
3485
|
+
inside?: (ref: CommandEntityRef, query: string, limit: number) => CommandEntityRef[] | Promise<CommandEntityRef[]>;
|
|
3486
|
+
};
|
|
3487
|
+
|
|
3488
|
+
/**
|
|
3489
|
+
* What the palette is scoped to: one record, or a selection of them.
|
|
3490
|
+
*
|
|
3491
|
+
* `kind: "many"` carries an id SNAPSHOT rather than a live selection, taken when
|
|
3492
|
+
* the palette opened — it is the authoritative target list for the run, so a
|
|
3493
|
+
* selection changing behind the overlay cannot redirect an action mid-flight.
|
|
3494
|
+
*/
|
|
3495
|
+
export declare type CommandEntityRef = {
|
|
3496
|
+
type: string;
|
|
3497
|
+
kind: "one";
|
|
3498
|
+
id: string;
|
|
3499
|
+
/** Scope label and row title, e.g. `MacBook Pro 14"`. */
|
|
3500
|
+
label: string;
|
|
3501
|
+
/** Tells duplicates apart while choosing, e.g. an owner or a model. */
|
|
3502
|
+
sublabel?: string;
|
|
3503
|
+
icon?: IconType;
|
|
3504
|
+
avatar?: CommandEntityAvatar;
|
|
3505
|
+
/** Where `Enter` goes in global mode. Scoping uses `/` instead. */
|
|
3506
|
+
href?: string;
|
|
3507
|
+
} | {
|
|
3508
|
+
type: string;
|
|
3509
|
+
kind: "many";
|
|
3510
|
+
ids: string[];
|
|
3511
|
+
/** Scope label, e.g. `12 devices`. */
|
|
3512
|
+
label: string;
|
|
3513
|
+
icon?: IconType;
|
|
3514
|
+
};
|
|
3515
|
+
|
|
3516
|
+
/**
|
|
3517
|
+
* ONE HEADING AND WHAT SITS UNDER IT.
|
|
3518
|
+
*
|
|
3519
|
+
* Either items the consumer wrote, or a provider that fetches records — one
|
|
3520
|
+
* ordered list holds both, and the order it is written in is the order the
|
|
3521
|
+
* groups appear on screen.
|
|
3522
|
+
*
|
|
3523
|
+
* There is no separate `navigation` prop and no built-in "Go to". A destination
|
|
3524
|
+
* is a command whose `CommandDoes` picked `href`, so a group of destinations is
|
|
3525
|
+
* a group like any other and the product names it. The palette used to assign
|
|
3526
|
+
* those headings itself, which made "Actions" and "Go to" the only two words on
|
|
3527
|
+
* screen a product could not choose — and put copy about the consumer's own
|
|
3528
|
+
* content into a labels table, where it did not belong.
|
|
3529
|
+
*
|
|
3530
|
+
* Exactly one of `items` or `provider`, enforced by `never` on the other, so a
|
|
3531
|
+
* group carrying both is a type error rather than a silent precedence rule.
|
|
3532
|
+
*
|
|
3533
|
+
* Give it a STABLE identity — module scope, or memoised. It keys the row memos.
|
|
3534
|
+
*/
|
|
3535
|
+
export declare type CommandGroup = {
|
|
3536
|
+
label: string;
|
|
3537
|
+
items: CommandAction[];
|
|
3538
|
+
provider?: never;
|
|
3539
|
+
} | {
|
|
3540
|
+
provider: CommandEntityProvider;
|
|
3541
|
+
label?: never;
|
|
3542
|
+
items?: never;
|
|
3543
|
+
};
|
|
3544
|
+
|
|
3545
|
+
/** How a run lands on a selection — stated on the row, before the commit. */
|
|
3546
|
+
export declare type CommandImpact = {
|
|
3547
|
+
eligible: number;
|
|
3548
|
+
total: number;
|
|
3549
|
+
skipped: number;
|
|
3550
|
+
reason?: string;
|
|
3551
|
+
};
|
|
3552
|
+
|
|
3553
|
+
/**
|
|
3554
|
+
* EVERY WORD THE PALETTE PUTS ON SCREEN — all of it, and all of it required.
|
|
3555
|
+
*
|
|
3556
|
+
* The palette ships no copy of its own. It renders the consumer's records,
|
|
3557
|
+
* their commands and their destinations, so the words wrapped around that
|
|
3558
|
+
* content belong to the same product and arrive the same way: as props, rather
|
|
3559
|
+
* than half here and half in a shared translation table this component would
|
|
3560
|
+
* have to grow a key in every time a row learned a new state.
|
|
3561
|
+
*
|
|
3562
|
+
* REQUIRED, not optional with a fallback, because a fallback is exactly where
|
|
3563
|
+
* an untranslated string hides. An English default renders perfectly inside a
|
|
3564
|
+
* Spanish app and nothing fails — nothing is even detectably wrong until a
|
|
3565
|
+
* reader sees it. A required field is a compile error instead.
|
|
3566
|
+
*
|
|
3567
|
+
* ANYTHING THAT INTERPOLATES IS A FUNCTION, never a template carrying
|
|
3568
|
+
* `{{name}}`. A function is typed, so a missing value is a compile error rather
|
|
3569
|
+
* than a literal `{{name}}` on screen; it cannot be handed the wrong
|
|
3570
|
+
* interpolation dialect; and it is the only form that can reorder its parts or
|
|
3571
|
+
* choose a plural, which a template cannot do in any language that inflects.
|
|
3572
|
+
*
|
|
3573
|
+
* Define it at MODULE SCOPE and hand over the same object every render. It is
|
|
3574
|
+
* static copy, so there is nothing to recompute — and the palette keys its row
|
|
3575
|
+
* memos off these values.
|
|
3576
|
+
*/
|
|
3577
|
+
export declare type CommandPaletteLabels = {
|
|
3578
|
+
/** Accessible name of the overlay, for a screen reader announcing it. */
|
|
3579
|
+
label: string;
|
|
3580
|
+
/** The prompt in the field while nothing is typed and nothing is scoped. */
|
|
3581
|
+
placeholder: string;
|
|
3582
|
+
/** The short form, for a field sharing its row with the assistant on a phone. */
|
|
3583
|
+
placeholderPhone: string;
|
|
3584
|
+
/** The prompt once the palette is scoped and only actions remain. */
|
|
3585
|
+
placeholderScoped: string;
|
|
3586
|
+
/** The same, once the palette is scoped to a record. */
|
|
3587
|
+
fieldLabelScoped: (name: string) => string;
|
|
3588
|
+
empty: {
|
|
3589
|
+
title: string;
|
|
3590
|
+
description: string;
|
|
3591
|
+
};
|
|
3592
|
+
/**
|
|
3593
|
+
* Headings over the buckets the palette COMPUTES, and only those.
|
|
3594
|
+
*
|
|
3595
|
+
* Every other heading arrives with its content: a `CommandGroup` names itself
|
|
3596
|
+
* with `label`, and a provider names its records' group the same way. What is
|
|
3597
|
+
* left here is the three rearrangements the palette performs on that content
|
|
3598
|
+
* — what you did lately, what it floats first, what it had to gate. Those are
|
|
3599
|
+
* facts about this component's own behaviour, so they are generic copy;
|
|
3600
|
+
* "Actions" and "Go to" never were, and used to sit here by mistake.
|
|
3601
|
+
*/
|
|
3602
|
+
groups: {
|
|
3603
|
+
recent: string;
|
|
3604
|
+
suggested: string;
|
|
3605
|
+
unavailable: string;
|
|
3606
|
+
};
|
|
3607
|
+
/** The key legend's labels. The keys themselves are glyphs, not copy. */
|
|
3608
|
+
footer: {
|
|
3609
|
+
actions: string;
|
|
3610
|
+
rowActions: string;
|
|
3611
|
+
ask: string;
|
|
3612
|
+
choose: string;
|
|
3613
|
+
leaveScope: string;
|
|
3614
|
+
goBack: string;
|
|
3615
|
+
};
|
|
3616
|
+
/** The chip in the field, which is a control and needs a name. */
|
|
3617
|
+
scope: {
|
|
3618
|
+
remove: (name: string) => string;
|
|
3619
|
+
};
|
|
3620
|
+
/** Visible text and tooltips on the controls a row carries. */
|
|
3621
|
+
rowActions: {
|
|
3622
|
+
actions: string;
|
|
3623
|
+
actionsFor: (label: string) => string;
|
|
3624
|
+
copyLink: string;
|
|
3625
|
+
copyLinkTo: (label: string) => string;
|
|
3626
|
+
linkCopied: string;
|
|
3627
|
+
};
|
|
3628
|
+
/**
|
|
3629
|
+
* What the live region says when the palette changes under the reader.
|
|
3630
|
+
*
|
|
3631
|
+
* `scoped` is handed the count so it can pick its own plural — including the
|
|
3632
|
+
* zero case, which is why there is no separate "no actions" string.
|
|
3633
|
+
*/
|
|
3634
|
+
announce: {
|
|
3635
|
+
scoped: (name: string, count: number) => string;
|
|
3636
|
+
cleared: string;
|
|
3637
|
+
unavailable: (label: string, reason: string) => string;
|
|
3638
|
+
linkCopied: (url: string) => string;
|
|
3639
|
+
};
|
|
3640
|
+
/** What one row says, and what pressing it will do. */
|
|
3641
|
+
row: {
|
|
3642
|
+
open: (label: string) => string;
|
|
3643
|
+
run: (label: string) => string;
|
|
3644
|
+
ask: (label: string) => string;
|
|
3645
|
+
/** One word each, on the tooltip of a row's own `↵`. */
|
|
3646
|
+
verb: {
|
|
3647
|
+
open: string;
|
|
3648
|
+
run: string;
|
|
3649
|
+
ask: string;
|
|
3650
|
+
};
|
|
3651
|
+
/** Shown on a gated row that supplied no reason of its own. */
|
|
3652
|
+
unavailable: string;
|
|
3653
|
+
/** Shown in a provider's group when its search could not be reached. */
|
|
3654
|
+
searchFailed: string;
|
|
3655
|
+
};
|
|
3656
|
+
/**
|
|
3657
|
+
* The blast radius, as a sentence. Three values and a conditional reason,
|
|
3658
|
+
* which is more than a template can put in a sensible order.
|
|
3659
|
+
*/
|
|
3660
|
+
impact: (impact: CommandImpact) => string;
|
|
3661
|
+
};
|
|
3662
|
+
|
|
3663
|
+
/** One choice inside a parameter step. */
|
|
3664
|
+
export declare type CommandParamOption = {
|
|
3665
|
+
value: string;
|
|
3666
|
+
label: string;
|
|
3667
|
+
sublabel?: string;
|
|
3668
|
+
icon?: IconType;
|
|
3669
|
+
avatar?: CommandEntityAvatar;
|
|
3670
|
+
};
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* A value the action still needs, rendered as the next level of the palette
|
|
3674
|
+
* rather than as a separate dialog.
|
|
3675
|
+
*
|
|
3676
|
+
* Covers the `select` and `multiple` shapes. An action needing free-form or
|
|
3677
|
+
* multi-field input should collect nothing here and hand off to its own dialog
|
|
3678
|
+
* from `run` instead.
|
|
3679
|
+
*/
|
|
3680
|
+
export declare type CommandParamStep = {
|
|
3681
|
+
key: string;
|
|
3682
|
+
/** Level heading and input placeholder, e.g. "Choose a version". */
|
|
3683
|
+
label: string;
|
|
3684
|
+
options: (ref: CommandEntityRef) => CommandParamOption[];
|
|
3685
|
+
multiple?: boolean;
|
|
3686
|
+
};
|
|
3687
|
+
|
|
3688
|
+
/** Values collected across the parameter levels, keyed by `CommandParamStep.key`. */
|
|
3689
|
+
export declare type CommandParamValues = Record<string, string[]>;
|
|
3690
|
+
|
|
3691
|
+
export declare type CommandRowAction = {
|
|
3692
|
+
key: string;
|
|
3693
|
+
/**
|
|
3694
|
+
* The accessible name, and it always carries the target: `Copy link to
|
|
3695
|
+
* MacBook Pro 14"`. The tooltip may be shorter — see `tip`.
|
|
3696
|
+
*/
|
|
3697
|
+
label: string;
|
|
3698
|
+
icon?: IconType;
|
|
3699
|
+
/**
|
|
3700
|
+
* Visible text next to the icon. Give it to at most one action per row —
|
|
3701
|
+
* otherwise the row turns into a row of buttons.
|
|
3702
|
+
*/
|
|
3703
|
+
text?: string;
|
|
3704
|
+
tip?: string;
|
|
3705
|
+
run: () => void;
|
|
3706
|
+
};
|
|
3707
|
+
|
|
3708
|
+
/**
|
|
3709
|
+
* What the palette lends an action at run time, so a provider stays free of the
|
|
3710
|
+
* router and of any assistant runtime. An action that has to reach a screen
|
|
3711
|
+
* calls `navigate` rather than importing a router itself.
|
|
3712
|
+
*/
|
|
3713
|
+
export declare type CommandRunContext = {
|
|
3714
|
+
navigate: (href: string) => void;
|
|
3715
|
+
/** Hands a prompt to the assistant. A no-op when no `assistant` is configured. */
|
|
3716
|
+
ask: (prompt: string) => void;
|
|
3717
|
+
};
|
|
3718
|
+
|
|
3294
3719
|
export declare const CommunityPost: (({ id, author, group, createdAt, title, description, onClick, mediaUrl, event, counters, reactions, inLabel, comment, actions, dropdownItems, noReactionsButton, descriptionExpandable, noDescriptionClamp, hideTitle, }: CommunityPostProps) => JSX_2.Element) & {
|
|
3295
3720
|
Skeleton: ({ withEvent, withImage, }: CommunityPostSkeletonProps) => JSX_2.Element;
|
|
3296
3721
|
};
|
|
@@ -7557,6 +7982,62 @@ export declare type F0ChatVoiceAttachment = {
|
|
|
7557
7982
|
name?: string;
|
|
7558
7983
|
};
|
|
7559
7984
|
|
|
7985
|
+
/** What `useCommandPalette()` hands back. */
|
|
7986
|
+
export declare type F0CommandPaletteApi = {
|
|
7987
|
+
open: () => void;
|
|
7988
|
+
/**
|
|
7989
|
+
* Open already scoped to a record or a selection — the shortcut for any
|
|
7990
|
+
* surface that already knows its target (a row menu, a bulk bar, a detail
|
|
7991
|
+
* header), so the only thing left to do is name the verb.
|
|
7992
|
+
*/
|
|
7993
|
+
openScoped: (ref: CommandEntityRef) => void;
|
|
7994
|
+
close: () => void;
|
|
7995
|
+
isOpen: boolean;
|
|
7996
|
+
};
|
|
7997
|
+
|
|
7998
|
+
/**
|
|
7999
|
+
* @experimental This is an experimental API use it at your own risk
|
|
8000
|
+
*/
|
|
8001
|
+
export declare const F0CommandPaletteProvider: ({ children, groups, recent, assistant, labels, onNavigate, shortcut, open: openProp, onOpenChange, }: F0CommandPaletteProviderProps_2) => JSX_2.Element;
|
|
8002
|
+
|
|
8003
|
+
export declare type F0CommandPaletteProviderProps = {
|
|
8004
|
+
children: ReactNode;
|
|
8005
|
+
/** Every word the palette puts on screen. Required: it ships none itself. */
|
|
8006
|
+
labels: CommandPaletteLabels;
|
|
8007
|
+
/**
|
|
8008
|
+
* Everything findable, as an ordered list of groups.
|
|
8009
|
+
*
|
|
8010
|
+
* One prop rather than three, because `actions`, `navigation` and `providers`
|
|
8011
|
+
* were the same idea three times — a heading and the rows under it. Order
|
|
8012
|
+
* here is order on screen, so where records sit relative to commands is the
|
|
8013
|
+
* product's call and no longer a rule buried in this component.
|
|
8014
|
+
*/
|
|
8015
|
+
groups: CommandGroup[];
|
|
8016
|
+
/**
|
|
8017
|
+
* Ids of items in `groups` to lead the empty state with, most recent first.
|
|
8018
|
+
*
|
|
8019
|
+
* Consumer-owned on purpose: what counts as recent is a fact about the app's
|
|
8020
|
+
* history, not about this overlay, and the palette must not be the thing that
|
|
8021
|
+
* decides to write to storage.
|
|
8022
|
+
*/
|
|
8023
|
+
recent?: string[];
|
|
8024
|
+
assistant?: CommandAssistant;
|
|
8025
|
+
/**
|
|
8026
|
+
* How an `href` is followed. Defaults to a full page load, which is right for
|
|
8027
|
+
* an app without a client router and wrong for one with it — pass the router's
|
|
8028
|
+
* own navigate.
|
|
8029
|
+
*/
|
|
8030
|
+
onNavigate?: (href: string) => void;
|
|
8031
|
+
/**
|
|
8032
|
+
* Bind `mod+K` to open the palette.
|
|
8033
|
+
* @default true
|
|
8034
|
+
*/
|
|
8035
|
+
shortcut?: boolean;
|
|
8036
|
+
/** Controlled open state. Leave it out to let the palette own it. */
|
|
8037
|
+
open?: boolean;
|
|
8038
|
+
onOpenChange?: (open: boolean) => void;
|
|
8039
|
+
};
|
|
8040
|
+
|
|
7560
8041
|
/**
|
|
7561
8042
|
* F0CommunityPostsCarousel — the Communities widget's content: the latest posts as
|
|
7562
8043
|
* TILES you page through, two at a time on a main-column card and one in
|
|
@@ -14702,6 +15183,15 @@ export declare type UpsellActionDefinitionFn = () => UpsellActionDefinition | un
|
|
|
14702
15183
|
|
|
14703
15184
|
export declare function useAiPromotionChat(): AiPromotionChatProviderReturnValue;
|
|
14704
15185
|
|
|
15186
|
+
/**
|
|
15187
|
+
* Open the palette from anywhere below the provider.
|
|
15188
|
+
*
|
|
15189
|
+
* `openScoped(ref)` is the one every surface that already knows its target
|
|
15190
|
+
* should reach for — a row menu, a bulk bar, a detail header. The UI supplies
|
|
15191
|
+
* the scope, the reader supplies the intent.
|
|
15192
|
+
*/
|
|
15193
|
+
export declare const useCommandPalette: () => F0CommandPaletteApi;
|
|
15194
|
+
|
|
14705
15195
|
export declare type UseDataCollectionData<R extends RecordType> = UseDataCollectionDataReturn<R> & {
|
|
14706
15196
|
summaries?: R;
|
|
14707
15197
|
};
|