foldkit-builder 0.2.0 → 0.3.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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Option, Pipeable, Schema } from "effect";
1
+ import { Option, Schema } from "effect";
2
2
  import { Bundle } from "foldkit-bundle";
3
3
  import { AnyBlock, Catalog, CatalogAction, Document, NodeId, Operation, PropsOf } from "foldkit-composition";
4
4
  import { Renderer } from "foldkit-composition/foldkit";
@@ -6,449 +6,88 @@ import { Control } from "foldkit-form";
6
6
  import { Entity } from "foldkit-entity";
7
7
  import { Metadata } from "foldkit-metadata";
8
8
  import { TreeNavigation } from "foldkit-primitives/interaction";
9
- import { Html, HtmlBuilder, KeyboardModifiers } from "foldkit/html";
10
- import "foldkit/message";
9
+ import { KeyboardModifiers } from "foldkit/html";
11
10
  import * as Submodel from "foldkit/submodel";
12
- import * as ManagedResource from "foldkit/managedResource";
13
- import * as Subscription from "foldkit/subscription";
14
- import * as Update from "foldkit/update";
15
- import { CallableTaggedStruct } from "foldkit/schema";
16
- import "foldkit/url";
17
- //#region ../bundle/src/placed.d.ts
18
- declare const PlacedTypeId: unique symbol;
19
- /**
20
- * Args for a placement: a static value, or a factory deriving them from the
21
- * parent seed — the fields `assembly.initial(rest)` was given, before any
22
- * placement initialised. A factory runs once per initialization and its result
23
- * is retained for the placement's `init`, `update`, helpers, Subscriptions,
24
- * and resources; it never re-runs against changing parent state, so keep it
25
- * pure of its seed.
26
- *
27
- * When no initialization ran — a hand-built Model in a test, which never went
28
- * through `initial` — `update` derives from the given parent per use, without
29
- * retaining, so each Model is folded with its own seed.
30
- *
31
- * Read only seed fields (route, auth, workspace, ...), never sibling
32
- * placement fields: every factory sees the same base seed, so a sibling read
33
- * is consistently absent rather than order-dependent.
34
- */
35
- type ArgsSource<Seed, Args> = Args | ((seed: Seed) => Args);
36
- interface PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> {
37
- /**
38
- * The bundle's args: a static value, or a factory from the parent seed (the
39
- * fields `assembly.initial(rest)` was given, minus this placement's own
40
- * field). A factory is computed once per initialization and retained for
41
- * `init`, `update`, and helpers. Subscriptions and resources built from it
42
- * require `initial`/`config` to have run first; a bundle with neither
43
- * contributes empty records either way.
44
- */
45
- readonly args?: ArgsSource<ParentSeed, Args>;
46
- /** Handles the child's OutMessage in parent terms, with the child already written back. */
47
- readonly onOut?: (outMessage: OutMessage, context: Update.FoldContext<Message, LinkMessage>) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
48
- /**
49
- * Observes each of the child's Messages in parent terms, after the child has
50
- * handled it and its `onOut` has run, so the parent's own update needs no arm
51
- * for the wrapper. Helpers are not Messages and do not reach it.
52
- */
53
- readonly onMessage?: (message: Message) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
54
- /** Prefix for the placement's Subscription and resource keys. Defaults to `Name@path`. */
55
- readonly key?: string;
56
- /** A gate beside the Link's own: Subscriptions and resources run only while both hold. */
57
- readonly when?: (parent: Parent) => boolean;
58
- }
59
- /** A lifted resource record: each child entry in parent terms, keyed by the placement. */
60
- type PlacedResources<Parent, ParentMessage, Resources> = Readonly<Record<string, { readonly [K in keyof Resources]: Resources[K] extends ManagedResource.Entry<any, any, infer Requirements, infer Value, infer Service, infer OnAcquired extends (...args: ReadonlyArray<any>) => any> ? ManagedResource.Entry<Parent, ParentMessage, Requirements, Value, Service, (...args: Parameters<OnAcquired>) => ParentMessage> : never; }[keyof Resources]>>;
61
- type PlacedHelpers<Parent, ParentMessage, R, Helpers> = { readonly [K in keyof Helpers]: Helpers[K] extends ((model: any, ...input: infer Input) => any) ? (...input: Input) => Update.Step<Parent, ParentMessage, R> : never; };
62
- interface Placed<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Resources, Helpers, Field extends string = string, Claimed extends string = string> {
63
- readonly [PlacedTypeId]: typeof PlacedTypeId;
64
- /** Types only: the top-level Model field this placement owns, or `string` when unknown. */
65
- readonly field?: Field;
66
- /** Types only: the parent Message tag this placement routes, or `string` when unknown. */
67
- readonly claims?: Claimed;
68
- readonly name: Name;
69
- /** `Name@path`, or the configured `key`: the prefix of every Subscription and resource key. */
70
- readonly key: string;
71
- /** The encoded args as text, when the bundle has an args Schema. */
72
- readonly argsSummary: string | undefined;
73
- /** Whether `args` was given as a seed factory; resolved once per initialization. */
74
- readonly hasDynamicArgs: boolean;
75
- /**
76
- * Derives the factory's args from `seed`, validates them against the
77
- * bundle's args Schema, and retains them for `init`, `update`, helpers,
78
- * Subscriptions, and resources. A no-op for static args. The assembly calls
79
- * this with the base seed before running inits, so every factory sees the
80
- * same parent state whatever the placement order.
81
- */
82
- readonly resolveArgs: (seed: unknown) => void;
83
- /**
84
- * Assembly use: marks the placement skipped because `rest` provides its
85
- * top-level field, so its factory never runs and its records contribute
86
- * nothing while the child is absent. Cleared by the next `resolveArgs`.
87
- */
88
- readonly skipArgs: () => void;
89
- readonly link: Link<Parent, ParentMessage, Model, Message>;
90
- /** Writes the child's initial Model and starts its `init` Commands. */
91
- readonly init: Update.Step<Parent, ParentMessage, R>;
92
- /** Folds the Message when it belongs to this placement; `None` otherwise. */
93
- readonly update: (parent: Parent, message: AnyMessage) => Option.Option<Update.Return<Parent, ParentMessage, R>>;
94
- readonly subscriptions: Subscription.Subscriptions<Parent, ParentMessage, S>;
95
- readonly resources: PlacedResources<Parent, ParentMessage, Resources>;
96
- /**
97
- * Renders the child through `h.submodel`; nothing while the child is absent.
98
- * Generic over the parent's whole Message, which must include this placement's.
99
- */
100
- readonly view: PlacedView<Parent, ParentMessage, ViewInputs>;
101
- /**
102
- * The same view in another slot, for rendering one placement in two DOM
103
- * positions (desktop and mobile). `h.submodel` throws on a repeated slot.
104
- */
105
- readonly viewIn: (slot: string) => PlacedView<Parent, ParentMessage, ViewInputs>;
106
- readonly helpers: PlacedHelpers<Parent, ParentMessage, R, Helpers>;
107
- }
108
- /**
109
- * What a placement's view needs of a builder: `submodel`, and `OnClick` to
110
- * read its Message from. A wrapper of Foldkit's builder that keeps both, such
111
- * as `foldkit-ssr`'s resumable builder, is one.
112
- */
113
- type BuilderLike = Pick<HtmlBuilder<any>, 'submodel' | 'OnClick'>;
114
- type PlacedView<Parent, ParentMessage, ViewInputs> = [ViewInputs] extends [void] ? <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>) => Html : <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, viewInputs: ViewInputs) => Html;
115
- /** A readable type error: intersected onto a parameter, its message names the fix. */
116
- interface Invalid<Message extends string> {
117
- readonly invalid: Message;
118
- }
119
- type BuilderMessage<H> = H extends {
120
- readonly OnClick: (message: infer M, ...rest: any) => any;
121
- } ? M : never;
122
- /**
123
- * The parent's `h`, checked to accept this placement's Messages. Generic over the
124
- * whole builder rather than its Message: inferring a Message through
125
- * `HtmlBuilder` costs thousands of type instantiations per call, while the
126
- * builder infers as itself and its Message is extracted once per builder type.
127
- */
128
- type ViewBuilder<H, ParentMessage> = H & ([ParentMessage] extends [BuilderMessage<H>] ? unknown : Invalid<"The parent Message does not include this placement's wrapper variant; spread its Link.wrapper(...).cases into defineMessageUnion">);
129
- /** The tag of a Link's parent variant, or `string` when it cannot be read. */
130
- type TagOf<LinkMessage> = LinkMessage extends {
131
- readonly _tag: infer Tag extends string;
132
- } ? Tag : string;
133
- //#endregion
134
- //#region ../bundle/src/link.d.ts
135
- declare const LinkTypeId: unique symbol;
136
- /** The parent Message variant `Tag({ message })` that carries a child's Messages. */
137
- type Wrapped<Tag extends string, ChildMessage> = {
138
- readonly _tag: Tag;
139
- readonly message: ChildMessage;
140
- };
141
- /**
142
- * Both directions between a child Message and its parent variant. Spread
143
- * `cases` into the parent's `defineMessageUnion` so the variant is part of the
144
- * parent Message.
145
- */
146
- interface Wrapper<Tag extends string, ChildMessage> {
147
- readonly tag: Tag;
148
- readonly Schema: CallableTaggedStruct<Tag, {
149
- readonly message: Schema.Codec<ChildMessage, unknown>;
150
- }>;
151
- readonly cases: { readonly [K in Tag]: {
152
- readonly message: Schema.Codec<ChildMessage, unknown>;
153
- }; };
154
- readonly make: (message: ChildMessage) => Wrapped<Tag, ChildMessage>;
155
- readonly toParentMessage: (message: ChildMessage) => Wrapped<Tag, ChildMessage>;
156
- readonly fromParentMessage: (message: AnyMessage) => Option.Option<ChildMessage>;
157
- }
158
- /** Every Foldkit Message is tagged; routing only needs the tag. */
159
- type AnyMessage = {
160
- readonly _tag: string;
161
- };
162
- /**
163
- * `Field` is the parent's top-level field the child is written into, when the
164
- * Link is one: `never` for a child nested deeper, and `string` when unknown.
165
- */
166
- interface Link<Parent, ParentMessage, Child, ChildMessage, Field extends string = string> extends Pipeable.Pipeable {
167
- readonly [LinkTypeId]: typeof LinkTypeId;
168
- /** Types only: the top-level field, so `placements.initial` knows who writes it. */
169
- readonly field?: Field;
170
- readonly read: (parent: Parent) => Option.Option<Child>;
171
- readonly write: (parent: Parent, child: Child) => Parent;
172
- readonly toParentMessage: (message: ChildMessage) => ParentMessage;
173
- /** Recognises this child's variant among all of the parent's Messages. */
174
- readonly fromParentMessage: (message: AnyMessage) => Option.Option<ChildMessage>;
175
- /** The parent's own gate: while it returns `false`, the child's Subscriptions and resources stop. */
176
- readonly when: Option.Option<(parent: Parent) => boolean>;
177
- /** Where the child lives, for placement keys and diagnostics. */
178
- readonly path: ReadonlyArray<string>;
179
- /** The parent Message tags this link's Messages travel under, outermost first. */
180
- readonly messages: ReadonlyArray<string>;
181
- /** The application a Link built from a Surface field ref belongs to, for its Module contract. */
182
- readonly owner?: object | undefined;
183
- }
184
- /** A Message union's variant `Tag({ message })`, as `defineMessageUnion` declares it. */
185
- type Variant = {
186
- readonly fields: {
187
- readonly _tag: Schema.tag<string>;
188
- readonly message: Schema.Top;
189
- };
190
- };
191
- type VariantTag<V extends Variant> = V['fields']['_tag'] extends Schema.tag<infer Tag extends string> ? Tag : never;
192
- type OnlyMessage<V extends Variant> = [Exclude<keyof V['fields'], '_tag' | 'message'>] extends [never] ? unknown : Invalid<'A wrapper variant carries only `message`; this variant has other fields'>;
193
- /**
194
- * The parent variant `Tag({ message })` for a child's Messages: from a tag and
195
- * the child's Message Schema, whose `cases` then go into the parent's union, or
196
- * from a variant the parent's union already declares.
197
- */
198
- declare function wrapper<const Tag extends string, ChildMessage>(tag: Tag, childMessage: Schema.Codec<ChildMessage, unknown>): Wrapper<Tag, ChildMessage>;
199
- declare function wrapper<V extends Variant>(variant: V & OnlyMessage<V>): Wrapper<VariantTag<V>, V['fields']['message']['Type']>;
200
- interface MakeConfig<Parent, Tag extends string, Child, ChildMessage, Path> {
201
- readonly read: (parent: Parent) => Option.Option<Child>;
202
- readonly write: (parent: Parent, child: Child) => Parent;
203
- readonly wrapper: Wrapper<Tag, ChildMessage>;
204
- readonly when?: (parent: Parent) => boolean;
205
- readonly path: Path;
206
- readonly owner?: object | undefined;
207
- }
208
- /**
209
- * The top-level field a path names. `initial` treats a one-segment path as the
210
- * field the placement writes, so a longer one names none.
211
- */
212
- type FieldOfPath<Path> = Path extends readonly [infer Field extends string] ? Field : Path extends readonly [string, ...ReadonlyArray<string>] ? never : string;
213
- type OptionKeys<Parent> = { [K in keyof Parent]: Parent[K] extends Option.Option<unknown> ? K : never; }[keyof Parent] & string;
214
- type OptionValue<A> = A extends Option.Option<infer Value> ? Value : never;
215
- /** The parent Message variant `Tag({ key, message })` that carries one collection item's Messages. */
216
- type KeyedWrapped<Tag extends string, ChildMessage, Key extends string = string> = {
217
- readonly _tag: Tag;
218
- readonly key: Key;
219
- readonly message: ChildMessage;
220
- };
221
- type KeyedFields<ChildMessage, Key extends string> = {
222
- readonly key: Schema.Codec<Key, string>;
223
- readonly message: Schema.Codec<ChildMessage, unknown>;
224
- };
225
- /** Both directions between an item's Message and its keyed parent variant. */
226
- interface KeyedWrapper<Tag extends string, ChildMessage, Key extends string = string> {
227
- readonly tag: Tag;
228
- readonly Schema: CallableTaggedStruct<Tag, KeyedFields<ChildMessage, Key>>;
229
- readonly cases: { readonly [K in Tag]: KeyedFields<ChildMessage, Key>; };
230
- readonly make: (key: Key, message: ChildMessage) => KeyedWrapped<Tag, ChildMessage, Key>;
231
- readonly fromParentMessage: (message: AnyMessage) => Option.Option<readonly [key: Key, message: ChildMessage]>;
232
- }
233
- /**
234
- * Where a keyed collection of children lives. The storage is the Link's
235
- * business: a record by key, an array identified by id, or anything with these
236
- * operations. `entries` is the order views and Subscriptions follow.
237
- */
238
- interface CollectionLink<Parent, ParentMessage, Child, ChildMessage, Key extends string = string, Field extends string = string> {
239
- /** Types only: the top-level field holding the items, or `string` when unknown. */
240
- readonly field?: Field;
241
- /** The storage with no items, for a parent's initial Model. */
242
- readonly empty: unknown;
243
- readonly entries: (parent: Parent) => ReadonlyArray<readonly [key: Key, child: Child]>;
244
- readonly get: (parent: Parent, key: Key) => Option.Option<Child>;
245
- /** Writes one item; `None` removes it. */
246
- readonly write: (parent: Parent, key: Key, child: Option.Option<Child>) => Parent;
247
- readonly toParentMessage: (key: Key, message: ChildMessage) => ParentMessage;
248
- readonly fromParentMessage: (message: AnyMessage) => Option.Option<readonly [key: Key, message: ChildMessage]>;
249
- /** The parent's gate per item: while it returns `false`, that item's Subscriptions stop. */
250
- readonly when: Option.Option<(parent: Parent, key: Key) => boolean>;
251
- readonly path: ReadonlyArray<string>;
252
- /** The parent Message tag this collection's Messages travel under. */
253
- readonly messages: ReadonlyArray<string>;
254
- }
255
- type RecordKeys<Parent> = { [K in keyof Parent]: Parent[K] extends Readonly<Record<string, unknown>> ? K : never; }[keyof Parent] & string;
256
- type RecordValue<A> = A extends Readonly<Record<string, infer Value>> ? Value : never;
257
- type ArrayKeys<Parent> = { [K in keyof Parent]: Parent[K] extends ReadonlyArray<unknown> ? K : never; }[keyof Parent] & string;
258
- type ArrayItem<A> = A extends ReadonlyArray<infer Item> ? Item : never;
259
- declare const Link: {
260
- readonly wrapper: typeof wrapper;
261
- readonly make: <Parent, const Tag extends string, Child, ChildMessage, const Path extends ReadonlyArray<string> = readonly string[]>(config: MakeConfig<Parent, Tag, Child, ChildMessage, Path>) => Link<Parent, Wrapped<Tag, ChildMessage>, Child, ChildMessage, FieldOfPath<Path>>;
262
- readonly field: <Parent>() => <const Key extends keyof Parent & string, const Tag extends string, ChildMessage>(key: Key, wrap: Wrapper<Tag, ChildMessage>, options?: {
263
- readonly when?: (parent: Parent) => boolean;
264
- }) => Link<Parent, Wrapped<Tag, ChildMessage>, Parent[Key], ChildMessage, Key>;
265
- readonly optional: <Parent>() => <const Key extends OptionKeys<Parent>, const Tag extends string, ChildMessage>(key: Key, wrap: Wrapper<Tag, ChildMessage>, options?: {
266
- readonly when?: (parent: Parent) => boolean;
267
- }) => Link<Parent, Wrapped<Tag, ChildMessage>, OptionValue<Parent[Key]>, ChildMessage, Key>;
268
- readonly compose: <A, AMessage, B, BMessage extends AnyMessage, C, CMessage>(outer: Link<A, AMessage, B, BMessage, string>, inner: Link<B, BMessage, C, CMessage, string>) => Link<A, AMessage, C, CMessage, never>;
269
- readonly andThen: {
270
- <B, BMessage extends AnyMessage, C, CMessage>(inner: Link<B, BMessage, C, CMessage, string>): <A, AMessage>(outer: Link<A, AMessage, B, BMessage, string>) => Link<A, AMessage, C, CMessage, never>;
271
- <A, AMessage, B, BMessage extends AnyMessage, C, CMessage>(outer: Link<A, AMessage, B, BMessage, string>, inner: Link<B, BMessage, C, CMessage, string>): Link<A, AMessage, C, CMessage, never>;
272
- };
273
- readonly when: {
274
- <Parent>(predicate: (parent: Parent) => boolean): <ParentMessage, Child, ChildMessage, Field extends string>(self: Link<Parent, ParentMessage, Child, ChildMessage, Field>) => Link<Parent, ParentMessage, Child, ChildMessage, Field>;
275
- <Parent, ParentMessage, Child, ChildMessage, Field extends string>(self: Link<Parent, ParentMessage, Child, ChildMessage, Field>, predicate: (parent: Parent) => boolean): Link<Parent, ParentMessage, Child, ChildMessage, Field>;
276
- };
277
- readonly foldInit: <Parent, ParentMessage, Child, ChildMessage, Field extends string>(link: Link<Parent, ParentMessage, Child, ChildMessage, Field>, rest: Omit<Parent, Field>) => {
278
- readonly toParentModel: (child: Child) => Parent;
279
- readonly toParentMessage: (message: ChildMessage) => ParentMessage;
280
- };
281
- readonly keyedWrapper: <const Tag extends string, ChildMessage, Key extends string = string>(tag: Tag, childMessage: Schema.Codec<ChildMessage, unknown>, key?: Schema.Codec<Key, string>) => KeyedWrapper<Tag, ChildMessage, Key>;
282
- readonly collection: <Parent>() => <const Field extends RecordKeys<Parent>, const Tag extends string, ChildMessage, Key extends string>(field: Field, wrap: KeyedWrapper<Tag, ChildMessage, Key>, options?: {
283
- readonly when?: (parent: Parent, key: Key) => boolean;
284
- }) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, RecordValue<Parent[Field]>, ChildMessage, Key, Field>;
285
- readonly collectionById: <Parent>() => <const Field extends ArrayKeys<Parent>, const Tag extends string, ChildMessage, Key extends string>(field: Field, wrap: KeyedWrapper<Tag, ChildMessage, Key>, options: {
286
- readonly id: (item: ArrayItem<Parent[Field]>) => Key;
287
- readonly when?: (parent: Parent, key: Key) => boolean;
288
- }) => CollectionLink<Parent, KeyedWrapped<Tag, ChildMessage, Key>, ArrayItem<Parent[Field]>, ChildMessage, Key, Field>;
289
- readonly child: <Parent, ParentMessage, Child, ChildMessage, Services>(link: Link<Parent, ParentMessage, Child, ChildMessage, string>, update: (model: Child, message: ChildMessage) => Update.Return<Child, ChildMessage, Services>, view: (model: Child, h: HtmlBuilder<ChildMessage>) => Html, slotId: string) => {
290
- readonly update: (parent: Parent, message: ChildMessage) => Update.Return<Parent, ParentMessage, Services>;
291
- readonly view: PlacedView<Parent, ParentMessage, void>;
292
- };
293
- };
294
- //#endregion
295
- //#region ../bundle/src/collection.d.ts
296
- declare const PlacedCollectionTypeId: unique symbol;
297
- interface EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> {
298
- /**
299
- * The args every item's `init` and `update` receive: a static value, or a
300
- * factory from the parent seed, computed once per initialization and
301
- * retained. Adding items requires `initial`/`config` to have run; `update`
302
- * on a Model no initialization produced derives per use instead.
303
- */
304
- readonly args?: ArgsSource<ParentSeed, Args>;
305
- /** Handles an item's OutMessage in parent terms, with the item already written back. */
306
- readonly onOut?: (outMessage: OutMessage, key: Key, context: Update.FoldContext<Message, LinkMessage>) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
307
- /** Observes each item's Messages in parent terms, after the item has handled it and its `onOut` has run. */
308
- readonly onMessage?: (message: Message, key: Key) => Update.Step<NoInfer<Parent>, OutStepMessage, R2>;
309
- /** Prefix for the collection's Subscription keys. Defaults to `Name@path[]`. */
310
- readonly key?: string;
311
- readonly when?: (parent: Parent, key: Key) => boolean;
312
- }
313
- type CollectionView<Parent, ParentMessage, ViewInputs, Key extends string = string> = [ViewInputs] extends [void] ? <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, key: Key) => Html : <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, key: Key, viewInputs: ViewInputs) => Html;
314
- type CollectionHelpers<Parent, ParentMessage, R, Helpers, Key extends string = string> = { readonly [K in keyof Helpers]: Helpers[K] extends ((model: any, ...input: infer Input) => any) ? (key: Key, ...input: Input) => Update.Step<Parent, ParentMessage, R> : never; };
315
- interface PlacedCollection<Name extends string, Parent, ParentMessage, Model, Message, R, S, ViewInputs, Helpers, Field extends string = string, Key extends string = string, Claimed extends string = string> {
316
- readonly [PlacedCollectionTypeId]: typeof PlacedCollectionTypeId;
317
- /** Types only: the record field this collection owns, or `string` when unknown. */
318
- readonly field?: Field;
319
- /** Types only: the parent Message tag this collection routes, or `string` when unknown. */
320
- readonly claims?: Claimed;
321
- readonly name: Name;
322
- /** `Name@path[]`, or the configured `key`: the prefix of every Subscription key. */
323
- readonly key: string;
324
- /** The encoded args as text, when the bundle has an args Schema. */
325
- readonly argsSummary: string | undefined;
326
- /** Whether `args` was given as a seed factory; resolved once per initialization. */
327
- readonly hasDynamicArgs: boolean;
328
- /**
329
- * Derives the factory's args from `seed` and retains them for `add`,
330
- * `update`, and Subscriptions. A no-op for static args.
331
- */
332
- readonly resolveArgs: (seed: unknown) => void;
333
- readonly link: CollectionLink<Parent, ParentMessage, Model, Message, Key>;
334
- /** Folds the Message into its item; `None` when it is not this collection's. A missing key leaves the parent unchanged. */
335
- readonly update: (parent: Parent, message: AnyMessage) => Option.Option<Update.Return<Parent, ParentMessage, R>>;
336
- /**
337
- * Writes a new item from `init` and starts its Commands. `prepare` adjusts the
338
- * initial Model first, for what only the parent knows, such as the item's id.
339
- * An existing item is replaced.
340
- */
341
- readonly add: (key: Key, prepare?: (model: Model) => Model) => Update.Step<Parent, ParentMessage, R>;
342
- /** Removes an item; its Subscriptions stop with it, and later Messages for it are ignored. */
343
- readonly remove: (key: Key) => Update.Step<Parent, ParentMessage, never>;
344
- readonly subscriptions: Subscription.Subscriptions<Parent, ParentMessage, S>;
345
- /** One item's view; nothing when the key is missing. */
346
- readonly view: CollectionView<Parent, ParentMessage, ViewInputs, Key>;
347
- /** Every item's view, in the order of the Link's `entries`. */
348
- readonly viewAll: <H extends BuilderLike>(parent: Parent, h: ViewBuilder<H, ParentMessage>, ...viewInputs: [ViewInputs] extends [void] ? [] : [viewInputs: ViewInputs]) => ReadonlyArray<Html>;
349
- readonly helpers: CollectionHelpers<Parent, ParentMessage, R, Helpers, Key>;
350
- }
351
- //#endregion
352
- //#region ../bundle/src/bundle.d.ts
353
- /**
354
- * The parent seed a factory observes: the parent without the placement's own
355
- * field, or the whole parent where the field is unknown (`string`).
356
- */
357
- type SeedFor<Parent, Field extends string> = string extends Field ? Parent : Omit<Parent, Field>;
358
- declare const BundleTypeId: unique symbol;
359
- /** A child Managed Resource entry: its requirements are an `Option`, so the entry can release. */
360
- type ResourceEntry<Model, Message> = ManagedResource.Entry<Model, Message, Option.Option<any>, any, any>;
361
- type ResourceEntries<Model, Message> = Readonly<Record<string, ResourceEntry<Model, Message>>>;
362
- /** A programmatic entry point, like `Dialog.open`: the child Model plus any input. */
363
- type Helper<Model, Message, OutMessage, R> = (model: Model, ...input: ReadonlyArray<any>) => Update.ReturnWithOutMessage<Model, Message, OutMessage, R>;
364
- interface BundleSpec<Name extends string, Args, Model, Message extends AnyMessage, OutMessage, R, S, ViewInputs, Resources extends ResourceEntries<Model, Message>, Helpers extends Readonly<Record<string, Helper<Model, Message, OutMessage, R>>>> {
365
- readonly name: Name;
366
- readonly Model: Schema.Codec<Model, unknown>;
367
- readonly Message: Schema.Codec<Message, unknown>;
368
- /**
369
- * The args Schema. When given, `Args` is inferred from it, a placement's args
370
- * are checked against it, and Module lists them.
371
- */
372
- readonly args?: Schema.Codec<Args, unknown>;
373
- /** Set by `with`: the bound args, encoded as text, for Module. */
374
- readonly preset?: string | undefined;
375
- /** Runs when the bundle is placed; its Commands start with the placement. */
376
- readonly init: (args: Args) => Update.Return<Model, Message, R>;
377
- readonly update: (model: Model, message: Message, args: Args) => Update.ReturnWithOutMessage<Model, Message, OutMessage, R>;
378
- readonly subscriptions?: (args: Args) => Subscription.Subscriptions<Model, Message, S>;
379
- readonly resources?: (args: Args) => Resources;
380
- readonly view?: Submodel.View<Model, Message, ViewInputs>;
381
- readonly helpers?: Helpers;
382
- }
383
- interface Bundle$1<Name extends string, Args, Model, Message extends AnyMessage, OutMessage, R, S, ViewInputs, Resources extends ResourceEntries<Model, Message>, Helpers extends Readonly<Record<string, Helper<Model, Message, OutMessage, R>>>> extends BundleSpec<Name, Args, Model, Message, OutMessage, R, S, ViewInputs, Resources, Helpers>, Pipeable.Pipeable {
384
- readonly [BundleTypeId]: typeof BundleTypeId;
385
- /**
386
- * A preset: the same bundle with its args bound, so placements need no `args`.
387
- * The args are checked against the args Schema when there is one.
388
- */
389
- readonly with: (args: Args) => Bundle$1<Name, void, Model, Message, OutMessage, R, S, ViewInputs, Resources, Helpers>;
390
- /** Places the bundle where `link` points. */
391
- readonly at: <Parent, LinkMessage, Field extends string, OutStepMessage = never, R2 = never>(link: Link<Parent, LinkMessage, Model, Message, Field>, ...config: PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, SeedFor<Parent, Field>>) => Placed<Name, Parent, LinkMessage | OutStepMessage, Model, Message, R | R2, S, ViewInputs, Resources, Helpers, Field, TagOf<LinkMessage>>;
392
- /** Places the bundle once per key of the collection `link` points at. */
393
- readonly each: [keyof Resources] extends [never] ? <Parent, LinkMessage, Key extends string, Field extends string, OutStepMessage = never, R2 = never>(link: CollectionLink<Parent, LinkMessage, Model, Message, Key, Field>, ...config: EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, SeedFor<Parent, Field>>) => PlacedCollection<Name, Parent, LinkMessage | OutStepMessage, Model, Message, R | R2, S, ViewInputs, Helpers, Field, Key, TagOf<LinkMessage>> : Invalid<'Bundle.each does not support Managed Resources yet: the runtime provides a resource by one tag, so items would share it'>;
394
- }
11
+ //#region src/settings.d.ts
395
12
  /**
396
- * What placing needs: `args` when `init` takes them, and `onOut` when the
397
- * bundle has an OutMessage, so an OutMessage is never dropped by omission.
398
- * `args` is a static value or a factory from the parent seed (the parent
399
- * without this placement's own field); the seed type defaults to the whole
400
- * parent where the field is unknown.
13
+ * Block metadata: the control the inspector draws a prop with, where its
14
+ * Schema alone does not say, as
15
+ * `Heading.pipe(Block.annotate(Builder.controls({ text: Input.multiline() })))`.
16
+ * `Input.hidden()` leaves a prop out of the inspector.
401
17
  */
