@wardic/foldkit 0.0.0-stage → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/THIRD_PARTY_NOTICES.md +145 -0
  4. package/dist/AnimationControls.d.ts +37 -0
  5. package/dist/AnimationControls.d.ts.map +1 -0
  6. package/dist/AnimationControls.js +37 -0
  7. package/dist/AnimationControls.js.map +1 -0
  8. package/dist/AnimationScope.d.ts +20 -0
  9. package/dist/AnimationScope.d.ts.map +1 -0
  10. package/dist/AnimationScope.js +20 -0
  11. package/dist/AnimationScope.js.map +1 -0
  12. package/dist/DragControls.d.ts +25 -0
  13. package/dist/DragControls.d.ts.map +1 -0
  14. package/dist/DragControls.js +21 -0
  15. package/dist/DragControls.js.map +1 -0
  16. package/dist/Features.d.ts +36 -0
  17. package/dist/Features.d.ts.map +1 -0
  18. package/dist/Features.js +44 -0
  19. package/dist/Features.js.map +1 -0
  20. package/dist/Ward.d.ts +301 -0
  21. package/dist/Ward.d.ts.map +1 -0
  22. package/dist/Ward.js +6 -0
  23. package/dist/Ward.js.map +1 -0
  24. package/dist/Wardic.d.ts +363 -0
  25. package/dist/Wardic.d.ts.map +1 -0
  26. package/dist/Wardic.js +85 -0
  27. package/dist/Wardic.js.map +1 -0
  28. package/dist/index.d.ts +15 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +20 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/internal/builder.d.ts +8 -0
  33. package/dist/internal/builder.d.ts.map +1 -0
  34. package/dist/internal/builder.js +242 -0
  35. package/dist/internal/builder.js.map +1 -0
  36. package/dist/internal/commands.d.ts +143 -0
  37. package/dist/internal/commands.d.ts.map +1 -0
  38. package/dist/internal/commands.js +242 -0
  39. package/dist/internal/commands.js.map +1 -0
  40. package/dist/internal/delivery.d.ts +44 -0
  41. package/dist/internal/delivery.d.ts.map +1 -0
  42. package/dist/internal/delivery.js +85 -0
  43. package/dist/internal/delivery.js.map +1 -0
  44. package/dist/internal/dev.d.ts +10 -0
  45. package/dist/internal/dev.d.ts.map +1 -0
  46. package/dist/internal/dev.js +10 -0
  47. package/dist/internal/dev.js.map +1 -0
  48. package/dist/internal/dev.production.d.ts +8 -0
  49. package/dist/internal/dev.production.d.ts.map +1 -0
  50. package/dist/internal/dev.production.js +8 -0
  51. package/dist/internal/dev.production.js.map +1 -0
  52. package/dist/internal/drag.d.ts +66 -0
  53. package/dist/internal/drag.d.ts.map +1 -0
  54. package/dist/internal/drag.js +71 -0
  55. package/dist/internal/drag.js.map +1 -0
  56. package/dist/internal/element.d.ts +59 -0
  57. package/dist/internal/element.d.ts.map +1 -0
  58. package/dist/internal/element.js +582 -0
  59. package/dist/internal/element.js.map +1 -0
  60. package/dist/internal/gestures.d.ts +62 -0
  61. package/dist/internal/gestures.d.ts.map +1 -0
  62. package/dist/internal/gestures.js +109 -0
  63. package/dist/internal/gestures.js.map +1 -0
  64. package/dist/internal/hydrate.d.ts +5 -0
  65. package/dist/internal/hydrate.d.ts.map +1 -0
  66. package/dist/internal/hydrate.js +27 -0
  67. package/dist/internal/hydrate.js.map +1 -0
  68. package/dist/internal/keys.d.ts +21 -0
  69. package/dist/internal/keys.d.ts.map +1 -0
  70. package/dist/internal/keys.js +12 -0
  71. package/dist/internal/keys.js.map +1 -0
  72. package/dist/internal/layout.d.ts +29 -0
  73. package/dist/internal/layout.d.ts.map +1 -0
  74. package/dist/internal/layout.js +88 -0
  75. package/dist/internal/layout.js.map +1 -0
  76. package/dist/internal/mount.d.ts +22 -0
  77. package/dist/internal/mount.d.ts.map +1 -0
  78. package/dist/internal/mount.js +152 -0
  79. package/dist/internal/mount.js.map +1 -0
  80. package/dist/internal/presence.d.ts +33 -0
  81. package/dist/internal/presence.d.ts.map +1 -0
  82. package/dist/internal/presence.js +338 -0
  83. package/dist/internal/presence.js.map +1 -0
  84. package/dist/internal/reactivity.d.ts +15 -0
  85. package/dist/internal/reactivity.d.ts.map +1 -0
  86. package/dist/internal/reactivity.js +26 -0
  87. package/dist/internal/reactivity.js.map +1 -0
  88. package/dist/internal/reorder.d.ts +47 -0
  89. package/dist/internal/reorder.d.ts.map +1 -0
  90. package/dist/internal/reorder.js +250 -0
  91. package/dist/internal/reorder.js.map +1 -0
  92. package/dist/internal/scope.d.ts +28 -0
  93. package/dist/internal/scope.d.ts.map +1 -0
  94. package/dist/internal/scope.js +44 -0
  95. package/dist/internal/scope.js.map +1 -0
  96. package/dist/internal/server.d.ts +13 -0
  97. package/dist/internal/server.d.ts.map +1 -0
  98. package/dist/internal/server.js +13 -0
  99. package/dist/internal/server.js.map +1 -0
  100. package/dist/internal/server.node.d.ts +8 -0
  101. package/dist/internal/server.node.d.ts.map +1 -0
  102. package/dist/internal/server.node.js +8 -0
  103. package/dist/internal/server.node.js.map +1 -0
  104. package/dist/internal/services.d.ts +231 -0
  105. package/dist/internal/services.d.ts.map +1 -0
  106. package/dist/internal/services.js +350 -0
  107. package/dist/internal/services.js.map +1 -0
  108. package/dist/internal/tree.d.ts +71 -0
  109. package/dist/internal/tree.d.ts.map +1 -0
  110. package/dist/internal/tree.js +207 -0
  111. package/dist/internal/tree.js.map +1 -0
  112. package/dist/internal/variant-node.d.ts +62 -0
  113. package/dist/internal/variant-node.d.ts.map +1 -0
  114. package/dist/internal/variant-node.js +279 -0
  115. package/dist/internal/variant-node.js.map +1 -0
  116. package/dist/internal/view-transition.d.ts +10 -0
  117. package/dist/internal/view-transition.d.ts.map +1 -0
  118. package/dist/internal/view-transition.js +36 -0
  119. package/dist/internal/view-transition.js.map +1 -0
  120. package/dist/internal/walk.d.ts +26 -0
  121. package/dist/internal/walk.d.ts.map +1 -0
  122. package/dist/internal/walk.js +162 -0
  123. package/dist/internal/walk.js.map +1 -0
  124. package/package.json +99 -4
  125. package/src/AnimationControls.ts +46 -0
  126. package/src/AnimationScope.ts +19 -0
  127. package/src/DragControls.ts +27 -0
  128. package/src/Features.ts +45 -0
  129. package/src/Ward.ts +434 -0
  130. package/src/Wardic.ts +410 -0
  131. package/src/index.ts +20 -0
  132. package/src/internal/builder.ts +262 -0
  133. package/src/internal/commands.ts +359 -0
  134. package/src/internal/delivery.ts +116 -0
  135. package/src/internal/dev.production.ts +7 -0
  136. package/src/internal/dev.ts +9 -0
  137. package/src/internal/drag.ts +136 -0
  138. package/src/internal/element.ts +668 -0
  139. package/src/internal/gestures.ts +184 -0
  140. package/src/internal/hydrate.ts +29 -0
  141. package/src/internal/keys.ts +19 -0
  142. package/src/internal/layout.ts +109 -0
  143. package/src/internal/mount.ts +181 -0
  144. package/src/internal/presence.ts +362 -0
  145. package/src/internal/reactivity.ts +45 -0
  146. package/src/internal/reorder.ts +313 -0
  147. package/src/internal/scope.ts +60 -0
  148. package/src/internal/server.node.ts +7 -0
  149. package/src/internal/server.ts +12 -0
  150. package/src/internal/services.ts +508 -0
  151. package/src/internal/tree.ts +230 -0
  152. package/src/internal/variant-node.ts +352 -0
  153. package/src/internal/view-transition.ts +43 -0
  154. package/src/internal/walk.ts +211 -0
