foldkit 0.154.0 → 0.155.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.
Files changed (154) hide show
  1. package/dist/asyncData/asyncData.d.ts.map +1 -1
  2. package/dist/brand/brand.d.ts.map +1 -1
  3. package/dist/calendar/arithmetic.d.ts.map +1 -1
  4. package/dist/calendar/calendarDate.d.ts.map +1 -1
  5. package/dist/calendar/comparison.d.ts.map +1 -1
  6. package/dist/calendar/info.d.ts.map +1 -1
  7. package/dist/calendar/today.d.ts.map +1 -1
  8. package/dist/canvas/paint.d.ts.map +1 -1
  9. package/dist/canvas/view.d.ts.map +1 -1
  10. package/dist/command/brand.d.ts.map +1 -1
  11. package/dist/command/index.d.ts.map +1 -1
  12. package/dist/command/interruptible/interruptible.d.ts.map +1 -1
  13. package/dist/controlledDomState.d.ts.map +1 -1
  14. package/dist/customElement/index.d.ts +6 -3
  15. package/dist/customElement/index.d.ts.map +1 -1
  16. package/dist/devTools/historyQuery.d.ts.map +1 -1
  17. package/dist/devTools/protocol.d.ts +113 -113
  18. package/dist/devTools/protocol.d.ts.map +1 -1
  19. package/dist/devTools/schemaSummarize.d.ts.map +1 -1
  20. package/dist/devTools/serialize.d.ts.map +1 -1
  21. package/dist/devTools/store.d.ts.map +1 -1
  22. package/dist/devTools/submodelPath.d.ts.map +1 -1
  23. package/dist/devTools/summarize.d.ts +6 -6
  24. package/dist/devTools/summarize.d.ts.map +1 -1
  25. package/dist/devTools/webSocketBridge.d.ts +1 -1
  26. package/dist/devTools/webSocketBridge.d.ts.map +1 -1
  27. package/dist/devTools/webSocketBridge.js +4 -4
  28. package/dist/dom/dom.d.ts +11 -5
  29. package/dist/dom/dom.d.ts.map +1 -1
  30. package/dist/dom/dom.js +10 -5
  31. package/dist/dom/elementMovement.d.ts.map +1 -1
  32. package/dist/dom/inert.d.ts.map +1 -1
  33. package/dist/dom/waitForAnimation.d.ts.map +1 -1
  34. package/dist/domReflection.d.ts.map +1 -1
  35. package/dist/effectExtensions/optionExtensions.d.ts.map +1 -1
  36. package/dist/effectExtensions/stringExtensions.d.ts.map +1 -1
  37. package/dist/experimental/machine/machine.d.ts.map +1 -1
  38. package/dist/experimental/server/entry.d.ts.map +1 -1
  39. package/dist/experimental/server/host.d.ts.map +1 -1
  40. package/dist/experimental/server/serialize.d.ts.map +1 -1
  41. package/dist/experimental/server/server.d.ts.map +1 -1
  42. package/dist/experimental/server/template.d.ts.map +1 -1
  43. package/dist/fieldValidation/fieldValidation.d.ts +35 -0
  44. package/dist/fieldValidation/fieldValidation.d.ts.map +1 -1
  45. package/dist/fieldValidation/fieldValidation.js +31 -1
  46. package/dist/fieldValidation/public.d.ts +1 -1
  47. package/dist/fieldValidation/public.d.ts.map +1 -1
  48. package/dist/fieldValidation/public.js +1 -1
  49. package/dist/fieldValidation/rule.d.ts.map +1 -1
  50. package/dist/file/file.d.ts.map +1 -1
  51. package/dist/file/reader.d.ts.map +1 -1
  52. package/dist/file/select.d.ts.map +1 -1
  53. package/dist/html/boundary.d.ts.map +1 -1
  54. package/dist/html/childAttribute.d.ts.map +1 -1
  55. package/dist/html/dragZoneTracking.d.ts +1 -1
  56. package/dist/html/dragZoneTracking.d.ts.map +1 -1
  57. package/dist/html/index.d.ts +7 -20
  58. package/dist/html/index.d.ts.map +1 -1
  59. package/dist/html/index.js +12 -15
  60. package/dist/html/runtimeSingleton.d.ts.map +1 -1
  61. package/dist/html/submodel.d.ts.map +1 -1
  62. package/dist/hydrate.d.ts.map +1 -1
  63. package/dist/hydrationMarkers.d.ts.map +1 -1
  64. package/dist/managedResource/managedResource.d.ts +5 -3
  65. package/dist/managedResource/managedResource.d.ts.map +1 -1
  66. package/dist/managedResource/managedResource.js +5 -3
  67. package/dist/mount/index.d.ts +167 -114
  68. package/dist/mount/index.d.ts.map +1 -1
  69. package/dist/mount/index.js +47 -63
  70. package/dist/nativeInnerHtml.d.ts.map +1 -1
  71. package/dist/navigation/index.d.ts.map +1 -1
  72. package/dist/navigation/urlRequest.d.ts +2 -2
  73. package/dist/navigation/urlRequest.d.ts.map +1 -1
  74. package/dist/port/port.d.ts.map +1 -1
  75. package/dist/propertyProvenance.d.ts.map +1 -1
  76. package/dist/propsModule.d.ts.map +1 -1
  77. package/dist/propsModule.js +3 -3
  78. package/dist/route/parser.d.ts.map +1 -1
  79. package/dist/route/transition.d.ts +4 -4
  80. package/dist/route/transition.d.ts.map +1 -1
  81. package/dist/runtime/browserListeners.d.ts.map +1 -1
  82. package/dist/runtime/crashUI.d.ts.map +1 -1
  83. package/dist/runtime/deepFreeze.d.ts.map +1 -1
  84. package/dist/runtime/hmrScroll.d.ts.map +1 -1
  85. package/dist/runtime/preserveScheduler.d.ts.map +1 -1
  86. package/dist/runtime/runtime.d.ts +1 -1
  87. package/dist/runtime/runtime.d.ts.map +1 -1
  88. package/dist/runtime/runtime.js +115 -28
  89. package/dist/runtime/viewTransition.d.ts.map +1 -1
  90. package/dist/snabbdom/eventlisteners.d.ts.map +1 -1
  91. package/dist/snabbdom/h.d.ts.map +1 -1
  92. package/dist/snabbdom/init.d.ts.map +1 -1
  93. package/dist/snabbdom/init.js +45 -25
  94. package/dist/snabbdom/vnode.d.ts.map +1 -1
  95. package/dist/struct/index.d.ts.map +1 -1
  96. package/dist/subscription/animationFrame.d.ts.map +1 -1
  97. package/dist/subscription/fromEvent.d.ts.map +1 -1
  98. package/dist/subscription/subscription.d.ts +2 -2
  99. package/dist/subscription/subscription.d.ts.map +1 -1
  100. package/dist/tagName.d.ts.map +1 -1
  101. package/dist/test/apps/attributes.d.ts.map +1 -1
  102. package/dist/test/apps/bubbling.d.ts.map +1 -1
  103. package/dist/test/apps/colorPicker.d.ts +1 -1
  104. package/dist/test/apps/colorPicker.d.ts.map +1 -1
  105. package/dist/test/apps/contextMenu.d.ts +6 -6
  106. package/dist/test/apps/contextMenu.d.ts.map +1 -1
  107. package/dist/test/apps/contextMenu.js +3 -3
  108. package/dist/test/apps/counter.d.ts +10 -10
  109. package/dist/test/apps/counter.d.ts.map +1 -1
  110. package/dist/test/apps/crashOnRender.d.ts +3 -3
  111. package/dist/test/apps/crashOnRender.d.ts.map +1 -1
  112. package/dist/test/apps/drafts.d.ts +2 -2
  113. package/dist/test/apps/drafts.d.ts.map +1 -1
  114. package/dist/test/apps/feedSocket.d.ts +15 -15
  115. package/dist/test/apps/feedSocket.d.ts.map +1 -1
  116. package/dist/test/apps/fileUpload.d.ts +1 -1
  117. package/dist/test/apps/fileUpload.d.ts.map +1 -1
  118. package/dist/test/apps/focusBoundary.d.ts.map +1 -1
  119. package/dist/test/apps/formChild.d.ts +18 -18
  120. package/dist/test/apps/formChild.d.ts.map +1 -1
  121. package/dist/test/apps/interactions.d.ts +7 -7
  122. package/dist/test/apps/interactions.d.ts.map +1 -1
  123. package/dist/test/apps/keypress.d.ts +2 -2
  124. package/dist/test/apps/keypress.d.ts.map +1 -1
  125. package/dist/test/apps/login.d.ts +12 -12
  126. package/dist/test/apps/login.d.ts.map +1 -1
  127. package/dist/test/apps/logoutButton.d.ts.map +1 -1
  128. package/dist/test/apps/mountPanel.d.ts +9 -9
  129. package/dist/test/apps/mountPanel.d.ts.map +1 -1
  130. package/dist/test/apps/mountPanel.js +24 -13
  131. package/dist/test/apps/multiRole.d.ts.map +1 -1
  132. package/dist/test/apps/pointer.d.ts +2 -2
  133. package/dist/test/apps/pointer.d.ts.map +1 -1
  134. package/dist/test/apps/resumeUpload.d.ts +8 -8
  135. package/dist/test/apps/resumeUpload.d.ts.map +1 -1
  136. package/dist/test/apps/scorePanel.d.ts.map +1 -1
  137. package/dist/test/apps/selectiveKeys.d.ts +2 -2
  138. package/dist/test/apps/selectiveKeys.d.ts.map +1 -1
  139. package/dist/test/apps/uploads.d.ts +15 -15
  140. package/dist/test/apps/uploads.d.ts.map +1 -1
  141. package/dist/test/apps/uploads.js +3 -3
  142. package/dist/test/internal.d.ts.map +1 -1
  143. package/dist/test/matchers.d.ts.map +1 -1
  144. package/dist/test/query.d.ts.map +1 -1
  145. package/dist/test/scene.d.ts +136 -58
  146. package/dist/test/scene.d.ts.map +1 -1
  147. package/dist/test/scene.js +75 -32
  148. package/dist/test/story.d.ts +30 -5
  149. package/dist/test/story.d.ts.map +1 -1
  150. package/dist/update/update.d.ts.map +1 -1
  151. package/dist/url/index.d.ts.map +1 -1
  152. package/dist/vdom.d.ts.map +1 -1
  153. package/dist/vdom.js +6 -8
  154. package/package.json +6 -8