402
- type PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> = {
403
- /** Prefix for the placement's Subscription and resource keys. Defaults to `Name@path`. */
404
- readonly key?: string;
405
- /** A gate beside the Link's own: the child's Subscriptions and resources run only while both hold. */
406
- readonly when?: (parent: Parent) => boolean;
407
- /** Observes each of the child's Messages in parent terms, after the child handled it. */
408
- readonly onMessage?: Required<PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>>['onMessage'];
409
- } & ([Args] extends [void] ? {
410
- readonly args?: never;
411
- } : {
412
- readonly args: ArgsSource<ParentSeed, Args>;
413
- }) & ([OutMessage] extends [never] ? {
414
- readonly onOut?: never;
415
- } : {
416
- readonly onOut: Required<PlaceConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>>['onOut'];
417
- });
418
- /** The config argument is optional only when it would be empty. */
419
- type PlaceConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed = Parent> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>] : [config: PlacementConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, ParentSeed>];
420
- type EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> = {
421
- readonly key?: string;
422
- /** A gate per item beside the Link's own: an item's Subscriptions run only while both hold. */
423
- readonly when?: (parent: Parent, key: Key) => boolean;
424
- /** Observes each item's Messages in parent terms, after the item handled it. */
425
- readonly onMessage?: Required<EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>>['onMessage'];
426
- } & ([Args] extends [void] ? {
427
- readonly args?: never;
428
- } : {
429
- readonly args: ArgsSource<ParentSeed, Args>;
430
- }) & ([OutMessage] extends [never] ? {
431
- readonly onOut?: never;
432
- } : {
433
- readonly onOut: Required<EachConfig<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>>['onOut'];
434
- });
435
- type EachConfigParam<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key extends string = string, ParentSeed = Parent> = [Args] extends [void] ? [OutMessage] extends [never] ? [config?: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>] : [config: EachOptions<Args, Parent, LinkMessage, Message, OutMessage, OutStepMessage, R2, Key, ParentSeed>];
436
- //#endregion
437
- //#region src/settings.d.ts
18
+ declare const controls: (given: Readonly<Record<string, Control>>) => Metadata;
438
19
  /** A form over `fields`, named `name`, with the controls `hints` asks for. */