@@ -0,0 +1,363 @@
1
+ /**
2
+ * Wardic for Foldkit (ADR-0071, #561): a **Handle** made once per program with {@link make}, whose
3
+ * `html(h)` gives a view the builder `w`. A `w.*` element takes Foldkit's attributes and Wardic's
4
+ * (`w.Initial`, `w.Animate`, `w.Transition`, `w.Style`), animates its `Animate` target from `Initial`
5
+ * as it mounts, Retargets on a render that changes its target and holds through one that doesn't. The
6
+ * first `w.*` element to mount builds Wardic's services on the Handle's `env`, which every element
7
+ * shares until the last has left; `w.Provider(options)` on the `w.*` element at the top names the root
8
+ * the subtree options hang on.
9
+ *
10
+ * @example
11
+ * // src/lib/wardic.ts
12
+ * import { DomLive } from "@wardic/dom"
13
+ * import * as Wardic from "@wardic/foldkit/Wardic"
14
+ *
15
+ * export const wardic = Wardic.make({ env: DomLive })
16
+ *
17
+ * // src/view.ts
18
+ * const view = (model: Model, h: HtmlBuilder<Message>): Html => {
19
+ * const w = wardic.html(h)
20
+ * return w.div([h.Class("app")], [
21
+ * w.div([h.Class("card"), w.Initial({ opacity: 0, y: 8 }), w.Animate({ opacity: 1, y: 0 }), w.Transition({ duration: 0.3 })], [model.title]),
22
+ * ])
23
+ * }
24
+ *
25
+ * @module
26
+ */
27
+ import * as Arc from "@wardic/core/Arc";
28
+ import * as Stagger from "@wardic/core/Stagger";
29
+ import type * as WardicServices from "@wardic/core/unstable/WardicServices";
30
+ import type * as Feature from "@wardic/dom/unstable/Feature";
31
+ import type * as WardConfig from "@wardic/dom/unstable/WardConfig";
32
+ import type * as Layer from "effect/Layer";
33
+ import type * as FoldkitHtml from "foldkit/html";
34
+ import type { MountAction } from "foldkit/mount";
35
+ import type * as FoldkitRuntime from "foldkit/runtime";
36
+ import type * as AnimationScope from "./AnimationScope.ts";
37
+ import type * as Ward from "./Ward.ts";
38
+ import { type Attributes } from "./internal/builder.ts";
39
+ import { HANDLE, type Wardic as WardicTag } from "./internal/commands.ts";
40
+ export { animate, animateLayout, type AnimateLayoutOptions, type AnimateOptions, AnimationFailed, type AnimationEnd, LayoutFailed, pointer, type PointerOptions, type PointerValues, provide, scroll, ScrollFailed, type ScrollOptions, type Sequence, type SequenceOptions, Wardic } from "./internal/commands.ts";
41
+ /** What {@link make} takes. */
42
+ export interface MakeOptions<F> {
43
+ /** Wardic's Environment: `@wardic/dom`'s `DomLive` in a browser. Required, as a Solid provider's `env` is (#791, Q1). */
44
+ readonly env: WardicServices.WardicEnv;
45
+ /**
46
+ * The **Features** its elements have (#511, ADR-0067 *Amendment (#516)*): given at once, or loads
47
+ * (`() => import(…)`), as Solid's `createWardic` takes them. Without any, the base props alone: a
48
+ * gesture or layout attribute is then a type error naming its Feature (from slice 3 on).
49
+ */
50
+ readonly features?: F | undefined;
51
+ /** The app-wide settings (ADR-0062; ADR-0071 decision 22): what `w.Config(…)` takes, under every subtree's. */
52
+ readonly config?: Ward.ConfigOptions | undefined;
53
+ /**
54
+ * What runs a Measure pass (decision 30; #792, Q10 and Q17): `"patch"` (the default), a pass after
55
+ * every patch that changed the DOM, found by a `MutationObserver` on the `w.Provider()` element, else
56
+ * the document's body; `"declared"`, only a `w.LayoutDependency` change and `Wardic.animateLayout`.
57
+ */
58
+ readonly layoutTrigger?: "patch" | "declared" | undefined;
59
+ /** Attributes the observer watches beside `class` and `hidden` (decision 30): those the app's CSS lays out by. */
60
+ readonly layoutAttributes?: ReadonlyArray<string> | undefined;
61
+ /**
62
+ * **Appear animations** on a server: on by default, under `w.Provider()`, whose element renders their
63
+ * rules; `false` renders none; `"explain"` says, at Warning, why each element that doesn't play waits
64
+ * for the JavaScript.
65
+ */
66
+ readonly appear?: boolean | "explain" | undefined;
67
+ /** The nonce the page's Content Security Policy gives inline styles: the rules' `<style>` carries it. */
68
+ readonly nonce?: string | undefined;
69
+ }
70
+ /** A `w.*` element's function: `h.div`'s shape, taking Wardic's attributes too. */
71
+ export type ElementFunction<Message> = (attributes: Attributes<Message>, children?: ReadonlyArray<Ward.Child>) => FoldkitHtml.Html;
72
+ /** The phantom that carries a Handle's Features on its builder. */
73
+ declare const FEATURES: unique symbol;
74
+ /**
75
+ * A Feature's attribute factory on a builder whose Handle has Features `F` (ADR-0071 *Amendment
76
+ * (#516)*; #793, Q11): the factory when `F` names the Feature `N`; else what names the missing one, so
77
+ * calling it is a type error reading `NeedsFeature<"hover">`.
78
+ */
79
+ type Needs<F, N extends Feature.PropFeature, Factory> = N extends Feature.PropFeatureNames<F> ? Factory : Feature.NeedsFeature<N>;
80
+ /**
81
+ * The builder `w` of `wardic.html(h)`: `h`'s element factories, each taking Wardic's attributes beside
82
+ * Foldkit's; `keyed`; the `attributes` bundle, for an element `w` doesn't make (a custom element, a
83
+ * component library's); and Wardic's attribute factories. Foldkit's own attributes stay on `h`.
84
+ */
85
+ export type Html<Message, F = never> = {
86
+ readonly [Tag in FoldkitHtml.TagName]: ElementFunction<Message>;
87
+ } & Readonly<{
88
+ readonly [FEATURES]?: F;
89
+ /** `w.keyed(tag)(key, attributes, children)`: a keyed `w.*` element, as `h.keyed`'s. */
90
+ keyed: (tag: FoldkitHtml.TagName) => (key: string, attributes: Attributes<Message>, children?: ReadonlyArray<Ward.Child>) => FoldkitHtml.Html;
91
+ /**
92
+ * The **Bundle** (ADR-0071, decision 18): a Ward's attributes for any element, `h.div([...w.attributes({ … })])`.
93
+ * It takes the element's own Mount and fuses it with Wardic's, since one element has one `OnMount`.
94
+ * An element it's on isn't stamped, so key such an element (P2).
95
+ */
96
+ attributes: (bundle: Ward.Bundle<Message>) => ReadonlyArray<FoldkitHtml.Attribute<Message> | FoldkitHtml.ChildAttribute>;
97
+ /**
98
+ * The **Provider attribute** (decision 9, *Amendment (#791)*): on the `w.*` element at the top of the
99
+ * view, when the subtree options (slice 2's) are wanted: that element is the root they hang on. With
100
+ * none, the first `w.*` element to mount builds Wardic's services, shared until the last has left.
101
+ */
102
+ Provider: (options?: Ward.ProviderOptions) => Ward.Attribute;
103
+ /**
104
+ * Where the element starts: values, or `false` to start at `Animate` (Motion's `initial`). Read once,
105
+ * at mount, as Motion reads it: give the same `Initial` on every render, since a view renders it as
106
+ * the element's Starting style, and a changed one would be written over what Wardic draws.
107
+ */
108
+ Initial: (value: Ward.Config["initial"]) => Ward.Attribute;
109
+ /** Where the element animates to (Motion's `animate`): a change Retargets it from wherever it is. */
110
+ Animate: (value: Ward.Config["animate"]) => Ward.Attribute;
111
+ /** How it gets there (Motion's `transition`). */
112
+ Transition: (value: Ward.Config["transition"]) => Ward.Attribute;
113
+ /**
114
+ * The element's `style` as Wardic sees it (Motion's `style`): its base values, where a key returns
115
+ * when nothing animates it. A key in both `w.Style` and `h.Style` is an error in development.
116
+ */
117
+ Style: (value: Ward.Config["style"]) => Ward.Attribute;
118
+ /**
119
+ * Named targets `Initial`, `Animate` and the rest can name (Motion's `variants`). A child with
120
+ * `Variants` and no `Animate` of its own follows the name its nearest Wardic ancestor hands down,
121
+ * staggered by that ancestor's `Transition`.
122
+ */
123
+ Variants: (value: Ward.Config["variants"]) => Ward.Attribute;
124
+ /** What the element's dynamic variants resolve with (Motion's `custom`). */
125
+ Custom: (value: Ward.Config["custom"]) => Ward.Attribute;
126
+ /** `false` keeps the element out of its ancestor's variants (Motion's `inherit`). */
127
+ Inherit: (value: Ward.Config["inherit"]) => Ward.Attribute;
128
+ /** `false` keeps the element's mount animation off a server render's **Appear animations**: it starts when the script runs. */
129
+ Appear: (value: Ward.Config["appear"]) => Ward.Attribute;
130
+ /** The subtree's settings (Motion's `MotionConfig`), this element's included, over the nearest ancestor's and the Handle's. */
131
+ Config: (options: Ward.ConfigOptions) => Ward.Attribute;
132
+ /**
133
+ * The **Animation scope** this element is (`AnimationScope.make()`'s): a Command's `Wardic.animate(…, {
134
+ * scope })` looks its selectors up inside it, and the element's release stops the animations started
135
+ * in the scope where they are.
136
+ */
137
+ AnimationScope: (scope: AnimationScope.AnimationScope) => Ward.Attribute;
138
+ /** Sent as an animation of the element starts, with what it animates to (Motion's `onAnimationStart`). */
139
+ OnAnimationStart: (handler: Ward.Handler<Message, Ward.AnimationDefinition>) => Ward.Attribute;
140
+ /** Sent as that animation lands (Motion's `onAnimationComplete`); not for one a new target interrupted. */
141
+ OnAnimationComplete: (handler: Ward.Handler<Message, Ward.AnimationDefinition>) => Ward.Attribute;
142
+ /**
143
+ * The element's text, from an Atom, written outside the patch as it changes (a **Live value**, decision
144
+ * 16): the element takes no children from the view, an error in development. Format with a derived Atom.
145
+ */
146
+ Text: (atom: Ward.Config["text"]) => Ward.Attribute;
147
+ /** The element's values each committed frame, set on a writable Atom (Motion's `onUpdate`): a copy per frame. */
148
+ OnUpdate: (atom: Ward.Config["onUpdate"]) => Ward.Attribute;
149
+ /** The element's transform from its values and the generated string (Motion's `transformTemplate`). Hoist the function. */
150
+ TransformTemplate: (template: Ward.Config["transformTemplate"]) => Ward.Attribute;
151
+ /**
152
+ * Where the element animates to as it leaves, under a `w.Presence` above it (Motion's `exit`): values,
153
+ * a variant name, or a dynamic variant resolved with the presence's `custom`. Its presence keeps it on
154
+ * the page, in its place, until it lands.
155
+ */
156
+ Exit: (value: Ward.Config["exit"]) => Ward.Attribute;
157
+ /**
158
+ * The **Presence** (ADR-0007; decision 29), on the leavers' parent: each child Foldkit removes stays
159
+ * where it was while its `Exit` plays, in Motion's order through the patches that follow, and one that
160
+ * comes back under its key mid-exit takes over from where the leaver is. Needs `Features.presence`.
161
+ * Give it on the element's first render.
162
+ */
163
+ Presence: (options?: Ward.PresenceOptions<Message>) => Ward.Attribute;
164
+ /**
165
+ * The element is a **Projection node** (ADR-0009; Motion's `layout`): it animates from where it was
166
+ * to where a patch put it, measured by a **Measure pass** after every patch that changed the DOM
167
+ * (decision 30). `true` (the default), or a Layout mode: `"position"`, `"size"`, `"preserve-aspect"`.
168
+ * Needs `Features.layout`.
169
+ */
170
+ Layout: Needs<F, "layout", (value?: Ward.Config["layout"]) => Ward.Attribute>;
171
+ /** A **Shared layout** id (ADR-0010; Motion's `layoutId`): an element with the same one, mounting as this leaves, flies from it. */
172
+ LayoutId: Needs<F, "layout", (id: Ward.Config["layoutId"]) => Ward.Attribute>;
173
+ /** A value whose change asks for a Measure pass (Motion's `layoutDependency`): the trigger under `layoutTrigger: "declared"`. */
174
+ LayoutDependency: Needs<F, "layout", (value: Ward.Config["layoutDependency"]) => Ward.Attribute>;
175
+ /** The element scrolls, and its scroll isn't read as its children moving (Motion's `layoutScroll`). */
176
+ LayoutScroll: Needs<F, "layout", (value?: Ward.Config["layoutScroll"]) => Ward.Attribute>;
177
+ /** A stable sub-root of the projection tree (ADR-0013; Motion's `layoutRoot`): the layout animations inside it anchor to it, and it never animates its own. */
178
+ LayoutRoot: Needs<F, "layout", (value?: Ward.Config["layoutRoot"]) => Ward.Attribute>;
179
+ /**
180
+ * Whether a `LayoutId` handover onto this element crossfades the two (Motion's `layoutCrossfade`):
181
+ * `false` hides the twin it takes over from as the handover starts, and it moves at its own opacity,
182
+ * one element flying rather than two blending.
183
+ */
184
+ LayoutCrossfade: Needs<F, "layout", (value?: Ward.Config["layoutCrossfade"]) => Ward.Attribute>;
185
+ /** A **Layout group** (#432; Motion's `LayoutGroup`): the namespace of the `LayoutId`s under the element, read once. */
186
+ LayoutGroup: Needs<F, "layout", (options?: Ward.LayoutGroupOptions) => Ward.Attribute>;
187
+ /** Sent at the frame a layout animation's first step is painted (Motion's `onLayoutAnimationStart`). */
188
+ OnLayoutAnimationStart: Needs<F, "layout", (handler: Ward.Handler<Message, void>) => Ward.Attribute>;
189
+ /** Sent once it has landed (Motion's `onLayoutAnimationComplete`). */
190
+ OnLayoutAnimationComplete: Needs<F, "layout", (handler: Ward.Handler<Message, void>) => Ward.Attribute>;
191
+ /** Called as each measure of the element begins (Motion's `onBeforeLayoutMeasure`): a plain function, which can't send (decision 24). */
192
+ OnBeforeLayoutMeasure: Needs<F, "layout", (fn: Ward.Config["onBeforeLayoutMeasure"]) => Ward.Attribute>;
193
+ /** Called with the element's box after each measure, and the one before (Motion's `onLayoutMeasure`): a plain function (decision 24). */
194
+ OnLayoutMeasure: Needs<F, "layout", (fn: Ward.Config["onLayoutMeasure"]) => Ward.Attribute>;
195
+ /**
196
+ * A **Reorder group** (ADR-0020; decision 28; #793, Q11): the element's keyed `w.ReorderItem` children
197
+ * are put in order by dragging them, or from the keyboard (ADR-0037). The order lives in the Model:
198
+ * `values` is its, and `onReorder` sends a Message with each new order; each item is a layout element
199
+ * dragged on the group's axis and raised while it's in hand. Needs `Features.layout` and `Features.drag`.
200
+ */
201
+ ReorderGroup: Needs<F, "layout", Needs<F, "drag", <V>(options: Ward.ReorderGroupOptions<Message, V>) => Ward.Attribute>>;
202
+ /**
203
+ * An item of the group above it, with its `value` in the group's `values`, read once: on a keyed element
204
+ * (`w.keyed("li")(key, …)`), which a render reorders by its key. `w.Layout("position")` beside it moves
205
+ * its place alone, as Motion's `Reorder.Item` takes.
206
+ */
207
+ ReorderItem: Needs<F, "layout", Needs<F, "drag", (value: unknown) => Ward.Attribute>>;
208
+ /**
209
+ * Where the element animates while the pointer is over it, and back when it leaves (Motion's
210
+ * `whileHover`): values or a variant name, which Variant children follow too. Needs `Features.hover`.
211
+ */
212
+ WhileHover: Needs<F, "hover", (value: Ward.Config["whileHover"]) => Ward.Attribute>;
213
+ /** Sent as the pointer comes over the element, with the DOM's event and its viewport point (Motion's `onHoverStart`). A touch never hovers. */
214
+ OnHoverStart: Needs<F, "hover", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.PointInfo>) => Ward.Attribute>;
215
+ /** Sent as the pointer leaves the element (Motion's `onHoverEnd`). */
216
+ OnHoverEnd: Needs<F, "hover", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.PointInfo>) => Ward.Attribute>;
217
+ /**
218
+ * Where the element animates while it's pressed, by a pointer or by Enter or Space while it has
219
+ * focus (Motion's `whileTap`; a **Keyboard press**). An element that can't take focus is made
220
+ * focusable. Needs `Features.press`.
221
+ */
222
+ WhileTap: Needs<F, "press", (value: Ward.Config["whileTap"]) => Ward.Attribute>;
223
+ /** `{ tap: false }` keeps a press to this element (a **Press claim**): a pressable ancestor neither plays its `WhileTap` nor hears the tap (Motion's `propagate`). */
224
+ Propagate: Needs<F, "press", (options: Ward.Config["propagate"]) => Ward.Attribute>;
225
+ /** Sent as a press begins: a pointer going down, or Enter or Space while focused (`info.input` says which; Motion's `onTapStart`). */
226
+ OnTapStart: Needs<F, "press", (handler: Ward.GestureHandler<Message, Ward.PressEvent, Ward.PressInfo>) => Ward.Attribute>;
227
+ /** Sent as that press ends on the element, or its key comes up (Motion's `onTap`). */
228
+ OnTap: Needs<F, "press", (handler: Ward.GestureHandler<Message, Ward.PressEvent, Ward.PressInfo>) => Ward.Attribute>;
229
+ /** Sent as that press ends elsewhere, or is cancelled; a press a drag took over is neither (Motion's `onTapCancel`). */
230
+ OnTapCancel: Needs<F, "press", (handler: Ward.GestureHandler<Message, Ward.PressEvent, Ward.PressInfo>) => Ward.Attribute>;
231
+ /** Where the element animates while it has the keyboard's focus, as `:focus-visible` shows it, not a click's (Motion's `whileFocus`). Needs `Features.focus`. */
232
+ WhileFocus: Needs<F, "focus", (value: Ward.Config["whileFocus"]) => Ward.Attribute>;
233
+ /** Where the element animates while it's in view, as `Viewport` defines it (Motion's `whileInView`). Needs `Features.inView`. */
234
+ WhileInView: Needs<F, "inView", (value: Ward.Config["whileInView"]) => Ward.Attribute>;
235
+ /** What "in view" means (Motion's `viewport`): `once`, `margin`, `amount`, and `root` as `"parent"` or a selector. */
236
+ Viewport: Needs<F, "inView", (options: Ward.ViewportOptions) => Ward.Attribute>;
237
+ /** Sent as the element comes into view, with the browser's `IntersectionObserverEntry` (Motion's `onViewportEnter`). */
238
+ OnViewportEnter: Needs<F, "inView", (handler: Ward.Handler<Message, IntersectionObserverEntry>) => Ward.Attribute>;
239
+ /** Sent as it leaves the view; never after the first entry under `once` (Motion's `onViewportLeave`). */
240
+ OnViewportLeave: Needs<F, "inView", (handler: Ward.Handler<Message, IntersectionObserverEntry>) => Ward.Attribute>;
241
+ /**
242
+ * The element drags (ADR-0004; Motion's `drag`): `true` (the default) on both axes, `"x"` or `"y"` on
243
+ * one. On release it carries on at the speed it was let go, a Fling, and slows to a stop. It gets
244
+ * `touch-action`, `user-select: none` and `draggable="false"` as its drag starts, under its own
245
+ * `h.Style`. The drag's options (`Drag` to `DragListener`, `DragControls`) are read as its track starts,
246
+ * at the first render that gives `Drag`, and kept: give a changed one on a new key. Needs `Features.drag`.
247
+ */
248
+ Drag: Needs<F, "drag", (value?: Ward.Config["drag"]) => Ward.Attribute>;
249
+ /** Where the element animates while it's dragged, and back once it's let go (Motion's `whileDrag`); a name reaches its Variant children. */
250
+ WhileDrag: Needs<F, "drag", (value: Ward.Config["whileDrag"]) => Ward.Attribute>;
251
+ /** Where it can be dragged to (Motion's `dragConstraints`): a box of pixels, `"parent"`, a selector resolved under the view at each measure, or `false`. */
252
+ DragConstraints: Needs<F, "drag", (value: Ward.DragConstraints) => Ward.Attribute>;
253
+ /** How far past `DragConstraints` it can be pulled, 0 to 1: 0 stops it at the edge; 0.35 by default (Motion's `dragElastic`). */
254
+ DragElastic: Needs<F, "drag", (value: Ward.Config["dragElastic"]) => Ward.Attribute>;
255
+ /** `false` stops the element where it's let go, instead of carrying on at the speed it was let go (Motion's `dragMomentum`). */
256
+ DragMomentum: Needs<F, "drag", (value: Ward.Config["dragMomentum"]) => Ward.Attribute>;
257
+ /** Springs the element back to where it started when it's let go (Motion's `dragSnapToOrigin`). */
258
+ DragSnapToOrigin: Needs<F, "drag", (value?: Ward.Config["dragSnapToOrigin"]) => Ward.Attribute>;
259
+ /** How it carries on after it's let go: Motion's inertia options (`power`, `timeConstant`, `bounceStiffness`, …), over Motion's defaults (`dragTransition`). */
260
+ DragTransition: Needs<F, "drag", (value: Ward.Config["dragTransition"]) => Ward.Attribute>;
261
+ /** Lets a draggable ancestor drag along with this element, instead of only the innermost dragging (Motion's `dragPropagation`; a **Drag claim** not taken). */
262
+ DragPropagation: Needs<F, "drag", (value?: Ward.Config["dragPropagation"]) => Ward.Attribute>;
263
+ /** Waits until a drag has moved 10 px, then keeps it to the axis it moved on; `OnDirectionLock` says which (Motion's `dragDirectionLock`). */
264
+ DragDirectionLock: Needs<F, "drag", (value?: Ward.Config["dragDirectionLock"]) => Ward.Attribute>;
265
+ /** `false`: pressing the element itself doesn't drag it, only its `DragControls` do, and it gets none of the drag's styles (Motion's `dragListener`). */
266
+ DragListener: Needs<F, "drag", (value: Ward.Config["dragListener"]) => Ward.Attribute>;
267
+ /** The **Drag controls** that start this element's drag from elsewhere: `DragControls.make()`'s (Motion's `dragControls`). */
268
+ DragControls: Needs<F, "drag", (controls: Ward.DragControls) => Ward.Attribute>;
269
+ /**
270
+ * The `StartsDrag` element (#793, Q8): a pointer pressed on it starts the drags of every element given
271
+ * `controls`, with `options` (`snapToCursor`, `distanceThreshold`). Give it `touch-action: none`, or a
272
+ * touch on it scrolls the page.
273
+ */
274
+ StartsDrag: Needs<F, "drag", (controls: Ward.DragControls, options?: Ward.StartOptions) => Ward.Attribute>;
275
+ /** With a container in `DragConstraints`: called with the bounds measured against it at each measure; return other bounds to use them (a plain function, decision 24; Motion's `onMeasureDragConstraints`). */
276
+ OnMeasureDragConstraints: Needs<F, "drag", (fn: Ward.Config["onMeasureDragConstraints"]) => Ward.Attribute>;
277
+ /** Sent as a drag of the element starts, with the DOM's event and the drag's info (Motion's `onDragStart`). */
278
+ OnDragStart: Needs<F, "drag", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
279
+ /** Sent as the drag moves: at its start, and each move after (Motion's `onDrag`). */
280
+ OnDrag: Needs<F, "drag", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
281
+ /** Sent as the drag is let go; not for one its controls cancelled (Motion's `onDragEnd`). */
282
+ OnDragEnd: Needs<F, "drag", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
283
+ /** Sent as the element comes to rest after it's let go; not when a new grab stops it (Motion's `onDragTransitionEnd`). */
284
+ OnDragTransitionEnd: Needs<F, "drag", (handler: Ward.Handler<Message, void>) => Ward.Attribute>;
285
+ /** With `DragDirectionLock`: sent with the axis a drag locked to, before `OnDragStart` (Motion's `onDirectionLock`). */
286
+ OnDirectionLock: Needs<F, "drag", (handler: Ward.Handler<Message, "x" | "y">) => Ward.Attribute>;
287
+ /**
288
+ * Sent as a pointer goes down on the element, ready to pan, with its point (Motion's `onPanSessionStart`).
289
+ * A pan moves nothing itself: read its offset and velocity in `OnPan`. On a touch screen, give the
290
+ * element a `touch-action`, such as `pan-y` for a sideways pan, or the page's scroll takes the gesture.
291
+ * Needs `Features.pan`.
292
+ */
293
+ OnPanSessionStart: Needs<F, "pan", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.PointInfo>) => Ward.Attribute>;
294
+ /** Sent as a pan starts, past its threshold, with the DOM's event and the pan's info (Motion's `onPanStart`). */
295
+ OnPanStart: Needs<F, "pan", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
296
+ /** Sent as the pan moves: at its start, and each move after (Motion's `onPan`). */
297
+ OnPan: Needs<F, "pan", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
298
+ /** Sent as a pan that started ends, or is cancelled (Motion's `onPanEnd`). */
299
+ OnPanEnd: Needs<F, "pan", (handler: Ward.GestureHandler<Message, PointerEvent, Ward.DragInfo>) => Ward.Attribute>;
300
+ }>;
301
+ /**
302
+ * A **Handle**: one Wardic runtime inside a Foldkit program (ADR-0071, decision 9), typed by its
303
+ * Features `F`. Made once, at module scope.
304
+ */
305
+ export interface Handle<F = never> {
306
+ /** The Handle's mark: what the `Wardic` service carries. */
307
+ readonly [HANDLE]: true;
308
+ /** The builder `w` for a view's `h`, made once per `h`. */
309
+ readonly html: <Message>(h: FoldkitHtml.HtmlBuilder<Message>) => Html<Message, F>;
310
+ /** The provider's raw Mount, for a Scene test to resolve by name (decision 36): `Scene.Mount.resolve(wardic.Provider, Done())`. */
311
+ readonly Provider: MountAction<never>;
312
+ /** An element's raw Mount, for a Scene test to resolve by name (decision 36): one per `w.*` element in the view. */
313
+ readonly Element: MountAction<never>;
314
+ /** A `w.Presence` element's raw Mount, for a Scene test to resolve by name (#792, Q19). */
315
+ readonly Presence: MountAction<never>;
316
+ /** A `w.ReorderGroup` element's raw Mount, for a Scene test to resolve by name (#793, Q18); its items stay `Element`. */
317
+ readonly Reorder: MountAction<never>;
318
+ /**
319
+ * The Layer a program's `resources` takes (decision 9): its Commands then run `Wardic.animate`,
320
+ * `Wardic.animateLayout` and `Wardic.provide`, which need the `Wardic` service, this Handle.
321
+ */
322
+ readonly resources: Layer.Layer<WardicTag>;
323
+ /**
324
+ * The app's `viewTransition` predicate, wrapped (decision 33): `Runtime.makeElement({ viewTransition:
325
+ * wardic.viewTransition(decide) })`. In a render `decide` transitions, layout moves and `layoutId`
326
+ * handovers land at once, for the View Transition's morph to carry; the decision passes through
327
+ * unchanged, and where the document has no `startViewTransition` Wardic animates them itself.
328
+ */
329
+ readonly viewTransition: <Model, Message>(decide: FoldkitRuntime.ViewTransitionConfig<Model, Message>) => FoldkitRuntime.ViewTransitionConfig<Model, Message>;
330
+ /**
331
+ * Foldkit's `Runtime.hydrate`, for a page its `experimental/server`'s `renderToString` rendered: the
332
+ * client entry calls this instead. It moves the **Appear animations**' rules the Provider element
333
+ * rendered into the head, and has the hydration render keep each element's running animation, which
334
+ * its mount takes over where the CSS has got (the **Handoff**); then Foldkit adopts the page.
335
+ */
336
+ readonly hydrate: typeof FoldkitRuntime.hydrate;
337
+ }
338
+ /**
339
+ * Makes a Handle on `env`, with `features` (above). One per program, at module scope: a second
340
+ * `w.Provider()` for it while the first's element is mounted is reported and ignored.
341
+ */
342
+ export declare const make: <const F extends Feature.InstanceFeaturesProp = never>(options: MakeOptions<F>) => Handle<F>;
343
+ /** `stagger(duration, options)`'s options (#436, Motion's `stagger`): `startDelay`, `from` and `ease`, core's. */
344
+ export type StaggerOptions = Stagger.Options;
345
+ /**
346
+ * A stagger for a transition's `delayChildren`, or an `animate`'s `delay` (Motion's `stagger`): `duration`
347
+ * seconds between children, from `options.from`, after `options.startDelay`.
348
+ */
349
+ export declare const stagger: (duration?: number, options?: StaggerOptions) => WardConfig.WardicStagger;
350
+ /** `arc()`'s options (Motion's `ArcOptions`): `strength`, `peak`, `direction` and `rotate`, core's. */
351
+ export type ArcOptions = Arc.Options;
352
+ /**
353
+ * A curved path for a transition's `path` (Motion's `arc()`): `x` and `y` travel along a curve between
354
+ * where they start and their target, on `x`'s transition, in place of two straight lines. Make it once,
355
+ * at module scope: with no `direction`, it remembers which side of the screen it bulged to.
356
+ *
357
+ * @example
358
+ * const toss = arc({ strength: 0.4 })
359
+ * w.img([w.LayoutId("photo"), w.Transition({ layout: { type: "tween", duration: 0.6, path: toss } })])
360
+ */
361
+ export declare const arc: (options?: ArcOptions) => WardConfig.WardicPath;
362
+ export { correctParentTransform, type ElementGiven, transformViewBoxPoint } from "@wardic/dom/unstable/PagePoint";
363
+ //# sourceMappingURL=Wardic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wardic.d.ts","sourceRoot":"","sources":["../src/Wardic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,KAAK,cAAc,MAAM,sCAAsC,CAAA;AAC3E,OAAO,KAAK,KAAK,OAAO,MAAM,8BAA8B,CAAA;AAC5D,OAAO,KAAK,KAAK,UAAU,MAAM,iCAAiC,CAAA;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,KAAK,cAAc,MAAM,iBAAiB,CAAA;AAEtD,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,KAAK,UAAU,EAAa,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAe,KAAK,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAMtF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEnT,+BAA+B;AAC/B,M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gCAA6B,cAAc,KAAQ,UAAU,CAAC,aAAgD,CAAA;AAElI,uGAAuG;AACvG,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAA;AAGpC;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,aAAa,UAAU,KAAQ,UAAU,CAAC,UAA+B,CAAA;AAGzF,OAAO,EAAE,sBAAsB,EAAE,KAAK,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA"}
package/dist/Wardic.js ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Wardic for Foldkit (ADR-0071, #561): a **Handle** made once per program with {@link make}, whose
3
+ * `html(h)` gives a view the builder `w`. A `w.*` element takes Foldkit's attributes and Wardic's
4
+ * (`w.Initial`, `w.Animate`, `w.Transition`, `w.Style`), animates its `Animate` target from `Initial`
5
+ * as it mounts, Retargets on a render that changes its target and holds through one that doesn't. The
6
+ * first `w.*` element to mount builds Wardic's services on the Handle's `env`, which every element
7
+ * shares until the last has left; `w.Provider(options)` on the `w.*` element at the top names the root
8
+ * the subtree options hang on.
9
+ *
10
+ * @example
11
+ * // src/lib/wardic.ts
12
+ * import { DomLive } from "@wardic/dom"
13
+ * import * as Wardic from "@wardic/foldkit/Wardic"
14
+ *
15
+ * export const wardic = Wardic.make({ env: DomLive })
16
+ *
17
+ * // src/view.ts
18
+ * const view = (model: Model, h: HtmlBuilder<Message>): Html => {
19
+ * const w = wardic.html(h)
20
+ * return w.div([h.Class("app")], [
21
+ * w.div([h.Class("card"), w.Initial({ opacity: 0, y: 8 }), w.Animate({ opacity: 1, y: 0 }), w.Transition({ duration: 0.3 })], [model.title]),
22
+ * ])
23
+ * }
24
+ *
25
+ * @module
26
+ */
27
+ import * as Arc from "@wardic/core/Arc";
28
+ import * as Stagger from "@wardic/core/Stagger";
29
+ import * as Predicate from "effect/Predicate";
30
+ import { builderOf } from "./internal/builder.js";
31
+ import { HANDLE, resourcesOf } from "./internal/commands.js";
32
+ import { hydrateOf } from "./internal/hydrate.js";
33
+ import { mountOf } from "./internal/mount.js";
34
+ import { makeState, remember } from "./internal/services.js";
35
+ import { viewTransitionOf } from "./internal/view-transition.js";
36
+ export { animate, animateLayout, AnimationFailed, LayoutFailed, pointer, provide, scroll, ScrollFailed, Wardic } from "./internal/commands.js";
37
+ /**
38
+ * Makes a Handle on `env`, with `features` (above). One per program, at module scope: a second
39
+ * `w.Provider()` for it while the first's element is mounted is reported and ignored.
40
+ */
41
+ export const make = (options) => {
42
+ const state = makeState(options);
43
+ // Made once per `h` (decision 18): as `===`-stable as `h` is, for `createLazy`.
44
+ const builders = new WeakMap();
45
+ const html = (h) => {
46
+ const known = builders.get(h);
47
+ if (Predicate.isNotUndefined(known))
48
+ return known;
49
+ const made = builderOf(state, h);
50
+ builders.set(h, made);
51
+ return made;
52
+ };
53
+ const handle = {
54
+ [HANDLE]: true,
55
+ html,
56
+ Provider: mountOf(state, { provider: {}, user: undefined, presence: false, reorder: false }),
57
+ Element: mountOf(state, { provider: undefined, user: undefined, presence: false, reorder: false }),
58
+ Presence: mountOf(state, { provider: undefined, user: undefined, presence: true, reorder: false }),
59
+ Reorder: mountOf(state, { provider: undefined, user: undefined, presence: false, reorder: true }),
60
+ resources: resourcesOf(() => handle),
61
+ viewTransition: viewTransitionOf(state),
62
+ hydrate: hydrateOf(state),
63
+ };
64
+ remember(handle, state);
65
+ return handle;
66
+ };
67
+ /**
68
+ * A stagger for a transition's `delayChildren`, or an `animate`'s `delay` (Motion's `stagger`): `duration`
69
+ * seconds between children, from `options.from`, after `options.startDelay`.
70
+ */
71
+ export const stagger = (duration = 0.1, options = {}) => Stagger.make(duration, options);
72
+ // #438; #795. Solid's `arc`, so an app imports nothing from `@wardic/core` for it (#791, Q13).
73
+ /**
74
+ * A curved path for a transition's `path` (Motion's `arc()`): `x` and `y` travel along a curve between
75
+ * where they start and their target, on `x`'s transition, in place of two straight lines. Make it once,
76
+ * at module scope: with no `direction`, it remembers which side of the screen it bulged to.
77
+ *
78
+ * @example
79
+ * const toss = arc({ strength: 0.4 })
80
+ * w.img([w.LayoutId("photo"), w.Transition({ layout: { type: "tween", duration: 0.6, path: toss } })])
81
+ */
82
+ export const arc = (options = {}) => Arc.make(options);
83
+ // #443; #795. dom's, for Solid's `correctParentTransform` and `transformViewBoxPoint` on Foldkit, which has no refs: an element is given as a selector.
84
+ export { correctParentTransform, transformViewBoxPoint } from "@wardic/dom/unstable/PagePoint";
85
+ //# sourceMappingURL=Wardic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wardic.js","sourceRoot":"","sources":["../src/Wardic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAQ/C,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAG7C,OAAO,EAAmB,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,WAAW,EAA4B,MAAM,wBAAwB,CAAA;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAc,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAkD,eAAe,EAAqB,YAAY,EAAE,OAAO,EAA2C,OAAO,EAAE,MAAM,EAAE,YAAY,EAA2D,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAqTnT;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAuD,OAAuB,EAAa,EAAE;IAC/G,MAAM,KAAK,GAAU,SAAS,CAAC,OAAO,CAAC,CAAA;IACvC,gFAAgF;IAChF,MAAM,QAAQ,GAAG,IAAI,OAAO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,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACvB,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAKD;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAE,OAAO,GAAmB,EAAE,EAA4B,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AAKlI,+FAA+F;AAC/F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAAO,GAAe,EAAE,EAAyB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAEzF,wJAAwJ;AACxJ,OAAO,EAAE,sBAAsB,EAAqB,qBAAqB,EAAE,MAAM,gCAAgC,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @wardic/foldkit — Wardic for Foldkit (ADR-0071, #561): Motion's animations on Foldkit's views, as
3
+ * Effect. `Wardic.make({ env })` makes a Handle once per program; `wardic.html(h)` gives a view its
4
+ * `w.*` elements. Shipped from 1.2 (#561).
5
+ */
6
+ export declare const VERSION = "1.3.0";
7
+ export * as Wardic from "./Wardic.ts";
8
+ export * as Ward from "./Ward.ts";
9
+ export * as Features from "./Features.ts";
10
+ export * as DragControls from "./DragControls.ts";
11
+ export * as AnimationControls from "./AnimationControls.ts";
12
+ export * as AnimationScope from "./AnimationScope.ts";
13
+ export * as LiveValue from "@wardic/core/LiveValue";
14
+ export { arc, correctParentTransform, stagger, transformViewBoxPoint } from "./Wardic.ts";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAU,CAAA;AAE9B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @wardic/foldkit — Wardic for Foldkit (ADR-0071, #561): Motion's animations on Foldkit's views, as
3
+ * Effect. `Wardic.make({ env })` makes a Handle once per program; `wardic.html(h)` gives a view its
4
+ * `w.*` elements. Shipped from 1.2 (#561).
5
+ */
6
+ export const VERSION = "1.3.0";
7
+ export * as Wardic from "./Wardic.js";
8
+ export * as Ward from "./Ward.js";
9
+ // The Features a Handle takes (#792, Q16): dom's, and the binding's own `presence`.
10
+ export * as Features from "./Features.js";
11
+ // Drag controls (#431; #793, Q8): made apart from the elements they drive.
12
+ export * as DragControls from "./DragControls.js";
13
+ // Animation controls (#433; #798): made apart from the elements they drive, started from a Command.
14
+ export * as AnimationControls from "./AnimationControls.js";
15
+ // Animation scopes (#433; #798): what a Command's selectors resolve under, and whose element's release stops its animations.
16
+ export * as AnimationScope from "./AnimationScope.js";
17
+ // Core's Live values (ADR-0043) and the helpers Solid's root has, so an app imports nothing from `@wardic/core` or `@wardic/dom` (#791, Q13; #795).
18
+ export * as LiveValue from "@wardic/core/LiveValue";
19
+ export { arc, correctParentTransform, stagger, transformViewBoxPoint } from "./Wardic.js";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAE9B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,oFAAoF;AACpF,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,2EAA2E;AAC3E,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,oGAAoG;AACpG,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,6HAA6H;AAC7H,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,oJAAoJ;AACpJ,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { Attribute, ChildAttribute, HtmlBuilder } from "foldkit/html";
2
+ import * as Ward from "../Ward.ts";
3
+ import { type State } from "./services.ts";
4
+ /** What a `w.*` element takes: Foldkit's attributes and Wardic's. */
5
+ export type Attributes<Message> = ReadonlyArray<Attribute<Message> | ChildAttribute | Ward.Attribute>;
6
+ /** The builder `w` for `h` (above). Its type is `Wardic.Html<Message, F>`. */
7
+ export declare const builderOf: <Message>(state: State, h: HtmlBuilder<Message>) => object;
8
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/internal/builder.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAA;AAEhF,OAAO,KAAK,IAAI,MAAM,YAAY,CAAA;AAIlC,OAAO,EAAoD,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAY5F,qEAAqE;AACrE,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;AAoIrG,8EAA8E;AAC9E,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAK,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,MAyF1E,CAAA"}