@@ -22,8 +22,8 @@ export type MountDefinitionTypeId = typeof MountDefinitionTypeId;
22
22
  * the element unmounts, the runtime interrupts the fiber, which closes the
23
23
  * Stream's scope and runs any registered `acquireRelease` finalizers.
24
24
  *
25
- * Authors typically don't construct Stream-returning factories directly.
26
- * `Mount.define` wraps an `Effect<Message>` for the one-shot case; only
25
+ * Authors don't construct this shape directly. `Mount.define` builds it from
26
+ * an `execute` returning `Effect<Message>` for the one-shot case; only
27
27
  * `Mount.defineStream` exposes the raw Stream shape for continuous-event
28
28
  * cases. */
29
29
  export type MountAction<Message, E = never> = Readonly<{
@@ -54,16 +54,34 @@ export interface MountDefinitionWithArgs<Name extends string, Fields extends Sch
54
54
  * Union over the no-args and with-args shapes; consumers that only need
55
55
  * name/identity can accept this. */
56
56
  export type MountDefinition<Name extends string = string, ResultMessage = any> = MountDefinitionNoArgs<Name, ResultMessage> | MountDefinitionWithArgs<Name, any, ResultMessage>;
57
+ /** @internal Rejects an args field named `element`. `execute` receives the live
58
+ * element under that name, so an arg of the same name would shadow it. The
59
+ * literal is the type error a colliding declaration produces. */
60
+ type ElementFieldIsReserved = 'Mount args cannot declare `element`: execute already receives the live element';
57
61
  /**
58
- * Defines a one-shot Mount. The factory returns `Effect<Message>` that runs
59
- * once when the element mounts and produces exactly one Message. Cleanup
60
- * composes via `Effect.acquireRelease` inside the Effect: registered
62
+ * Defines a one-shot Mount. Every input is a named field: `args` declares the
63
+ * args Schema, `messages` lists the Messages this Mount can produce, and
64
+ * `execute` holds the work. `execute` receives the live `Element` as `element`
65
+ * alongside the declared args, and returns an `Effect<Message>` that runs once
66
+ * when the element mounts and produces exactly one Message.
67
+ *
68
+ * `args` is optional. Omit it and the Definition is callable as `Definition()`;
69
+ * declare it and the Definition is callable as `Definition(args)`. `execute`
70
+ * keeps the same shape either way, because a Mount always has an element. An
71
+ * args field named `element` is rejected where you declare it, since it would
72
+ * collide with the element `execute` receives.
73
+ *
74
+ * Constructing a MountAction never runs `execute`. The runtime calls it when
75
+ * the element enters the DOM, so nothing the body does happens inside the pure
76
+ * view that built the action.
77
+ *
78
+ * Cleanup composes via `Effect.acquireRelease` inside the Effect: registered
61
79
  * finalizers run when the element unmounts. The Mount's scope stays open
62
80
  * across the element's full lifetime, even after the Effect completes.
63
81
  *
64
82
  * At least one result Message schema is required. The Effect's success
65
- * type is `Schema.Schema.Type<Results[number]>`; without a declared
66
- * result, the factory would have to return `Effect.never`, leaving
83
+ * type is `Schema.Schema.Type<Messages[number]>`; without a declared
84
+ * result, `execute` would have to return `Effect.never`, leaving
67
85
  * `update` with no record of the work and removing DevTools, Scene,
68
86
  * and time-travel replay's reference point. Fire-and-forget Mounts
69
87
  * follow the same convention as fire-and-forget Commands: declare a
@@ -71,15 +89,14 @@ export type MountDefinition<Name extends string = string, ResultMessage = any> =
71
89
  * effect stays observable; `update` simply has nothing meaningful to
72
90
  * do with the acknowledgment.
73
91
  *
74
- * Two forms, distinguished by whether the second argument is a Schema (a
75
- * result message) or a record of Schemas (the args declaration). Cleanup is
76
- * asynchronous with respect to snabbdom's `destroy` hook: the runtime forks
77
- * `Fiber.interrupt` and returns immediately, so finalizers run on a separate
78
- * fiber after `destroy` has already completed. For idempotent DOM operations
79
- * (`element.remove()`, observer `disconnect()`, `removeEventListener`) this
80
- * is fine; if your cleanup has ordering requirements relative to other DOM
81
- * removals, prefer doing the imperative work synchronously inside `acquire`
82
- * and using `release` only for self-contained teardown.
92
+ * Cleanup is asynchronous with respect to snabbdom's `destroy` hook: the
93
+ * runtime forks `Fiber.interrupt` and returns immediately, so finalizers run
94
+ * on a separate fiber after `destroy` has already completed. For idempotent
95
+ * DOM operations (`element.remove()`, observer `disconnect()`,
96
+ * `removeEventListener`) this is fine; if your cleanup has ordering
97
+ * requirements relative to other DOM removals, prefer doing the imperative
98
+ * work synchronously inside `acquire` and using `release` only for
99
+ * self-contained teardown.
83
100
  *
84
101
  * **Construct resources INSIDE the acquire body, never before it.**
85
102
  * `Effect.acquireRelease` only guarantees atomicity of "acquire body
@@ -100,20 +117,20 @@ export type MountDefinition<Name extends string = string, ResultMessage = any> =
100
117
  *
101
118
  * @example One-shot, no cleanup (read element geometry on mount)
102
119
  * ```ts
103
- * const MeasurePanelWidth = Mount.define(
104
- * 'MeasurePanelWidth',
105
- * MeasuredPanelWidth,
106
- * )(element =>
107
- * Effect.sync(() =>
108
- * MeasuredPanelWidth({ width: element.getBoundingClientRect().width }),
109
- * ),
110
- * )
120
+ * const MeasurePanelWidth = Mount.define('MeasurePanelWidth', {
121
+ * messages: [MeasuredPanelWidth],
122
+ * execute: ({ element }) =>
123
+ * Effect.sync(() =>
124
+ * MeasuredPanelWidth({ width: element.getBoundingClientRect().width }),
125
+ * ),
126
+ * })
111
127
  * ```
112
128
  *
113
129
  * @example One-shot with cleanup (portal-to-body)
114
130
  * ```ts
115
- * const PortalToBody = Mount.define('PortalToBody', CompletedPortalToBody)(
116
- * element =>
131
+ * const PortalToBody = Mount.define('PortalToBody', {
132
+ * messages: [CompletedPortalToBody],
133
+ * execute: ({ element }) =>
117
134
  * Effect.gen(function* () {
118
135
  * yield* Effect.acquireRelease(
119
136
  * Effect.sync(() => document.body.appendChild(element)),
@@ -121,27 +138,26 @@ export type MountDefinition<Name extends string = string, ResultMessage = any> =
121
138
  * )
122
139
  * return CompletedPortalToBody()
123
140
  * }),
124
- * )
141
+ * })
125
142
  * ```
126
143
  *
127
144
  * @example With args
128
145
  * ```ts
129
- * const AnchorPopover = Mount.define(
130
- * 'AnchorPopover',
131
- * { buttonId: S.String, anchor: AnchorConfig },
132
- * CompletedAnchorPopover,
133
- * )(({ buttonId, anchor }) => element =>
134
- * Effect.gen(function* () {
135
- * yield* Effect.acquireRelease(
136
- * Effect.sync(() => anchorSetup(element, { buttonId, anchor })),
137
- * cleanup => Effect.sync(cleanup),
138
- * )
139
- * return CompletedAnchorPopover()
140
- * }),
141
- * )
146
+ * const AnchorPopover = Mount.define('AnchorPopover', {
147
+ * args: { buttonId: S.String, anchor: AnchorConfig },
148
+ * messages: [CompletedAnchorPopover],
149
+ * execute: ({ element, buttonId, anchor }) =>
150
+ * Effect.gen(function* () {
151
+ * yield* Effect.acquireRelease(
152
+ * Effect.sync(() => anchorSetup(element, { buttonId, anchor })),
153
+ * cleanup => Effect.sync(cleanup),
154
+ * )
155
+ * return CompletedAnchorPopover()
156
+ * }),
157
+ * })
142
158
  * ```
143
159
  *
144
- * **Args are captured at mount, not refreshed across renders.** The factory
160
+ * **Args are captured at mount, not refreshed across renders.** `execute`
145
161
  * runs once when the element enters the DOM. Subsequent renders construct
146
162
  * fresh `MountAction` values with updated arg values, but those values are
147
163
  * captured in closures that never execute. `OnMount` only binds to
@@ -164,19 +180,46 @@ export type MountDefinition<Name extends string = string, ResultMessage = any> =
164
180
  * applying `user-select: none` to the document while a drag is in progress
165
181
  * and undoing it when the drag ends).)
166
182
  */
167
- export declare function define<const Name extends string, Results extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, ...results: Results): (factory: (element: Element) => Effect.Effect<Schema.Schema.Type<Results[number]>, never, Scope.Scope>) => MountDefinitionNoArgs<Name, Schema.Schema.Type<Results[number]>>;
168
- export declare function define<const Name extends string, Fields extends Schema.Struct.Fields, Results extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, args: Fields, ...results: Results): (factoryBuilder: (args: Schema.Schema.Type<Schema.Struct<Fields>>) => (element: Element) => Effect.Effect<Schema.Schema.Type<Results[number]>, never, Scope.Scope>) => MountDefinitionWithArgs<Name, Fields, Schema.Schema.Type<Results[number]>>;
183
+ export declare function define<const Name extends string, Fields extends Schema.Struct.Fields, const Messages extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, config: Readonly<{
184
+ args: Fields & Readonly<{
185
+ element?: ElementFieldIsReserved;
186
+ }>;
187
+ messages: Messages;
188
+ execute: (input: Readonly<{
189
+ element: Element;
190
+ }> & Schema.Schema.Type<Schema.Struct<Fields>>) => Effect.Effect<Schema.Schema.Type<Messages[number]>, never, Scope.Scope>;
191
+ }>): MountDefinitionWithArgs<Name, Fields, Schema.Schema.Type<Messages[number]>>;
192
+ export declare function define<const Name extends string, const Messages extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, config: Readonly<{
193
+ args?: never;
194
+ messages: Messages;
195
+ execute: (input: Readonly<{
196
+ element: Element;
197
+ }>) => Effect.Effect<Schema.Schema.Type<Messages[number]>, never, Scope.Scope>;
198
+ }>): MountDefinitionNoArgs<Name, Schema.Schema.Type<Messages[number]>>;
169
199
  /**
170
- * Defines a streaming Mount. The factory returns `Stream<Message>` whose
171
- * lifetime is bound to the element's lifetime: each emitted Message is
172
- * dispatched, and the Stream's scope is closed (running any registered
173
- * `Effect.acquireRelease` finalizers) when the element unmounts. Use this
174
- * form when the Mount emits a continuum of events from observers or
175
- * listeners attached to the element.
200
+ * Defines a streaming Mount. Every input is a named field, exactly as in
201
+ * `Mount.define`: `args` declares the args Schema, `messages` lists the
202
+ * Messages this Mount can produce, and `execute` holds the work. `execute`
203
+ * receives the live `Element` as `element` alongside the declared args, and
204
+ * returns a `Stream<Message>` whose lifetime is bound to the element's
205
+ * lifetime: each emitted Message is dispatched, and the Stream's scope is
206
+ * closed (running any registered `Effect.acquireRelease` finalizers) when the
207
+ * element unmounts. Use this form when the Mount emits a continuum of events
208
+ * from observers or listeners attached to the element.
209
+ *
210
+ * `args` is optional. Omit it and the Definition is callable as `Definition()`;
211
+ * declare it and the Definition is callable as `Definition(args)`. `execute`
212
+ * keeps the same shape either way, because a Mount always has an element. An
213
+ * args field named `element` is rejected where you declare it, since it would
214
+ * collide with the element `execute` receives.
215
+ *
216
+ * Constructing a MountAction never runs `execute`. The runtime calls it when
217
+ * the element enters the DOM, so nothing the body does happens inside the pure
218
+ * view that built the action.
176
219
  *
177
220
  * At least one result Message schema is required. The Stream's emission
178
- * type is `Schema.Schema.Type<Results[number]>`; without a declared
179
- * result, the factory would have to return `Stream<never>`, leaving
221
+ * type is `Schema.Schema.Type<Messages[number]>`; without a declared
222
+ * result, `execute` would have to return `Stream<never>`, leaving
180
223
  * `update` with no record of the work and removing DevTools, Scene,
181
224
  * and time-travel replay's reference point. Fire-and-forget Mounts
182
225
  * follow the same convention as fire-and-forget Commands: declare a
@@ -184,10 +227,8 @@ export declare function define<const Name extends string, Fields extends Schema.
184
227
  * effect stays observable; `update` simply has nothing meaningful to
185
228
  * do with the acknowledgment. Re-check the cause.
186
229
  *
187
- * Two forms, distinguished by whether the second argument is a Schema or a
188
- * record of Schemas (the args declaration). Cleanup timing relative to
189
- * snabbdom's `destroy` hook is the same as `Mount.define` (asynchronous via
190
- * `Fiber.interrupt`).
230
+ * Cleanup timing relative to snabbdom's `destroy` hook is the same as
231
+ * `Mount.define` (asynchronous via `Fiber.interrupt`).
191
232
  *
192
233
  * For a Mount that produces exactly one Message at acquire and then holds
193
234
  * lifecycle-scoped resources, use `Mount.define` with `Effect<Message>`.
@@ -196,75 +237,87 @@ export declare function define<const Name extends string, Fields extends Schema.
196
237
  *
197
238
  * @example Continuous scroll events from an element
198
239
  * ```ts
199
- * const SyncSidebarScroll = Mount.defineStream(
200
- * 'SyncSidebarScroll',
201
- * ScrolledSidebar,
202
- * )(element =>
203
- * Stream.callback<typeof ScrolledSidebar.Type>(queue =>
204
- * Effect.gen(function* () {
205
- * yield* Effect.acquireRelease(
206
- * Effect.sync(() => {
207
- * const handler = () =>
208
- * Queue.offerUnsafe(
209
- * queue,
210
- * ScrolledSidebar({ scroll: element.scrollTop }),
211
- * )
212
- * element.addEventListener('scroll', handler, { passive: true })
213
- * return handler
214
- * }),
215
- * handler =>
216
- * Effect.sync(() =>
217
- * element.removeEventListener('scroll', handler),
218
- * ),
219
- * )
220
- * return yield* Effect.never
221
- * }),
222
- * ),
223
- * )
240
+ * const SyncSidebarScroll = Mount.defineStream('SyncSidebarScroll', {
241
+ * messages: [ScrolledSidebar],
242
+ * execute: ({ element }) =>
243
+ * Stream.callback<typeof ScrolledSidebar.Type>(queue =>
244
+ * Effect.gen(function* () {
245
+ * yield* Effect.acquireRelease(
246
+ * Effect.sync(() => {
247
+ * const handler = () =>
248
+ * Queue.offerUnsafe(
249
+ * queue,
250
+ * ScrolledSidebar({ scroll: element.scrollTop }),
251
+ * )
252
+ * element.addEventListener('scroll', handler, { passive: true })
253
+ * return handler
254
+ * }),
255
+ * handler =>
256
+ * Effect.sync(() =>
257
+ * element.removeEventListener('scroll', handler),
258
+ * ),
259
+ * )
260
+ * return yield* Effect.never
261
+ * }),
262
+ * ),
263
+ * })
224
264
  * ```
225
265
  *
226
266
  * @example IntersectionObserver events
227
267
  * ```ts
228
- * const ObserveHeroVisibility = Mount.defineStream(
229
- * 'ObserveHeroVisibility',
230
- * ChangedHeroVisibility,
231
- * )(element =>
232
- * Stream.callback<typeof ChangedHeroVisibility.Type>(queue =>
233
- * Effect.gen(function* () {
234
- * yield* Effect.acquireRelease(
235
- * Effect.sync(() => {
236
- * const observer = new IntersectionObserver(entries => {
237
- * pipe(
238
- * Array.head(entries),
239
- * Option.match({
240
- * onNone: Function.constVoid,
241
- * onSome: entry =>
242
- * Queue.offerUnsafe(
243
- * queue,
244
- * ChangedHeroVisibility({
245
- * isVisible: entry.isIntersecting,
246
- * }),
247
- * ),
248
- * }),
249
- * )
250
- * })
251
- * observer.observe(element)
252
- * return observer
253
- * }),
254
- * observer => Effect.sync(() => observer.disconnect()),
255
- * )
256
- * return yield* Effect.never
257
- * }),
258
- * ),
259
- * )
268
+ * const ObserveHeroVisibility = Mount.defineStream('ObserveHeroVisibility', {
269
+ * messages: [ChangedHeroVisibility],
270
+ * execute: ({ element }) =>
271
+ * Stream.callback<typeof ChangedHeroVisibility.Type>(queue =>
272
+ * Effect.gen(function* () {
273
+ * yield* Effect.acquireRelease(
274
+ * Effect.sync(() => {
275
+ * const observer = new IntersectionObserver(entries => {
276
+ * pipe(
277
+ * Array.head(entries),
278
+ * Option.match({
279
+ * onNone: Function.constVoid,
280
+ * onSome: entry =>
281
+ * Queue.offerUnsafe(
282
+ * queue,
283
+ * ChangedHeroVisibility({
284
+ * isVisible: entry.isIntersecting,
285
+ * }),
286
+ * ),
287
+ * }),
288
+ * )
289
+ * })
290
+ * observer.observe(element)
291
+ * return observer
292
+ * }),
293
+ * observer => Effect.sync(() => observer.disconnect()),
294
+ * )
295
+ * return yield* Effect.never
296
+ * }),
297
+ * ),
298
+ * })
260
299
  * ```
261
300
  *
262
301
  * The args-captured-at-mount and Subscriptions-vs-Mount guidance from
263
302
  * `Mount.define` apply identically here. See that constructor's docs for
264
303
  * the mental model.
265
304
  */