439
20
  declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>, hints: Readonly<Record<string, Control>>) => {
440
21
  form: {
441
- bundle: Bundle$1<string, void, import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
22
+ pipe<A>(this: A): A;
23
+ pipe<A, B = never>(this: A, ab: (_: A) => B): B;
24
+ pipe<A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C;
25
+ pipe<A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D;
26
+ pipe<A, B = never, C = never, D = never, E_1 = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1): E_1;
27
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F): F;
28
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G): G;
29
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H): H;
30
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I): I;
31
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J): J;
32
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K): K;
33
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L): L;
34
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M): M;
35
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N): N;
36
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O): O;
37
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P): P;
38
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q): Q;
39
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R_1 = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R_1): R_1;
40
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R_1 = never, S = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R_1, rs: (_: R_1) => S): S;
41
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R_1 = never, S = never, T = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R_1, rs: (_: R_1) => S, st: (_: S) => T): T;
42
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R_1 = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R_1, rs: (_: R_1) => S, st: (_: S) => T, tu: (_: T) => U): U;
43
+ pipe<A, B = never, C = never, D = never, E_1 = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R_1 = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E_1, ef: (_: E_1) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R_1, rs: (_: R_1) => S, st: (_: S) => T, tu: (_: T) => U): U;
44
+ name: string;
45
+ options: import("foldkit-form").FormOptions<Readonly<Record<string, Schema.Top>>, {
46
+ readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
47
+ }, never, {}, Readonly<Record<string, Control<unknown>>>>;
48
+ types: {
49
+ readonly Name: string;
50
+ readonly E: Entity<string, Readonly<Record<string, Schema.Top>>, {}, {}>;
51
+ readonly Fields: Readonly<Record<string, Schema.Top>>;
52
+ readonly Members: {
53
+ readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
54
+ };
55
+ readonly R: never;
56
+ readonly Nest: {};
57
+ readonly Inputs: Readonly<Record<string, Control<unknown>>>;
58
+ };
59
+ bundle: import("foldkit-bundle").BundleShape<string, void, import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
442
60
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
443
61
  }, import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>>>, {
62
+ readonly _tag: "About";
63
+ readonly subject: {
64
+ readonly [x: string]: string;
65
+ };
66
+ } | {
67
+ readonly _tag: "Blurred";
68
+ readonly key: string;
69
+ } | {
70
+ readonly _tag: "Changed";
71
+ readonly key: string;
72
+ readonly value: string | boolean | readonly string[];
73
+ } | {
74
+ readonly _tag: "Checked";
75
+ readonly key: string;
76
+ readonly draft: string | boolean | readonly string[];
77
+ readonly error: string | null;
78
+ } | {
79
+ readonly _tag: "Control";
80
+ readonly key: never;
81
+ readonly message: unknown;
82
+ } | {
444
83
  readonly _tag: "Nested";
445
84
  readonly key: string;
446
85
  readonly row: string;
447
86
  readonly message: unknown;
448
87
  } | {
449
- readonly _tag: "Submitted";
450
- } | {
451
- readonly _tag: "ValidatedAll";
88
+ readonly _tag: "Refused";
89
+ readonly key: string;
90
+ readonly error: string;
452
91
  } | {
453
92
  readonly _tag: "Reset";
454
93
  } | {
@@ -458,35 +97,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
458
97
  readonly _tag: "RowRemoved";
459
98
  readonly key: string;
460
99
  readonly row: string;
461
- } | {
462
- readonly _tag: "About";
463
- readonly subject: {
464
- readonly [x: string]: string;
465
- };
466
- } | {
467
- readonly _tag: "Changed";
468
- readonly key: string;
469
- readonly value: string | boolean | readonly string[];
470
- } | {
471
- readonly _tag: "Blurred";
472
- readonly key: string;
473
100
  } | {
474
101
  readonly _tag: "Searched";
475
102
  readonly key: string;
476
103
  readonly text: string;
477
104
  } | {
478
- readonly _tag: "Checked";
479
- readonly key: string;
480
- readonly draft: string | boolean | readonly string[];
481
- readonly error: string | null;
482
- } | {
483
- readonly _tag: "Refused";
484
- readonly key: string;
485
- readonly error: string;
105
+ readonly _tag: "Submitted";
486
106
  } | {
487
- readonly _tag: "Control";
488
- readonly key: never;
489
- readonly message: unknown;
107
+ readonly _tag: "ValidatedAll";
490
108
  }, import("foldkit-form").Submitted<{
491
109
  readonly [x: string]: unknown;
492
110
  }>, never, never, void, {}, {
@@ -568,19 +186,42 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
568
186
  field: (model: import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
569
187
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
570
188
  }, import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>>>, key: string) => import("foldkit/fieldValidation").Field<import("foldkit-form").Draft>;
571
- control: <K extends never>(key: K) => {
189
+ control: <K extends keyof import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>> & Exclude<string & string, import("foldkit-form").NestedKey<{
190
+ readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
191
+ }>>>(key: K) => {
572
192
  readonly field: (model: import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
573
193
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
574
194
  }, import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>>>) => import("foldkit/fieldValidation").Field<string>;
575
195
  readonly send: (message: never) => {
196
+ readonly _tag: "About";
197
+ readonly subject: {
198
+ readonly [x: string]: string;
199
+ };
200
+ } | {
201
+ readonly _tag: "Blurred";
202
+ readonly key: string;
203
+ } | {
204
+ readonly _tag: "Changed";
205
+ readonly key: string;
206
+ readonly value: string | boolean | readonly string[];
207
+ } | {
208
+ readonly _tag: "Checked";
209
+ readonly key: string;
210
+ readonly draft: string | boolean | readonly string[];
211
+ readonly error: string | null;
212
+ } | {
213
+ readonly _tag: "Control";
214
+ readonly key: never;
215
+ readonly message: unknown;
216
+ } | {
576
217
  readonly _tag: "Nested";
577
218
  readonly key: string;
578
219
  readonly row: string;
579
220
  readonly message: unknown;
580
221
  } | {
581
- readonly _tag: "Submitted";
582
- } | {
583
- readonly _tag: "ValidatedAll";
222
+ readonly _tag: "Refused";
223
+ readonly key: string;
224
+ readonly error: string;
584
225
  } | {
585
226
  readonly _tag: "Reset";
586
227
  } | {
@@ -590,35 +231,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
590
231
  readonly _tag: "RowRemoved";
591
232
  readonly key: string;
592
233
  readonly row: string;
593
- } | {
594
- readonly _tag: "About";
595
- readonly subject: {
596
- readonly [x: string]: string;
597
- };
598
- } | {
599
- readonly _tag: "Changed";
600
- readonly key: string;
601
- readonly value: string | boolean | readonly string[];
602
- } | {
603
- readonly _tag: "Blurred";
604
- readonly key: string;
605
234
  } | {
606
235
  readonly _tag: "Searched";
607
236
  readonly key: string;
608
237
  readonly text: string;
609
238
  } | {
610
- readonly _tag: "Checked";
611
- readonly key: string;
612
- readonly draft: string | boolean | readonly string[];
613
- readonly error: string | null;
614
- } | {
615
- readonly _tag: "Refused";
616
- readonly key: string;
617
- readonly error: string;
239
+ readonly _tag: "Submitted";
618
240
  } | {
619
- readonly _tag: "Control";
620
- readonly key: never;
621
- readonly message: unknown;
241
+ readonly _tag: "ValidatedAll";
622
242
  };
623
243
  };
624
244
  search: (model: import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
@@ -628,15 +248,38 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
628
248
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
629
249
  }, import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>>>) => Readonly<Record<string, string>>;
630
250
  nested: {};
631
- row: <K extends never>(key: K, row: string) => import("foldkit-form").RowHandle<K extends never ? NonNullable<{}[K]> : import("foldkit-form").NestedForm, {
251
+ row: <K extends Extract<string & string, import("foldkit-form").NestedKey<{
252
+ readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
253
+ }>>>(key: K, row: string) => import("foldkit-form").RowHandle<K extends never ? NonNullable<{}[K]> : import("foldkit-form").NestedForm, {
254
+ readonly _tag: "About";
255
+ readonly subject: {
256
+ readonly [x: string]: string;
257
+ };
258
+ } | {
259
+ readonly _tag: "Blurred";
260
+ readonly key: string;
261
+ } | {
262
+ readonly _tag: "Changed";
263
+ readonly key: string;
264
+ readonly value: string | boolean | readonly string[];
265
+ } | {
266
+ readonly _tag: "Checked";
267
+ readonly key: string;
268
+ readonly draft: string | boolean | readonly string[];
269
+ readonly error: string | null;
270
+ } | {
271
+ readonly _tag: "Control";
272
+ readonly key: never;
273
+ readonly message: unknown;
274
+ } | {
632
275
  readonly _tag: "Nested";
633
276
  readonly key: string;
634
277
  readonly row: string;
635
278
  readonly message: unknown;
636
279
  } | {
637
- readonly _tag: "Submitted";
638
- } | {
639
- readonly _tag: "ValidatedAll";
280
+ readonly _tag: "Refused";
281
+ readonly key: string;
282
+ readonly error: string;
640
283
  } | {
641
284
  readonly _tag: "Reset";
642
285
  } | {
@@ -646,35 +289,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
646
289
  readonly _tag: "RowRemoved";
647
290
  readonly key: string;
648
291
  readonly row: string;
649
- } | {
650
- readonly _tag: "About";
651
- readonly subject: {
652
- readonly [x: string]: string;
653
- };
654
- } | {
655
- readonly _tag: "Changed";
656
- readonly key: string;
657
- readonly value: string | boolean | readonly string[];
658
- } | {
659
- readonly _tag: "Blurred";
660
- readonly key: string;
661
292
  } | {
662
293
  readonly _tag: "Searched";
663
294
  readonly key: string;
664
295
  readonly text: string;
665
296
  } | {
666
- readonly _tag: "Checked";
667
- readonly key: string;
668
- readonly draft: string | boolean | readonly string[];
669
- readonly error: string | null;
670
- } | {
671
- readonly _tag: "Refused";
672
- readonly key: string;
673
- readonly error: string;
297
+ readonly _tag: "Submitted";
674
298
  } | {
675
- readonly _tag: "Control";
676
- readonly key: never;
677
- readonly message: unknown;
299
+ readonly _tag: "ValidatedAll";
678
300
  }>;
679
301
  isFollowing: (model: import("foldkit-form").FormModel<Readonly<Record<string, Schema.Top>>, {
680
302
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
@@ -715,14 +337,35 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
715
337
  args?: Record<string, unknown>;
716
338
  key?: string;
717
339
  effect: import("effect/Effect").Effect<{
340
+ readonly _tag: "About";
341
+ readonly subject: {
342
+ readonly [x: string]: string;
343
+ };
344
+ } | {
345
+ readonly _tag: "Blurred";
346
+ readonly key: string;
347
+ } | {
348
+ readonly _tag: "Changed";
349
+ readonly key: string;
350
+ readonly value: string | boolean | readonly string[];
351
+ } | {
352
+ readonly _tag: "Checked";
353
+ readonly key: string;
354
+ readonly draft: string | boolean | readonly string[];
355
+ readonly error: string | null;
356
+ } | {
357
+ readonly _tag: "Control";
358
+ readonly key: never;
359
+ readonly message: unknown;
360
+ } | {
718
361
  readonly _tag: "Nested";
719
362
  readonly key: string;
720
363
  readonly row: string;
721
364
  readonly message: unknown;
722
365
  } | {
723
- readonly _tag: "Submitted";
724
- } | {
725
- readonly _tag: "ValidatedAll";
366
+ readonly _tag: "Refused";
367
+ readonly key: string;
368
+ readonly error: string;
726
369
  } | {
727
370
  readonly _tag: "Reset";
728
371
  } | {
@@ -732,35 +375,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
732
375
  readonly _tag: "RowRemoved";
733
376
  readonly key: string;
734
377
  readonly row: string;
735
- } | {
736
- readonly _tag: "About";
737
- readonly subject: {
738
- readonly [x: string]: string;
739
- };
740
- } | {
741
- readonly _tag: "Changed";
742
- readonly key: string;
743
- readonly value: string | boolean | readonly string[];
744
- } | {
745
- readonly _tag: "Blurred";
746
- readonly key: string;
747
378
  } | {
748
379
  readonly _tag: "Searched";
749
380
  readonly key: string;
750
381
  readonly text: string;
751
382
  } | {
752
- readonly _tag: "Checked";
753
- readonly key: string;
754
- readonly draft: string | boolean | readonly string[];
755
- readonly error: string | null;
756
- } | {
757
- readonly _tag: "Refused";
758
- readonly key: string;
759
- readonly error: string;
383
+ readonly _tag: "Submitted";
760
384
  } | {
761
- readonly _tag: "Control";
762
- readonly key: never;
763
- readonly message: unknown;
385
+ readonly _tag: "ValidatedAll";
764
386
  }, never, never>;
765
387
  }>[];
766
388
  };
@@ -775,14 +397,35 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
775
397
  args?: Record<string, unknown>;
776
398
  key?: string;
777
399
  effect: import("effect/Effect").Effect<{
400
+ readonly _tag: "About";
401
+ readonly subject: {
402
+ readonly [x: string]: string;
403
+ };
404
+ } | {
405
+ readonly _tag: "Blurred";
406
+ readonly key: string;
407
+ } | {
408
+ readonly _tag: "Changed";
409
+ readonly key: string;
410
+ readonly value: string | boolean | readonly string[];
411
+ } | {
412
+ readonly _tag: "Checked";
413
+ readonly key: string;
414
+ readonly draft: string | boolean | readonly string[];
415
+ readonly error: string | null;
416
+ } | {
417
+ readonly _tag: "Control";
418
+ readonly key: never;
419
+ readonly message: unknown;
420
+ } | {
778
421
  readonly _tag: "Nested";
779
422
  readonly key: string;
780
423
  readonly row: string;
781
424
  readonly message: unknown;
782
425
  } | {
783
- readonly _tag: "Submitted";
784
- } | {
785
- readonly _tag: "ValidatedAll";
426
+ readonly _tag: "Refused";
427
+ readonly key: string;
428
+ readonly error: string;
786
429
  } | {
787
430
  readonly _tag: "Reset";
788
431
  } | {
@@ -792,35 +435,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
792
435
  readonly _tag: "RowRemoved";
793
436
  readonly key: string;
794
437
  readonly row: string;
795
- } | {
796
- readonly _tag: "About";
797
- readonly subject: {
798
- readonly [x: string]: string;
799
- };
800
- } | {
801
- readonly _tag: "Changed";
802
- readonly key: string;
803
- readonly value: string | boolean | readonly string[];
804
- } | {
805
- readonly _tag: "Blurred";
806
- readonly key: string;
807
438
  } | {
808
439
  readonly _tag: "Searched";
809
440
  readonly key: string;
810
441
  readonly text: string;
811
442
  } | {
812
- readonly _tag: "Checked";
813
- readonly key: string;
814
- readonly draft: string | boolean | readonly string[];
815
- readonly error: string | null;
816
- } | {
817
- readonly _tag: "Refused";
818
- readonly key: string;
819
- readonly error: string;
443
+ readonly _tag: "Submitted";
820
444
  } | {
821
- readonly _tag: "Control";
822
- readonly key: never;
823
- readonly message: unknown;
445
+ readonly _tag: "ValidatedAll";
824
446
  }, never, never>;
825
447
  }>[];
