@voltro/client 0.54.0 → 0.56.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/CHANGELOG.md +639 -2
- package/dist/form.d.ts +28 -1
- package/dist/form.js +2 -2
- package/dist/formData-DtlF8t8h.js +641 -0
- package/dist/index.d.ts +483 -6
- package/dist/index.js +942 -860
- package/package.json +2 -2
- package/dist/formData-BO7zkG_F.js +0 -386
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { RpcGroup } from '@effect/rpc';
|
|
|
16
16
|
import { Schema } from 'effect';
|
|
17
17
|
import { Stream } from 'effect';
|
|
18
18
|
import { SubscriptionEvent } from '@voltro/protocol';
|
|
19
|
+
import { TargetRelations } from '@voltro/protocol';
|
|
19
20
|
import { UIEvent as UIEvent_2 } from 'react';
|
|
20
21
|
import { WorkflowDomainEventRow } from '@voltro/protocol';
|
|
21
22
|
import { WorkflowEventDeliveryRow } from '@voltro/protocol';
|
|
@@ -315,6 +316,12 @@ export declare interface AutoApplyTarget {
|
|
|
315
316
|
* nested-array item when `path` is set. Typed to the item, not the output.
|
|
316
317
|
* 2nd arg is the optimistic id (insert) or the current item (update). */
|
|
317
318
|
readonly shapeItem?: ((input: Record<string, unknown>, currentOrOptimisticId: unknown) => Record<string, unknown>) | undefined;
|
|
319
|
+
/** Declared many-to-many relations (`{ inputField: { junction, anchorColumn,
|
|
320
|
+
* targetColumn } }`). Drives JUNCTION auto-optimistic: entries sourced on the
|
|
321
|
+
* junction table get their link rows for this anchor reconciled against
|
|
322
|
+
* `input[inputField]` immediately, instead of waiting for the server delta
|
|
323
|
+
* while every scalar field of the same form has already flipped. */
|
|
324
|
+
readonly relations?: TargetRelations | undefined;
|
|
318
325
|
}
|
|
319
326
|
|
|
320
327
|
/**
|
|
@@ -822,6 +829,9 @@ export declare const deriveEntityAdmins: (manifest: CapabilityManifest) => Reado
|
|
|
822
829
|
* outside a browser. Primary subtag only (`de-AT` → `de`). */
|
|
823
830
|
export declare const documentLocale: () => string;
|
|
824
831
|
|
|
832
|
+
/** The empty value — what an unfilled rich-text field holds. */
|
|
833
|
+
export declare const emptyRichTextDocument: RichTextDocument;
|
|
834
|
+
|
|
825
835
|
export declare const enqueueEntry: (queue: Outbox, id: string, tag: string, input: unknown) => Outbox;
|
|
826
836
|
|
|
827
837
|
/**
|
|
@@ -1101,6 +1111,28 @@ export declare interface FormBinding<Input, Output> {
|
|
|
1101
1111
|
readonly focusFirstInvalid: () => void;
|
|
1102
1112
|
}
|
|
1103
1113
|
|
|
1114
|
+
/**
|
|
1115
|
+
* Make one binding reachable to every field component below, so
|
|
1116
|
+
* {@link useFormField} can find it WITHOUT the binding being threaded through
|
|
1117
|
+
* each one as a prop.
|
|
1118
|
+
*
|
|
1119
|
+
* That thread is what stops an incremental migration. A deployment moving a
|
|
1120
|
+
* hundred-plus forms keeps its own field context and swaps engines per form
|
|
1121
|
+
* with a single prop; `useFormField(form, path)` would have forced the binding
|
|
1122
|
+
* down to every one of their ~30 field components at once, so they adopted the
|
|
1123
|
+
* binding and declined the narrow subscription — the exact optimisation they
|
|
1124
|
+
* had the most forms to gain from.
|
|
1125
|
+
*
|
|
1126
|
+
* <FormBindingProvider binding={form}>{children}</FormBindingProvider>
|
|
1127
|
+
* // deeper: const f = useFormField('address.city')
|
|
1128
|
+
*
|
|
1129
|
+
* `<AutoForm>` mounts one for you.
|
|
1130
|
+
*/
|
|
1131
|
+
export declare const FormBindingProvider: (props: {
|
|
1132
|
+
readonly binding: FormBinding<never, never> | FormBinding<Record<string, unknown>, unknown>;
|
|
1133
|
+
readonly children?: ReactNode;
|
|
1134
|
+
}) => ReactElement;
|
|
1135
|
+
|
|
1104
1136
|
/**
|
|
1105
1137
|
* Convert posted form entries into the input object the mutation's schema
|
|
1106
1138
|
* decodes — the shape `validateFields` (and the RPC payload) expects.
|
|
@@ -1251,15 +1283,40 @@ export declare interface FrameworkRuntimes {
|
|
|
1251
1283
|
readonly get: (name: string) => ApiHandle;
|
|
1252
1284
|
/** Enumerate the names of currently-installed apis (for debug). */
|
|
1253
1285
|
readonly names: ReadonlyArray<string>;
|
|
1286
|
+
/**
|
|
1287
|
+
* "Something in this tree needs `apiName`."
|
|
1288
|
+
*
|
|
1289
|
+
* Under `web.api.connect: 'lazy'` the provider does not open a socket until
|
|
1290
|
+
* this is called, so a page that reads no data never opens one. Under the
|
|
1291
|
+
* default `'eager'` it is a no-op — every api connects at mount, as before.
|
|
1292
|
+
*
|
|
1293
|
+
* It exists because the alternative was worse in a specific, measured way:
|
|
1294
|
+
* `interactive: 'full'` is the DEFAULT render mode, and the client opened a
|
|
1295
|
+
* WebSocket on every such page whether or not it subscribed. A pre-rendered
|
|
1296
|
+
* documentation page with no data at all opened one (measured in a real
|
|
1297
|
+
* browser: 0 sockets on `interactive: 'none'` / `'islands'`, one on `'full'`).
|
|
1298
|
+
* And an open socket keeps a dormancy-managed instance awake — `isIdleNow`
|
|
1299
|
+
* returns false while `connectedClients() > 0` — so one browser tab on a
|
|
1300
|
+
* pricing page prevented scale-to-zero indefinitely.
|
|
1301
|
+
*
|
|
1302
|
+
* Optional so a foreign host embedding `FrameworkRuntimesContext` by hand
|
|
1303
|
+
* keeps working; absent means "already connected", which is the safe reading.
|
|
1304
|
+
*/
|
|
1305
|
+
readonly demand?: (apiName: string) => void;
|
|
1254
1306
|
}
|
|
1255
1307
|
|
|
1256
1308
|
export declare const FrameworkRuntimesContext: Context<FrameworkRuntimes | null>;
|
|
1257
1309
|
|
|
1258
|
-
export declare const FrameworkRuntimesProvider: ({ apis, children, }: FrameworkRuntimesProviderProps) => ReactNode;
|
|
1310
|
+
export declare const FrameworkRuntimesProvider: ({ apis, children, demand, }: FrameworkRuntimesProviderProps) => ReactNode;
|
|
1259
1311
|
|
|
1260
1312
|
export declare interface FrameworkRuntimesProviderProps {
|
|
1261
1313
|
readonly apis: ReadonlyMap<string, ApiHandle>;
|
|
1262
1314
|
readonly children: ReactNode;
|
|
1315
|
+
/** Passed straight through to the context so `useFrameworkApi` can say that
|
|
1316
|
+
* something in the tree needs an api. The web boot supplies it under
|
|
1317
|
+
* `web.api.connect: 'lazy'`; a foreign host may omit it, which reads as
|
|
1318
|
+
* "already connected". */
|
|
1319
|
+
readonly demand?: (apiName: string) => void;
|
|
1263
1320
|
}
|
|
1264
1321
|
|
|
1265
1322
|
/** Browser-safe unique idempotency key: prefer `crypto.randomUUID`, fall back to
|
|
@@ -1301,6 +1358,20 @@ export declare const getMutations: () => ReadonlyArray<MutationEvent>;
|
|
|
1301
1358
|
*/
|
|
1302
1359
|
export declare const globalContext: <T>(key: string, initial: T) => Context<T>;
|
|
1303
1360
|
|
|
1361
|
+
/** True when `value` is structurally a rich-text document (a cheap render-side
|
|
1362
|
+
* guard; the decode remains the boundary). */
|
|
1363
|
+
export declare const isRichTextDocument: (value: unknown) => value is RichTextDocument;
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Is this `href` safe to put in a document?
|
|
1367
|
+
*
|
|
1368
|
+
* ALLOWLIST, never a denylist — a denylist is a list of the bypasses somebody
|
|
1369
|
+
* already thought of. Accepted: absolute `http(s)`, `mailto:`, a same-document
|
|
1370
|
+
* fragment, and a root-relative path. Everything else, `javascript:` and
|
|
1371
|
+
* `data:` included, is refused.
|
|
1372
|
+
*/
|
|
1373
|
+
export declare const isSafeHref: (href: string) => boolean;
|
|
1374
|
+
|
|
1304
1375
|
/** Is this the framework's `Unauthenticated`? Matched on `_tag`, the wire
|
|
1305
1376
|
* contract, rather than on an instance — the error crosses a package boundary
|
|
1306
1377
|
* and may be re-created by the decoder. */
|
|
@@ -1586,6 +1657,13 @@ export declare interface OutboxPersistence {
|
|
|
1586
1657
|
|
|
1587
1658
|
export declare type OutboxStatus = 'pending' | 'sent' | 'failed' | 'conflict';
|
|
1588
1659
|
|
|
1660
|
+
/**
|
|
1661
|
+
* Parse the widget's markdown-subset SOURCE into a document. Total: every input
|
|
1662
|
+
* yields a valid document, because everything unrecognised is text. Not a
|
|
1663
|
+
* security boundary — see the header; the decode is.
|
|
1664
|
+
*/
|
|
1665
|
+
export declare const parseRichText: (source: string) => RichTextDocument;
|
|
1666
|
+
|
|
1589
1667
|
/** Provide the current subject's scopes to `useCan`. Mount it once high in the
|
|
1590
1668
|
* tree, fed by your session subscription so it updates on role changes. */
|
|
1591
1669
|
export declare function PermissionProvider(props: PermissionProviderProps): ReactNode;
|
|
@@ -1848,6 +1926,15 @@ export declare interface RecordState<R> {
|
|
|
1848
1926
|
readonly error: unknown | undefined;
|
|
1849
1927
|
}
|
|
1850
1928
|
|
|
1929
|
+
/**
|
|
1930
|
+
* Make an api's client descriptors visible to a SERVER render.
|
|
1931
|
+
*
|
|
1932
|
+
* Called by the boot paths before rendering a page; harmless in the browser,
|
|
1933
|
+
* where the real handle carries them. Idempotent — descriptors are static per
|
|
1934
|
+
* api, so last write wins.
|
|
1935
|
+
*/
|
|
1936
|
+
export declare const registerSsrDescriptors: (apiName: string, descriptors: Readonly<Record<string, ClientDescriptor>>) => void;
|
|
1937
|
+
|
|
1851
1938
|
/**
|
|
1852
1939
|
* The entries to replay, in FIFO order, UP TO (not including) the first
|
|
1853
1940
|
* conflict — a conflicted write blocks everything after it (causality). Sent
|
|
@@ -1872,6 +1959,9 @@ export declare const _resetFrameworkRuntimesWarning: () => void;
|
|
|
1872
1959
|
/** Drop all applied client-side seeds. Tests only. */
|
|
1873
1960
|
export declare const resetPreloadSeeds: () => void;
|
|
1874
1961
|
|
|
1962
|
+
/** Test-only: forget every registration. */
|
|
1963
|
+
export declare const _resetSsrDescriptors: () => void;
|
|
1964
|
+
|
|
1875
1965
|
/** Test helper: forget every defined store. NEVER call this in app code. */
|
|
1876
1966
|
export declare const resetStoreRegistryForTests: () => void;
|
|
1877
1967
|
|
|
@@ -1939,6 +2029,33 @@ export declare interface ResourceCansResult {
|
|
|
1939
2029
|
readonly allowedIds: ReadonlyArray<string>;
|
|
1940
2030
|
}
|
|
1941
2031
|
|
|
2032
|
+
/**
|
|
2033
|
+
* Keep only the keys the input schema DECLARES.
|
|
2034
|
+
*
|
|
2035
|
+
* The two submit paths had drifted apart on this, and the server sided with
|
|
2036
|
+
* neither: `formDataToInput` (the no-JS path) documents "unknown keys are
|
|
2037
|
+
* dropped", while the JS path validated with a decode that IGNORES excess
|
|
2038
|
+
* properties and then sent the object UNCHANGED. Since 0.37 the server
|
|
2039
|
+
* refuses an undeclared input field — so a form carrying anything beyond the
|
|
2040
|
+
* mutation's input (a display toggle, a repeat control, a file held before
|
|
2041
|
+
* upload, which is nearly every real form) passed client validation and was
|
|
2042
|
+
* rejected on the wire, with a message pointing at no field. Measured by a
|
|
2043
|
+
* deployment with `renderFormBinding`, our own harness.
|
|
2044
|
+
*
|
|
2045
|
+
* `toInput` is the seam for this and stays the recommended one — but it only
|
|
2046
|
+
* protects a form that HAS one, and the failure mode of not having one was a
|
|
2047
|
+
* green tick followed by a server refusal. Dropping matches the no-JS path,
|
|
2048
|
+
* so the two submits now agree; a genuinely mistyped key still surfaces,
|
|
2049
|
+
* because the field it was meant to be is then missing and fails validation.
|
|
2050
|
+
*
|
|
2051
|
+
* Non-struct schemas (a scalar input) are returned untouched — there is no
|
|
2052
|
+
* declared key set to restrict against.
|
|
2053
|
+
*/
|
|
2054
|
+
export declare const restrictToSchema: (schema: Schema.Schema.Any, input: unknown) => {
|
|
2055
|
+
readonly input: unknown;
|
|
2056
|
+
readonly dropped: ReadonlyArray<string>;
|
|
2057
|
+
};
|
|
2058
|
+
|
|
1942
2059
|
export declare interface ResumableAgentStreamControls<E> extends ResumableAgentStreamState<E> {
|
|
1943
2060
|
/** Begin a run. `input` MUST carry the resume key (`streamId`) so reconnects
|
|
1944
2061
|
* target the same server-side log; `fromSeq` is injected by the hook. */
|
|
@@ -2004,6 +2121,339 @@ export declare type ResumableStreamMethod<E> = (payload: unknown) => Stream.Stre
|
|
|
2004
2121
|
|
|
2005
2122
|
export declare type ResumableStreamStatus = 'idle' | 'streaming' | 'reconnecting' | 'done' | 'error';
|
|
2006
2123
|
|
|
2124
|
+
/** Marks a text run may carry. Closed set — a mark is a NAME, never a style
|
|
2125
|
+
* string or attribute bag, so nothing here can express behaviour. */
|
|
2126
|
+
export declare const RICH_TEXT_MARKS: readonly ["bold", "italic", "code", "strike"];
|
|
2127
|
+
|
|
2128
|
+
/** Upper bound on the node count of one document. A refusal, not a hang: an
|
|
2129
|
+
* unbounded tree is a decode bomb on a server thread. */
|
|
2130
|
+
export declare const RICH_TEXT_MAX_NODES = 5000;
|
|
2131
|
+
|
|
2132
|
+
export declare type RichTextBlock = typeof RichTextBlock_2.Type;
|
|
2133
|
+
|
|
2134
|
+
declare const RichTextBlock_2: Schema.Union<[Schema.Struct<{
|
|
2135
|
+
type: Schema.Literal<["paragraph"]>;
|
|
2136
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2137
|
+
type: Schema.Literal<["text"]>;
|
|
2138
|
+
text: typeof Schema.String;
|
|
2139
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2140
|
+
}>, Schema.Struct<{
|
|
2141
|
+
type: Schema.Literal<["link"]>;
|
|
2142
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2143
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2144
|
+
type: Schema.Literal<["text"]>;
|
|
2145
|
+
text: typeof Schema.String;
|
|
2146
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2147
|
+
}>>;
|
|
2148
|
+
}>]>>;
|
|
2149
|
+
}>, Schema.Struct<{
|
|
2150
|
+
type: Schema.Literal<["heading"]>;
|
|
2151
|
+
level: Schema.Literal<[1, 2, 3]>;
|
|
2152
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2153
|
+
type: Schema.Literal<["text"]>;
|
|
2154
|
+
text: typeof Schema.String;
|
|
2155
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2156
|
+
}>, Schema.Struct<{
|
|
2157
|
+
type: Schema.Literal<["link"]>;
|
|
2158
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2159
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2160
|
+
type: Schema.Literal<["text"]>;
|
|
2161
|
+
text: typeof Schema.String;
|
|
2162
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2163
|
+
}>>;
|
|
2164
|
+
}>]>>;
|
|
2165
|
+
}>, Schema.Struct<{
|
|
2166
|
+
type: Schema.Literal<["blockquote"]>;
|
|
2167
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2168
|
+
type: Schema.Literal<["text"]>;
|
|
2169
|
+
text: typeof Schema.String;
|
|
2170
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2171
|
+
}>, Schema.Struct<{
|
|
2172
|
+
type: Schema.Literal<["link"]>;
|
|
2173
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2174
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2175
|
+
type: Schema.Literal<["text"]>;
|
|
2176
|
+
text: typeof Schema.String;
|
|
2177
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2178
|
+
}>>;
|
|
2179
|
+
}>]>>;
|
|
2180
|
+
}>, Schema.Struct<{
|
|
2181
|
+
type: Schema.Literal<["bulletList"]>;
|
|
2182
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2183
|
+
type: Schema.Literal<["listItem"]>;
|
|
2184
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2185
|
+
type: Schema.Literal<["text"]>;
|
|
2186
|
+
text: typeof Schema.String;
|
|
2187
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2188
|
+
}>, Schema.Struct<{
|
|
2189
|
+
type: Schema.Literal<["link"]>;
|
|
2190
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2191
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2192
|
+
type: Schema.Literal<["text"]>;
|
|
2193
|
+
text: typeof Schema.String;
|
|
2194
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2195
|
+
}>>;
|
|
2196
|
+
}>]>>;
|
|
2197
|
+
}>>;
|
|
2198
|
+
}>, Schema.Struct<{
|
|
2199
|
+
type: Schema.Literal<["orderedList"]>;
|
|
2200
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2201
|
+
type: Schema.Literal<["listItem"]>;
|
|
2202
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2203
|
+
type: Schema.Literal<["text"]>;
|
|
2204
|
+
text: typeof Schema.String;
|
|
2205
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2206
|
+
}>, Schema.Struct<{
|
|
2207
|
+
type: Schema.Literal<["link"]>;
|
|
2208
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2209
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2210
|
+
type: Schema.Literal<["text"]>;
|
|
2211
|
+
text: typeof Schema.String;
|
|
2212
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2213
|
+
}>>;
|
|
2214
|
+
}>]>>;
|
|
2215
|
+
}>>;
|
|
2216
|
+
}>, Schema.Struct<{
|
|
2217
|
+
type: Schema.Literal<["codeBlock"]>;
|
|
2218
|
+
text: typeof Schema.String;
|
|
2219
|
+
}>]>;
|
|
2220
|
+
|
|
2221
|
+
declare type RichTextBlock = typeof RichTextBlock_2.Type;
|
|
2222
|
+
|
|
2223
|
+
/**
|
|
2224
|
+
* The rich-text field's value. Use it directly in a mutation input:
|
|
2225
|
+
*
|
|
2226
|
+
* Schema.Struct({ id: Schema.String, body: RichTextDocument })
|
|
2227
|
+
*
|
|
2228
|
+
* It carries the `rich-text` widget annotation, so `<AutoForm>` renders the
|
|
2229
|
+
* editor with no extra `formField({ widget })` call — and the decode that
|
|
2230
|
+
* validates the mutation input IS the sanitizing boundary (see the header).
|
|
2231
|
+
*/
|
|
2232
|
+
export declare const RichTextDocument: Schema.refine<{
|
|
2233
|
+
readonly type: "doc";
|
|
2234
|
+
readonly content: readonly ({
|
|
2235
|
+
readonly type: "paragraph";
|
|
2236
|
+
readonly content: readonly ({
|
|
2237
|
+
readonly text: string;
|
|
2238
|
+
readonly type: "text";
|
|
2239
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2240
|
+
} | {
|
|
2241
|
+
readonly type: "link";
|
|
2242
|
+
readonly href: string;
|
|
2243
|
+
readonly content: readonly {
|
|
2244
|
+
readonly text: string;
|
|
2245
|
+
readonly type: "text";
|
|
2246
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2247
|
+
}[];
|
|
2248
|
+
})[];
|
|
2249
|
+
} | {
|
|
2250
|
+
readonly type: "heading";
|
|
2251
|
+
readonly level: 1 | 2 | 3;
|
|
2252
|
+
readonly content: readonly ({
|
|
2253
|
+
readonly text: string;
|
|
2254
|
+
readonly type: "text";
|
|
2255
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2256
|
+
} | {
|
|
2257
|
+
readonly type: "link";
|
|
2258
|
+
readonly href: string;
|
|
2259
|
+
readonly content: readonly {
|
|
2260
|
+
readonly text: string;
|
|
2261
|
+
readonly type: "text";
|
|
2262
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2263
|
+
}[];
|
|
2264
|
+
})[];
|
|
2265
|
+
} | {
|
|
2266
|
+
readonly type: "blockquote";
|
|
2267
|
+
readonly content: readonly ({
|
|
2268
|
+
readonly text: string;
|
|
2269
|
+
readonly type: "text";
|
|
2270
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2271
|
+
} | {
|
|
2272
|
+
readonly type: "link";
|
|
2273
|
+
readonly href: string;
|
|
2274
|
+
readonly content: readonly {
|
|
2275
|
+
readonly text: string;
|
|
2276
|
+
readonly type: "text";
|
|
2277
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2278
|
+
}[];
|
|
2279
|
+
})[];
|
|
2280
|
+
} | {
|
|
2281
|
+
readonly type: "bulletList";
|
|
2282
|
+
readonly content: readonly {
|
|
2283
|
+
readonly type: "listItem";
|
|
2284
|
+
readonly content: readonly ({
|
|
2285
|
+
readonly text: string;
|
|
2286
|
+
readonly type: "text";
|
|
2287
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2288
|
+
} | {
|
|
2289
|
+
readonly type: "link";
|
|
2290
|
+
readonly href: string;
|
|
2291
|
+
readonly content: readonly {
|
|
2292
|
+
readonly text: string;
|
|
2293
|
+
readonly type: "text";
|
|
2294
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2295
|
+
}[];
|
|
2296
|
+
})[];
|
|
2297
|
+
}[];
|
|
2298
|
+
} | {
|
|
2299
|
+
readonly type: "orderedList";
|
|
2300
|
+
readonly content: readonly {
|
|
2301
|
+
readonly type: "listItem";
|
|
2302
|
+
readonly content: readonly ({
|
|
2303
|
+
readonly text: string;
|
|
2304
|
+
readonly type: "text";
|
|
2305
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2306
|
+
} | {
|
|
2307
|
+
readonly type: "link";
|
|
2308
|
+
readonly href: string;
|
|
2309
|
+
readonly content: readonly {
|
|
2310
|
+
readonly text: string;
|
|
2311
|
+
readonly type: "text";
|
|
2312
|
+
readonly marks?: readonly ("bold" | "strike" | "code" | "italic")[] | undefined;
|
|
2313
|
+
}[];
|
|
2314
|
+
})[];
|
|
2315
|
+
}[];
|
|
2316
|
+
} | {
|
|
2317
|
+
readonly text: string;
|
|
2318
|
+
readonly type: "codeBlock";
|
|
2319
|
+
})[];
|
|
2320
|
+
}, Schema.Struct<{
|
|
2321
|
+
type: Schema.Literal<["doc"]>;
|
|
2322
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2323
|
+
type: Schema.Literal<["paragraph"]>;
|
|
2324
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2325
|
+
type: Schema.Literal<["text"]>;
|
|
2326
|
+
text: typeof Schema.String;
|
|
2327
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2328
|
+
}>, Schema.Struct<{
|
|
2329
|
+
type: Schema.Literal<["link"]>;
|
|
2330
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2331
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2332
|
+
type: Schema.Literal<["text"]>;
|
|
2333
|
+
text: typeof Schema.String;
|
|
2334
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2335
|
+
}>>;
|
|
2336
|
+
}>]>>;
|
|
2337
|
+
}>, Schema.Struct<{
|
|
2338
|
+
type: Schema.Literal<["heading"]>;
|
|
2339
|
+
level: Schema.Literal<[1, 2, 3]>;
|
|
2340
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2341
|
+
type: Schema.Literal<["text"]>;
|
|
2342
|
+
text: typeof Schema.String;
|
|
2343
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2344
|
+
}>, Schema.Struct<{
|
|
2345
|
+
type: Schema.Literal<["link"]>;
|
|
2346
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2347
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2348
|
+
type: Schema.Literal<["text"]>;
|
|
2349
|
+
text: typeof Schema.String;
|
|
2350
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2351
|
+
}>>;
|
|
2352
|
+
}>]>>;
|
|
2353
|
+
}>, Schema.Struct<{
|
|
2354
|
+
type: Schema.Literal<["blockquote"]>;
|
|
2355
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2356
|
+
type: Schema.Literal<["text"]>;
|
|
2357
|
+
text: typeof Schema.String;
|
|
2358
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2359
|
+
}>, Schema.Struct<{
|
|
2360
|
+
type: Schema.Literal<["link"]>;
|
|
2361
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2362
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2363
|
+
type: Schema.Literal<["text"]>;
|
|
2364
|
+
text: typeof Schema.String;
|
|
2365
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2366
|
+
}>>;
|
|
2367
|
+
}>]>>;
|
|
2368
|
+
}>, Schema.Struct<{
|
|
2369
|
+
type: Schema.Literal<["bulletList"]>;
|
|
2370
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2371
|
+
type: Schema.Literal<["listItem"]>;
|
|
2372
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2373
|
+
type: Schema.Literal<["text"]>;
|
|
2374
|
+
text: typeof Schema.String;
|
|
2375
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2376
|
+
}>, Schema.Struct<{
|
|
2377
|
+
type: Schema.Literal<["link"]>;
|
|
2378
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2379
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2380
|
+
type: Schema.Literal<["text"]>;
|
|
2381
|
+
text: typeof Schema.String;
|
|
2382
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2383
|
+
}>>;
|
|
2384
|
+
}>]>>;
|
|
2385
|
+
}>>;
|
|
2386
|
+
}>, Schema.Struct<{
|
|
2387
|
+
type: Schema.Literal<["orderedList"]>;
|
|
2388
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2389
|
+
type: Schema.Literal<["listItem"]>;
|
|
2390
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2391
|
+
type: Schema.Literal<["text"]>;
|
|
2392
|
+
text: typeof Schema.String;
|
|
2393
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2394
|
+
}>, Schema.Struct<{
|
|
2395
|
+
type: Schema.Literal<["link"]>;
|
|
2396
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2397
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2398
|
+
type: Schema.Literal<["text"]>;
|
|
2399
|
+
text: typeof Schema.String;
|
|
2400
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2401
|
+
}>>;
|
|
2402
|
+
}>]>>;
|
|
2403
|
+
}>>;
|
|
2404
|
+
}>, Schema.Struct<{
|
|
2405
|
+
type: Schema.Literal<["codeBlock"]>;
|
|
2406
|
+
text: typeof Schema.String;
|
|
2407
|
+
}>]>>;
|
|
2408
|
+
}>>;
|
|
2409
|
+
|
|
2410
|
+
export declare type RichTextDocument = typeof RichTextDocument.Type;
|
|
2411
|
+
|
|
2412
|
+
export declare type RichTextInline = typeof RichTextInline_2.Type;
|
|
2413
|
+
|
|
2414
|
+
declare const RichTextInline_2: Schema.Union<[Schema.Struct<{
|
|
2415
|
+
type: Schema.Literal<["text"]>;
|
|
2416
|
+
text: typeof Schema.String;
|
|
2417
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2418
|
+
}>, Schema.Struct<{
|
|
2419
|
+
type: Schema.Literal<["link"]>;
|
|
2420
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2421
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2422
|
+
type: Schema.Literal<["text"]>;
|
|
2423
|
+
text: typeof Schema.String;
|
|
2424
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2425
|
+
}>>;
|
|
2426
|
+
}>]>;
|
|
2427
|
+
|
|
2428
|
+
declare type RichTextInline = typeof RichTextInline_2.Type;
|
|
2429
|
+
|
|
2430
|
+
export declare type RichTextListItem = typeof RichTextListItem_2.Type;
|
|
2431
|
+
|
|
2432
|
+
declare const RichTextListItem_2: Schema.Struct<{
|
|
2433
|
+
type: Schema.Literal<["listItem"]>;
|
|
2434
|
+
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
2435
|
+
type: Schema.Literal<["text"]>;
|
|
2436
|
+
text: typeof Schema.String;
|
|
2437
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2438
|
+
}>, Schema.Struct<{
|
|
2439
|
+
type: Schema.Literal<["link"]>;
|
|
2440
|
+
href: Schema.filter<typeof Schema.String>;
|
|
2441
|
+
content: Schema.Array$<Schema.Struct<{
|
|
2442
|
+
type: Schema.Literal<["text"]>;
|
|
2443
|
+
text: typeof Schema.String;
|
|
2444
|
+
marks: Schema.optional<Schema.Array$<Schema.Literal<["bold", "italic", "code", "strike"]>>>;
|
|
2445
|
+
}>>;
|
|
2446
|
+
}>]>>;
|
|
2447
|
+
}>;
|
|
2448
|
+
|
|
2449
|
+
declare type RichTextListItem = typeof RichTextListItem_2.Type;
|
|
2450
|
+
|
|
2451
|
+
export declare type RichTextMark = (typeof RICH_TEXT_MARKS)[number];
|
|
2452
|
+
|
|
2453
|
+
/** The document's text, with no markers — for search indexing, excerpts and
|
|
2454
|
+
* plain-text notification bodies. */
|
|
2455
|
+
export declare const richTextToPlainText: (value: unknown) => string;
|
|
2456
|
+
|
|
2007
2457
|
/** Pure: map source rows → `{ value, label }` options. Falls back to the value
|
|
2008
2458
|
* when the label field is absent. Exported for direct testing + reuse. */
|
|
2009
2459
|
export declare const rowsToOptions: (rows: ReadonlyArray<Record<string, unknown>>, labelField: string, valueField: string) => ReadonlyArray<FieldOption>;
|
|
@@ -2157,6 +2607,10 @@ export declare type SequenceResult<Ctx> = {
|
|
|
2157
2607
|
}>;
|
|
2158
2608
|
};
|
|
2159
2609
|
|
|
2610
|
+
/** Render a document back to the widget's source form. Accepts anything —
|
|
2611
|
+
* a field that has never been filled holds `undefined`. */
|
|
2612
|
+
export declare const serializeRichText: (value: unknown) => string;
|
|
2613
|
+
|
|
2160
2614
|
export declare const ServerRequestContext: Context<ServerRequestContextValue | null>;
|
|
2161
2615
|
|
|
2162
2616
|
export declare interface ServerRequestContextValue {
|
|
@@ -2255,6 +2709,9 @@ export declare const sourceValues: (sources: Record<string, unknown>) => Readonl
|
|
|
2255
2709
|
|
|
2256
2710
|
export declare const ssrClientProxy: unknown;
|
|
2257
2711
|
|
|
2712
|
+
/** Registered SSR descriptors for `apiName`, if any. */
|
|
2713
|
+
export declare const ssrDescriptorsFor: (apiName: string) => Readonly<Record<string, ClientDescriptor>> | undefined;
|
|
2714
|
+
|
|
2258
2715
|
export declare const ssrStubHandle: ApiHandle;
|
|
2259
2716
|
|
|
2260
2717
|
/**
|
|
@@ -2828,9 +3285,13 @@ export declare interface SubscriptionMeta {
|
|
|
2828
3285
|
* screen. Those still reach the api's error bus — subscribe with
|
|
2829
3286
|
* `useOnRpcError` for connection-level UX.
|
|
2830
3287
|
*
|
|
2831
|
-
* A cold-start failure
|
|
2832
|
-
*
|
|
2833
|
-
*
|
|
3288
|
+
* A cold-start failure is its own STATE: `loading` is `false`, `failed` is
|
|
3289
|
+
* `true`, and this field is non-optional there (see
|
|
3290
|
+
* {@link SubscriptionFailed}). It used to leave `loading` true — this
|
|
3291
|
+
* comment predicted the consequence, a deployment hit it, and the fix was
|
|
3292
|
+
* to stop making `loading` mean two things rather than to keep warning
|
|
3293
|
+
* about it. Branching on `loading` alone no longer renders a skeleton
|
|
3294
|
+
* forever. */
|
|
2834
3295
|
readonly error: unknown | undefined;
|
|
2835
3296
|
/** Number of live optimistic patches currently applied. Useful for
|
|
2836
3297
|
* rendering a faint "syncing…" indicator when > 0. */
|
|
@@ -3424,6 +3885,9 @@ export declare interface UseEventOptions {
|
|
|
3424
3885
|
|
|
3425
3886
|
export declare const useFormBinding: <Input extends Record<string, unknown> = Record<string, unknown>, Output = unknown>(apiName: string, mutationTag: string, options: UseFormBindingOptions<Input>) => FormBinding<Input, Output>;
|
|
3426
3887
|
|
|
3888
|
+
/** The enclosing binding, if a {@link FormBindingProvider} is mounted. */
|
|
3889
|
+
export declare const useFormBindingContext: () => FormBinding<Record<string, unknown>, unknown> | undefined;
|
|
3890
|
+
|
|
3427
3891
|
export declare interface UseFormBindingOptions<Input> {
|
|
3428
3892
|
/** The mutation's input `Schema`. Optional: when omitted it is resolved from
|
|
3429
3893
|
* the mounted client descriptor (`descriptors[tag].input`, the capability
|
|
@@ -3478,6 +3942,17 @@ export declare interface UseFormBindingOptions<Input> {
|
|
|
3478
3942
|
}) => Promise<unknown>;
|
|
3479
3943
|
/** Ran after a successful submit with the mutation's output. */
|
|
3480
3944
|
readonly onSuccess?: (output: unknown) => void;
|
|
3945
|
+
/**
|
|
3946
|
+
* Ran when a submit failed with something NO field can carry — a store
|
|
3947
|
+
* refusal, a constraint violation, a failure raised by a composed
|
|
3948
|
+
* `onSubmit`. The same value lands in `state.submitError`, so a banner
|
|
3949
|
+
* bound to that needs nothing here; this is for a toast or a report sink.
|
|
3950
|
+
*
|
|
3951
|
+
* `submit()` does not reject for these. It resolves `undefined` and the
|
|
3952
|
+
* failure is state, because a form calls `submit()` from a handler that
|
|
3953
|
+
* cannot await it — a rejection there has nowhere to go but the console.
|
|
3954
|
+
*/
|
|
3955
|
+
readonly onError?: (error: unknown) => void;
|
|
3481
3956
|
/**
|
|
3482
3957
|
* Async field checks `submit` must wait for. Pass each field's
|
|
3483
3958
|
* `useAsyncValidation` result under its field path:
|
|
@@ -3517,7 +3992,9 @@ export declare interface UseFormBindingOptions<Input> {
|
|
|
3517
3992
|
* return <input id={f.a11y.id} value={String(f.value ?? '')} onChange={(e) => f.setValue(e.target.value)} onBlur={f.onBlur} />
|
|
3518
3993
|
* }
|
|
3519
3994
|
*/
|
|
3520
|
-
export declare
|
|
3995
|
+
export declare function useFormField(path: string): FormFieldHandle;
|
|
3996
|
+
|
|
3997
|
+
export declare function useFormField(binding: FormBinding<never, never> | FormBinding<Record<string, unknown>, unknown>, path: string): FormFieldHandle;
|
|
3521
3998
|
|
|
3522
3999
|
/**
|
|
3523
4000
|
* The failed-no-JS-POST payload for ONE form, or `undefined`.
|
|
@@ -3835,7 +4312,7 @@ export declare const validationStatus: (args: {
|
|
|
3835
4312
|
/** The default widget kinds the framework can render from a schema. `'custom'`
|
|
3836
4313
|
* means "no default widget" — the field needs a render-prop (a nested object,
|
|
3837
4314
|
* an array of objects, or a multi-branch union). Mirrors innovation/01's set. */
|
|
3838
|
-
export declare type WidgetKind = 'text' | 'textarea' | 'number' | 'checkbox' | 'switch' | 'select' | 'radio' | 'async-select' | 'multi-select' | 'date' | 'datetime' | 'daterange' | 'file' | 'hidden' | 'array' | 'reference' | 'custom';
|
|
4315
|
+
export declare type WidgetKind = 'text' | 'textarea' | 'rich-text' | 'number' | 'checkbox' | 'switch' | 'select' | 'radio' | 'async-select' | 'multi-select' | 'date' | 'datetime' | 'daterange' | 'file' | 'hidden' | 'array' | 'reference' | 'custom';
|
|
3839
4316
|
|
|
3840
4317
|
export declare interface WindowedSubscriptionState<Row> {
|
|
3841
4318
|
/** The in-window rows (live). */
|