266
- export declare function defineStream<const Name extends string, Results extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, ...results: Results): (factory: (element: Element) => Stream.Stream<Schema.Schema.Type<Results[number]>, never, never>) => MountDefinitionNoArgs<Name, Schema.Schema.Type<Results[number]>>;
267
- export declare function defineStream<const Name extends string, Fields extends Schema.Struct.Fields, Results extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, args: Fields, ...results: Results): (factoryBuilder: (args: Schema.Schema.Type<Schema.Struct<Fields>>) => (element: Element) => Stream.Stream<Schema.Schema.Type<Results[number]>, never, never>) => MountDefinitionWithArgs<Name, Fields, Schema.Schema.Type<Results[number]>>;
305
+ export declare function defineStream<const Name extends string, Fields extends Schema.Struct.Fields, const Messages extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, config: Readonly<{
306
+ args: Fields & Readonly<{
307
+ element?: ElementFieldIsReserved;
308
+ }>;
309
+ messages: Messages;
310
+ execute: (input: Readonly<{
311
+ element: Element;
312
+ }> & Schema.Schema.Type<Schema.Struct<Fields>>) => Stream.Stream<Schema.Schema.Type<Messages[number]>, never, never>;
313
+ }>): MountDefinitionWithArgs<Name, Fields, Schema.Schema.Type<Messages[number]>>;
314
+ export declare function defineStream<const Name extends string, const Messages extends readonly [Schema.Top, ...ReadonlyArray<Schema.Top>]>(name: Name, config: Readonly<{
315
+ args?: never;
316
+ messages: Messages;
317
+ execute: (input: Readonly<{
318
+ element: Element;
319
+ }>) => Stream.Stream<Schema.Schema.Type<Messages[number]>, never, never>;
320
+ }>): MountDefinitionNoArgs<Name, Schema.Schema.Type<Messages[number]>>;
268
321
  /** Lifts a `MountAction` from one Message universe to another by mapping its
269
322
  * dispatched Messages through a transform. Used by Submodel components to
270
323
  * emit lifecycle action results into the parent's Message union via the
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EAIN,MAAM,EACN,KAAK,EACL,MAAM,EACP,MAAM,QAAQ,CAAA;;sBAWO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI;oBACxD,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI;;AAV1E;;;;;4CAK4C;AAC5C,qBAAa,YAAa,SAAQ,iBAMN;CAAG;AAE/B,mDAAmD;AAEnD,eAAO,MAAM,qBAAqB,EAAE,OAAO,MAEN,CAAA;AAErC,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA;AAEhE;;;;;;;;;;aAUa;AACb,MAAM,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,IAAI,QAAQ,CAAC;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ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AA;AAuBpE;;;6EAG6E;AAC7E,eAAO,MAAM,UAAU,EAAE;IACvB,CAAC,CAAC,EAAE,CAAC,EACH,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GACnB,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAU9E,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Context, Effect, Function, Predicate, Queue, Schema, Stream, } from 'effect';
1
+ import { Context, Effect, Function, Predicate, Queue, Stream, } from 'effect';
2
2
  /** Effect service tag that observes Mount lifecycle events. The runtime
3
3
  * provides an implementation that buffers events for DevTools history;
4
4
  * the OnMount snabbdom hooks call `started` synchronously when an element
@@ -10,78 +10,62 @@ export class MountTracker extends Context.Service()('@foldkit/MountTracker') {
10
10
  /** Type-level brand for MountDefinition values. */
