foldkit 0.22.0 → 0.24.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/runtime/runtime.d.ts +49 -34
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +22 -8
- package/dist/task/dom.d.ts.map +1 -1
- package/dist/ui/group.d.ts +8 -0
- package/dist/ui/group.d.ts.map +1 -0
- package/dist/ui/group.js +13 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/keyboard.d.ts +2 -0
- package/dist/ui/keyboard.d.ts.map +1 -1
- package/dist/ui/keyboard.js +2 -0
- package/dist/ui/listbox/index.d.ts +182 -0
- package/dist/ui/listbox/index.d.ts.map +1 -0
- package/dist/ui/listbox/index.js +509 -0
- package/dist/ui/listbox/public.d.ts +4 -0
- package/dist/ui/listbox/public.d.ts.map +1 -0
- package/dist/ui/listbox/public.js +1 -0
- package/dist/ui/menu/index.d.ts +4 -9
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +9 -29
- package/dist/ui/typeahead.d.ts +4 -0
- package/dist/ui/typeahead.d.ts.map +1 -0
- package/dist/ui/typeahead.js +14 -0
- package/package.json +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Effect, Schema, Stream } from 'effect';
|
|
1
|
+
import { Context, Effect, Layer, Schema, Stream } from 'effect';
|
|
2
2
|
import type { Command } from '../command';
|
|
3
3
|
import { Html } from '../html';
|
|
4
4
|
import { Url } from '../url';
|
|
@@ -17,96 +17,111 @@ export type BrowserConfig<Message> = {
|
|
|
17
17
|
readonly onUrlChange: (url: Url) => Message;
|
|
18
18
|
};
|
|
19
19
|
/** Full runtime configuration including model schema, flags, init, update, view, and optional browser/stream config. */
|
|
20
|
-
export interface RuntimeConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags> {
|
|
20
|
+
export interface RuntimeConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never> {
|
|
21
21
|
Model: Schema.Schema<Model, any, never>;
|
|
22
22
|
Flags: Schema.Schema<Flags, any, never>;
|
|
23
23
|
readonly flags: Effect.Effect<Flags>;
|
|
24
|
-
readonly init: (flags: Flags, url?: Url) => [Model, ReadonlyArray<Command<Message>>];
|
|
25
|
-
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message>>];
|
|
24
|
+
readonly init: (flags: Flags, url?: Url) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
25
|
+
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
26
26
|
readonly view: (model: Model) => Html;
|
|
27
|
-
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap>;
|
|
27
|
+
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap, Resources>;
|
|
28
28
|
readonly container: HTMLElement;
|
|
29
29
|
readonly browser?: BrowserConfig<Message>;
|
|
30
30
|
readonly errorView?: (error: Error) => Html;
|
|
31
|
+
/**
|
|
32
|
+
* An Effect Layer providing long-lived resources that persist across command
|
|
33
|
+
* invocations. Use this for browser resources with lifecycle (AudioContext,
|
|
34
|
+
* RTCPeerConnection, CanvasRenderingContext2D) — not for stateless utilities
|
|
35
|
+
* (HttpClient, JSON encoding) which should be provided per-command.
|
|
36
|
+
*
|
|
37
|
+
* The runtime memoizes the layer, ensuring a single shared instance for all
|
|
38
|
+
* commands and subscriptions throughout the application's lifetime.
|
|
39
|
+
*/
|
|
40
|
+
readonly resources?: Layer.Layer<Resources>;
|
|
31
41
|
}
|
|
32
|
-
interface BaseElementConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
42
|
+
interface BaseElementConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never> {
|
|
33
43
|
readonly Model: Schema.Schema<Model, any, never>;
|
|
34
|
-
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message>>];
|
|
44
|
+
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
35
45
|
readonly view: (model: Model) => Html;
|
|
36
|
-
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap>;
|
|
46
|
+
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap, Resources>;
|
|
37
47
|
readonly container: HTMLElement;
|
|
38
48
|
readonly errorView?: (error: Error) => Html;
|
|
49
|
+
readonly resources?: Layer.Layer<Resources>;
|
|
39
50
|
}
|
|
40
51
|
/** Configuration for `makeElement` when the element receives initial data via flags. */
|
|
41
|
-
export interface ElementConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags> extends BaseElementConfig<Model, Message, StreamDepsMap> {
|
|
52
|
+
export interface ElementConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never> extends BaseElementConfig<Model, Message, StreamDepsMap, Resources> {
|
|
42
53
|
readonly Flags: Schema.Schema<Flags, any, never>;
|
|
43
54
|
readonly flags: Effect.Effect<Flags>;
|
|
44
|
-
readonly init: (flags: Flags) => [Model, ReadonlyArray<Command<Message>>];
|
|
55
|
+
readonly init: (flags: Flags) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
45
56
|
}
|
|
46
57
|
/** Configuration for `makeElement` without flags. */
|
|
47
|
-
export interface ElementConfigWithoutFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
48
|
-
readonly init: () => [
|
|
58
|
+
export interface ElementConfigWithoutFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never> extends BaseElementConfig<Model, Message, StreamDepsMap, Resources> {
|
|
59
|
+
readonly init: () => [
|
|
60
|
+
Model,
|
|
61
|
+
ReadonlyArray<Command<Message, never, Resources>>
|
|
62
|
+
];
|
|
49
63
|
}
|
|
50
|
-
interface BaseApplicationConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
64
|
+
interface BaseApplicationConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never> {
|
|
51
65
|
readonly Model: Schema.Schema<Model, any, never>;
|
|
52
|
-
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message>>];
|
|
66
|
+
readonly update: (model: Model, message: Message) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
53
67
|
readonly view: (model: Model) => Html;
|
|
54
|
-
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap>;
|
|
68
|
+
readonly subscriptions?: Subscriptions<Model, Message, StreamDepsMap, Resources>;
|
|
55
69
|
readonly container: HTMLElement;
|
|
56
70
|
readonly browser: BrowserConfig<Message>;
|
|
57
71
|
readonly errorView?: (error: Error) => Html;
|
|
72
|
+
readonly resources?: Layer.Layer<Resources>;
|
|
58
73
|
}
|
|
59
74
|
/** Configuration for `makeApplication` when the application receives initial data via flags. */
|
|
60
|
-
export interface ApplicationConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags> extends BaseApplicationConfig<Model, Message, StreamDepsMap> {
|
|
75
|
+
export interface ApplicationConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never> extends BaseApplicationConfig<Model, Message, StreamDepsMap, Resources> {
|
|
61
76
|
readonly Flags: Schema.Schema<Flags, any, never>;
|
|
62
77
|
readonly flags: Effect.Effect<Flags>;
|
|
63
|
-
readonly init: (flags: Flags, url: Url) => [Model, ReadonlyArray<Command<Message>>];
|
|
78
|
+
readonly init: (flags: Flags, url: Url) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
64
79
|
}
|
|
65
80
|
/** Configuration for `makeApplication` without flags. */
|
|
66
|
-
export interface ApplicationConfigWithoutFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
67
|
-
readonly init: (url: Url) => [Model, ReadonlyArray<Command<Message>>];
|
|
81
|
+
export interface ApplicationConfigWithoutFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never> extends BaseApplicationConfig<Model, Message, StreamDepsMap, Resources> {
|
|
82
|
+
readonly init: (url: Url) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
68
83
|
}
|
|
69
84
|
/** The `init` function type for elements, with an optional `flags` parameter when `Flags` is not `void`. */
|
|
70
|
-
export type ElementInit<Model, Message, Flags = void> = Flags extends void ? () => [Model, ReadonlyArray<Command<Message>>] : (flags: Flags) => [Model, ReadonlyArray<Command<Message>>];
|
|
85
|
+
export type ElementInit<Model, Message, Flags = void, Resources = never> = Flags extends void ? () => [Model, ReadonlyArray<Command<Message, never, Resources>>] : (flags: Flags) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
71
86
|
/** The `init` function type for applications, receives the current URL and optional flags. */
|
|
72
|
-
export type ApplicationInit<Model, Message, Flags = void> = Flags extends void ? (url: Url) => [Model, ReadonlyArray<Command<Message>>] : (flags: Flags, url: Url) => [Model, ReadonlyArray<Command<Message>>];
|
|
87
|
+
export type ApplicationInit<Model, Message, Flags = void, Resources = never> = Flags extends void ? (url: Url) => [Model, ReadonlyArray<Command<Message, never, Resources>>] : (flags: Flags, url: Url) => [Model, ReadonlyArray<Command<Message, never, Resources>>];
|
|
73
88
|
/** A reactive binding between model state and a long-running stream of commands. */
|
|
74
|
-
export type Subscription<Model, Message, StreamDeps> = {
|
|
89
|
+
export type Subscription<Model, Message, StreamDeps, Resources = never> = {
|
|
75
90
|
readonly modelToDeps: (model: Model) => StreamDeps;
|
|
76
|
-
readonly depsToStream: (deps: StreamDeps) => Stream.Stream<Command<Message>>;
|
|
91
|
+
readonly depsToStream: (deps: StreamDeps) => Stream.Stream<Command<Message, never, Resources>>;
|
|
77
92
|
};
|
|
78
|
-
type SubscriptionConfig<Model, Message, StreamDeps> = {
|
|
93
|
+
type SubscriptionConfig<Model, Message, StreamDeps, Resources = never> = {
|
|
79
94
|
readonly schema: Schema.Schema<StreamDeps>;
|
|
80
|
-
} & Subscription<Model, Message, StreamDeps>;
|
|
95
|
+
} & Subscription<Model, Message, StreamDeps, Resources>;
|
|
81
96
|
/** A record of named subscription configurations, keyed by dependency field name. */
|
|
82
|
-
export type Subscriptions<Model, Message, SubscriptionDeps extends Schema.Struct<any
|
|
83
|
-
readonly [K in keyof Schema.Schema.Type<SubscriptionDeps>]: SubscriptionConfig<Model, Message, Schema.Schema.Type<SubscriptionDeps>[K]>;
|
|
97
|
+
export type Subscriptions<Model, Message, SubscriptionDeps extends Schema.Struct<any>, Resources = never> = {
|
|
98
|
+
readonly [K in keyof Schema.Schema.Type<SubscriptionDeps>]: SubscriptionConfig<Model, Message, Schema.Schema.Type<SubscriptionDeps>[K], Resources>;
|
|
84
99
|
};
|
|
85
100
|
/** Creates type-safe subscription configurations from a dependency schema. */
|
|
86
|
-
export declare const makeSubscriptions: <SubscriptionDeps extends Schema.Struct<any>>(SubscriptionDeps: SubscriptionDeps) => <Model, Message>(configs: { [K in keyof Schema.Schema.Type<SubscriptionDeps>]: {
|
|
101
|
+
export declare const makeSubscriptions: <SubscriptionDeps extends Schema.Struct<any>>(SubscriptionDeps: SubscriptionDeps) => <Model, Message, Resources = never>(configs: { [K in keyof Schema.Schema.Type<SubscriptionDeps>]: {
|
|
87
102
|
modelToDeps: (model: Model) => Schema.Schema.Type<SubscriptionDeps>[K];
|
|
88
|
-
depsToStream: (deps: Schema.Schema.Type<SubscriptionDeps>[K]) => Stream.Stream<Command<Message>>;
|
|
103
|
+
depsToStream: (deps: Schema.Schema.Type<SubscriptionDeps>[K]) => Stream.Stream<Command<Message, never, Resources>>;
|
|
89
104
|
}; }) => Record<string, {
|
|
90
105
|
schema: any;
|
|
91
106
|
modelToDeps: (model: Model) => Schema.Schema.Type<SubscriptionDeps>[K];
|
|
92
|
-
depsToStream: (deps: Schema.Schema.Type<SubscriptionDeps>[K]) => Stream.Stream<Command<Message>>;
|
|
107
|
+
depsToStream: (deps: Schema.Schema.Type<SubscriptionDeps>[K]) => Stream.Stream<Command<Message, never, Resources>>;
|
|
93
108
|
}>;
|
|
94
109
|
/** A configured Foldkit runtime returned by `makeElement` or `makeApplication`, passed to `run` to start the application. */
|
|
95
110
|
export type MakeRuntimeReturn = (hmrModel?: unknown) => Effect.Effect<void>;
|
|
96
111
|
/** Creates a Foldkit element (no URL routing) and returns a runtime that can be passed to `run`. */
|
|
97
112
|
export declare function makeElement<Model, Message extends {
|
|
98
113
|
_tag: string;
|
|
99
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags>(config: ElementConfigWithFlags<Model, Message, StreamDepsMap, Flags>): MakeRuntimeReturn;
|
|
114
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never>(config: ElementConfigWithFlags<Model, Message, StreamDepsMap, Flags, Resources>): MakeRuntimeReturn;
|
|
100
115
|
export declare function makeElement<Model, Message extends {
|
|
101
116
|
_tag: string;
|
|
102
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
117
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never>(config: ElementConfigWithoutFlags<Model, Message, StreamDepsMap, Resources>): MakeRuntimeReturn;
|
|
103
118
|
/** Creates a Foldkit application with URL routing and returns a runtime that can be passed to `run`. */
|
|
104
119
|
export declare function makeApplication<Model, Message extends {
|
|
105
120
|
_tag: string;
|
|
106
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags>(config: ApplicationConfigWithFlags<Model, Message, StreamDepsMap, Flags>): MakeRuntimeReturn;
|
|
121
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never>(config: ApplicationConfigWithFlags<Model, Message, StreamDepsMap, Flags, Resources>): MakeRuntimeReturn;
|
|
107
122
|
export declare function makeApplication<Model, Message extends {
|
|
108
123
|
_tag: string;
|
|
109
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields
|
|
124
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never>(config: ApplicationConfigWithoutFlags<Model, Message, StreamDepsMap, Resources>): MakeRuntimeReturn;
|
|
110
125
|
/** Starts a Foldkit runtime, with HMR support for development. */
|
|
111
126
|
export declare const run: (foldkitRuntime: MakeRuntimeReturn) => void;
|
|
112
127
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EACP,MAAM,EAGN,KAAK,EAOL,MAAM,EACN,MAAM,EAGP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAA+B,MAAM,QAAQ,CAAA;AAOzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;;4BAMb,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;2BAC1C,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI;;AALrD,8EAA8E;AAC9E,qBAAa,QAAS,SAAQ,aAM3B;CAAG;AAEN,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,gGAAgG;AAChG,MAAM,MAAM,aAAa,CAAC,OAAO,IAAI;IACnC,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAA;IACvD,QA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;AAEpB,wBAAgB,eAAe,CAC7B,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EAEjB,MAAM,EAAE,6BAA6B,CACnC,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,CACV,GACA,iBAAiB,CAAA;AAuDpB,kEAAkE;AAClE,eAAO,MAAM,GAAG,GAAI,gBAAgB,iBAAiB,KAAG,IAUvD,CAAA"}
|
package/dist/runtime/runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BrowserRuntime } from '@effect/platform-browser/index';
|
|
2
|
-
import { Cause, Context, Effect, Either, Function, Option, Predicate, Queue, Record, Ref, Runtime, Schema, Stream, SubscriptionRef, pipe, } from 'effect';
|
|
2
|
+
import { Cause, Context, Effect, Either, Function, Layer, Option, Predicate, Queue, Record, Ref, Runtime, Schema, Stream, SubscriptionRef, pipe, } from 'effect';
|
|
3
3
|
import { h } from 'snabbdom';
|
|
4
4
|
import { fromString as urlFromString } from '../url';
|
|
5
5
|
import { patch, toVNode } from '../vdom';
|
|
@@ -14,7 +14,15 @@ export const makeSubscriptions = (SubscriptionDeps) => (configs) => Record.map(c
|
|
|
14
14
|
modelToDeps,
|
|
15
15
|
depsToStream,
|
|
16
16
|
}));
|
|
17
|
-
const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view, subscriptions, container, browser: browserConfig, errorView, }) => (hmrModel) => Effect.gen(function* () {
|
|
17
|
+
const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view, subscriptions, container, browser: browserConfig, errorView, resources, }) => (hmrModel) => Effect.scoped(Effect.gen(function* () {
|
|
18
|
+
const maybeResourceLayer = resources
|
|
19
|
+
? Option.some(yield* Layer.memoize(resources))
|
|
20
|
+
: Option.none();
|
|
21
|
+
const provideCommandResources = (command) => Option.match(maybeResourceLayer, {
|
|
22
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
23
|
+
onNone: () => command,
|
|
24
|
+
onSome: resourceLayer => Effect.provide(command, resourceLayer),
|
|
25
|
+
});
|
|
18
26
|
const flags = yield* flags_;
|
|
19
27
|
const modelEquivalence = Schema.equivalence(Model);
|
|
20
28
|
const messageQueue = yield* Queue.unbounded();
|
|
@@ -27,7 +35,7 @@ const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view,
|
|
|
27
35
|
}))
|
|
28
36
|
: init(flags, Option.getOrUndefined(currentUrl));
|
|
29
37
|
const modelSubscriptionRef = yield* SubscriptionRef.make(initModel);
|
|
30
|
-
yield* Effect.forEach(initCommands, command => Effect.forkDaemon(command.pipe(Effect.flatMap(enqueueMessage))));
|
|
38
|
+
yield* Effect.forEach(initCommands, command => Effect.forkDaemon(command.pipe(provideCommandResources, Effect.flatMap(enqueueMessage))));
|
|
31
39
|
if (browserConfig) {
|
|
32
40
|
addNavigationEventListeners(messageQueue, browserConfig);
|
|
33
41
|
}
|
|
@@ -43,7 +51,7 @@ const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view,
|
|
|
43
51
|
yield* SubscriptionRef.set(modelSubscriptionRef, nextModel);
|
|
44
52
|
preserveModel(nextModel);
|
|
45
53
|
}
|
|
46
|
-
yield* Effect.forEach(commands, command => Effect.forkDaemon(command.pipe(Effect.flatMap(enqueueMessage))));
|
|
54
|
+
yield* Effect.forEach(commands, command => Effect.forkDaemon(command.pipe(provideCommandResources, Effect.flatMap(enqueueMessage))));
|
|
47
55
|
});
|
|
48
56
|
const runProcessMessage = (messageEffect) => (runtime) => {
|
|
49
57
|
try {
|
|
@@ -53,7 +61,9 @@ const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view,
|
|
|
53
61
|
const squashed = Runtime.isFiberFailure(error)
|
|
54
62
|
? Cause.squash(error[Runtime.FiberFailureCauseId])
|
|
55
63
|
: error;
|
|
56
|
-
const appError = squashed instanceof Error
|
|
64
|
+
const appError = squashed instanceof Error
|
|
65
|
+
? squashed
|
|
66
|
+
: new Error(String(squashed));
|
|
57
67
|
renderErrorView(appError, errorView, container, maybeCurrentVNodeRef);
|
|
58
68
|
}
|
|
59
69
|
};
|
|
@@ -84,7 +94,7 @@ const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view,
|
|
|
84
94
|
if (subscriptions) {
|
|
85
95
|
yield* pipe(subscriptions, Record.toEntries, Effect.forEach(([_key, { schema, modelToDeps, depsToStream }]) => {
|
|
86
96
|
const modelStream = Stream.concat(Stream.make(initModel), modelSubscriptionRef.changes);
|
|
87
|
-
return Effect.forkDaemon(modelStream.pipe(Stream.map(modelToDeps), Stream.changesWith(Schema.equivalence(schema)), Stream.flatMap(depsToStream, { switch: true }), Stream.runForEach(Effect.flatMap(enqueueMessage))));
|
|
97
|
+
return Effect.forkDaemon(modelStream.pipe(Stream.map(modelToDeps), Stream.changesWith(Schema.equivalence(schema)), Stream.flatMap(depsToStream, { switch: true }), Stream.runForEach(command => command.pipe(provideCommandResources, Effect.flatMap(enqueueMessage)))));
|
|
88
98
|
}, {
|
|
89
99
|
concurrency: 'unbounded',
|
|
90
100
|
discard: true,
|
|
@@ -95,10 +105,12 @@ const makeRuntime = ({ Model, Flags: _Flags, flags: flags_, init, update, view,
|
|
|
95
105
|
yield* processMessage(message);
|
|
96
106
|
})), Effect.catchAllCause(cause => Effect.sync(() => {
|
|
97
107
|
const squashed = Cause.squash(cause);
|
|
98
|
-
const appError = squashed instanceof Error
|
|
108
|
+
const appError = squashed instanceof Error
|
|
109
|
+
? squashed
|
|
110
|
+
: new Error(String(squashed));
|
|
99
111
|
renderErrorView(appError, errorView, container, maybeCurrentVNodeRef);
|
|
100
112
|
})));
|
|
101
|
-
});
|
|
113
|
+
}));
|
|
102
114
|
const patchVNode = (maybeCurrentVNode, nextVNodeNullish, container) => {
|
|
103
115
|
const nextVNode = Predicate.isNotNull(nextVNodeNullish)
|
|
104
116
|
? nextVNodeNullish
|
|
@@ -134,6 +146,7 @@ export function makeElement(config) {
|
|
|
134
146
|
...(config.subscriptions && { subscriptions: config.subscriptions }),
|
|
135
147
|
container: config.container,
|
|
136
148
|
...(config.errorView && { errorView: config.errorView }),
|
|
149
|
+
...(config.resources && { resources: config.resources }),
|
|
137
150
|
};
|
|
138
151
|
if ('Flags' in config) {
|
|
139
152
|
return makeRuntime({
|
|
@@ -162,6 +175,7 @@ export function makeApplication(config) {
|
|
|
162
175
|
container: config.container,
|
|
163
176
|
browser: config.browser,
|
|
164
177
|
...(config.errorView && { errorView: config.errorView }),
|
|
178
|
+
...(config.resources && { resources: config.resources }),
|
|
165
179
|
};
|
|
166
180
|
if ('Flags' in config) {
|
|
167
181
|
return makeRuntime({
|
package/dist/task/dom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/task/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAqC,MAAM,QAAQ,CAAA;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAczC;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWxE,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/task/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAqC,MAAM,QAAQ,CAAA;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAczC;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWxE,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAWlC,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAYlC,CAAA;AAEJ,0EAA0E;AAC1E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAA;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,WAAW,cAAc,KACxB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAuClC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A contiguous segment of items sharing the same group key. */
|
|
2
|
+
export type Segment<A> = Readonly<{
|
|
3
|
+
key: string;
|
|
4
|
+
items: ReadonlyArray<A>;
|
|
5
|
+
}>;
|
|
6
|
+
/** Groups items into contiguous segments by a key function. Adjacent items with the same key are collected into a single segment. */
|
|
7
|
+
export declare const groupContiguous: <A>(items: ReadonlyArray<A>, toKey: (item: A, index: number) => string) => ReadonlyArray<Segment<A>>;
|
|
8
|
+
//# sourceMappingURL=group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/ui/group.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAA;AAE3E,qIAAqI;AACrI,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,aAAa,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,KACxC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAW1B,CAAA"}
|
package/dist/ui/group.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Array } from 'effect';
|
|
2
|
+
/** Groups items into contiguous segments by a key function. Adjacent items with the same key are collected into a single segment. */
|
|
3
|
+
export const groupContiguous = (items, toKey) => {
|
|
4
|
+
const tagged = Array.map(items, (item, index) => ({
|
|
5
|
+
key: toKey(item, index),
|
|
6
|
+
item,
|
|
7
|
+
}));
|
|
8
|
+
return Array.chop(tagged, nonEmpty => {
|
|
9
|
+
const key = Array.headNonEmpty(nonEmpty).key;
|
|
10
|
+
const [matching, rest] = Array.span(nonEmpty, tagged => tagged.key === key);
|
|
11
|
+
return [{ key, items: Array.map(matching, ({ item }) => item) }, rest];
|
|
12
|
+
});
|
|
13
|
+
};
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA"}
|
package/dist/ui/index.js
CHANGED
package/dist/ui/keyboard.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Whether a keyboard event key is a single printable character (not a named key like "Enter" or "ArrowDown"). */
|
|
2
|
+
export declare const isPrintableKey: (key: string) => boolean;
|
|
1
3
|
export declare const wrapIndex: (index: number, length: number) => number;
|
|
2
4
|
export declare const findFirstEnabledIndex: (itemCount: number, focusedIndex: number, isDisabled: (index: number) => boolean) => (startIndex: number, direction: 1 | -1) => number;
|
|
3
5
|
export declare const keyToIndex: (nextKey: string, previousKey: string, itemCount: number, focusedIndex: number, isDisabled: (index: number) => boolean) => ((key: string) => number);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/ui/keyboard.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MACpB,CAAA;AAEtC,eAAO,MAAM,qBAAqB,GAE9B,WAAW,MAAM,EACjB,cAAc,MAAM,EACpB,YAAY,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,MAEvC,YAAY,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,KAAG,MAMtC,CAAA;AAEL,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,aAAa,MAAM,EACnB,WAAW,MAAM,EACjB,cAAc,MAAM,EACpB,YAAY,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,KACrC,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAW1B,CAAA"}
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/ui/keyboard.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,OAA2B,CAAA;AAExE,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,MACpB,CAAA;AAEtC,eAAO,MAAM,qBAAqB,GAE9B,WAAW,MAAM,EACjB,cAAc,MAAM,EACpB,YAAY,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,MAEvC,YAAY,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,KAAG,MAMtC,CAAA;AAEL,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,aAAa,MAAM,EACnB,WAAW,MAAM,EACjB,cAAc,MAAM,EACpB,YAAY,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,KACrC,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAW1B,CAAA"}
|
package/dist/ui/keyboard.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Array, Match as M, Option, Predicate, pipe } from 'effect';
|
|
2
|
+
/** Whether a keyboard event key is a single printable character (not a named key like "Enter" or "ArrowDown"). */
|
|
3
|
+
export const isPrintableKey = (key) => key.length === 1;
|
|
2
4
|
export const wrapIndex = (index, length) => ((index % length) + length) % length;
|
|
3
5
|
export const findFirstEnabledIndex = (itemCount, focusedIndex, isDisabled) => (startIndex, direction) => pipe(itemCount, Array.makeBy(step => wrapIndex(startIndex + step * direction, itemCount)), Array.findFirst(Predicate.not(isDisabled)), Option.getOrElse(() => focusedIndex));
|
|
4
6
|
export const keyToIndex = (nextKey, previousKey, itemCount, focusedIndex, isDisabled) => {
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Schema as S } from 'effect';
|
|
2
|
+
import type { Command } from '../../command';
|
|
3
|
+
import { type Html } from '../../html';
|
|
4
|
+
import type { AnchorConfig } from '../menu/anchor';
|
|
5
|
+
import { resolveTypeaheadMatch } from '../typeahead';
|
|
6
|
+
export { resolveTypeaheadMatch };
|
|
7
|
+
/** Schema for the activation trigger — whether the user interacted via mouse or keyboard. */
|
|
8
|
+
export declare const ActivationTrigger: S.Literal<["Pointer", "Keyboard"]>;
|
|
9
|
+
export type ActivationTrigger = typeof ActivationTrigger.Type;
|
|
10
|
+
/** Schema for the transition animation state, tracking enter/leave phases for CSS transition coordination. */
|
|
11
|
+
export declare const TransitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
12
|
+
export type TransitionState = typeof TransitionState.Type;
|
|
13
|
+
/** Schema for the listbox orientation — whether items flow vertically or horizontally. */
|
|
14
|
+
export declare const Orientation: S.Literal<["Vertical", "Horizontal"]>;
|
|
15
|
+
export type Orientation = typeof Orientation.Type;
|
|
16
|
+
/** Schema for the listbox component's state, tracking open/closed status, active item, selected items, activation trigger, and typeahead search. */
|
|
17
|
+
export declare const Model: S.Struct<{
|
|
18
|
+
id: typeof S.String;
|
|
19
|
+
isOpen: typeof S.Boolean;
|
|
20
|
+
isAnimated: typeof S.Boolean;
|
|
21
|
+
isModal: typeof S.Boolean;
|
|
22
|
+
isMultiple: typeof S.Boolean;
|
|
23
|
+
orientation: S.Literal<["Vertical", "Horizontal"]>;
|
|
24
|
+
transitionState: S.Literal<["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
25
|
+
maybeActiveItemIndex: S.OptionFromSelf<typeof S.Number>;
|
|
26
|
+
activationTrigger: S.Literal<["Pointer", "Keyboard"]>;
|
|
27
|
+
searchQuery: typeof S.String;
|
|
28
|
+
searchVersion: typeof S.Number;
|
|
29
|
+
selectedItems: S.Array$<typeof S.String>;
|
|
30
|
+
maybeLastPointerPosition: S.OptionFromSelf<S.Struct<{
|
|
31
|
+
screenX: typeof S.Number;
|
|
32
|
+
screenY: typeof S.Number;
|
|
33
|
+
}>>;
|
|
34
|
+
maybeLastButtonPointerType: S.OptionFromSelf<typeof S.String>;
|
|
35
|
+
}>;
|
|
36
|
+
export type Model = typeof Model.Type;
|
|
37
|
+
/** Sent when the listbox opens via button click or keyboard. Contains an optional initial active item index — None for pointer, Some for keyboard. */
|
|
38
|
+
export declare const Opened: import("../../schema").CallableTaggedStruct<"Opened", {
|
|
39
|
+
maybeActiveItemIndex: S.OptionFromSelf<typeof S.Number>;
|
|
40
|
+
}>;
|
|
41
|
+
/** Sent when the listbox closes via Escape key or backdrop click. */
|
|
42
|
+
export declare const Closed: import("../../schema").CallableTaggedStruct<"Closed", {}>;
|
|
43
|
+
/** Sent when focus leaves the listbox items container via Tab key or blur. */
|
|
44
|
+
export declare const ClosedByTab: import("../../schema").CallableTaggedStruct<"ClosedByTab", {}>;
|
|
45
|
+
/** Sent when an item is highlighted via arrow keys or mouse hover. Includes activation trigger. */
|
|
46
|
+
export declare const ActivatedItem: import("../../schema").CallableTaggedStruct<"ActivatedItem", {
|
|
47
|
+
index: typeof S.Number;
|
|
48
|
+
activationTrigger: S.Literal<["Pointer", "Keyboard"]>;
|
|
49
|
+
}>;
|
|
50
|
+
/** Sent when the mouse leaves an enabled item. */
|
|
51
|
+
export declare const DeactivatedItem: import("../../schema").CallableTaggedStruct<"DeactivatedItem", {}>;
|
|
52
|
+
/** Sent when an item is selected via Enter, Space, or click. Contains the item's string value. */
|
|
53
|
+
export declare const SelectedItem: import("../../schema").CallableTaggedStruct<"SelectedItem", {
|
|
54
|
+
item: typeof S.String;
|
|
55
|
+
}>;
|
|
56
|
+
/** Sent when Enter or Space is pressed on the active item, triggering a programmatic click on the DOM element. */
|
|
57
|
+
export declare const RequestedItemClick: import("../../schema").CallableTaggedStruct<"RequestedItemClick", {
|
|
58
|
+
index: typeof S.Number;
|
|
59
|
+
}>;
|
|
60
|
+
/** Sent when a printable character is typed for typeahead search. */
|
|
61
|
+
export declare const Searched: import("../../schema").CallableTaggedStruct<"Searched", {
|
|
62
|
+
key: typeof S.String;
|
|
63
|
+
maybeTargetIndex: S.OptionFromSelf<typeof S.Number>;
|
|
64
|
+
}>;
|
|
65
|
+
/** Sent after the search debounce period to clear the accumulated query. */
|
|
66
|
+
export declare const ClearedSearch: import("../../schema").CallableTaggedStruct<"ClearedSearch", {
|
|
67
|
+
version: typeof S.Number;
|
|
68
|
+
}>;
|
|
69
|
+
/** Sent when the pointer moves over a listbox item, carrying screen coordinates for tracked-pointer comparison. */
|
|
70
|
+
export declare const MovedPointerOverItem: import("../../schema").CallableTaggedStruct<"MovedPointerOverItem", {
|
|
71
|
+
index: typeof S.Number;
|
|
72
|
+
screenX: typeof S.Number;
|
|
73
|
+
screenY: typeof S.Number;
|
|
74
|
+
}>;
|
|
75
|
+
/** Placeholder message used when no action is needed. */
|
|
76
|
+
export declare const NoOp: import("../../schema").CallableTaggedStruct<"NoOp", {}>;
|
|
77
|
+
/** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
|
|
78
|
+
export declare const AdvancedTransitionFrame: import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>;
|
|
79
|
+
/** Sent internally when all CSS transitions on the listbox items container have completed. */
|
|
80
|
+
export declare const EndedTransition: import("../../schema").CallableTaggedStruct<"EndedTransition", {}>;
|
|
81
|
+
/** Sent internally when the listbox button moves in the viewport during a leave transition, cancelling the animation. */
|
|
82
|
+
export declare const DetectedButtonMovement: import("../../schema").CallableTaggedStruct<"DetectedButtonMovement", {}>;
|
|
83
|
+
/** Sent when the user presses a pointer device on the listbox button. Records pointer type for click handling. */
|
|
84
|
+
export declare const PressedPointerOnButton: import("../../schema").CallableTaggedStruct<"PressedPointerOnButton", {
|
|
85
|
+
pointerType: typeof S.String;
|
|
86
|
+
button: typeof S.Number;
|
|
87
|
+
}>;
|
|
88
|
+
/** Union of all messages the listbox component can produce. */
|
|
89
|
+
export declare const Message: S.Union<[import("../../schema").CallableTaggedStruct<"Opened", {
|
|
90
|
+
maybeActiveItemIndex: S.OptionFromSelf<typeof S.Number>;
|
|
91
|
+
}>, import("../../schema").CallableTaggedStruct<"Closed", {}>, import("../../schema").CallableTaggedStruct<"ClosedByTab", {}>, import("../../schema").CallableTaggedStruct<"ActivatedItem", {
|
|
92
|
+
index: typeof S.Number;
|
|
93
|
+
activationTrigger: S.Literal<["Pointer", "Keyboard"]>;
|
|
94
|
+
}>, import("../../schema").CallableTaggedStruct<"DeactivatedItem", {}>, import("../../schema").CallableTaggedStruct<"SelectedItem", {
|
|
95
|
+
item: typeof S.String;
|
|
96
|
+
}>, import("../../schema").CallableTaggedStruct<"MovedPointerOverItem", {
|
|
97
|
+
index: typeof S.Number;
|
|
98
|
+
screenX: typeof S.Number;
|
|
99
|
+
screenY: typeof S.Number;
|
|
100
|
+
}>, import("../../schema").CallableTaggedStruct<"RequestedItemClick", {
|
|
101
|
+
index: typeof S.Number;
|
|
102
|
+
}>, import("../../schema").CallableTaggedStruct<"Searched", {
|
|
103
|
+
key: typeof S.String;
|
|
104
|
+
maybeTargetIndex: S.OptionFromSelf<typeof S.Number>;
|
|
105
|
+
}>, import("../../schema").CallableTaggedStruct<"ClearedSearch", {
|
|
106
|
+
version: typeof S.Number;
|
|
107
|
+
}>, import("../../schema").CallableTaggedStruct<"NoOp", {}>, import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>, import("../../schema").CallableTaggedStruct<"EndedTransition", {}>, import("../../schema").CallableTaggedStruct<"DetectedButtonMovement", {}>, import("../../schema").CallableTaggedStruct<"PressedPointerOnButton", {
|
|
108
|
+
pointerType: typeof S.String;
|
|
109
|
+
button: typeof S.Number;
|
|
110
|
+
}>]>;
|
|
111
|
+
export type Opened = typeof Opened.Type;
|
|
112
|
+
export type Closed = typeof Closed.Type;
|
|
113
|
+
export type ClosedByTab = typeof ClosedByTab.Type;
|
|
114
|
+
export type ActivatedItem = typeof ActivatedItem.Type;
|
|
115
|
+
export type DeactivatedItem = typeof DeactivatedItem.Type;
|
|
116
|
+
export type SelectedItem = typeof SelectedItem.Type;
|
|
117
|
+
export type MovedPointerOverItem = typeof MovedPointerOverItem.Type;
|
|
118
|
+
export type RequestedItemClick = typeof RequestedItemClick.Type;
|
|
119
|
+
export type Searched = typeof Searched.Type;
|
|
120
|
+
export type ClearedSearch = typeof ClearedSearch.Type;
|
|
121
|
+
export type NoOp = typeof NoOp.Type;
|
|
122
|
+
export type AdvancedTransitionFrame = typeof AdvancedTransitionFrame.Type;
|
|
123
|
+
export type EndedTransition = typeof EndedTransition.Type;
|
|
124
|
+
export type DetectedButtonMovement = typeof DetectedButtonMovement.Type;
|
|
125
|
+
export type PressedPointerOnButton = typeof PressedPointerOnButton.Type;
|
|
126
|
+
export type Message = typeof Message.Type;
|
|
127
|
+
/** Configuration for creating a listbox model with `init`. `isAnimated` enables CSS transition coordination (default `false`). `isModal` locks page scroll and inerts other elements when open (default `false`). `isMultiple` enables multi-select with toggle behavior (default `false`). `selectedItems` sets the initial selection (default `[]`). */
|
|
128
|
+
export type InitConfig = Readonly<{
|
|
129
|
+
id: string;
|
|
130
|
+
isAnimated?: boolean;
|
|
131
|
+
isModal?: boolean;
|
|
132
|
+
isMultiple?: boolean;
|
|
133
|
+
orientation?: Orientation;
|
|
134
|
+
selectedItems?: ReadonlyArray<string>;
|
|
135
|
+
}>;
|
|
136
|
+
/** Creates an initial listbox model from a config. Defaults to closed with no active item and no selection. */
|
|
137
|
+
export declare const init: (config: InitConfig) => Model;
|
|
138
|
+
type UpdateReturn = [Model, ReadonlyArray<Command<Message>>];
|
|
139
|
+
/** Processes a listbox message and returns the next model and commands. */
|
|
140
|
+
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
141
|
+
/** Configuration for an individual listbox item's appearance. */
|
|
142
|
+
export type ItemConfig = Readonly<{
|
|
143
|
+
className: string;
|
|
144
|
+
content: Html;
|
|
145
|
+
}>;
|
|
146
|
+
/** Configuration for a group heading rendered above a group of items. */
|
|
147
|
+
export type GroupHeading = Readonly<{
|
|
148
|
+
content: Html;
|
|
149
|
+
className: string;
|
|
150
|
+
}>;
|
|
151
|
+
/** Configuration for rendering a listbox with `view`. */
|
|
152
|
+
export type ViewConfig<Message, Item> = Readonly<{
|
|
153
|
+
model: Model;
|
|
154
|
+
toMessage: (message: Opened | Closed | ClosedByTab | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | Searched | PressedPointerOnButton | NoOp) => Message;
|
|
155
|
+
items: ReadonlyArray<Item>;
|
|
156
|
+
itemToConfig: (item: Item, context: Readonly<{
|
|
157
|
+
isActive: boolean;
|
|
158
|
+
isDisabled: boolean;
|
|
159
|
+
isSelected: boolean;
|
|
160
|
+
}>) => ItemConfig;
|
|
161
|
+
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
162
|
+
itemToSearchText?: (item: Item, index: number) => string;
|
|
163
|
+
itemToValue?: (item: Item) => string;
|
|
164
|
+
isButtonDisabled?: boolean;
|
|
165
|
+
buttonContent: Html;
|
|
166
|
+
buttonClassName: string;
|
|
167
|
+
itemsClassName: string;
|
|
168
|
+
backdropClassName: string;
|
|
169
|
+
className?: string;
|
|
170
|
+
itemGroupKey?: (item: Item, index: number) => string;
|
|
171
|
+
groupToHeading?: (groupKey: string) => GroupHeading | undefined;
|
|
172
|
+
groupClassName?: string;
|
|
173
|
+
separatorClassName?: string;
|
|
174
|
+
anchor?: AnchorConfig;
|
|
175
|
+
name?: string;
|
|
176
|
+
form?: string;
|
|
177
|
+
isDisabled?: boolean;
|
|
178
|
+
isInvalid?: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
/** Renders a headless listbox with typeahead search, keyboard navigation, selection tracking, and aria-activedescendant focus management. */
|
|
181
|
+
export declare const view: <Message, Item>(config: ViewConfig<Message, Item>) => Html;
|
|
182
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,YAAY,CAAA;AAO5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAIhC,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,oCAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,8GAA8G;AAC9G,eAAO,MAAM,eAAe,qFAM3B,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,0FAA0F;AAC1F,eAAO,MAAM,WAAW,uCAAsC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,oJAAoJ;AACpJ,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;EAiBhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,sJAAsJ;AACtJ,eAAO,MAAM,MAAM;;EAEjB,CAAA;AACF,qEAAqE;AACrE,eAAO,MAAM,MAAM,2DAAc,CA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