826
448
  };
@@ -838,43 +460,6 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
838
460
  readonly [x: string]: unknown;
839
461
  } | undefined;
840
462
  };
841
- pipe<A>(this: A): A;
842
- pipe<A, B = never>(this: A, ab: (_: A) => B): B;
843
- pipe<A, B_1 = never, C = never>(this: A, ab: (_: A) => B_1, bc: (_: B_1) => C): C;
844
- pipe<A, B_2 = never, C_1 = never, D = never>(this: A, ab: (_: A) => B_2, bc: (_: B_2) => C_1, cd: (_: C_1) => D): D;
845
- pipe<A, B_3 = never, C_2 = never, D_1 = never, E_1 = never>(this: A, ab: (_: A) => B_3, bc: (_: B_3) => C_2, cd: (_: C_2) => D_1, de: (_: D_1) => E_1): E_1;
846
- pipe<A, B_4 = never, C_3 = never, D_2 = never, E_2 = never, F = never>(this: A, ab: (_: A) => B_4, bc: (_: B_4) => C_3, cd: (_: C_3) => D_2, de: (_: D_2) => E_2, ef: (_: E_2) => F): F;
847
- pipe<A, B_5 = never, C_4 = never, D_3 = never, E_3 = never, F_1 = never, G = never>(this: A, ab: (_: A) => B_5, bc: (_: B_5) => C_4, cd: (_: C_4) => D_3, de: (_: D_3) => E_3, ef: (_: E_3) => F_1, fg: (_: F_1) => G): G;
848
- pipe<A, B_6 = never, C_5 = never, D_4 = never, E_4 = never, F_2 = never, G_1 = never, H = never>(this: A, ab: (_: A) => B_6, bc: (_: B_6) => C_5, cd: (_: C_5) => D_4, de: (_: D_4) => E_4, ef: (_: E_4) => F_2, fg: (_: F_2) => G_1, gh: (_: G_1) => H): H;
849
- pipe<A, B_7 = never, C_6 = never, D_5 = never, E_5 = never, F_3 = never, G_2 = never, H_1 = never, I = never>(this: A, ab: (_: A) => B_7, bc: (_: B_7) => C_6, cd: (_: C_6) => D_5, de: (_: D_5) => E_5, ef: (_: E_5) => F_3, fg: (_: F_3) => G_2, gh: (_: G_2) => H_1, hi: (_: H_1) => I): I;
850
- pipe<A, B_8 = never, C_7 = never, D_6 = never, E_6 = never, F_4 = never, G_3 = never, H_2 = never, I_1 = never, J = never>(this: A, ab: (_: A) => B_8, bc: (_: B_8) => C_7, cd: (_: C_7) => D_6, de: (_: D_6) => E_6, ef: (_: E_6) => F_4, fg: (_: F_4) => G_3, gh: (_: G_3) => H_2, hi: (_: H_2) => I_1, ij: (_: I_1) => J): J;
851
- pipe<A, B_9 = never, C_8 = never, D_7 = never, E_7 = never, F_5 = never, G_4 = never, H_3 = never, I_2 = never, J_1 = never, K = never>(this: A, ab: (_: A) => B_9, bc: (_: B_9) => C_8, cd: (_: C_8) => D_7, de: (_: D_7) => E_7, ef: (_: E_7) => F_5, fg: (_: F_5) => G_4, gh: (_: G_4) => H_3, hi: (_: H_3) => I_2, ij: (_: I_2) => J_1, jk: (_: J_1) => K): K;
852
- pipe<A, B_10 = never, C_9 = never, D_8 = never, E_8 = never, F_6 = never, G_5 = never, H_4 = never, I_3 = never, J_2 = never, K_1 = never, L = never>(this: A, ab: (_: A) => B_10, bc: (_: B_10) => C_9, cd: (_: C_9) => D_8, de: (_: D_8) => E_8, ef: (_: E_8) => F_6, fg: (_: F_6) => G_5, gh: (_: G_5) => H_4, hi: (_: H_4) => I_3, ij: (_: I_3) => J_2, jk: (_: J_2) => K_1, kl: (_: K_1) => L): L;
853
- pipe<A, B_11 = never, C_10 = never, D_9 = never, E_9 = never, F_7 = never, G_6 = never, H_5 = never, I_4 = never, J_3 = never, K_2 = never, L_1 = never, M = never>(this: A, ab: (_: A) => B_11, bc: (_: B_11) => C_10, cd: (_: C_10) => D_9, de: (_: D_9) => E_9, ef: (_: E_9) => F_7, fg: (_: F_7) => G_6, gh: (_: G_6) => H_5, hi: (_: H_5) => I_4, ij: (_: I_4) => J_3, jk: (_: J_3) => K_2, kl: (_: K_2) => L_1, lm: (_: L_1) => M): M;
854
- pipe<A, B_12 = never, C_11 = never, D_10 = never, E_10 = never, F_8 = never, G_7 = never, H_6 = never, I_5 = never, J_4 = never, K_3 = never, L_2 = never, M_1 = never, N = never>(this: A, ab: (_: A) => B_12, bc: (_: B_12) => C_11, cd: (_: C_11) => D_10, de: (_: D_10) => E_10, ef: (_: E_10) => F_8, fg: (_: F_8) => G_7, gh: (_: G_7) => H_6, hi: (_: H_6) => I_5, ij: (_: I_5) => J_4, jk: (_: J_4) => K_3, kl: (_: K_3) => L_2, lm: (_: L_2) => M_1, mn: (_: M_1) => N): N;
855
- pipe<A, B_13 = never, C_12 = never, D_11 = never, E_11 = never, F_9 = never, G_8 = never, H_7 = never, I_6 = never, J_5 = never, K_4 = never, L_3 = never, M_2 = never, N_1 = never, O = never>(this: A, ab: (_: A) => B_13, bc: (_: B_13) => C_12, cd: (_: C_12) => D_11, de: (_: D_11) => E_11, ef: (_: E_11) => F_9, fg: (_: F_9) => G_8, gh: (_: G_8) => H_7, hi: (_: H_7) => I_6, ij: (_: I_6) => J_5, jk: (_: J_5) => K_4, kl: (_: K_4) => L_3, lm: (_: L_3) => M_2, mn: (_: M_2) => N_1, no: (_: N_1) => O): O;
856
- pipe<A, B_14 = never, C_13 = never, D_12 = never, E_12 = never, F_10 = never, G_9 = never, H_8 = never, I_7 = never, J_6 = never, K_5 = never, L_4 = never, M_3 = never, N_2 = never, O_1 = never, P = never>(this: A, ab: (_: A) => B_14, bc: (_: B_14) => C_13, cd: (_: C_13) => D_12, de: (_: D_12) => E_12, ef: (_: E_12) => F_10, fg: (_: F_10) => G_9, gh: (_: G_9) => H_8, hi: (_: H_8) => I_7, ij: (_: I_7) => J_6, jk: (_: J_6) => K_5, kl: (_: K_5) => L_4, lm: (_: L_4) => M_3, mn: (_: M_3) => N_2, no: (_: N_2) => O_1, op: (_: O_1) => P): P;
857
- pipe<A, B_15 = never, C_14 = never, D_13 = never, E_13 = never, F_11 = never, G_10 = never, H_9 = never, I_8 = never, J_7 = never, K_6 = never, L_5 = never, M_4 = never, N_3 = never, O_2 = never, P_1 = never, Q = never>(this: A, ab: (_: A) => B_15, bc: (_: B_15) => C_14, cd: (_: C_14) => D_13, de: (_: D_13) => E_13, ef: (_: E_13) => F_11, fg: (_: F_11) => G_10, gh: (_: G_10) => H_9, hi: (_: H_9) => I_8, ij: (_: I_8) => J_7, jk: (_: J_7) => K_6, kl: (_: K_6) => L_5, lm: (_: L_5) => M_4, mn: (_: M_4) => N_3, no: (_: N_3) => O_2, op: (_: O_2) => P_1, pq: (_: P_1) => Q): Q;
858
- pipe<A, B_16 = never, C_15 = never, D_14 = never, E_14 = never, F_12 = never, G_11 = never, H_10 = never, I_9 = never, J_8 = never, K_7 = never, L_6 = never, M_5 = never, N_4 = never, O_3 = never, P_2 = never, Q_1 = never, R_1 = never>(this: A, ab: (_: A) => B_16, bc: (_: B_16) => C_15, cd: (_: C_15) => D_14, de: (_: D_14) => E_14, ef: (_: E_14) => F_12, fg: (_: F_12) => G_11, gh: (_: G_11) => H_10, hi: (_: H_10) => I_9, ij: (_: I_9) => J_8, jk: (_: J_8) => K_7, kl: (_: K_7) => L_6, lm: (_: L_6) => M_5, mn: (_: M_5) => N_4, no: (_: N_4) => O_3, op: (_: O_3) => P_2, pq: (_: P_2) => Q_1, qr: (_: Q_1) => R_1): R_1;
859
- pipe<A, B_17 = never, C_16 = never, D_15 = never, E_15 = never, F_13 = never, G_12 = never, H_11 = never, I_10 = never, J_9 = never, K_8 = never, L_7 = never, M_6 = never, N_5 = never, O_4 = never, P_3 = never, Q_2 = never, R_2 = never, S = never>(this: A, ab: (_: A) => B_17, bc: (_: B_17) => C_16, cd: (_: C_16) => D_15, de: (_: D_15) => E_15, ef: (_: E_15) => F_13, fg: (_: F_13) => G_12, gh: (_: G_12) => H_11, hi: (_: H_11) => I_10, ij: (_: I_10) => J_9, jk: (_: J_9) => K_8, kl: (_: K_8) => L_7, lm: (_: L_7) => M_6, mn: (_: M_6) => N_5, no: (_: N_5) => O_4, op: (_: O_4) => P_3, pq: (_: P_3) => Q_2, qr: (_: Q_2) => R_2, rs: (_: R_2) => S): S;
860
- pipe<A, B_18 = never, C_17 = never, D_16 = never, E_16 = never, F_14 = never, G_13 = never, H_12 = never, I_11 = never, J_10 = never, K_9 = never, L_8 = never, M_7 = never, N_6 = never, O_5 = never, P_4 = never, Q_3 = never, R_3 = never, S_1 = never, T = never>(this: A, ab: (_: A) => B_18, bc: (_: B_18) => C_17, cd: (_: C_17) => D_16, de: (_: D_16) => E_16, ef: (_: E_16) => F_14, fg: (_: F_14) => G_13, gh: (_: G_13) => H_12, hi: (_: H_12) => I_11, ij: (_: I_11) => J_10, jk: (_: J_10) => K_9, kl: (_: K_9) => L_8, lm: (_: L_8) => M_7, mn: (_: M_7) => N_6, no: (_: N_6) => O_5, op: (_: O_5) => P_4, pq: (_: P_4) => Q_3, qr: (_: Q_3) => R_3, rs: (_: R_3) => S_1, st: (_: S_1) => T): T;
861
- pipe<A, B_19 = never, C_18 = never, D_17 = never, E_17 = never, F_15 = never, G_14 = never, H_13 = never, I_12 = never, J_11 = never, K_10 = never, L_9 = never, M_8 = never, N_7 = never, O_6 = never, P_5 = never, Q_4 = never, R_4 = never, S_2 = never, T_1 = never, U = never>(this: A, ab: (_: A) => B_19, bc: (_: B_19) => C_18, cd: (_: C_18) => D_17, de: (_: D_17) => E_17, ef: (_: E_17) => F_15, fg: (_: F_15) => G_14, gh: (_: G_14) => H_13, hi: (_: H_13) => I_12, ij: (_: I_12) => J_11, jk: (_: J_11) => K_10, kl: (_: K_10) => L_9, lm: (_: L_9) => M_8, mn: (_: M_8) => N_7, no: (_: N_7) => O_6, op: (_: O_6) => P_5, pq: (_: P_5) => Q_4, qr: (_: Q_4) => R_4, rs: (_: R_4) => S_2, st: (_: S_2) => T_1, tu: (_: T_1) => U): U;
862
- pipe<A, B_20 = never, C_19 = never, D_18 = never, E_18 = never, F_16 = never, G_15 = never, H_14 = never, I_13 = never, J_12 = never, K_11 = never, L_10 = never, M_9 = never, N_8 = never, O_7 = never, P_6 = never, Q_5 = never, R_5 = never, S_3 = never, T_2 = never, U_1 = never>(this: A, ab: (_: A) => B_20, bc: (_: B_20) => C_19, cd: (_: C_19) => D_18, de: (_: D_18) => E_18, ef: (_: E_18) => F_16, fg: (_: F_16) => G_15, gh: (_: G_15) => H_14, hi: (_: H_14) => I_13, ij: (_: I_13) => J_12, jk: (_: J_12) => K_11, kl: (_: K_11) => L_10, lm: (_: L_10) => M_9, mn: (_: M_9) => N_8, no: (_: N_8) => O_7, op: (_: O_7) => P_6, pq: (_: P_6) => Q_5, qr: (_: Q_5) => R_5, rs: (_: R_5) => S_3, st: (_: S_3) => T_2, tu: (_: T_2) => U_1): U_1;
863
- name: string;
864
- options: import("foldkit-form").FormOptions<Readonly<Record<string, Schema.Top>>, {
865
- readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
866
- }, never, {}, Readonly<Record<string, Control<unknown>>>>;
867
- types: {
868
- readonly Name: string;
869
- readonly E: Entity<string, Readonly<Record<string, Schema.Top>>, {}, {}>;
870
- readonly Fields: Readonly<Record<string, Schema.Top>>;
871
- readonly Members: {
872
- readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
873
- };
874
- readonly R: never;
875
- readonly Nest: {};
876
- readonly Inputs: Readonly<Record<string, Control<unknown>>>;
877
- };
878
463
  };
