foldkit 0.40.0 → 0.42.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/README.md +20 -18
- package/dist/devtools/overlay.d.ts.map +1 -1
- package/dist/devtools/overlay.js +35 -6
- package/dist/devtools/store.d.ts +2 -1
- package/dist/devtools/store.d.ts.map +1 -1
- package/dist/devtools/store.js +4 -1
- package/dist/runtime/browserListeners.d.ts +2 -2
- package/dist/runtime/browserListeners.js +11 -11
- package/dist/runtime/crashUI.d.ts.map +1 -1
- package/dist/runtime/crashUI.js +1 -3
- package/dist/runtime/public.d.ts +2 -2
- package/dist/runtime/public.d.ts.map +1 -1
- package/dist/runtime/public.js +1 -1
- package/dist/runtime/runtime.d.ts +33 -46
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +25 -43
- package/dist/ui/checkbox/index.d.ts +3 -3
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +11 -8
- package/dist/ui/combobox/multi.d.ts +4 -3
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +4 -4
- package/dist/ui/combobox/public.d.ts +2 -2
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +1 -1
- package/dist/ui/combobox/shared.d.ts +12 -1
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +32 -19
- package/dist/ui/combobox/single.d.ts +4 -3
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +4 -4
- package/dist/ui/dialog/index.d.ts +11 -3
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +15 -7
- package/dist/ui/dialog/public.d.ts +1 -1
- package/dist/ui/dialog/public.d.ts.map +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/disclosure/index.d.ts +8 -3
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +12 -7
- package/dist/ui/disclosure/public.d.ts +2 -2
- package/dist/ui/disclosure/public.d.ts.map +1 -1
- package/dist/ui/disclosure/public.js +1 -1
- package/dist/ui/listbox/multi.d.ts +4 -3
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +4 -4
- package/dist/ui/listbox/public.d.ts +3 -3
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +2 -2
- package/dist/ui/listbox/shared.d.ts +14 -1
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +31 -16
- package/dist/ui/listbox/single.d.ts +10 -5
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +8 -5
- package/dist/ui/menu/index.d.ts +19 -3
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +39 -21
- package/dist/ui/menu/public.d.ts +2 -2
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +20 -3
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +31 -14
- package/dist/ui/popover/public.d.ts +2 -2
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/radioGroup/index.d.ts +10 -5
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +18 -20
- package/dist/ui/radioGroup/public.d.ts +2 -2
- package/dist/ui/radioGroup/public.d.ts.map +1 -1
- package/dist/ui/radioGroup/public.js +1 -1
- package/dist/ui/switch/index.d.ts +3 -3
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +11 -8
- package/dist/ui/tabs/index.d.ts +8 -3
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +15 -8
- package/dist/ui/tabs/public.d.ts +2 -2
- package/dist/ui/tabs/public.d.ts.map +1 -1
- package/dist/ui/tabs/public.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<h3 align="center">The frontend framework for correctness.</h3>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
|
-
<a href="https://foldkit.dev"><strong>Documentation</strong></a> · <a href="https://
|
|
16
|
+
<a href="https://foldkit.dev"><strong>Documentation</strong></a> · <a href="https://foldkit.dev/example-apps"><strong>Examples</strong></a> · <a href="https://foldkit.dev/getting-started"><strong>Getting Started</strong></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -84,7 +84,7 @@ const update = (
|
|
|
84
84
|
|
|
85
85
|
// INIT
|
|
86
86
|
|
|
87
|
-
const init: Runtime.
|
|
87
|
+
const init: Runtime.ProgramInit<Model, Message> = () => [{ count: 0 }, []]
|
|
88
88
|
|
|
89
89
|
// VIEW
|
|
90
90
|
|
|
@@ -119,7 +119,7 @@ const buttonStyle = 'bg-black text-white hover:bg-gray-700 px-4 py-2 transition'
|
|
|
119
119
|
|
|
120
120
|
// RUN
|
|
121
121
|
|
|
122
|
-
const
|
|
122
|
+
const program = Runtime.makeProgram({
|
|
123
123
|
Model,
|
|
124
124
|
init,
|
|
125
125
|
update,
|
|
@@ -127,7 +127,7 @@ const element = Runtime.makeElement({
|
|
|
127
127
|
container: document.getElementById('root')!,
|
|
128
128
|
})
|
|
129
129
|
|
|
130
|
-
Runtime.run(
|
|
130
|
+
Runtime.run(program)
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
Source: [examples/counter/src/main.ts](https://github.com/foldkit/foldkit/blob/main/examples/counter/src/main.ts)
|
|
@@ -143,7 +143,8 @@ Foldkit is a complete system, not a collection of libraries you stitch together.
|
|
|
143
143
|
- **UI Components** — Dialog, menu, tabs, listbox, disclosure — fully accessible primitives that are easy to style and customize.
|
|
144
144
|
- **Field Validation** — Per-field validation state modeled as a discriminated union. Define rules as data, apply them in update, and the Model tracks the result.
|
|
145
145
|
- **Virtual DOM** — Declarative Views powered by [Snabbdom](https://github.com/snabbdom/snabbdom). Fast, keyed diffing. Views are plain functions of your Model.
|
|
146
|
-
- **DevTools** — Built-in overlay for inspecting Messages
|
|
146
|
+
- **DevTools** — Built-in overlay for inspecting Messages, Model state, and Commands. Time-travel mode lets you jump to any point in your app's history.
|
|
147
|
+
- **Testing** — Simulate the update loop in tests. Send Messages, resolve Commands inline, and assert on the Model. No mocking libraries, no fake timers, no setup or teardown.
|
|
147
148
|
- **HMR** — Vite plugin with state-preserving hot module replacement. Change your view, keep your state.
|
|
148
149
|
|
|
149
150
|
## Correctness You (And Your LLM) Can See
|
|
@@ -154,19 +155,20 @@ This is what makes Foldkit unusually AI-friendly. The same property that makes t
|
|
|
154
155
|
|
|
155
156
|
## Examples
|
|
156
157
|
|
|
157
|
-
- **[Counter](https://
|
|
158
|
-
- **[Todo](https://
|
|
159
|
-
- **[Stopwatch](https://
|
|
160
|
-
- **[Crash View](https://
|
|
161
|
-
- **[Form](https://
|
|
162
|
-
- **[Weather](https://
|
|
163
|
-
- **[Routing](https://
|
|
164
|
-
- **[Query Sync](https://
|
|
165
|
-
- **[Snake](https://
|
|
166
|
-
- **[Auth](https://
|
|
167
|
-
- **[Shopping Cart](https://
|
|
168
|
-
- **[WebSocket Chat](https://
|
|
169
|
-
- **[
|
|
158
|
+
- **[Counter](https://foldkit.dev/example-apps/counter)** — Increment/decrement with reset
|
|
159
|
+
- **[Todo](https://foldkit.dev/example-apps/todo)** — CRUD operations with localStorage persistence
|
|
160
|
+
- **[Stopwatch](https://foldkit.dev/example-apps/stopwatch)** — Timer with start/stop/reset
|
|
161
|
+
- **[Crash View](https://foldkit.dev/example-apps/crash-view)** — Custom crash fallback UI with crash reporting
|
|
162
|
+
- **[Form](https://foldkit.dev/example-apps/form)** — Form validation with async email checking
|
|
163
|
+
- **[Weather](https://foldkit.dev/example-apps/weather)** — HTTP requests with async state handling
|
|
164
|
+
- **[Routing](https://foldkit.dev/example-apps/routing)** — URL routing with parser combinators
|
|
165
|
+
- **[Query Sync](https://foldkit.dev/example-apps/query-sync)** — URL query parameter sync with filtering and sorting
|
|
166
|
+
- **[Snake](https://foldkit.dev/example-apps/snake)** — Classic game built with Subscriptions
|
|
167
|
+
- **[Auth](https://foldkit.dev/example-apps/auth)** — Authentication flow with Submodels and OutMessage
|
|
168
|
+
- **[Shopping Cart](https://foldkit.dev/example-apps/shopping-cart)** — Nested models and complex state
|
|
169
|
+
- **[WebSocket Chat](https://foldkit.dev/example-apps/websocket-chat)** — Managed Resources with WebSocket integration
|
|
170
|
+
- **[UI Showcase](https://foldkit.dev/example-apps/ui-showcase)** — Interactive showcase of every Foldkit UI component
|
|
171
|
+
- **[Typing Game](https://github.com/foldkit/foldkit/tree/main/packages/typing-game)** — Multiplayer typing game with Effect RPC backend ([play it live](https://typingterminal.com))
|
|
170
172
|
|
|
171
173
|
## License
|
|
172
174
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/devtools/overlay.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,MAAM,EACN,OAAO,EAGP,MAAM,EAQP,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AAKrC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAMxE,OAAO,EAAE,KAAK,aAAa,EAA+B,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/devtools/overlay.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,MAAM,EACN,OAAO,EAGP,MAAM,EAQP,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AAKrC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAMxE,OAAO,EAAE,KAAK,aAAa,EAA+B,MAAM,SAAS,CAAA;AA4QzE,eAAO,MAAM,MAAM;;EAA0C,CAAA;AAC7D,eAAO,MAAM,YAAY;;;;;;EAGxB,CAAA;AACD,eAAO,MAAM,aAAa;;;;;;EAGzB,CAAA;AACD,eAAO,MAAM,MAAM;;EAA4C,CAAA;AAC/D,eAAO,MAAM,KAAK;;EAA0C,CAAA;AAC5D,eAAO,MAAM,UAAU;;EAA6C,CAAA;AACpE,eAAO,MAAM,YAAY;;EAAiD,CAAA;AAC1E,eAAO,MAAM,WAAW;;EAA+C,CAAA;AAsmCvE,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,UAAU,gBAAgB,EAC1B,MAAM,YAAY,EAClB,aAAa,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,sCA4ChC,CAAA"}
|
package/dist/devtools/overlay.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as Command from '../command';
|
|
|
4
4
|
import { OptionExt } from '../effectExtensions';
|
|
5
5
|
import { createKeyedLazy, html } from '../html';
|
|
6
6
|
import { m } from '../message';
|
|
7
|
-
import {
|
|
7
|
+
import { makeProgram } from '../runtime/runtime';
|
|
8
8
|
import { makeSubscriptions } from '../runtime/subscription';
|
|
9
9
|
import { evo } from '../struct';
|
|
10
10
|
import { lockScroll, unlockScroll } from '../task/scrollLock';
|
|
@@ -29,6 +29,7 @@ const Model = S.Struct({
|
|
|
29
29
|
isOpen: S.Boolean,
|
|
30
30
|
isMobile: S.Boolean,
|
|
31
31
|
entries: S.Array(DisplayEntry),
|
|
32
|
+
initCommandNames: S.Array(S.String),
|
|
32
33
|
startIndex: S.Number,
|
|
33
34
|
isPaused: S.Boolean,
|
|
34
35
|
pausedAtIndex: S.Number,
|
|
@@ -44,6 +45,7 @@ const Model = S.Struct({
|
|
|
44
45
|
const Flags = S.Struct({
|
|
45
46
|
isMobile: S.Boolean,
|
|
46
47
|
entries: S.Array(DisplayEntry),
|
|
48
|
+
initCommandNames: S.Array(S.String),
|
|
47
49
|
startIndex: S.Number,
|
|
48
50
|
isPaused: S.Boolean,
|
|
49
51
|
pausedAtIndex: S.Number,
|
|
@@ -75,6 +77,7 @@ const GotInspectorTabsMessage = m('GotInspectorTabsMessage', {
|
|
|
75
77
|
});
|
|
76
78
|
const ReceivedStoreUpdate = m('ReceivedStoreUpdate', {
|
|
77
79
|
entries: S.Array(DisplayEntry),
|
|
80
|
+
initCommandNames: S.Array(S.String),
|
|
78
81
|
startIndex: S.Number,
|
|
79
82
|
isPaused: S.Boolean,
|
|
80
83
|
pausedAtIndex: S.Number,
|
|
@@ -96,6 +99,7 @@ const toDisplayEntries = ({ entries }) => Array_.map(entries, ({ tag, commandNam
|
|
|
96
99
|
}));
|
|
97
100
|
const toDisplayState = (state) => ({
|
|
98
101
|
entries: toDisplayEntries(state),
|
|
102
|
+
initCommandNames: state.initCommandNames,
|
|
99
103
|
startIndex: state.startIndex,
|
|
100
104
|
isPaused: state.isPaused,
|
|
101
105
|
pausedAtIndex: state.pausedAtIndex,
|
|
@@ -302,7 +306,7 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
302
306
|
}),
|
|
303
307
|
[],
|
|
304
308
|
],
|
|
305
|
-
ReceivedStoreUpdate: ({ entries, startIndex, isPaused, pausedAtIndex, }) => {
|
|
309
|
+
ReceivedStoreUpdate: ({ entries, initCommandNames, startIndex, isPaused, pausedAtIndex, }) => {
|
|
306
310
|
const shouldFollowLatest = M.value(mode).pipe(M.when('TimeTravel', () => !isPaused), M.when('Inspect', () => model.isFollowingLatest), M.exhaustive);
|
|
307
311
|
const latestIndex = Array_.match(entries, {
|
|
308
312
|
onEmpty: () => INIT_INDEX,
|
|
@@ -311,6 +315,7 @@ const makeUpdate = (store, shadow, mode) => {
|
|
|
311
315
|
return [
|
|
312
316
|
evo(model, {
|
|
313
317
|
entries: () => entries,
|
|
318
|
+
initCommandNames: () => initCommandNames,
|
|
314
319
|
startIndex: () => startIndex,
|
|
315
320
|
isPaused: () => isPaused,
|
|
316
321
|
pausedAtIndex: () => pausedAtIndex,
|
|
@@ -513,7 +518,11 @@ const makeView = (position, mode, maybeBanner) => {
|
|
|
513
518
|
const emptyInspectorView = div([
|
|
514
519
|
Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
515
520
|
], ['Click a message to inspect']);
|
|
516
|
-
const INSPECTOR_TABS = [
|
|
521
|
+
const INSPECTOR_TABS = [
|
|
522
|
+
'Model',
|
|
523
|
+
'Message',
|
|
524
|
+
'Commands',
|
|
525
|
+
];
|
|
517
526
|
const noMessageView = div([
|
|
518
527
|
Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
519
528
|
], ['init — no Message']);
|
|
@@ -529,13 +538,33 @@ const makeView = (position, mode, maybeBanner) => {
|
|
|
529
538
|
]),
|
|
530
539
|
]),
|
|
531
540
|
});
|
|
532
|
-
const
|
|
541
|
+
const selectedCommandNames = (model) => {
|
|
542
|
+
const selectedIndex = M.value(mode).pipe(M.when('TimeTravel', () => model.isPaused ? model.pausedAtIndex : INIT_INDEX), M.when('Inspect', () => model.selectedIndex), M.exhaustive);
|
|
543
|
+
if (selectedIndex === INIT_INDEX) {
|
|
544
|
+
return model.initCommandNames;
|
|
545
|
+
}
|
|
546
|
+
return pipe(Array_.get(model.entries, selectedIndex - model.startIndex), Option.map(entry => entry.commandNames), Option.getOrElse(() => []));
|
|
547
|
+
};
|
|
548
|
+
const commandsTabContent = (model) => Array_.match(selectedCommandNames(model), {
|
|
549
|
+
onEmpty: () => div([
|
|
550
|
+
Class('flex-1 flex items-center justify-center text-dt-muted text-2xs font-mono min-w-0'),
|
|
551
|
+
], ['No Commands returned']),
|
|
552
|
+
onNonEmpty: names => div([
|
|
553
|
+
Class('flex flex-col flex-1 min-h-0 min-w-0 overflow-auto overscroll-none'),
|
|
554
|
+
], Array_.map(names, (name, index) => div([
|
|
555
|
+
Class('flex items-center px-2 py-1 text-base font-mono text-dt border-b gap-1.5'),
|
|
556
|
+
], [
|
|
557
|
+
span([Class(indexClass)], [String(index + 1)]),
|
|
558
|
+
span([Class('json-tag')], [name]),
|
|
559
|
+
]))),
|
|
560
|
+
});
|
|
561
|
+
const inspectorTabContent = (model, tab, inspectedModel) => M.value(tab).pipe(M.when('Model', () => modelTabContent(model, inspectedModel)), M.when('Message', () => messageTabContent(model)), M.when('Commands', () => commandsTabContent(model)), M.exhaustive);
|
|
533
562
|
const inspectorPaneView = (model) => div([
|
|
534
563
|
Class('flex flex-col border-l min-w-0 min-h-0 flex-1 dt-inspector-pane'),
|
|
535
564
|
], [
|
|
536
565
|
Tabs.view({
|
|
537
566
|
model: model.inspectorTabs,
|
|
538
|
-
|
|
567
|
+
toParentMessage: tabsMessage => GotInspectorTabsMessage({ message: tabsMessage }),
|
|
539
568
|
tabs: INSPECTOR_TABS,
|
|
540
569
|
tabListAriaLabel: 'Inspector tabs',
|
|
541
570
|
attributes: [Class('flex flex-col flex-1 min-h-0')],
|
|
@@ -734,7 +763,7 @@ export const createOverlay = (store, position, mode, maybeBanner) => Effect.gen(
|
|
|
734
763
|
},
|
|
735
764
|
[],
|
|
736
765
|
];
|
|
737
|
-
const overlayRuntime =
|
|
766
|
+
const overlayRuntime = makeProgram({
|
|
738
767
|
Model,
|
|
739
768
|
Flags,
|
|
740
769
|
flags,
|
package/dist/devtools/store.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type StoreState = Readonly<{
|
|
|
11
11
|
entries: ReadonlyArray<HistoryEntry>;
|
|
12
12
|
keyframes: HashMap.HashMap<number, unknown>;
|
|
13
13
|
maybeInitModel: Option.Option<unknown>;
|
|
14
|
+
initCommandNames: ReadonlyArray<string>;
|
|
14
15
|
startIndex: number;
|
|
15
16
|
isPaused: boolean;
|
|
16
17
|
pausedAtIndex: number;
|
|
@@ -22,7 +23,7 @@ export type Bridge = Readonly<{
|
|
|
22
23
|
}>;
|
|
23
24
|
export declare const createDevtoolsStore: (bridge: Bridge, maxEntries?: number) => Effect.Effect<DevtoolsStore>;
|
|
24
25
|
export type DevtoolsStore = Readonly<{
|
|
25
|
-
recordInit: (model: unknown) => Effect.Effect<void>;
|
|
26
|
+
recordInit: (model: unknown, commandNames: ReadonlyArray<string>) => Effect.Effect<void>;
|
|
26
27
|
recordMessage: (message: Readonly<{
|
|
27
28
|
_tag: string;
|
|
28
29
|
}>, modelAfterUpdate: unknown, commandNames: ReadonlyArray<string>, isModelChanged: boolean) => Effect.Effect<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/devtools/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAQ,MAAM,QAAQ,CAAA;AAE9E,eAAO,MAAM,UAAU,KAAK,CAAA;AAI5B,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;CACxB,CAAC,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACpC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3C,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;IAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;IACrD,MAAM,EAAE,C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
10
|
startIndex: 0,
|
|
10
11
|
isPaused: false,
|
|
11
12
|
pausedAtIndex: 0,
|
|
@@ -34,9 +35,10 @@ export const createDevtoolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
34
35
|
isPaused: state.isPaused && isPausedAtRetainedIndex,
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
|
-
const recordInit = (model) => SubscriptionRef.update(stateRef, state => ({
|
|
38
|
+
const recordInit = (model, commandNames) => SubscriptionRef.update(stateRef, state => ({
|
|
38
39
|
...state,
|
|
39
40
|
maybeInitModel: Option.some(model),
|
|
41
|
+
initCommandNames: commandNames,
|
|
40
42
|
keyframes: HashMap.set(state.keyframes, 0, model),
|
|
41
43
|
}));
|
|
42
44
|
const recordMessage = (message, modelAfterUpdate, commandNames, isModelChanged) => SubscriptionRef.update(stateRef, state => {
|
|
@@ -83,6 +85,7 @@ export const createDevtoolsStore = (bridge, maxEntries = DEFAULT_MAX_ENTRIES) =>
|
|
|
83
85
|
const clear = SubscriptionRef.update(stateRef, state => ({
|
|
84
86
|
...emptyState,
|
|
85
87
|
maybeInitModel: state.maybeInitModel,
|
|
88
|
+
initCommandNames: state.initCommandNames,
|
|
86
89
|
keyframes: Option.match(state.maybeInitModel, {
|
|
87
90
|
onNone: () => HashMap.empty(),
|
|
88
91
|
onSome: model => HashMap.set(HashMap.empty(), 0, model),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Queue } from 'effect';
|
|
2
|
-
import {
|
|
3
|
-
export declare const addNavigationEventListeners: <Message>(messageQueue: Queue.Queue<Message>,
|
|
2
|
+
import { RoutingConfig } from './runtime';
|
|
3
|
+
export declare const addNavigationEventListeners: <Message>(messageQueue: Queue.Queue<Message>, routingConfig: RoutingConfig<Message>) => void;
|
|
4
4
|
export declare const addBfcacheRestoreListener: () => void;
|
|
5
5
|
//# sourceMappingURL=browserListeners.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Option, Queue, String } from 'effect';
|
|
2
2
|
import { OptionExt, StringExt } from '../effectExtensions';
|
|
3
3
|
import { External, Internal } from './urlRequest';
|
|
4
|
-
export const addNavigationEventListeners = (messageQueue,
|
|
5
|
-
addPopStateListener(messageQueue,
|
|
6
|
-
addLinkClickListener(messageQueue,
|
|
7
|
-
addProgrammaticNavigationListener(messageQueue,
|
|
4
|
+
export const addNavigationEventListeners = (messageQueue, routingConfig) => {
|
|
5
|
+
addPopStateListener(messageQueue, routingConfig);
|
|
6
|
+
addLinkClickListener(messageQueue, routingConfig);
|
|
7
|
+
addProgrammaticNavigationListener(messageQueue, routingConfig);
|
|
8
8
|
};
|
|
9
|
-
const addPopStateListener = (messageQueue,
|
|
9
|
+
const addPopStateListener = (messageQueue, routingConfig) => {
|
|
10
10
|
const onPopState = () => {
|
|
11
|
-
Queue.unsafeOffer(messageQueue,
|
|
11
|
+
Queue.unsafeOffer(messageQueue, routingConfig.onUrlChange(locationToUrl()));
|
|
12
12
|
};
|
|
13
13
|
window.addEventListener('popstate', onPopState);
|
|
14
14
|
};
|
|
15
|
-
const addLinkClickListener = (messageQueue,
|
|
15
|
+
const addLinkClickListener = (messageQueue, routingConfig) => {
|
|
16
16
|
const onLinkClick = (event) => {
|
|
17
17
|
const target = event.target;
|
|
18
18
|
if (!target || !('closest' in target)) {
|
|
@@ -31,16 +31,16 @@ const addLinkClickListener = (messageQueue, browserConfig) => {
|
|
|
31
31
|
const linkUrl = new URL(href);
|
|
32
32
|
const currentUrl = new URL(window.location.href);
|
|
33
33
|
if (linkUrl.origin !== currentUrl.origin) {
|
|
34
|
-
Queue.unsafeOffer(messageQueue,
|
|
34
|
+
Queue.unsafeOffer(messageQueue, routingConfig.onUrlRequest(External({ href })));
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
Queue.unsafeOffer(messageQueue,
|
|
37
|
+
Queue.unsafeOffer(messageQueue, routingConfig.onUrlRequest(Internal({ url: urlToFoldkitUrl(linkUrl) })));
|
|
38
38
|
};
|
|
39
39
|
document.addEventListener('click', onLinkClick);
|
|
40
40
|
};
|
|
41
|
-
const addProgrammaticNavigationListener = (messageQueue,
|
|
41
|
+
const addProgrammaticNavigationListener = (messageQueue, routingConfig) => {
|
|
42
42
|
const onProgrammaticNavigation = () => {
|
|
43
|
-
Queue.unsafeOffer(messageQueue,
|
|
43
|
+
Queue.unsafeOffer(messageQueue, routingConfig.onUrlChange(locationToUrl()));
|
|
44
44
|
};
|
|
45
45
|
window.addEventListener('foldkit:urlchange', onProgrammaticNavigation);
|
|
46
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crashUI.d.ts","sourceRoot":"","sources":["../../src/runtime/crashUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AAEpC,eAAO,MAAM,YAAY;8BACG,OAAO;6BACR,OAAO;CACjC,CAAA;AAmBD,eAAO,MAAM,gBAAgB,GAC3B,SAAS,QAAQ,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,EACnC,YAAY,OAAO,KAClB,
|
|
1
|
+
{"version":3,"file":"crashUI.d.ts","sourceRoot":"","sources":["../../src/runtime/crashUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AAEpC,eAAO,MAAM,YAAY;8BACG,OAAO;6BACR,OAAO;CACjC,CAAA;AAmBD,eAAO,MAAM,gBAAgB,GAC3B,SAAS,QAAQ,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,EACnC,YAAY,OAAO,KAClB,IA0LF,CAAA"}
|
package/dist/runtime/crashUI.js
CHANGED
|
@@ -92,9 +92,7 @@ export const defaultCrashView = (context, viewError) => {
|
|
|
92
92
|
'This is the default crash view. You can customize it by providing a ',
|
|
93
93
|
span([inlineCodeStyle], ['crash.view']),
|
|
94
94
|
' function to ',
|
|
95
|
-
span([inlineCodeStyle], ['
|
|
96
|
-
' or ',
|
|
97
|
-
span([inlineCodeStyle], ['makeApplication']),
|
|
95
|
+
span([inlineCodeStyle], ['makeProgram']),
|
|
98
96
|
'.',
|
|
99
97
|
]),
|
|
100
98
|
];
|
package/dist/runtime/public.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { makeProgram, run } from './runtime';
|
|
2
|
+
export type { RoutingConfig, CrashConfig, CrashContext, RoutingProgramConfigWithFlags, RoutingProgramConfig, ProgramConfigWithFlags, ProgramConfig, ProgramInit, RoutingProgramInit, MakeRuntimeReturn, Visibility, SlowViewContext, SlowViewConfig, DevtoolsConfig, } from './runtime';
|
|
3
3
|
export { UrlRequest } from './urlRequest';
|
|
4
4
|
export type { Internal, External } from './urlRequest';
|
|
5
5
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/runtime/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/runtime/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE5C,YAAY,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/runtime/public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { makeProgram, run } from './runtime';
|
|
2
2
|
export { UrlRequest } from './urlRequest';
|
|
@@ -60,8 +60,8 @@ declare const Dispatch_base: Context.TagClass<Dispatch, "@foldkit/Dispatch", {
|
|
|
60
60
|
export declare class Dispatch extends Dispatch_base {
|
|
61
61
|
}
|
|
62
62
|
export type { Command } from '../command';
|
|
63
|
-
/** Configuration for
|
|
64
|
-
export type
|
|
63
|
+
/** Configuration for URL routing with handlers for URL requests and URL changes. */
|
|
64
|
+
export type RoutingConfig<Message> = Readonly<{
|
|
65
65
|
onUrlRequest: (request: UrlRequest) => Message;
|
|
66
66
|
onUrlChange: (url: Url) => Message;
|
|
67
67
|
}>;
|
|
@@ -76,7 +76,7 @@ export type CrashConfig<Model, Message> = Readonly<{
|
|
|
76
76
|
view?: (context: CrashContext<Model, Message>) => Html;
|
|
77
77
|
report?: (context: CrashContext<Model, Message>) => void;
|
|
78
78
|
}>;
|
|
79
|
-
type
|
|
79
|
+
type BaseProgramConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never> = Readonly<{
|
|
80
80
|
Model: Schema.Schema<Model, any, never>;
|
|
81
81
|
update: (model: Model, message: Message) => readonly [
|
|
82
82
|
Model,
|
|
@@ -89,88 +89,75 @@ type BaseElementConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schem
|
|
|
89
89
|
slowView?: SlowViewConfig<Model, Message>;
|
|
90
90
|
resources?: Layer.Layer<Resources>;
|
|
91
91
|
managedResources?: ManagedResources<Model, Message, ManagedResourceServices>;
|
|
92
|
+
/** Derives the document title from the current model. Called after every render. */
|
|
93
|
+
title?: (model: Model) => string;
|
|
92
94
|
devtools?: DevtoolsConfig;
|
|
93
95
|
}>;
|
|
94
|
-
/** Configuration for `
|
|
95
|
-
export type
|
|
96
|
+
/** Configuration for `makeProgram` with flags and URL routing. */
|
|
97
|
+
export type RoutingProgramConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never> = BaseProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices> & Readonly<{
|
|
96
98
|
Flags: Schema.Schema<Flags, any, never>;
|
|
97
99
|
flags: Effect.Effect<Flags>;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
101
|
-
];
|
|
102
|
-
}>;
|
|
103
|
-
/** Configuration for `makeElement` without flags. */
|
|
104
|
-
export type ElementConfigWithoutFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never> = BaseElementConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices> & Readonly<{
|
|
105
|
-
init: () => readonly [
|
|
100
|
+
routing: RoutingConfig<Message>;
|
|
101
|
+
init: (flags: Flags, url: Url) => readonly [
|
|
106
102
|
Model,
|
|
107
103
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
108
104
|
];
|
|
109
105
|
}>;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
/** Configuration for `makeProgram` with URL routing but no flags. */
|
|
107
|
+
export type RoutingProgramConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never> = BaseProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices> & Readonly<{
|
|
108
|
+
routing: RoutingConfig<Message>;
|
|
109
|
+
init: (url: Url) => readonly [
|
|
113
110
|
Model,
|
|
114
111
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
115
112
|
];
|
|
116
|
-
view: (model: Model) => Html;
|
|
117
|
-
subscriptions?: Subscriptions<Model, Message, StreamDepsMap, Resources | ManagedResourceServices>;
|
|
118
|
-
container: HTMLElement;
|
|
119
|
-
browser: BrowserConfig<Message>;
|
|
120
|
-
crash?: CrashConfig<Model, Message>;
|
|
121
|
-
slowView?: SlowViewConfig<Model, Message>;
|
|
122
|
-
resources?: Layer.Layer<Resources>;
|
|
123
|
-
managedResources?: ManagedResources<Model, Message, ManagedResourceServices>;
|
|
124
|
-
devtools?: DevtoolsConfig;
|
|
125
113
|
}>;
|
|
126
|
-
/** Configuration for `
|
|
127
|
-
export type
|
|
114
|
+
/** Configuration for `makeProgram` with flags but no URL routing. */
|
|
115
|
+
export type ProgramConfigWithFlags<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never> = BaseProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices> & Readonly<{
|
|
128
116
|
Flags: Schema.Schema<Flags, any, never>;
|
|
129
117
|
flags: Effect.Effect<Flags>;
|
|
130
|
-
init: (flags: Flags
|
|
118
|
+
init: (flags: Flags) => readonly [
|
|
131
119
|
Model,
|
|
132
120
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
133
121
|
];
|
|
134
122
|
}>;
|
|
135
|
-
/** Configuration for `
|
|
136
|
-
export type
|
|
137
|
-
init: (
|
|
123
|
+
/** Configuration for `makeProgram` without flags or URL routing. */
|
|
124
|
+
export type ProgramConfig<Model, Message, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never> = BaseProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices> & Readonly<{
|
|
125
|
+
init: () => readonly [
|
|
138
126
|
Model,
|
|
139
127
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
140
128
|
];
|
|
141
129
|
}>;
|
|
142
|
-
/** The `init` function type for
|
|
143
|
-
export type
|
|
130
|
+
/** The `init` function type for programs without URL routing. */
|
|
131
|
+
export type ProgramInit<Model, Message, Flags = void, Resources = never, ManagedResourceServices = never> = Flags extends void ? () => readonly [
|
|
144
132
|
Model,
|
|
145
133
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
146
134
|
] : (flags: Flags) => readonly [
|
|
147
135
|
Model,
|
|
148
136
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
149
137
|
];
|
|
150
|
-
/** The `init` function type for
|
|
151
|
-
export type
|
|
138
|
+
/** The `init` function type for programs with URL routing, receives the current URL and optional flags. */
|
|
139
|
+
export type RoutingProgramInit<Model, Message, Flags = void, Resources = never, ManagedResourceServices = never> = Flags extends void ? (url: Url) => readonly [
|
|
152
140
|
Model,
|
|
153
141
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
154
142
|
] : (flags: Flags, url: Url) => readonly [
|
|
155
143
|
Model,
|
|
156
144
|
ReadonlyArray<Command<Message, never, Resources | ManagedResourceServices>>
|
|
157
145
|
];
|
|
158
|
-
/** A configured Foldkit runtime returned by `
|
|
146
|
+
/** A configured Foldkit runtime returned by `makeProgram`, passed to `run` to start the application. */
|
|
159
147
|
export type MakeRuntimeReturn = (hmrModel?: unknown) => Effect.Effect<void>;
|
|
160
|
-
/** Creates a Foldkit
|
|
161
|
-
export declare function
|
|
148
|
+
/** Creates a Foldkit program and returns a runtime that can be passed to `run`. Add a `routing` config for URL routing. */
|
|
149
|
+
export declare function makeProgram<Model, Message extends {
|
|
162
150
|
_tag: string;
|
|
163
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never>(config:
|
|
164
|
-
export declare function
|
|
151
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never>(config: RoutingProgramConfigWithFlags<Model, Message, StreamDepsMap, Flags, Resources, ManagedResourceServices>): MakeRuntimeReturn;
|
|
152
|
+
export declare function makeProgram<Model, Message extends {
|
|
165
153
|
_tag: string;
|
|
166
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never>(config:
|
|
167
|
-
|
|
168
|
-
export declare function makeApplication<Model, Message extends {
|
|
154
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never>(config: RoutingProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices>): MakeRuntimeReturn;
|
|
155
|
+
export declare function makeProgram<Model, Message extends {
|
|
169
156
|
_tag: string;
|
|
170
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never>(config:
|
|
171
|
-
export declare function
|
|
157
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Flags, Resources = never, ManagedResourceServices = never>(config: ProgramConfigWithFlags<Model, Message, StreamDepsMap, Flags, Resources, ManagedResourceServices>): MakeRuntimeReturn;
|
|
158
|
+
export declare function makeProgram<Model, Message extends {
|
|
172
159
|
_tag: string;
|
|
173
|
-
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never>(config:
|
|
160
|
+
}, StreamDepsMap extends Schema.Struct<Schema.Struct.Fields>, Resources = never, ManagedResourceServices = never>(config: ProgramConfig<Model, Message, StreamDepsMap, Resources, ManagedResourceServices>): MakeRuntimeReturn;
|
|
174
161
|
/** Starts a Foldkit runtime, with HMR support for development. */
|
|
175
162
|
export declare const run: (foldkitRuntime: MakeRuntimeReturn) => void;
|
|
176
163
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EACP,MAAM,EAGN,KAAK,EAEL,MAAM,EAMN,MAAM,EAKP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAA+B,MA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