11
11
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
12
12
  export const MountDefinitionTypeId = Symbol.for('foldkit/MountDefinition');
13
- const wrapEffectAsStream = (factory) => (element) => Stream.callback(queue => Effect.gen(function* () {
14
- const message = yield* factory(element);
13
+ /** @internal Stamps a callable Definition with its Mount name and the
14
+ * {@link MountDefinitionTypeId} brand, so `Scene` matchers and the runtime
15
+ * recognise it. Internal to the Mount module. */
16
+ const brandAsDefinition = (definition, name) => {
17
+ Object.defineProperty(definition, 'name', {
18
+ value: name,
19
+ configurable: true,
20
+ });
21
+ Object.defineProperty(definition, MountDefinitionTypeId, {
22
+ value: MountDefinitionTypeId,
23
+ });
24
+ };
25
+ const wrapEffectAsStream = (toEffect) => (element) => Stream.callback(queue => Effect.gen(function* () {
26
+ const message = yield* toEffect(element);
15
27
  Queue.offerUnsafe(queue, message);
16
28
  return yield* Effect.never;
17
29
  }));
18
- export function define(name, ...rest) {
19
- const [maybeArgs] = rest;
20
- const isArgsRecord = Predicate.isObject(maybeArgs) && !Schema.isSchema(maybeArgs);
21
- if (isArgsRecord) {
22
- return (factoryBuilder) => {
23
- const definition = (args) => ({
24
- name,
25
- args,
26
- f: wrapEffectAsStream(factoryBuilder(args)),
27
- });
28
- Object.defineProperty(definition, 'name', {
29
- value: name,
30
- configurable: true,
31
- });
32
- Object.defineProperty(definition, MountDefinitionTypeId, {
33
- value: MountDefinitionTypeId,
34
- });
35
- /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
36
- return definition;
37
- };
38
- }
39
- return (factory) => {
40
- const definition = () => ({ name, f: wrapEffectAsStream(factory) });
41
- Object.defineProperty(definition, 'name', {
42
- value: name,
43
- configurable: true,
30
+ export function define(name, config) {
31
+ const isArgsDeclared = Predicate.isNotUndefined(config.args);
32
+ if (isArgsDeclared) {
33
+ const definition = (args) => ({
34
+ name,
35
+ args,
36
+ f: wrapEffectAsStream(element => config.execute({ ...args, element })),
44
37
  });
45
- Object.defineProperty(definition, MountDefinitionTypeId, {
46
- value: MountDefinitionTypeId,
38
+ brandAsDefinition(definition, name);
39
+ return definition;
40
+ }
41
+ else {
42
+ const definition = () => ({
43
+ name,
44
+ f: wrapEffectAsStream(element => config.execute({ element })),
47
45
  });
48
- /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
46
+ brandAsDefinition(definition, name);
49
47
  return definition;
50
- };
51
- }
52
- export function defineStream(name, ...rest) {
53
- const [maybeArgs] = rest;
54
- const isArgsRecord = Predicate.isObject(maybeArgs) && !Schema.isSchema(maybeArgs);
55
- if (isArgsRecord) {
56
- return (factoryBuilder) => {
57
- const definition = (args) => ({
58
- name,
59
- args,
60
- f: factoryBuilder(args),
61
- });
62
- Object.defineProperty(definition, 'name', {
63
- value: name,
64
- configurable: true,
65
- });
66
- Object.defineProperty(definition, MountDefinitionTypeId, {
67
- value: MountDefinitionTypeId,
68
- });
69
- /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
70
- return definition;
71
- };
72
48
  }
73
- return (factory) => {
74
- const definition = () => ({ name, f: factory });
75
- Object.defineProperty(definition, 'name', {
76
- value: name,
77
- configurable: true,
49
+ }
50
+ export function defineStream(name, config) {
51
+ const isArgsDeclared = Predicate.isNotUndefined(config.args);
52
+ if (isArgsDeclared) {
53
+ const definition = (args) => ({
54
+ name,
55
+ args,
56
+ f: (element) => config.execute({ ...args, element }),
78
57
  });
79
- Object.defineProperty(definition, MountDefinitionTypeId, {
80
- value: MountDefinitionTypeId,
58
+ brandAsDefinition(definition, name);
59
+ return definition;
60
+ }
61
+ else {
62
+ const definition = () => ({
63
+ name,
64
+ f: (element) => config.execute({ element }),
81
65
  });
82
- /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
66
+ brandAsDefinition(definition, name);
83
67
  return definition;
84
- };
68
+ }
85
69
  }
86
70
  /** Lifts a `MountAction` from one Message universe to another by mapping its
87
71
  * dispatched Messages through a transform. Used by Submodel components to
@@ -1 +1 @@
1
- {"version":3,"file":"nativeInnerHtml.d.ts","sourceRoot":"","sources":["../src/nativeInnerHtml.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,OAAO,KAAG,MAGtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,OAAO,MAAM,KAAG,IAEtE,CAAA"}
1
+ {"version":3,"file":"nativeInnerHtml.d.ts","sourceRoot":"","sources":["../src/nativeInnerHtml.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAa,OAAO,KAAG,MAGtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,YAAa,OAAO,SAAS,MAAM,KAAG,IAEtE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,sFAAsF;AACtF,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAIpD,CAAA;AAEJ,8FAA8F;AAC9F,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAIvD,CAAA;AAEJ,yCAAyC;AACzC,eAAO,MAAM,IAAI,QAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CACA,CAAA;AAE1C,4CAA4C;AAC5C,eAAO,MAAM,OAAO,QAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CACA,CAAA;AAE7C,yDAAyD;AACzD,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACL,CAAA;AAEjD;4GAC4G;AAC5G,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAGrD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,sFAAsF;AACtF,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAIpD,CAAA;AAEJ,8FAA8F;AAC9F,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAIvD,CAAA;AAEJ,yCAAyC;AACzC,eAAO,MAAM,IAAI,QAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CACA,CAAA;AAE1C,4CAA4C;AAC5C,eAAO,MAAM,OAAO,QAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CACA,CAAA;AAE7C,yDAAyD;AACzD,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CACL,CAAA;AAEjD;4GAC4G;AAC5G,eAAO,MAAM,OAAO,SAAU,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAGrD,CAAA"}
@@ -2,7 +2,7 @@ import { Schema as S } from 'effect';
2
2
  /** Union of `Internal` and `External` URL request types. */
3
3
  export declare const UrlRequest: import("../schema/index.js").TaggedUnion<{
4
4
  readonly Internal: {
5
- readonly url: S.Struct<{
5
+ url: S.Struct<{
6
6
  readonly protocol: S.String;
7
7
  readonly host: S.String;
8
8
  readonly port: S.Option<S.String>;
@@ -12,7 +12,7 @@ export declare const UrlRequest: import("../schema/index.js").TaggedUnion<{
12
12
  }>;
13
13
  };
14
14
  readonly External: {
15
- readonly href: S.String;
15
+ href: S.String;
16
16
  };
17
17
  }>;
18
18
  /** Union of `Internal` and `External` URL request types. */
@@ -1 +1 @@
1
- {"version":3,"file":"urlRequest.d.ts","sourceRoot":"","sources":["../../src/navigation/urlRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAKpC,4DAA4D;AAC5D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EAGrB,CAAA;AACF,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA"}
1
+ {"version":3,"file":"urlRequest.d.ts","sourceRoot":"","sources":["../../src/navigation/urlRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAKpC,4DAA4D;AAC5D,eAAO,MAAM,UAAU;;QACT,GAAG;;;;;;;;;;Q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KAAK,EAAE,OAAO,CAAC,SACvB,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,IAAI,CAcjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"propertyProvenance.d.ts","sourceRoot":"","sources":["../src/propertyProvenance.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,MAAM,KACZ,IAIF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,MAAM,KACX,IAOF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,MAAM,KACX,IAEF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,KACnD,OASF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACpD,MAAM,MAAM,KACX,OAKF,CAAA"}
1
+ {"version":3,"file":"propertyProvenance.d.ts","sourceRoot":"","sources":["../src/propertyProvenance.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,UACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SACvB,MAAM,KACZ,IAIF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,UAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACxB,MAAM,KACX,IAOF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,UAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACxB,MAAM,KACX,IAEF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,UACvB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,KACnD,OASF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UACxB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,QAC9C,MAAM,KACX,OAKF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"propsModule.d.ts","sourceRoot":"","sources":["../src/propsModule.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA0NjD,eAAO,MAAM,WAAW,EAAE,MAIzB,CAAA"}
1
+ {"version":3,"file":"propsModule.d.ts","sourceRoot":"","sources":["../src/propsModule.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAyNjD,eAAO,MAAM,WAAW,EAAE,MAIzB,CAAA"}
@@ -13,9 +13,9 @@ const writeProperty = (element, name, value) => {
13
13
  });
14
14
  }
15
15
  else {
16
- if (!Reflect.set(element, name, value)) {
17
- throw new TypeError(`[foldkit] Cannot assign DOM property ${name}.`);
18
- }
16
+ /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
17
+ const elementProperties = element;
18
+ elementProperties[name] = value;
19
19
  }
20
20
  };
21
21
  const isAutonomousCustomElement = (element) => (element.namespaceURI === null || element.namespaceURI === HTML_NAMESPACE) &&