879
464
  /** Every key the form's Schema names, edited or shown. */
880
465
  keys: string[];
@@ -902,45 +487,37 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
902
487
  readonly [x: string]: import("foldkit-entity").EntityField<string, string, Schema.Top>;
903
488
  }, import("foldkit-form").ControlsOf<Readonly<Record<string, Control<unknown>>>>>>;
904
489
  encodeMessage: (message: {
905
- readonly _tag: "Refused";
490
+ readonly _tag: "About";
491
+ readonly subject: {
492
+ readonly [x: string]: string;
493
+ };
494
+ } | {
495
+ readonly _tag: "Blurred";
906
496
  readonly key: string;
907
- readonly error: string;
908
497
  } | {
909
498
  readonly _tag: "Changed";
910
499
  readonly key: string;
911
500
  readonly value: string | boolean | readonly string[];
912
- } | {
913
- readonly _tag: "Blurred";
914
- readonly key: string;
915
- } | {
916
- readonly _tag: "ValidatedAll";
917
- } | {
918
- readonly _tag: "Submitted";
919
- } | {
920
- readonly _tag: "Reset";
921
501
  } | {
922
502
  readonly _tag: "Checked";
923
503
  readonly key: string;
924
504
  readonly draft: string | boolean | readonly string[];
925
505
  readonly error: string | null;
926
506
  } | {
927
- readonly _tag: "About";
928
- readonly subject: {
929
- readonly [x: string]: string;
930
- };
931
- } | {
932
- readonly _tag: "Searched";
933
- readonly key: string;
934
- readonly text: string;
507
+ readonly _tag: "Control";
508
+ readonly key: never;
509
+ readonly message: unknown;
935
510
  } | {
936
511
  readonly _tag: "Nested";
937
512
  readonly key: string;
938
513
  readonly row: string;
939
514
  readonly message: unknown;
940
515
  } | {
941
- readonly _tag: "Control";
942
- readonly key: never;
943
- readonly message: unknown;
516
+ readonly _tag: "Refused";
517
+ readonly key: string;
518
+ readonly error: string;
519
+ } | {
520
+ readonly _tag: "Reset";
944
521
  } | {
945
522
  readonly _tag: "RowAdded";
946
523
  readonly key: string;
@@ -948,47 +525,47 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
948
525
  readonly _tag: "RowRemoved";
949
526
  readonly key: string;
950
527
  readonly row: string;
951
- }) => Schema.Json;
952
- decodeMessage: (held: Schema.Json) => Option.Option<{
953
- readonly _tag: "Refused";
954
- readonly key: string;
955
- readonly error: string;
956
528
  } | {
957
- readonly _tag: "Changed";
529
+ readonly _tag: "Searched";
958
530
  readonly key: string;
959
- readonly value: string | boolean | readonly string[];
531
+ readonly text: string;
960
532
  } | {
961
- readonly _tag: "Blurred";
962
- readonly key: string;
533
+ readonly _tag: "Submitted";
963
534
  } | {
964
535
  readonly _tag: "ValidatedAll";
536
+ }) => Schema.Json;
537
+ decodeMessage: (held: Schema.Json) => Option.Option<{
538
+ readonly _tag: "About";
539
+ readonly subject: {
540
+ readonly [x: string]: string;
541
+ };
965
542
  } | {
966
- readonly _tag: "Submitted";
543
+ readonly _tag: "Blurred";
544
+ readonly key: string;
967
545
  } | {
968
- readonly _tag: "Reset";
546
+ readonly _tag: "Changed";
547
+ readonly key: string;
548
+ readonly value: string | boolean | readonly string[];
969
549
  } | {
970
550
  readonly _tag: "Checked";
971
551
  readonly key: string;
972
552
  readonly draft: string | boolean | readonly string[];
973
553
  readonly error: string | null;
974
554
  } | {
975
- readonly _tag: "About";
976
- readonly subject: {
977
- readonly [x: string]: string;
978
- };
979
- } | {
980
- readonly _tag: "Searched";
981
- readonly key: string;
982
- readonly text: string;
555
+ readonly _tag: "Control";
556
+ readonly key: never;
557
+ readonly message: unknown;
983
558
  } | {
984
559
  readonly _tag: "Nested";
985
560
  readonly key: string;
986
561
  readonly row: string;
987
562
  readonly message: unknown;
988
563
  } | {
989
- readonly _tag: "Control";
990
- readonly key: never;
991
- readonly message: unknown;
564
+ readonly _tag: "Refused";
565
+ readonly key: string;
566
+ readonly error: string;
567
+ } | {
568
+ readonly _tag: "Reset";
992
569
  } | {
993
570
  readonly _tag: "RowAdded";
994
571
  readonly key: string;
@@ -996,6 +573,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
996
573
  readonly _tag: "RowRemoved";
997
574
  readonly key: string;
998
575
  readonly row: string;
576
+ } | {
577
+ readonly _tag: "Searched";
578
+ readonly key: string;
579
+ readonly text: string;
580
+ } | {
581
+ readonly _tag: "Submitted";
582
+ } | {
583
+ readonly _tag: "ValidatedAll";
999
584
  }>;
1000
585
  /**
1001
586
  * A Message of the Bundle behind `key`'s control (an `Input.bundle`), as the
@@ -1003,45 +588,37 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
1003
588
  * so it is checked here: a key not edited by one throws.
1004
589
  */
1005
590
  control: (key: string, message: unknown) => {
1006
- readonly _tag: "Refused";
591
+ readonly _tag: "About";
592
+ readonly subject: {
593
+ readonly [x: string]: string;
594
+ };
595
+ } | {
596
+ readonly _tag: "Blurred";
1007
597
  readonly key: string;
1008
- readonly error: string;
1009
598
  } | {
1010
599
  readonly _tag: "Changed";
1011
600
  readonly key: string;
1012
601
  readonly value: string | boolean | readonly string[];
1013
- } | {
1014
- readonly _tag: "Blurred";
1015
- readonly key: string;
1016
- } | {
1017
- readonly _tag: "ValidatedAll";
1018
- } | {
1019
- readonly _tag: "Submitted";
1020
- } | {
1021
- readonly _tag: "Reset";
1022
602
  } | {
1023
603
  readonly _tag: "Checked";
1024
604
  readonly key: string;
1025
605
  readonly draft: string | boolean | readonly string[];
1026
606
  readonly error: string | null;
1027
607
  } | {
1028
- readonly _tag: "About";
1029
- readonly subject: {
1030
- readonly [x: string]: string;
1031
- };
1032
- } | {
1033
- readonly _tag: "Searched";
1034
- readonly key: string;
1035
- readonly text: string;
608
+ readonly _tag: "Control";
609
+ readonly key: never;
610
+ readonly message: unknown;
1036
611
  } | {
1037
612
  readonly _tag: "Nested";
1038
613
  readonly key: string;
1039
614
  readonly row: string;
1040
615
  readonly message: unknown;
1041
616
  } | {
1042
- readonly _tag: "Control";
1043
- readonly key: never;
1044
- readonly message: unknown;
617
+ readonly _tag: "Refused";
618
+ readonly key: string;
619
+ readonly error: string;
620
+ } | {
621
+ readonly _tag: "Reset";
1045
622
  } | {
1046
623
  readonly _tag: "RowAdded";
1047
624
  readonly key: string;
@@ -1049,6 +626,14 @@ declare const make: (name: string, fields: Readonly<Record<string, Schema.Top>>,
1049
626
  readonly _tag: "RowRemoved";
1050
627
  readonly key: string;
1051
628
  readonly row: string;
629
+ } | {
630
+ readonly _tag: "Searched";
631
+ readonly key: string;
632
+ readonly text: string;
633
+ } | {
634
+ readonly _tag: "Submitted";
635
+ } | {
636
+ readonly _tag: "ValidatedAll";
1052
637
  };
1053
638
  /**
1054
639
  * What a new value starts from, as the Document stores it: each field's
@@ -1146,13 +731,13 @@ export declare const Layers: Bundle.Declared<Bundle.Bundle<"TreeNavigation", {
1146
731
  readonly current: string | null;
1147
732
  readonly toggled: readonly string[];
1148
733
  }, {
1149
- readonly _tag: "Focused";
734
+ readonly _tag: "Closed";
1150
735
  readonly id: string;
1151
736
  } | {
1152
- readonly _tag: "Opened";
737
+ readonly _tag: "Focused";
1153
738
  readonly id: string;
1154
739
  } | {
1155
- readonly _tag: "Closed";
740
+ readonly _tag: "Opened";
1156
741
  readonly id: string;
1157
742
  }, never, never, never, void, {}, {}>, "layers">;
1158
743
  export declare const layersArgs: TreeNavigation.Args;
@@ -1165,19 +750,19 @@ export declare const Announcer: Bundle.Declared<Bundle.Bundle<"LiveAnnounce", {
1165
750
  readonly assertive: string;
1166
751
  readonly pending: {
1167
752
  readonly message: string;
1168
- readonly politeness: "polite" | "assertive";
753
+ readonly politeness: "assertive" | "polite";
1169
754
  } | null;
1170
755
  readonly generation: number;
1171
756
  }, {
1172
- readonly _tag: "Read";
1173
- readonly generation: number;
757
+ readonly _tag: "Announced";
758
+ readonly message: string;
759
+ readonly politeness: "assertive" | "polite";
1174
760
  } | {
1175
761
  readonly _tag: "Cleared";
1176
762
  readonly generation: number;
1177
763
  } | {
1178
- readonly _tag: "Announced";
1179
- readonly message: string;
1180
- readonly politeness: "polite" | "assertive";
764
+ readonly _tag: "Read";
765
+ readonly generation: number;
1181
766
  }, never, never, never, void, {}, {}>, "announcer">;
1182
767
  /** Where over a node a drop lands: before it, inside it, or after it. */
1183
768
  export declare const DropZone: Schema.Literals<readonly ["before", "inside", "after"]>;
@@ -1222,7 +807,7 @@ export type Drag = typeof Drag.Type;
1222
807
  /** A value of the page's context, as the editor previews it. */
1223
808
  export declare const ContextValue: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>;
1224
809
  export type ContextValue = typeof ContextValue.Type;
1225
- declare const Model$1: Schema.Struct<{
810
+ export declare const Model: Schema.Struct<{
1226
811
  /** The page and its undo steps: `page.present` is the Document being edited. */
1227
812
  readonly page: Schema.Struct<{
1228
813
  readonly past: Schema.$Array<Schema.Codec<{
@@ -1377,7 +962,7 @@ declare const Model$1: Schema.Struct<{
1377
962
  readonly assertive: string;
1378
963
  readonly pending: {
1379
964
  readonly message: string;
1380
- readonly politeness: "polite" | "assertive";
965
+ readonly politeness: "assertive" | "polite";
1381
966
  } | null;
1382
967
  readonly generation: number;
1383
968
  }, unknown, never, never>;
@@ -1386,7 +971,7 @@ declare const Model$1: Schema.Struct<{
1386
971
  readonly toggled: readonly string[];
1387
972
  }, unknown, never, never>;
1388
973
  }>;
1389
- type Model$1 = typeof Model$1.Type;
974
+ export type Model = typeof Model.Type;
1390
975
  /** One form the inspector draws for the selected node, and its Model. */
1391
976
  export interface InspectedForm {
1392
977
  /** Which it is, as `Inspected` names it: `props`, or `on:<event>:<action>`. */
@@ -1406,25 +991,25 @@ export interface Inspecting {
1406
991
  */
1407
992
  readonly on: Readonly<Record<string, InspectedForm>>;
1408
993
  }
1409
- declare const Message$1: import("foldkit/message").MessageUnion<{
994
+ export declare const Message: import("foldkit/message").MessageUnion<{
1410
995
  readonly Selected: {
1411
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
996
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1412
997
  };
1413
998
  /** Nothing is selected. */
1414
999
  readonly Deselected: {};
1415
1000
  readonly Hovered: {
1416
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1001
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1417
1002
  };
1418
1003
  /** The pointer left every node. */
1419
1004
  readonly Unhovered: {};
1420
1005
  /** An Operation, from a button, a key, a drag, or an agent. */
1421
1006
  readonly Applied: {
1422
- readonly op: Schema.Codec<Operation, unknown, never, never>;
1007
+ op: Schema.Codec<Operation, unknown, never, never>;
1423
1008
  };
1424
1009
  /** A new node of a Block, with the Block's starting props, once an id is minted. */
1425
1010
  readonly InsertAsked: {
1426
- readonly block: Schema.String;
1427
- readonly at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1011
+ block: Schema.String;
1012
+ at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1428
1013
  readonly index: import("effect/Schema").Int;
1429
1014
  }>, Schema.TaggedStruct<"Region", {
1430
1015
  readonly parent: import("effect/Schema").brand<import("effect/Schema").NonEmptyString, "@foldkit-composition/NodeId">;
@@ -1434,8 +1019,8 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1434
1019
  };
1435
1020
  /** A copy of a node and everything it holds, once ids are minted. */
1436
1021
  readonly DuplicateAsked: {
1437
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1438
- readonly at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1022
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1023
+ at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1439
1024
  readonly index: import("effect/Schema").Int;
1440
1025
  }>, Schema.TaggedStruct<"Region", {
1441
1026
  readonly parent: import("effect/Schema").brand<import("effect/Schema").NonEmptyString, "@foldkit-composition/NodeId">;
@@ -1445,8 +1030,8 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1445
1030
  };
1446
1031
  /** One of the Catalog's patterns, once ids are minted for its nodes. */
1447
1032
  readonly PatternAsked: {
1448
- readonly pattern: Schema.String;
1449
- readonly at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1033
+ pattern: Schema.String;
1034
+ at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1450
1035
  readonly index: import("effect/Schema").Int;
1451
1036
  }>, Schema.TaggedStruct<"Region", {
1452
1037
  readonly parent: import("effect/Schema").brand<import("effect/Schema").NonEmptyString, "@foldkit-composition/NodeId">;
@@ -1456,17 +1041,17 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1456
1041
  };
1457
1042
  /** The selected node and all it holds, copied. */
1458
1043
  readonly CopyAsked: {
1459
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1044
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1460
1045
  };
1461
1046
  /** The selected node and all it holds, copied and removed. */
1462
1047
  readonly CutAsked: {
1463
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1048
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1464
1049
  };
1465
1050
  /** A paste: the system clipboard is read, and what it holds goes in by the selection. */
1466
1051
  readonly PasteAsked: {};
1467
1052
  /** What the system clipboard held for a paste; none when it could not be read. */
1468
1053
  readonly ClipboardRead: {
1469
- readonly text: Schema.OptionFromNullOr<Schema.String>;
1054
+ text: Schema.OptionFromNullOr<Schema.String>;
1470
1055
  };
1471
1056
  /**
1472
1057
  * Text on the page is asked to be edited in place: a double-click on it, or
@@ -1474,26 +1059,26 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1474
1059
  * (`data-composition-field`), which is checked here.
1475
1060
  */
1476
1061
  readonly EditingAsked: {
1477
- readonly field: Schema.String;
1062
+ field: Schema.String;
1478
1063
  };
1479
1064
  /** What the field being edited holds now. */
1480
1065
  readonly FieldTyped: {
1481
- readonly field: Schema.String;
1482
- readonly text: Schema.String;
1066
+ field: Schema.String;
1067
+ text: Schema.String;
1483
1068
  };
1484
1069
  /** Editing ended with the text kept: Enter, or leaving the field. */
1485
1070
  readonly EditingCommitted: {
1486
- readonly field: Schema.String;
1487
- readonly text: Schema.String;
1071
+ field: Schema.String;
1072
+ text: Schema.String;
1488
1073
  };
1489
1074
  /** Editing ended with the text put back as it began: Escape. */
1490
1075
  readonly EditingCancelled: {
1491
- readonly field: Schema.String;
1076
+ field: Schema.String;
1492
1077
  };
1493
1078
  /** The ids a request waited for. */
1494
1079
  readonly Minted: {
1495
- readonly ids: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">>;
1496
- readonly request: Schema.Union<readonly [Schema.TaggedStruct<"Insert", {
1080
+ ids: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">>;
1081
+ request: Schema.Union<readonly [Schema.TaggedStruct<"Insert", {
1497
1082
  readonly block: Schema.String;
1498
1083
  readonly at: Schema.Union<readonly [Schema.TaggedStruct<"Root", {
1499
1084
  readonly index: import("effect/Schema").Int;
@@ -1546,8 +1131,8 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1546
1131
  * it runs is decided in `update`, from the Model as it is then.
1547
1132
  */
1548
1133
  readonly KeyPressed: {
1549
- readonly key: Schema.String;
1550
- readonly modifiers: Schema.Struct<{
1134
+ key: Schema.String;
1135
+ modifiers: Schema.Struct<{
1551
1136
  readonly shiftKey: Schema.Boolean;
1552
1137
  readonly ctrlKey: Schema.Boolean;
1553
1138
  readonly altKey: Schema.Boolean;
@@ -1557,14 +1142,14 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1557
1142
  readonly Undid: {};
1558
1143
  readonly Redid: {};
1559
1144
  readonly PanelChosen: {
1560
- readonly panel: Schema.Literals<readonly ["insert", "layers", "properties"]>;
1145
+ panel: Schema.Literals<readonly ["insert", "layers", "properties"]>;
1561
1146
  };
1562
1147
  readonly ViewportChosen: {
1563
- readonly viewport: Schema.Literals<readonly ["wide", "medium", "narrow"]>;
1148
+ viewport: Schema.Literals<readonly ["wide", "medium", "narrow"]>;
1564
1149
  };
1565
1150
  /** A pointer drag of a node began: it is selected, and nothing moves until the drop. */
1566
1151
  readonly DragStarted: {
1567
- readonly source: Schema.Union<readonly [Schema.TaggedStruct<"Existing", {
1152
+ source: Schema.Union<readonly [Schema.TaggedStruct<"Existing", {
1568
1153
  readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1569
1154
  }>, Schema.TaggedStruct<"New", {
1570
1155
  readonly block: Schema.String;
@@ -1572,13 +1157,13 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1572
1157
  };
1573
1158
  /** The dragged node is over another, in a zone of it. */
1574
1159
  readonly DraggedOver: {
1575
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1576
- readonly zone: Schema.Literals<readonly ["before", "inside", "after"]>;
1160
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1161
+ zone: Schema.Literals<readonly ["before", "inside", "after"]>;
1577
1162
  };
1578
1163
  /** The dragged node is over a node's empty Region, by name: a drop goes into it. */
1579
1164
  readonly DraggedOverRegion: {
1580
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1581
- readonly region: Schema.String;
1165
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1166
+ region: Schema.String;
1582
1167
  };
1583
1168
  /** The dragged node is over nothing. */
1584
1169
  readonly DraggedOff: {};
@@ -1592,12 +1177,12 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1592
1177
  readonly DragCancelled: {};
1593
1178
  /** The author previews the page with one context key set. */
1594
1179
  readonly PreviewChosen: {
1595
- readonly key: Schema.String;
1596
- readonly value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>;
1180
+ key: Schema.String;
1181
+ value: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>;
1597
1182
  };
1598
1183
  /** The author previews the page with one context key unset. */
1599
1184
  readonly PreviewCleared: {
1600
- readonly key: Schema.String;
1185
+ key: Schema.String;
1601
1186
  };
1602
1187
  /**
1603
1188
  * A Message of one of a node's forms (`Inspecting`), encoded to JSON. One for
@@ -1605,39 +1190,47 @@ declare const Message$1: import("foldkit/message").MessageUnion<{
1605
1190
  * Command answering late, is ignored.
1606
1191
  */
1607
1192
  readonly Inspected: {
1608
- readonly id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1609
- readonly form: Schema.String;
1610
- readonly message: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1193
+ id: Schema.brand<Schema.NonEmptyString, "@foldkit-composition/NodeId">;
1194
+ form: Schema.String;
1195
+ message: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1611
1196
  };
1612
1197
  readonly GotAnnouncerMessage: {
1613
1198
  readonly message: Schema.Codec<{
1614
- readonly _tag: "Read";
1615
- readonly generation: number;
1199
+ readonly _tag: "Announced";
1200
+ readonly message: string;
1201
+ readonly politeness: "assertive" | "polite";
1616
1202
  } | {
1617
1203
  readonly _tag: "Cleared";
1618
1204
  readonly generation: number;
1619
1205
  } | {
1620
- readonly _tag: "Announced";
1621
- readonly message: string;
1622
- readonly politeness: "polite" | "assertive";
1206
+ readonly _tag: "Read";
1207
+ readonly generation: number;
1623
1208
  }, unknown, never, never>;
1624
1209
  };
1625
1210
  readonly GotLayersMessage: {
1626
1211
  readonly message: Schema.Codec<{
1627
- readonly _tag: "Focused";
1212
+ readonly _tag: "Closed";
1628
1213
  readonly id: string;
1629
1214
  } | {
1630
- readonly _tag: "Opened";
1215
+ readonly _tag: "Focused";
1631
1216
  readonly id: string;
1632
1217
  } | {
1633
- readonly _tag: "Closed";
1218
+ readonly _tag: "Opened";
1634
1219
  readonly id: string;
1635
1220
  }, unknown, never, never>;
1636
1221
  };
1637
1222
  }>;
1638
- type Message$1 = typeof Message$1.Type;
1223
+ export type Message = typeof Message.Type;
1639
1224
  /** What a new node of each Block starts with. A Block without starting props is not offered. */
1640
1225
  export type Starters<Blocks extends AnyBlock> = { readonly [B in Blocks as B['name']]?: PropsOf<B>; };
1226
+ /** The Operation that moves a node `delta` places among its siblings; none at an end. */
1227
+ declare const moveBy: (document: Document, id: NodeId, delta: number) => Option.Option<Operation>;
1228
+ /** The Document being edited. */
1229
+ declare const documentOf: (model: Pick<Model, 'page'>) => Document;
1230
+ /** The Model showing another Document: what a fill, a reset or a restored revision does. */
1231
+ declare const replace: (model: Model, document: Document) => Model;
1232
+ /** The Model with nothing in flight, as a stored draft is shown again: no hover, no drag, no undo, no refusal. */
1233
+ declare const settle: (model: Model) => Model;
1641
1234
  /**
1642
1235
  * A key that runs a command, named as `KeyboardEvent.key` names it. `mod` is
1643
1236
  * Ctrl, or ⌘ on a Mac. `mod` and `alt` must be as given; `shift` must be as
@@ -1659,7 +1252,7 @@ export interface BuilderCommand {
1659
1252
  /** Where a drawn Builder offers it: with the selected node's actions, in the toolbar, or by key only. */
1660
1253
  readonly placement: ReadonlyArray<'node' | 'toolbar' | 'keyboard'>;
1661
1254
  /** The Message it sends now; none while it has nothing to do, which disables its button. */
1662
- readonly run: (model: Pick<Model$1, 'page' | 'selected'>) => Option.Option<Message$1>;
1255
+ readonly run: (model: Pick<Model, 'page' | 'selected'>) => Option.Option<Message>;
1663
1256
  }
1664
1257
  export declare const Builder: {
1665
1258
  /**
@@ -1668,7 +1261,7 @@ export declare const Builder: {
1668
1261
  * `Heading.pipe(Block.annotate(Builder.controls({ text: Input.multiline() })))`.
1669
1262
  * `Input.hidden()` leaves a prop out of the inspector.
1670
1263
  */
1671
- controls: (given: Readonly<Record<string, import("foldkit-form").Control>>) => import("foldkit-metadata").Metadata;
1264
+ controls: typeof controls;
1672
1265
  /**
1673
1266
  * A Builder for a Catalog: its Bundle, the form control that places it as a
1674
1267
  * key, and the helpers a view uses. `starters` gives the props a new node of
@@ -1761,7 +1354,7 @@ export declare const Builder: {
1761
1354
  readonly selected: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
1762
1355
  readonly hovered: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
1763
1356
  readonly panel: "insert" | "layers" | "properties";
1764
- readonly viewport: "wide" | "medium" | "narrow";
1357
+ readonly viewport: "medium" | "narrow" | "wide";
1765
1358
  readonly refused: Option.Option<{
1766
1359
  readonly code: string;
1767
1360
  readonly message: string;
@@ -1776,7 +1369,7 @@ export declare const Builder: {
1776
1369
  };
1777
1370
  readonly over: Option.Option<{
1778
1371
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1779
- readonly zone: "before" | "inside" | "after";
1372
+ readonly zone: "after" | "before" | "inside";
1780
1373
  readonly region: Option.Option<string>;
1781
1374
  }>;
1782
1375
  readonly at: Option.Option<{
@@ -1828,7 +1421,7 @@ export declare const Builder: {
1828
1421
  readonly assertive: string;
1829
1422
  readonly pending: {
1830
1423
  readonly message: string;
1831
- readonly politeness: "polite" | "assertive";
1424
+ readonly politeness: "assertive" | "polite";
1832
1425
  } | null;
1833
1426
  readonly generation: number;
1834
1427
  };
@@ -1837,55 +1430,44 @@ export declare const Builder: {
1837
1430
  readonly toggled: readonly string[];
1838
1431
  };
1839
1432
  }, {
1840
- readonly _tag: "GotLayersMessage";
1841
- readonly message: {
1842
- readonly _tag: "Focused";
1843
- readonly id: string;
1844
- } | {
1845
- readonly _tag: "Opened";
1846
- readonly id: string;
1847
- } | {
1848
- readonly _tag: "Closed";
1849
- readonly id: string;
1850
- };
1433
+ readonly _tag: "Applied";
1434
+ readonly op: Operation;
1851
1435
  } | {
1852
- readonly _tag: "GotAnnouncerMessage";
1853
- readonly message: {
1854
- readonly _tag: "Read";
1855
- readonly generation: number;
1856
- } | {
1857
- readonly _tag: "Cleared";
1858
- readonly generation: number;
1859
- } | {
1860
- readonly _tag: "Announced";
1861
- readonly message: string;
1862
- readonly politeness: "polite" | "assertive";
1863
- };
1436
+ readonly _tag: "ClipboardRead";
1437
+ readonly text: Option.Option<string>;
1864
1438
  } | {
1865
- readonly _tag: "Selected";
1439
+ readonly _tag: "CopyAsked";
1866
1440
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1867
1441
  } | {
1868
- readonly _tag: "Deselected";
1869
- } | {
1870
- readonly _tag: "Hovered";
1442
+ readonly _tag: "CutAsked";
1871
1443
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1872
1444
  } | {
1873
- readonly _tag: "Unhovered";
1445
+ readonly _tag: "Deselected";
1874
1446
  } | {
1875
- readonly _tag: "Applied";
1876
- readonly op: Operation;
1447
+ readonly _tag: "DragCancelled";
1877
1448
  } | {
1878
- readonly _tag: "InsertAsked";
1879
- readonly block: string;
1880
- readonly at: {
1881
- readonly _tag: "Root";
1882
- readonly index: number;
1449
+ readonly _tag: "DragDropped";
1450
+ } | {
1451
+ readonly _tag: "DragStarted";
1452
+ readonly source: {
1453
+ readonly _tag: "Existing";
1454
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1883
1455
  } | {
1884
- readonly _tag: "Region";
1885
- readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1886
- readonly region: string;
1887
- readonly index: number;
1456
+ readonly _tag: "New";
1457
+ readonly block: string;
1888
1458
  };
1459
+ } | {
1460
+ readonly _tag: "DraggedOff";
1461
+ } | {
1462
+ readonly _tag: "DraggedOver";
1463
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1464
+ readonly zone: "after" | "before" | "inside";
1465
+ } | {
1466
+ readonly _tag: "DraggedOverPage";
1467
+ } | {
1468
+ readonly _tag: "DraggedOverRegion";
1469
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1470
+ readonly region: string;
1889
1471
  } | {
1890
1472
  readonly _tag: "DuplicateAsked";
1891
1473
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
@@ -1899,8 +1481,50 @@ export declare const Builder: {
1899
1481
  readonly index: number;
1900
1482
  };
1901
1483
  } | {
1902
- readonly _tag: "PatternAsked";
1903
- readonly pattern: string;
1484
+ readonly _tag: "EditingAsked";
1485
+ readonly field: string;
1486
+ } | {
1487
+ readonly _tag: "EditingCancelled";
1488
+ readonly field: string;
1489
+ } | {
1490
+ readonly _tag: "EditingCommitted";
1491
+ readonly field: string;
1492
+ readonly text: string;
1493
+ } | {
1494
+ readonly _tag: "FieldTyped";
1495
+ readonly field: string;
1496
+ readonly text: string;
1497
+ } | {
1498
+ readonly _tag: "GotAnnouncerMessage";
1499
+ readonly message: {
1500
+ readonly _tag: "Announced";
1501
+ readonly message: string;
1502
+ readonly politeness: "assertive" | "polite";
1503
+ } | {
1504
+ readonly _tag: "Cleared";
1505
+ readonly generation: number;
1506
+ } | {
1507
+ readonly _tag: "Read";
1508
+ readonly generation: number;
1509
+ };
1510
+ } | {
1511
+ readonly _tag: "GotLayersMessage";
1512
+ readonly message: {
1513
+ readonly _tag: "Closed";
1514
+ readonly id: string;
1515
+ } | {
1516
+ readonly _tag: "Focused";
1517
+ readonly id: string;
1518
+ } | {
1519
+ readonly _tag: "Opened";
1520
+ readonly id: string;
1521
+ };
1522
+ } | {
1523
+ readonly _tag: "Hovered";
1524
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1525
+ } | {
1526
+ readonly _tag: "InsertAsked";
1527
+ readonly block: string;
1904
1528
  readonly at: {
1905
1529
  readonly _tag: "Root";
1906
1530
  readonly index: number;
@@ -1911,30 +1535,19 @@ export declare const Builder: {
1911
1535
  readonly index: number;
1912
1536
  };
1913
1537
  } | {
1914
- readonly _tag: "CopyAsked";
1915
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1916
- } | {
1917
- readonly _tag: "CutAsked";
1538
+ readonly _tag: "Inspected";
1918
1539
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1540
+ readonly form: string;
1541
+ readonly message: Schema.Json;
1919
1542
  } | {
1920
- readonly _tag: "PasteAsked";
1921
- } | {
1922
- readonly _tag: "ClipboardRead";
1923
- readonly text: Option.Option<string>;
1924
- } | {
1925
- readonly _tag: "EditingAsked";
1926
- readonly field: string;
1927
- } | {
1928
- readonly _tag: "FieldTyped";
1929
- readonly field: string;
1930
- readonly text: string;
1931
- } | {
1932
- readonly _tag: "EditingCommitted";
1933
- readonly field: string;
1934
- readonly text: string;
1935
- } | {
1936
- readonly _tag: "EditingCancelled";
1937
- readonly field: string;
1543
+ readonly _tag: "KeyPressed";
1544
+ readonly key: string;
1545
+ readonly modifiers: {
1546
+ readonly shiftKey: boolean;
1547
+ readonly ctrlKey: boolean;
1548
+ readonly altKey: boolean;
1549
+ readonly metaKey: boolean;
1550
+ };
1938
1551
  } | {
1939
1552
  readonly _tag: "Minted";
1940
1553
  readonly ids: readonly (string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">)[];
@@ -2005,50 +1618,23 @@ export declare const Builder: {
2005
1618
  readonly index: number;
2006
1619
  };
2007
1620
  };
2008
- } | {
2009
- readonly _tag: "KeyPressed";
2010
- readonly key: string;
2011
- readonly modifiers: {
2012
- readonly shiftKey: boolean;
2013
- readonly ctrlKey: boolean;
2014
- readonly altKey: boolean;
2015
- readonly metaKey: boolean;
2016
- };
2017
- } | {
2018
- readonly _tag: "Undid";
2019
- } | {
2020
- readonly _tag: "Redid";
2021
1621
  } | {
2022
1622
  readonly _tag: "PanelChosen";
2023
1623
  readonly panel: "insert" | "layers" | "properties";
2024
1624
  } | {
2025
- readonly _tag: "ViewportChosen";
2026
- readonly viewport: "wide" | "medium" | "narrow";
1625
+ readonly _tag: "PasteAsked";
2027
1626
  } | {
2028
- readonly _tag: "DragStarted";
2029
- readonly source: {
2030
- readonly _tag: "Existing";
2031
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1627
+ readonly _tag: "PatternAsked";
1628
+ readonly pattern: string;
1629
+ readonly at: {
1630
+ readonly _tag: "Root";
1631
+ readonly index: number;
2032
1632
  } | {
2033
- readonly _tag: "New";
2034
- readonly block: string;
1633
+ readonly _tag: "Region";
1634
+ readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1635
+ readonly region: string;
1636
+ readonly index: number;
2035
1637
  };
2036
- } | {
2037
- readonly _tag: "DraggedOver";
2038
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2039
- readonly zone: "before" | "inside" | "after";
2040
- } | {
2041
- readonly _tag: "DraggedOverRegion";
2042
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2043
- readonly region: string;
2044
- } | {
2045
- readonly _tag: "DraggedOff";
2046
- } | {
2047
- readonly _tag: "DraggedOverPage";
2048
- } | {
2049
- readonly _tag: "DragDropped";
2050
- } | {
2051
- readonly _tag: "DragCancelled";
2052
1638
  } | {
2053
1639
  readonly _tag: "PreviewChosen";
2054
1640
  readonly key: string;
@@ -2057,10 +1643,17 @@ export declare const Builder: {
2057
1643
  readonly _tag: "PreviewCleared";
2058
1644
  readonly key: string;
2059
1645
  } | {
2060
- readonly _tag: "Inspected";
1646
+ readonly _tag: "Redid";
1647
+ } | {
1648
+ readonly _tag: "Selected";
2061
1649
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2062
- readonly form: string;
2063
- readonly message: Schema.Json;
1650
+ } | {
1651
+ readonly _tag: "Undid";
1652
+ } | {
1653
+ readonly _tag: "Unhovered";
1654
+ } | {
1655
+ readonly _tag: "ViewportChosen";
1656
+ readonly viewport: "medium" | "narrow" | "wide";
2064
1657
  }, never, never, never, void, {}, {}>;
2065
1658
  initial: {
2066
1659
  readonly page: {
@@ -2129,7 +1722,7 @@ export declare const Builder: {
2129
1722
  readonly selected: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2130
1723
  readonly hovered: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2131
1724
  readonly panel: "insert" | "layers" | "properties";
2132
- readonly viewport: "wide" | "medium" | "narrow";
1725
+ readonly viewport: "medium" | "narrow" | "wide";
2133
1726
  readonly refused: Option.Option<{
2134
1727
  readonly code: string;
2135
1728
  readonly message: string;
@@ -2144,7 +1737,7 @@ export declare const Builder: {
2144
1737
  };
2145
1738
  readonly over: Option.Option<{
2146
1739
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2147
- readonly zone: "before" | "inside" | "after";
1740
+ readonly zone: "after" | "before" | "inside";
2148
1741
  readonly region: Option.Option<string>;
2149
1742
  }>;
2150
1743
  readonly at: Option.Option<{
@@ -2196,7 +1789,7 @@ export declare const Builder: {
2196
1789
  readonly assertive: string;
2197
1790
  readonly pending: {
2198
1791
  readonly message: string;
2199
- readonly politeness: "polite" | "assertive";
1792
+ readonly politeness: "assertive" | "polite";
2200
1793
  } | null;
2201
1794
  readonly generation: number;
2202
1795
  };
@@ -2273,7 +1866,7 @@ export declare const Builder: {
2273
1866
  readonly selected: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2274
1867
  readonly hovered: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2275
1868
  readonly panel: "insert" | "layers" | "properties";
2276
- readonly viewport: "wide" | "medium" | "narrow";
1869
+ readonly viewport: "medium" | "narrow" | "wide";
2277
1870
  readonly refused: Option.Option<{
2278
1871
  readonly code: string;
2279
1872
  readonly message: string;
@@ -2288,7 +1881,7 @@ export declare const Builder: {
2288
1881
  };
2289
1882
  readonly over: Option.Option<{
2290
1883
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2291
- readonly zone: "before" | "inside" | "after";
1884
+ readonly zone: "after" | "before" | "inside";
2292
1885
  readonly region: Option.Option<string>;
2293
1886
  }>;
2294
1887
  readonly at: Option.Option<{
@@ -2340,7 +1933,7 @@ export declare const Builder: {
2340
1933
  readonly assertive: string;
2341
1934
  readonly pending: {
2342
1935
  readonly message: string;
2343
- readonly politeness: "polite" | "assertive";
1936
+ readonly politeness: "assertive" | "polite";
2344
1937
  } | null;
2345
1938
  readonly generation: number;
2346
1939
  };
@@ -2349,55 +1942,44 @@ export declare const Builder: {
2349
1942
  readonly toggled: readonly string[];
2350
1943
  };
2351
1944
  }, {
2352
- readonly _tag: "GotLayersMessage";
2353
- readonly message: {
2354
- readonly _tag: "Focused";
2355
- readonly id: string;
2356
- } | {
2357
- readonly _tag: "Opened";
2358
- readonly id: string;
2359
- } | {
2360
- readonly _tag: "Closed";
2361
- readonly id: string;
2362
- };
1945
+ readonly _tag: "Applied";
1946
+ readonly op: Operation;
2363
1947
  } | {
2364
- readonly _tag: "GotAnnouncerMessage";
2365
- readonly message: {
2366
- readonly _tag: "Read";
2367
- readonly generation: number;
2368
- } | {
2369
- readonly _tag: "Cleared";
2370
- readonly generation: number;
2371
- } | {
2372
- readonly _tag: "Announced";
2373
- readonly message: string;
2374
- readonly politeness: "polite" | "assertive";
2375
- };
1948
+ readonly _tag: "ClipboardRead";
1949
+ readonly text: Option.Option<string>;
2376
1950
  } | {
2377
- readonly _tag: "Selected";
1951
+ readonly _tag: "CopyAsked";
2378
1952
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2379
1953
  } | {
2380
- readonly _tag: "Deselected";
2381
- } | {
2382
- readonly _tag: "Hovered";
1954
+ readonly _tag: "CutAsked";
2383
1955
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2384
1956
  } | {
2385
- readonly _tag: "Unhovered";
1957
+ readonly _tag: "Deselected";
2386
1958
  } | {
2387
- readonly _tag: "Applied";
2388
- readonly op: Operation;
1959
+ readonly _tag: "DragCancelled";
2389
1960
  } | {
2390
- readonly _tag: "InsertAsked";
2391
- readonly block: string;
2392
- readonly at: {
2393
- readonly _tag: "Root";
2394
- readonly index: number;
1961
+ readonly _tag: "DragDropped";
1962
+ } | {
1963
+ readonly _tag: "DragStarted";
1964
+ readonly source: {
1965
+ readonly _tag: "Existing";
1966
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2395
1967
  } | {
2396
- readonly _tag: "Region";
2397
- readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2398
- readonly region: string;
2399
- readonly index: number;
1968
+ readonly _tag: "New";
1969
+ readonly block: string;
2400
1970
  };
1971
+ } | {
1972
+ readonly _tag: "DraggedOff";
1973
+ } | {
1974
+ readonly _tag: "DraggedOver";
1975
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1976
+ readonly zone: "after" | "before" | "inside";
1977
+ } | {
1978
+ readonly _tag: "DraggedOverPage";
1979
+ } | {
1980
+ readonly _tag: "DraggedOverRegion";
1981
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
1982
+ readonly region: string;
2401
1983
  } | {
2402
1984
  readonly _tag: "DuplicateAsked";
2403
1985
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
@@ -2411,8 +1993,50 @@ export declare const Builder: {
2411
1993
  readonly index: number;
2412
1994
  };
2413
1995
  } | {
2414
- readonly _tag: "PatternAsked";
2415
- readonly pattern: string;
1996
+ readonly _tag: "EditingAsked";
1997
+ readonly field: string;
1998
+ } | {
1999
+ readonly _tag: "EditingCancelled";
2000
+ readonly field: string;
2001
+ } | {
2002
+ readonly _tag: "EditingCommitted";
2003
+ readonly field: string;
2004
+ readonly text: string;
2005
+ } | {
2006
+ readonly _tag: "FieldTyped";
2007
+ readonly field: string;
2008
+ readonly text: string;
2009
+ } | {
2010
+ readonly _tag: "GotAnnouncerMessage";
2011
+ readonly message: {
2012
+ readonly _tag: "Announced";
2013
+ readonly message: string;
2014
+ readonly politeness: "assertive" | "polite";
2015
+ } | {
2016
+ readonly _tag: "Cleared";
2017
+ readonly generation: number;
2018
+ } | {
2019
+ readonly _tag: "Read";
2020
+ readonly generation: number;
2021
+ };
2022
+ } | {
2023
+ readonly _tag: "GotLayersMessage";
2024
+ readonly message: {
2025
+ readonly _tag: "Closed";
2026
+ readonly id: string;
2027
+ } | {
2028
+ readonly _tag: "Focused";
2029
+ readonly id: string;
2030
+ } | {
2031
+ readonly _tag: "Opened";
2032
+ readonly id: string;
2033
+ };
2034
+ } | {
2035
+ readonly _tag: "Hovered";
2036
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2037
+ } | {
2038
+ readonly _tag: "InsertAsked";
2039
+ readonly block: string;
2416
2040
  readonly at: {
2417
2041
  readonly _tag: "Root";
2418
2042
  readonly index: number;
@@ -2423,30 +2047,19 @@ export declare const Builder: {
2423
2047
  readonly index: number;
2424
2048
  };
2425
2049
  } | {
2426
- readonly _tag: "CopyAsked";
2427
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2428
- } | {
2429
- readonly _tag: "CutAsked";
2050
+ readonly _tag: "Inspected";
2430
2051
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2052
+ readonly form: string;
2053
+ readonly message: Schema.Json;
2431
2054
  } | {
2432
- readonly _tag: "PasteAsked";
2433
- } | {
2434
- readonly _tag: "ClipboardRead";
2435
- readonly text: Option.Option<string>;
2436
- } | {
2437
- readonly _tag: "EditingAsked";
2438
- readonly field: string;
2439
- } | {
2440
- readonly _tag: "FieldTyped";
2441
- readonly field: string;
2442
- readonly text: string;
2443
- } | {
2444
- readonly _tag: "EditingCommitted";
2445
- readonly field: string;
2446
- readonly text: string;
2447
- } | {
2448
- readonly _tag: "EditingCancelled";
2449
- readonly field: string;
2055
+ readonly _tag: "KeyPressed";
2056
+ readonly key: string;
2057
+ readonly modifiers: {
2058
+ readonly shiftKey: boolean;
2059
+ readonly ctrlKey: boolean;
2060
+ readonly altKey: boolean;
2061
+ readonly metaKey: boolean;
2062
+ };
2450
2063
  } | {
2451
2064
  readonly _tag: "Minted";
2452
2065
  readonly ids: readonly (string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">)[];
@@ -2508,59 +2121,32 @@ export declare const Builder: {
2508
2121
  readonly _tag: "Pattern";
2509
2122
  readonly pattern: string;
2510
2123
  readonly at: {
2511
- readonly _tag: "Root";
2512
- readonly index: number;
2513
- } | {
2514
- readonly _tag: "Region";
2515
- readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2516
- readonly region: string;
2517
- readonly index: number;
2518
- };
2519
- };
2520
- } | {
2521
- readonly _tag: "KeyPressed";
2522
- readonly key: string;
2523
- readonly modifiers: {
2524
- readonly shiftKey: boolean;
2525
- readonly ctrlKey: boolean;
2526
- readonly altKey: boolean;
2527
- readonly metaKey: boolean;
2124
+ readonly _tag: "Root";
2125
+ readonly index: number;
2126
+ } | {
2127
+ readonly _tag: "Region";
2128
+ readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2129
+ readonly region: string;
2130
+ readonly index: number;
2131
+ };
2528
2132
  };
2529
- } | {
2530
- readonly _tag: "Undid";
2531
- } | {
2532
- readonly _tag: "Redid";
2533
2133
  } | {
2534
2134
  readonly _tag: "PanelChosen";
2535
2135
  readonly panel: "insert" | "layers" | "properties";
2536
2136
  } | {
2537
- readonly _tag: "ViewportChosen";
2538
- readonly viewport: "wide" | "medium" | "narrow";
2137
+ readonly _tag: "PasteAsked";
2539
2138
  } | {
2540
- readonly _tag: "DragStarted";
2541
- readonly source: {
2542
- readonly _tag: "Existing";
2543
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2139
+ readonly _tag: "PatternAsked";
2140
+ readonly pattern: string;
2141
+ readonly at: {
2142
+ readonly _tag: "Root";
2143
+ readonly index: number;
2544
2144
  } | {
2545
- readonly _tag: "New";
2546
- readonly block: string;
2145
+ readonly _tag: "Region";
2146
+ readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2147
+ readonly region: string;
2148
+ readonly index: number;
2547
2149
  };
2548
- } | {
2549
- readonly _tag: "DraggedOver";
2550
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2551
- readonly zone: "before" | "inside" | "after";
2552
- } | {
2553
- readonly _tag: "DraggedOverRegion";
2554
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2555
- readonly region: string;
2556
- } | {
2557
- readonly _tag: "DraggedOff";
2558
- } | {
2559
- readonly _tag: "DraggedOverPage";
2560
- } | {
2561
- readonly _tag: "DragDropped";
2562
- } | {
2563
- readonly _tag: "DragCancelled";
2564
2150
  } | {
2565
2151
  readonly _tag: "PreviewChosen";
2566
2152
  readonly key: string;
@@ -2569,10 +2155,17 @@ export declare const Builder: {
2569
2155
  readonly _tag: "PreviewCleared";
2570
2156
  readonly key: string;
2571
2157
  } | {
2572
- readonly _tag: "Inspected";
2158
+ readonly _tag: "Redid";
2159
+ } | {
2160
+ readonly _tag: "Selected";
2573
2161
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2574
- readonly form: string;
2575
- readonly message: Schema.Json;
2162
+ } | {
2163
+ readonly _tag: "Undid";
2164
+ } | {
2165
+ readonly _tag: "Unhovered";
2166
+ } | {
2167
+ readonly _tag: "ViewportChosen";
2168
+ readonly viewport: "medium" | "narrow" | "wide";
2576
2169
  }, {
2577
2170
  readonly format: 1;
2578
2171
  readonly roots: readonly (string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">)[];
@@ -2597,7 +2190,7 @@ export declare const Builder: {
2597
2190
  * The same control, drawn by another view, such as
2598
2191
  * `BuilderView.submodel(view)` from `foldkit-mixins-builder`.
2599
2192
  */
2600
- inputWith: <ViewInputs>(drawn: Submodel.View<Model$1, Message$1, ViewInputs>) => import("foldkit-form").BundleControl<{
2193
+ inputWith: <ViewInputs>(drawn: Submodel.View<Model, Message, ViewInputs>) => import("foldkit-form").BundleControl<{
2601
2194
  readonly page: {
2602
2195
  readonly past: readonly {
2603
2196
  readonly format: 1;
@@ -2664,7 +2257,7 @@ export declare const Builder: {
2664
2257
  readonly selected: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2665
2258
  readonly hovered: Option.Option<string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">>;
2666
2259
  readonly panel: "insert" | "layers" | "properties";
2667
- readonly viewport: "wide" | "medium" | "narrow";
2260
+ readonly viewport: "medium" | "narrow" | "wide";
2668
2261
  readonly refused: Option.Option<{
2669
2262
  readonly code: string;
2670
2263
  readonly message: string;
@@ -2679,7 +2272,7 @@ export declare const Builder: {
2679
2272
  };
2680
2273
  readonly over: Option.Option<{
2681
2274
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2682
- readonly zone: "before" | "inside" | "after";
2275
+ readonly zone: "after" | "before" | "inside";
2683
2276
  readonly region: Option.Option<string>;
2684
2277
  }>;
2685
2278
  readonly at: Option.Option<{
@@ -2731,7 +2324,7 @@ export declare const Builder: {
2731
2324
  readonly assertive: string;
2732
2325
  readonly pending: {
2733
2326
  readonly message: string;
2734
- readonly politeness: "polite" | "assertive";
2327
+ readonly politeness: "assertive" | "polite";
2735
2328
  } | null;
2736
2329
  readonly generation: number;
2737
2330
  };
@@ -2740,55 +2333,44 @@ export declare const Builder: {
2740
2333
  readonly toggled: readonly string[];
2741
2334
  };
2742
2335
  }, {
2743
- readonly _tag: "GotLayersMessage";
2744
- readonly message: {
2745
- readonly _tag: "Focused";
2746
- readonly id: string;
2747
- } | {
2748
- readonly _tag: "Opened";
2749
- readonly id: string;
2750
- } | {
2751
- readonly _tag: "Closed";
2752
- readonly id: string;
2753
- };
2336
+ readonly _tag: "Applied";
2337
+ readonly op: Operation;
2754
2338
  } | {
2755
- readonly _tag: "GotAnnouncerMessage";
2756
- readonly message: {
2757
- readonly _tag: "Read";
2758
- readonly generation: number;
2759
- } | {
2760
- readonly _tag: "Cleared";
2761
- readonly generation: number;
2762
- } | {
2763
- readonly _tag: "Announced";
2764
- readonly message: string;
2765
- readonly politeness: "polite" | "assertive";
2766
- };
2339
+ readonly _tag: "ClipboardRead";
2340
+ readonly text: Option.Option<string>;
2767
2341
  } | {
2768
- readonly _tag: "Selected";
2342
+ readonly _tag: "CopyAsked";
2769
2343
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2770
2344
  } | {
2771
- readonly _tag: "Deselected";
2772
- } | {
2773
- readonly _tag: "Hovered";
2345
+ readonly _tag: "CutAsked";
2774
2346
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2775
2347
  } | {
2776
- readonly _tag: "Unhovered";
2348
+ readonly _tag: "Deselected";
2777
2349
  } | {
2778
- readonly _tag: "Applied";
2779
- readonly op: Operation;
2350
+ readonly _tag: "DragCancelled";
2780
2351
  } | {
2781
- readonly _tag: "InsertAsked";
2782
- readonly block: string;
2783
- readonly at: {
2784
- readonly _tag: "Root";
2785
- readonly index: number;
2352
+ readonly _tag: "DragDropped";
2353
+ } | {
2354
+ readonly _tag: "DragStarted";
2355
+ readonly source: {
2356
+ readonly _tag: "Existing";
2357
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2786
2358
  } | {
2787
- readonly _tag: "Region";
2788
- readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2789
- readonly region: string;
2790
- readonly index: number;
2359
+ readonly _tag: "New";
2360
+ readonly block: string;
2791
2361
  };
2362
+ } | {
2363
+ readonly _tag: "DraggedOff";
2364
+ } | {
2365
+ readonly _tag: "DraggedOver";
2366
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2367
+ readonly zone: "after" | "before" | "inside";
2368
+ } | {
2369
+ readonly _tag: "DraggedOverPage";
2370
+ } | {
2371
+ readonly _tag: "DraggedOverRegion";
2372
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2373
+ readonly region: string;
2792
2374
  } | {
2793
2375
  readonly _tag: "DuplicateAsked";
2794
2376
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
@@ -2802,8 +2384,50 @@ export declare const Builder: {
2802
2384
  readonly index: number;
2803
2385
  };
2804
2386
  } | {
2805
- readonly _tag: "PatternAsked";
2806
- readonly pattern: string;
2387
+ readonly _tag: "EditingAsked";
2388
+ readonly field: string;
2389
+ } | {
2390
+ readonly _tag: "EditingCancelled";
2391
+ readonly field: string;
2392
+ } | {
2393
+ readonly _tag: "EditingCommitted";
2394
+ readonly field: string;
2395
+ readonly text: string;
2396
+ } | {
2397
+ readonly _tag: "FieldTyped";
2398
+ readonly field: string;
2399
+ readonly text: string;
2400
+ } | {
2401
+ readonly _tag: "GotAnnouncerMessage";
2402
+ readonly message: {
2403
+ readonly _tag: "Announced";
2404
+ readonly message: string;
2405
+ readonly politeness: "assertive" | "polite";
2406
+ } | {
2407
+ readonly _tag: "Cleared";
2408
+ readonly generation: number;
2409
+ } | {
2410
+ readonly _tag: "Read";
2411
+ readonly generation: number;
2412
+ };
2413
+ } | {
2414
+ readonly _tag: "GotLayersMessage";
2415
+ readonly message: {
2416
+ readonly _tag: "Closed";
2417
+ readonly id: string;
2418
+ } | {
2419
+ readonly _tag: "Focused";
2420
+ readonly id: string;
2421
+ } | {
2422
+ readonly _tag: "Opened";
2423
+ readonly id: string;
2424
+ };
2425
+ } | {
2426
+ readonly _tag: "Hovered";
2427
+ readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2428
+ } | {
2429
+ readonly _tag: "InsertAsked";
2430
+ readonly block: string;
2807
2431
  readonly at: {
2808
2432
  readonly _tag: "Root";
2809
2433
  readonly index: number;
@@ -2814,30 +2438,19 @@ export declare const Builder: {
2814
2438
  readonly index: number;
2815
2439
  };
2816
2440
  } | {
2817
- readonly _tag: "CopyAsked";
2818
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2819
- } | {
2820
- readonly _tag: "CutAsked";
2441
+ readonly _tag: "Inspected";
2821
2442
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2443
+ readonly form: string;
2444
+ readonly message: Schema.Json;
2822
2445
  } | {
2823
- readonly _tag: "PasteAsked";
2824
- } | {
2825
- readonly _tag: "ClipboardRead";
2826
- readonly text: Option.Option<string>;
2827
- } | {
2828
- readonly _tag: "EditingAsked";
2829
- readonly field: string;
2830
- } | {
2831
- readonly _tag: "FieldTyped";
2832
- readonly field: string;
2833
- readonly text: string;
2834
- } | {
2835
- readonly _tag: "EditingCommitted";
2836
- readonly field: string;
2837
- readonly text: string;
2838
- } | {
2839
- readonly _tag: "EditingCancelled";
2840
- readonly field: string;
2446
+ readonly _tag: "KeyPressed";
2447
+ readonly key: string;
2448
+ readonly modifiers: {
2449
+ readonly shiftKey: boolean;
2450
+ readonly ctrlKey: boolean;
2451
+ readonly altKey: boolean;
2452
+ readonly metaKey: boolean;
2453
+ };
2841
2454
  } | {
2842
2455
  readonly _tag: "Minted";
2843
2456
  readonly ids: readonly (string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">)[];
@@ -2908,50 +2521,23 @@ export declare const Builder: {
2908
2521
  readonly index: number;
2909
2522
  };
2910
2523
  };
2911
- } | {
2912
- readonly _tag: "KeyPressed";
2913
- readonly key: string;
2914
- readonly modifiers: {
2915
- readonly shiftKey: boolean;
2916
- readonly ctrlKey: boolean;
2917
- readonly altKey: boolean;
2918
- readonly metaKey: boolean;
2919
- };
2920
- } | {
2921
- readonly _tag: "Undid";
2922
- } | {
2923
- readonly _tag: "Redid";
2924
2524
  } | {
2925
2525
  readonly _tag: "PanelChosen";
2926
2526
  readonly panel: "insert" | "layers" | "properties";
2927
2527
  } | {
2928
- readonly _tag: "ViewportChosen";
2929
- readonly viewport: "wide" | "medium" | "narrow";
2528
+ readonly _tag: "PasteAsked";
2930
2529
  } | {
2931
- readonly _tag: "DragStarted";
2932
- readonly source: {
2933
- readonly _tag: "Existing";
2934
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2530
+ readonly _tag: "PatternAsked";
2531
+ readonly pattern: string;
2532
+ readonly at: {
2533
+ readonly _tag: "Root";
2534
+ readonly index: number;
2935
2535
  } | {
2936
- readonly _tag: "New";
2937
- readonly block: string;
2536
+ readonly _tag: "Region";
2537
+ readonly parent: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2538
+ readonly region: string;
2539
+ readonly index: number;
2938
2540
  };
2939
- } | {
2940
- readonly _tag: "DraggedOver";
2941
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2942
- readonly zone: "before" | "inside" | "after";
2943
- } | {
2944
- readonly _tag: "DraggedOverRegion";
2945
- readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2946
- readonly region: string;
2947
- } | {
2948
- readonly _tag: "DraggedOff";
2949
- } | {
2950
- readonly _tag: "DraggedOverPage";
2951
- } | {
2952
- readonly _tag: "DragDropped";
2953
- } | {
2954
- readonly _tag: "DragCancelled";
2955
2541
  } | {
2956
2542
  readonly _tag: "PreviewChosen";
2957
2543
  readonly key: string;
@@ -2960,10 +2546,17 @@ export declare const Builder: {
2960
2546
  readonly _tag: "PreviewCleared";
2961
2547
  readonly key: string;
2962
2548
  } | {
2963
- readonly _tag: "Inspected";
2549
+ readonly _tag: "Redid";
2550
+ } | {
2551
+ readonly _tag: "Selected";
2964
2552
  readonly id: string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">;
2965
- readonly form: string;
2966
- readonly message: Schema.Json;
2553
+ } | {
2554
+ readonly _tag: "Undid";
2555
+ } | {
2556
+ readonly _tag: "Unhovered";
2557
+ } | {
2558
+ readonly _tag: "ViewportChosen";
2559
+ readonly viewport: "medium" | "narrow" | "wide";
2967
2560
  }, {
2968
2561
  readonly format: 1;
2969
2562
  readonly roots: readonly (string & import("effect/Brand").Brand<"@foldkit-composition/NodeId">)[];
@@ -2985,7 +2578,7 @@ export declare const Builder: {
2985
2578
  };
2986
2579
  }, {}>;
2987
2580
  /** Where a new node of a Block goes, given the selection; none where it may not go. */
2988
- placeFor: (document: Document, selected: Option.Option<NodeId>, block: Blocks["name"]) => Option.Option<{
2581
+ placeFor: (document: Document, selected: Option.Option<NodeId>, block: Blocks['name']) => Option.Option<{
2989
2582
  readonly _tag: "Root";
2990
2583
  readonly index: number;
2991
2584
  } | {
@@ -3004,7 +2597,7 @@ export declare const Builder: {
3004
2597
  readonly region: string;
3005
2598
  readonly index: number;
3006
2599
  }>;
3007
- moveBy: (document: Document, id: NodeId, delta: number) => Option.Option<Operation>;
2600
+ moveBy: typeof moveBy;
3008
2601
  /** Where what is dragged over `target`, in `zone`, would go; none where it may not. */
3009
2602
  dropAt: (document: Document, dragged: DragSource, target: NodeId, zone: DropZone) => Option.Option<{
3010
2603
  readonly _tag: "Root";
@@ -3015,23 +2608,23 @@ export declare const Builder: {
3015
2608
  readonly region: string;
3016
2609
  readonly index: number;
3017
2610
  }>;
3018
- replace: (model: Model$1, document: Document) => Model$1;
3019
- settle: (model: Model$1) => Model$1;
2611
+ replace: typeof replace;
2612
+ settle: typeof settle;
3020
2613
  /** The editor's commands: what a key, a node's action or the toolbar runs. */
3021
2614
  commands: readonly BuilderCommand[];
3022
- keyCommand: (model: Pick<Model$1, "page" | "selected" | "editing">, key: string, modifiers: KeyboardModifiers) => Option.Option<Message$1>;
3023
- keyPressed: (model: Pick<Model$1, "editing">, key: string, modifiers: KeyboardModifiers) => Option.Option<Message$1>;
2615
+ keyCommand: (model: Pick<Model, 'page' | 'selected' | 'editing'>, key: string, modifiers: KeyboardModifiers) => Option.Option<Message>;
2616
+ keyPressed: (model: Pick<Model, 'editing'>, key: string, modifiers: KeyboardModifiers) => Option.Option<Message>;
3024
2617
  /**
3025
2618
  * The selected node's settings form and its Model, for the inspector to
3026
2619
  * draw: the Model it holds for the node, else one filled from the props.
3027
2620
  */
3028
- inspecting: (model: Pick<Model$1, "page" | "selected" | "inspector">) => Option.Option<Inspecting>;
2621
+ inspecting: (model: Pick<Model, 'page' | 'selected' | 'inspector'>) => Option.Option<Inspecting>;
3029
2622
  /** The Blocks a new node may be, in the Catalog's order: those with starting props. */
3030
2623
  offered: string[];
3031
2624
  /** The Document a Builder Model is editing: its history's present. */
3032
- document: (model: Pick<Model$1, "page">) => Document;
2625
+ document: typeof documentOf;
3033
2626
  };
3034
2627
  };
3035
2628
  //#endregion
3036
- export { type EditWords, Message$1 as Message, Model$1 as Model, type Settings };
2629
+ export type { EditWords, Settings };
3037
2630
  //# sourceMappingURL=index.d.mts.map