@wardic/solid 3.0.0-next.3 → 3.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/create-animate.js +48 -7
- package/dist/browser/create-animate.js.map +1 -1
- package/dist/browser/diagnostic-codes.js +10 -0
- package/dist/browser/diagnostic-codes.js.map +1 -1
- package/dist/browser/hooks/auto.js +7 -6
- package/dist/browser/hooks/auto.js.map +1 -1
- package/dist/browser/hooks/ward.js +33 -8
- package/dist/browser/hooks/ward.js.map +1 -1
- package/dist/browser/index.js +33 -13
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/live-scroll.js +14 -6
- package/dist/browser/live-scroll.js.map +1 -1
- package/dist/browser/reorder-components.js +4 -0
- package/dist/browser/reorder-components.js.map +1 -1
- package/dist/browser/v1/create-ward.js +18 -3
- package/dist/browser/v1/create-ward.js.map +1 -1
- package/dist/browser/v1/index.js +1 -1
- package/dist/browser/v1/live-scroll.js +3 -2
- package/dist/browser/v1/live-scroll.js.map +1 -1
- package/dist/browser/ward.js +31 -4
- package/dist/browser/ward.js.map +1 -1
- package/dist/server/create-animate.js +48 -7
- package/dist/server/create-animate.js.map +1 -1
- package/dist/server/diagnostic-codes.js +10 -0
- package/dist/server/diagnostic-codes.js.map +1 -1
- package/dist/server/hooks/auto.js +7 -6
- package/dist/server/hooks/auto.js.map +1 -1
- package/dist/server/hooks/ward.js +33 -8
- package/dist/server/hooks/ward.js.map +1 -1
- package/dist/server/index.js +33 -13
- package/dist/server/index.js.map +1 -1
- package/dist/server/live-scroll.js +14 -6
- package/dist/server/live-scroll.js.map +1 -1
- package/dist/server/reorder-components.js +4 -0
- package/dist/server/reorder-components.js.map +1 -1
- package/dist/server/v1/create-ward.js +18 -3
- package/dist/server/v1/create-ward.js.map +1 -1
- package/dist/server/v1/index.js +1 -1
- package/dist/server/v1/live-scroll.js +3 -2
- package/dist/server/v1/live-scroll.js.map +1 -1
- package/dist/server/ward.js +31 -4
- package/dist/server/ward.js.map +1 -1
- package/dist/solid/create-animate.d.ts +36 -6
- package/dist/solid/create-animate.d.ts.map +1 -1
- package/dist/solid/create-animate.jsx +46 -7
- package/dist/solid/create-animate.jsx.map +1 -1
- package/dist/solid/diagnostic-codes.d.ts.map +1 -1
- package/dist/solid/diagnostic-codes.js +11 -0
- package/dist/solid/diagnostic-codes.js.map +1 -1
- package/dist/solid/hooks/auto.js +7 -6
- package/dist/solid/hooks/auto.js.map +1 -1
- package/dist/solid/hooks/ward.d.ts.map +1 -1
- package/dist/solid/hooks/ward.js +35 -9
- package/dist/solid/hooks/ward.js.map +1 -1
- package/dist/solid/index.d.ts +132 -20
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.jsx +50 -14
- package/dist/solid/index.jsx.map +1 -1
- package/dist/solid/live-scroll.d.ts +9 -4
- package/dist/solid/live-scroll.d.ts.map +1 -1
- package/dist/solid/live-scroll.jsx +14 -6
- package/dist/solid/live-scroll.jsx.map +1 -1
- package/dist/solid/reorder-components.d.ts +3 -0
- package/dist/solid/reorder-components.d.ts.map +1 -1
- package/dist/solid/reorder-components.jsx +4 -0
- package/dist/solid/reorder-components.jsx.map +1 -1
- package/dist/solid/v1/create-ward.d.ts.map +1 -1
- package/dist/solid/v1/create-ward.jsx +19 -1
- package/dist/solid/v1/create-ward.jsx.map +1 -1
- package/dist/solid/v1/index.d.ts +1 -1
- package/dist/solid/v1/index.jsx +1 -1
- package/dist/solid/v1/live-scroll.d.ts +3 -2
- package/dist/solid/v1/live-scroll.d.ts.map +1 -1
- package/dist/solid/v1/live-scroll.jsx +3 -2
- package/dist/solid/v1/live-scroll.jsx.map +1 -1
- package/dist/solid/ward.d.ts +2 -2
- package/dist/solid/ward.d.ts.map +1 -1
- package/dist/solid/ward.jsx +31 -2
- package/dist/solid/ward.jsx.map +1 -1
- package/package.json +5 -5
- package/skills/wardic-diagnostics/SKILL.md +43 -2
- package/skills/wardic-solid/from-motion.md +1 -0
- package/src/create-animate.tsx +93 -8
- package/src/diagnostic-codes.ts +13 -0
- package/src/hooks/auto.ts +7 -7
- package/src/hooks/ward.ts +33 -8
- package/src/index.tsx +121 -20
- package/src/live-scroll.tsx +22 -9
- package/src/reorder-components.tsx +4 -0
- package/src/v1/create-ward.tsx +19 -1
- package/src/v1/index.tsx +1 -1
- package/src/v1/live-scroll.tsx +3 -2
- package/src/ward.tsx +32 -4
package/src/hooks/auto.ts
CHANGED
|
@@ -124,14 +124,14 @@ const TARGET_KEYS = ["initial", "animate", "exit", "whileHover", "whileTap", "wh
|
|
|
124
124
|
const isRecord = (value: unknown): value is Readonly<Record<string, unknown>> => Predicate.isObject(value) && !Array.isArray(value) && !Predicate.isFunction(value)
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
128
|
-
* (`Feature.unreadColorIn`)
|
|
129
|
-
*
|
|
130
|
-
*
|
|
127
|
+
* Whether a value names a colour space only the `colors` Feature reads: dom's own check, which its
|
|
128
|
+
* as-written word (`Feature.unreadColorIn`) and its Variable value rule share. It asks nothing of the page,
|
|
129
|
+
* and the spaces are in a module only the Feature loads (`colorSpaces.ts`), so a page's first chunk carries
|
|
130
|
+
* none of culori's beyond sRGB's.
|
|
131
131
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const isWide =
|
|
132
|
+
// #1092 (the grill's Q16): it was a copy of dom's pattern, from when the spaces sat in `colors.ts`, every
|
|
133
|
+
// app's, and asking whether they were registered brought them into a page's first chunk (13 KB of culori).
|
|
134
|
+
const isWide = Feature.isWideGamut
|
|
135
135
|
|
|
136
136
|
const namesWideColor = (target: unknown): boolean => isRecord(target) && Rec.some(target, isWide)
|
|
137
137
|
|
package/src/hooks/ward.ts
CHANGED
|
@@ -1125,6 +1125,9 @@ const popping = (ward: Ward, made: Joined, state: ShowState, exits: ((now: Seen)
|
|
|
1125
1125
|
})
|
|
1126
1126
|
state.letGo = () => popped().letGo()
|
|
1127
1127
|
let wasShown: boolean | undefined
|
|
1128
|
+
// A ward taken late, by a row or a presence value already leaving (Q20, Q12), was on the page and
|
|
1129
|
+
// shown as it was taken: its first run, which reads it hidden already, is its leave, not its mount.
|
|
1130
|
+
if (takingLate) wasShown = true
|
|
1128
1131
|
const shownIs = (shown: boolean): void => {
|
|
1129
1132
|
const before = wasShown
|
|
1130
1133
|
wasShown = shown
|
|
@@ -1306,9 +1309,13 @@ const poppedOf = (
|
|
|
1306
1309
|
if (Predicate.isUndefined(sensed)) return undefined
|
|
1307
1310
|
return untrack(() => sensed.element())
|
|
1308
1311
|
}
|
|
1309
|
-
// What it has taken to leave with it, held for at each of its leaves until their exits land
|
|
1310
|
-
// wards inside a row's or a presence value's element (Q20),
|
|
1311
|
-
|
|
1312
|
+
// What it has taken to leave with it, held for at each of its leaves until their exits land. The
|
|
1313
|
+
// wards inside a row's or a presence value's element (Q20), of the element they were taken from: a
|
|
1314
|
+
// presence's ward is on a new element for every value, and what was inside the old one went with
|
|
1315
|
+
// it. Its followers with an exit of their own (Q12), each taken once, as they're followers still.
|
|
1316
|
+
const inside: Array<ShowState> = []
|
|
1317
|
+
let insideOf: HTMLElement | undefined
|
|
1318
|
+
const tookFollowers = new WeakMap<Ward, ShowState>()
|
|
1312
1319
|
/**
|
|
1313
1320
|
* Its leave, for what leaves with it. A row's or a presence value's element: the wards inside it,
|
|
1314
1321
|
* still alive as it stays to leave (Q20). Any leader's followers with an `exit` of their own, which
|
|
@@ -1318,8 +1325,15 @@ const poppedOf = (
|
|
|
1318
1325
|
const leaveWithIt = (el: HTMLElement): void => {
|
|
1319
1326
|
queueMicrotask(() => {
|
|
1320
1327
|
if (untrack(state.shown)) return
|
|
1321
|
-
|
|
1322
|
-
|
|
1328
|
+
// On the element it left from before, a leave turned round and begun again: what it took inside
|
|
1329
|
+
// it is taken already, and holds this leave as it held that one.
|
|
1330
|
+
if (insideOf !== el) {
|
|
1331
|
+
inside.length = 0
|
|
1332
|
+
insideOf = el
|
|
1333
|
+
}
|
|
1334
|
+
if (state.sweeps) sweepInside(el, ward, state.shown, inside)
|
|
1335
|
+
const swept = [...inside]
|
|
1336
|
+
followersLeaving(ward, state.shown, tookFollowers, swept)
|
|
1323
1337
|
Arr.forEach(swept, (inner) => {
|
|
1324
1338
|
if (!untrack(inner.leaves)) return
|
|
1325
1339
|
inner.gone = holdOn(state)()
|
|
@@ -1876,16 +1890,27 @@ const takenLate = (found: Ward, kept: Kept, shown: Accessor<boolean>): ShowState
|
|
|
1876
1890
|
return take.state
|
|
1877
1891
|
}
|
|
1878
1892
|
|
|
1879
|
-
/**
|
|
1880
|
-
|
|
1893
|
+
/**
|
|
1894
|
+
* `leader`'s followers with an `exit` of their own, each taken by it as it first leaves (Q12) and kept
|
|
1895
|
+
* in `took`, each one's leaving state added to `into`. Its followers now: one whose owner has ended
|
|
1896
|
+
* is one no more ({@link followsOf}), so a presence value's follower holds that value's leave alone.
|
|
1897
|
+
*/
|
|
1898
|
+
const followersLeaving = (leader: Ward, shown: Accessor<boolean>, took: WeakMap<Ward, ShowState>, into: Array<ShowState>): void => {
|
|
1881
1899
|
const all = FOLLOWERS.get(leader)
|
|
1882
1900
|
if (Predicate.isUndefined(all)) return
|
|
1883
1901
|
Iter.forEach(all, (follower) => {
|
|
1884
1902
|
if (!follower.exits) return
|
|
1903
|
+
const before = took.get(follower.ward)
|
|
1904
|
+
if (Predicate.isNotUndefined(before)) {
|
|
1905
|
+
into.push(before)
|
|
1906
|
+
return
|
|
1907
|
+
}
|
|
1885
1908
|
const kept = keptFor(follower.ward)
|
|
1886
1909
|
if (Predicate.isUndefined(kept)) return
|
|
1887
1910
|
const taken = takenLate(follower.ward, kept, shown)
|
|
1888
|
-
if (Predicate.
|
|
1911
|
+
if (Predicate.isUndefined(taken)) return
|
|
1912
|
+
took.set(follower.ward, taken)
|
|
1913
|
+
into.push(taken)
|
|
1889
1914
|
})
|
|
1890
1915
|
}
|
|
1891
1916
|
|
package/src/index.tsx
CHANGED
|
@@ -69,19 +69,37 @@ export type { WardicConfigProps } from "./wardic-config.tsx"
|
|
|
69
69
|
* of the element's props, so an inline `{...ward(config)}` would make a new one each time, and throws.
|
|
70
70
|
* A kept ward has `.Provider` for its Variant children, `.read(key)` and `.atom(key)` for its values.
|
|
71
71
|
*/
|
|
72
|
+
// `ward(config)`, `wardic.*`, `w.*` and what serves them alone, the main entry's presence handle, `reorderGroup`,
|
|
73
|
+
// `reorderItem`, drag controls and the four sensors go at 3.0, `@deprecated` until then, each naming what takes
|
|
74
|
+
// its place (the 3.0 bar's Q10, Q11 and Q13). TypeScript reads the tag on an export specifier, so each carries its own.
|
|
72
75
|
export {
|
|
76
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
73
77
|
type AnyWard,
|
|
78
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
74
79
|
type Ward,
|
|
80
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
75
81
|
type WardChecked,
|
|
82
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
76
83
|
type WardConfig,
|
|
84
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
77
85
|
type WardOptions,
|
|
86
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
78
87
|
type WardProps,
|
|
88
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
79
89
|
type WardRead,
|
|
90
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
80
91
|
type WardStyle,
|
|
92
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
81
93
|
type WardWithProps,
|
|
82
94
|
} from "./ward.tsx"
|
|
83
|
-
export {
|
|
84
|
-
|
|
95
|
+
export {
|
|
96
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
97
|
+
ward,
|
|
98
|
+
} from "./complete.tsx"
|
|
99
|
+
export type {
|
|
100
|
+
/** @deprecated `ward(config)` goes at 3.0: `createWard(...runes)` from `@wardic/solid/hooks` takes its place. */
|
|
101
|
+
HeldWard,
|
|
102
|
+
} from "./ward-first.ts"
|
|
85
103
|
/** A Stage (#884, ADR-0073 decisions 12 and 20): what runs a scene, found through its own Solid context. */
|
|
86
104
|
export {
|
|
87
105
|
type SceneObjectEvent,
|
|
@@ -131,8 +149,16 @@ export type { WardicAnimationDefinition } from "@wardic/dom/unstable/WardConfig"
|
|
|
131
149
|
export type { AnimatedKey, WardKey, WardValueOf } from "./ward-keys.ts"
|
|
132
150
|
|
|
133
151
|
/** The variant context (ADR-0007): what a ward's `.Provider` and a `wardic.*` element hand their children. */
|
|
134
|
-
export {
|
|
135
|
-
|
|
152
|
+
export {
|
|
153
|
+
/** @deprecated What a 2.x ward's `.Provider` and `wardic.*` hand their children, going at 3.0 with them: a hook ward's child follows it by the rune key `follow`. */
|
|
154
|
+
useVariantContext,
|
|
155
|
+
/** @deprecated What a 2.x ward's `.Provider` and `wardic.*` hand their children, going at 3.0 with them: a hook ward's child follows it by the rune key `follow`. */
|
|
156
|
+
WardicVariantContext,
|
|
157
|
+
} from "./variant-node.ts"
|
|
158
|
+
export type {
|
|
159
|
+
/** @deprecated What a 2.x ward's `.Provider` and `wardic.*` hand their children, going at 3.0 with them: a hook ward's child follows it by the rune key `follow`. */
|
|
160
|
+
WardicVariantContextValue,
|
|
161
|
+
} from "@wardic/core/unstable/VariantTree"
|
|
136
162
|
export type {
|
|
137
163
|
WardicOrchestration,
|
|
138
164
|
WardicReducedMotion,
|
|
@@ -161,31 +187,60 @@ export type {
|
|
|
161
187
|
* element's own props and the motion props; a `wardic.create(Component)` component forwards its `ref`.
|
|
162
188
|
*/
|
|
163
189
|
export {
|
|
190
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
164
191
|
type GivenWard,
|
|
192
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
165
193
|
type Wardic,
|
|
194
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
166
195
|
type WardicBeside,
|
|
196
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
167
197
|
type WardicComponent,
|
|
198
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
168
199
|
type WardicMotion,
|
|
200
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
169
201
|
type WardicProps,
|
|
202
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
170
203
|
type WardicWrappable,
|
|
204
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
171
205
|
type WardicWrapped,
|
|
206
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
172
207
|
type WardNodeKey,
|
|
208
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
173
209
|
type WardRefCallback,
|
|
210
|
+
/** @deprecated `wardic.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
174
211
|
wardic,
|
|
175
212
|
} from "./wardic.tsx"
|
|
176
213
|
/**
|
|
177
214
|
* `w` (#511, ADR-0067; Motion's `m`): the **Slim element**'s forms, `w.<tag>`, `w.create` and
|
|
178
215
|
* `w.ward()`, each as its Complete form but with only the Features chosen above it.
|
|
179
216
|
*/
|
|
180
|
-
export {
|
|
217
|
+
export {
|
|
218
|
+
/** @deprecated `w.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
219
|
+
type W,
|
|
220
|
+
/** @deprecated `w.*` goes at 3.0: a hook ward, `createWard(...runes)` from `@wardic/solid/hooks`, spread on the element. */
|
|
221
|
+
w,
|
|
222
|
+
} from "./w.tsx"
|
|
181
223
|
// #516: a Wardic instance, its `w` and its ward typed to its Features: what `makeWard({ features, elements })`
|
|
182
224
|
// gives. `createWardic` was deleted at the owner's word (probe: behaviour-runes, after the scopes round); Solid 1's stays.
|
|
183
225
|
export type { WardConfigOf, WardicInstance } from "./wardic-instance.ts"
|
|
184
|
-
export type {
|
|
226
|
+
export type {
|
|
227
|
+
/** @deprecated `w.*`'s and `wardic.*`'s, going at 3.0 with them: a hook ward (`createWard` from `@wardic/solid/hooks`) takes runes, not motion props. */
|
|
228
|
+
WardicMotionPropsV2 as WardicMotionProps,
|
|
229
|
+
} from "./motion-props.ts"
|
|
185
230
|
// #443 (Motion's): `wardic.create`'s options; whether a component is a Wardic element's and what it
|
|
186
231
|
// wraps; whether a prop is a motion prop, Solid 2's own list.
|
|
187
|
-
export {
|
|
188
|
-
|
|
232
|
+
export {
|
|
233
|
+
/** @deprecated `w.*`'s and `wardic.*`'s, going at 3.0 with them: a hook ward (`createWard` from `@wardic/solid/hooks`) is spread on its element, no component of its own. */
|
|
234
|
+
isWardicComponent,
|
|
235
|
+
/** @deprecated `w.*`'s and `wardic.*`'s, going at 3.0 with them: a hook ward (`createWard` from `@wardic/solid/hooks`) is spread on its element, no component of its own. */
|
|
236
|
+
unwrapWardicComponent,
|
|
237
|
+
/** @deprecated `w.*`'s and `wardic.*`'s, going at 3.0 with them: a hook ward (`createWard` from `@wardic/solid/hooks`) is spread on its element, no component of its own. */
|
|
238
|
+
type WardicCreateOptions,
|
|
239
|
+
} from "./wardic-component.ts"
|
|
240
|
+
export {
|
|
241
|
+
/** @deprecated `w.*`'s and `wardic.*`'s, going at 3.0 with them: a hook ward (`createWard` from `@wardic/solid/hooks`) takes runes, not motion props. */
|
|
242
|
+
isValidWardicPropV2 as isValidWardicProp,
|
|
243
|
+
} from "./motion-props.ts"
|
|
189
244
|
|
|
190
245
|
/**
|
|
191
246
|
* A presence (ADR-0007): each child's exit before it's removed, from its ward's `exit`. `<AnimatePresence>`
|
|
@@ -193,7 +248,14 @@ export { isValidWardicPropV2 as isValidWardicProp } from "./motion-props.ts"
|
|
|
193
248
|
* hooks' `<Presence>` and `createPresenceScope` are built on it, and take its place. Solid 1's stays. A
|
|
194
249
|
* presence handle, `createPresence()`, is what a `<Presence ref>` is given.
|
|
195
250
|
*/
|
|
196
|
-
export {
|
|
251
|
+
export {
|
|
252
|
+
/** @deprecated The main entry's presence handle goes at 3.0: `createPresenceRef()` from `@wardic/solid/hooks`, for `<Presence ref>`. */
|
|
253
|
+
createPresence,
|
|
254
|
+
/** @deprecated The main entry's presence handle goes at 3.0: `createPresenceRef()` from `@wardic/solid/hooks`, for `<Presence ref>`. */
|
|
255
|
+
type Presence,
|
|
256
|
+
type PresenceEvent,
|
|
257
|
+
type PresenceEvents,
|
|
258
|
+
} from "./presence-handle.ts"
|
|
197
259
|
export type { PresenceMode, PresenceRecord } from "@wardic/dom/unstable/PresenceController"
|
|
198
260
|
// `usePresence`, `useIsPresent`, `usePresenceData`, `PresenceContext` and `usePresenceContext` were deleted at the owner's
|
|
199
261
|
// word (probe: behaviour-runes, after the scopes round; the gap grill's Q52): what cares about leaving has a ward, one with
|
|
@@ -215,6 +277,7 @@ export { measureLayoutBox } from "@wardic/dom/ProjectionSystem"
|
|
|
215
277
|
* setting over it, and `createPageInView` whether the page is shown (#443).
|
|
216
278
|
*/
|
|
217
279
|
export {
|
|
280
|
+
/** @deprecated `createDrag` goes at 3.0: a hook ward's `dragging()` and its `drag` events (`when("drag")`), `createWard` from `@wardic/solid/hooks`. */
|
|
218
281
|
type CreateDragOptions,
|
|
219
282
|
createInView,
|
|
220
283
|
createPageInView,
|
|
@@ -222,10 +285,22 @@ export {
|
|
|
222
285
|
createReducedMotionConfig,
|
|
223
286
|
type Sensor,
|
|
224
287
|
} from "./sensors.tsx"
|
|
225
|
-
export {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
288
|
+
export {
|
|
289
|
+
/** @deprecated `createDrag` goes at 3.0: a hook ward's `dragging()` and its `drag` events (`when("drag")`), `createWard` from `@wardic/solid/hooks`. */
|
|
290
|
+
createDrag,
|
|
291
|
+
} from "./drag-sensor.tsx"
|
|
292
|
+
export {
|
|
293
|
+
/** @deprecated `createFocus` goes at 3.0: a hook ward's `focusing()`, `createWard` from `@wardic/solid/hooks`, spread on its element or handed one by a rune's `subject`. */
|
|
294
|
+
createFocus,
|
|
295
|
+
} from "./focus-sensor.tsx"
|
|
296
|
+
export {
|
|
297
|
+
/** @deprecated `createHover` goes at 3.0: a hook ward's `hovering()`, `createWard` from `@wardic/solid/hooks`, spread on its element or handed one by a rune's `subject`. */
|
|
298
|
+
createHover,
|
|
299
|
+
} from "./hover-sensor.tsx"
|
|
300
|
+
export {
|
|
301
|
+
/** @deprecated `createPress` goes at 3.0: a hook ward's `pressing()`, `createWard` from `@wardic/solid/hooks`, spread on its element or handed one by a rune's `subject`. */
|
|
302
|
+
createPress,
|
|
303
|
+
} from "./press-sensor.tsx"
|
|
229
304
|
// `createCycle` (#443, Motion's `useCycle`): one of a list of states at a time, stepped through.
|
|
230
305
|
export { createCycle, type Cycle } from "./cycle.ts"
|
|
231
306
|
|
|
@@ -234,10 +309,26 @@ export { fromAtom, streamToSignal } from "./bridge.tsx"
|
|
|
234
309
|
export type { WardicDragTransition, WardicLayoutBox, WardicScaleCorrector, WardicTransformPoint, WardicTransformTemplate, WardicViewport } from "@wardic/dom/unstable/WardConfig"
|
|
235
310
|
export type { WardicBoundingBox, WardicDragConstraints, WardicMeasureDragConstraints } from "@wardic/dom/unstable/DragConstraints"
|
|
236
311
|
// Drag controls (#431, Motion's `useDragControls`): a drag started from a handle or a track.
|
|
237
|
-
export {
|
|
312
|
+
export {
|
|
313
|
+
/** @deprecated `createDragControls` goes at 3.0: `createGrip(row)` from `@wardic/solid/hooks`, a rune of the grip's own ward. */
|
|
314
|
+
createDragControls,
|
|
315
|
+
/** @deprecated `createDragControls` goes at 3.0: `createGrip(row)` from `@wardic/solid/hooks`, a rune of the grip's own ward. */
|
|
316
|
+
type WardicDragControls,
|
|
317
|
+
/** @deprecated `createDragControls` goes at 3.0: `createGrip(row)` from `@wardic/solid/hooks`, a rune of the grip's own ward. */
|
|
318
|
+
type WardicDragControlsOptions,
|
|
319
|
+
} from "@wardic/dom/unstable/DragControls"
|
|
238
320
|
// Imperative animation (#433, Motion's `useAnimate`): an Animation scope with `settled()`, its `animate` and its Playback controls.
|
|
239
321
|
// `WardicAnimationScope` on both bindings, each its own (#618, P1), as `isValidWardicProp` is.
|
|
240
|
-
export {
|
|
322
|
+
export {
|
|
323
|
+
createAnimate,
|
|
324
|
+
type WardicAnimate,
|
|
325
|
+
type WardicAnimationScopeV2 as WardicAnimationScope,
|
|
326
|
+
type WardicAnimationSequence,
|
|
327
|
+
type WardicAnimationSubject,
|
|
328
|
+
type WardicElementSegment,
|
|
329
|
+
type WardicScopeLanding,
|
|
330
|
+
type WardicSegment,
|
|
331
|
+
} from "./create-animate.tsx"
|
|
241
332
|
export {
|
|
242
333
|
createBatch,
|
|
243
334
|
type WardicBatch,
|
|
@@ -264,17 +355,12 @@ export type {
|
|
|
264
355
|
WardicBatchValues,
|
|
265
356
|
} from "@wardic/dom/unstable/BatchMembers"
|
|
266
357
|
export type {
|
|
267
|
-
WardicAnimate,
|
|
268
358
|
WardicAnimateOptions,
|
|
269
359
|
WardicAnimationEnd,
|
|
270
|
-
WardicAnimationSequence,
|
|
271
|
-
WardicAnimationSubject,
|
|
272
360
|
WardicBatchSegment,
|
|
273
|
-
WardicElementSegment,
|
|
274
361
|
WardicFunctionSegment,
|
|
275
362
|
WardicPlaybackControls,
|
|
276
363
|
WardicPlayState,
|
|
277
|
-
WardicSegment,
|
|
278
364
|
WardicSegmentOptions,
|
|
279
365
|
WardicSegmentTarget,
|
|
280
366
|
WardicSequenceLabel,
|
|
@@ -311,23 +397,38 @@ export type { FollowAccessor, FollowValueOptions, Live, LiveSource, SpringAccess
|
|
|
311
397
|
* utilities over `createReorder` (probe: hooks-first, the Reorder round).
|
|
312
398
|
*/
|
|
313
399
|
export { Reorder } from "./reorder-components.tsx"
|
|
400
|
+
// `ReorderGroup`, `ReorderGroupEvents` and `ReorderElementTag` the Batch pair names too, so the Batch round decides them.
|
|
314
401
|
export {
|
|
402
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
315
403
|
type AnyReorderGroup,
|
|
404
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
316
405
|
type AnyReorderItem,
|
|
406
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
317
407
|
type GroupRefCallback,
|
|
318
408
|
type ReorderElementTag,
|
|
319
409
|
type ReorderGroup,
|
|
410
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
320
411
|
type ReorderGroupComponentProps,
|
|
412
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
321
413
|
type ReorderGroupConfig,
|
|
322
414
|
type ReorderGroupEvents,
|
|
415
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
323
416
|
type ReorderGroupOf,
|
|
417
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
324
418
|
type ReorderGroupProps,
|
|
419
|
+
/** @deprecated `reorderGroup` and `<Reorder.Group>` go at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
325
420
|
reorderGroup,
|
|
421
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
326
422
|
type ReorderItem,
|
|
423
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
327
424
|
type ReorderItemComponentProps,
|
|
425
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
328
426
|
type ReorderItemConfig,
|
|
427
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
329
428
|
type ReorderItemLayout,
|
|
429
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
330
430
|
type ReorderItemOf,
|
|
431
|
+
/** @deprecated `reorderItem` and `<Reorder.Item>` go at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
331
432
|
reorderItem,
|
|
332
433
|
type ReorderBatchColumnSize,
|
|
333
434
|
type ReorderBatchGap,
|
package/src/live-scroll.tsx
CHANGED
|
@@ -22,6 +22,8 @@ import * as Scroll from "@wardic/dom/unstable/features/Scroll"
|
|
|
22
22
|
import * as GestureFeatures from "@wardic/dom/unstable/GestureFeatures"
|
|
23
23
|
import * as OwnerScope from "@wardic/dom/unstable/OwnerScope"
|
|
24
24
|
import { followScroll, letGoScroll, scrollAtomsOf } from "./scroll-values.ts"
|
|
25
|
+
import type { HookWard } from "./hooks/ward.ts"
|
|
26
|
+
import { sensedOf } from "./ward.tsx"
|
|
25
27
|
import * as Timelines from "@wardic/core/unstable/Timelines"
|
|
26
28
|
import { followAtom } from "./bridge.tsx"
|
|
27
29
|
import { CLOSE_FAILED, SERVER_ZERO } from "./live-value.tsx"
|
|
@@ -38,8 +40,11 @@ export type ElementSource = Element | Accessor<Element | undefined>
|
|
|
38
40
|
export interface ScrollOptions {
|
|
39
41
|
/** The scrolling element, as an accessor of its ref: `() => box`. The page's scroll when left out. */
|
|
40
42
|
readonly container?: ElementSource
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* An element whose way through the container the progress reads, between the `offset`s, or a ward, its
|
|
45
|
+
* Subject's, followed to another element as the ward moves (the 3.0 bar's Q4).
|
|
46
|
+
*/
|
|
47
|
+
readonly target?: ElementSource | HookWard
|
|
43
48
|
/**
|
|
44
49
|
* Where the progress runs, as Motion's: each stop pairs an edge of the target with an edge of the
|
|
45
50
|
* container, `["start end", "end start"]`, 0 at the first and 1 at the last. An edge is `start`,
|
|
@@ -67,11 +72,18 @@ export interface ScrollValues {
|
|
|
67
72
|
const NOT_YET = { container: Option.none(), target: Option.none() } as const
|
|
68
73
|
const SERVER_SCROLL: ScrollValues = { scrollX: SERVER_ZERO, scrollY: SERVER_ZERO, scrollXProgress: SERVER_ZERO, scrollYProgress: SERVER_ZERO }
|
|
69
74
|
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
/**
|
|
76
|
+
* An element source read now: `None` for an accessor whose ref hasn't arrived, or a ward with no Subject.
|
|
77
|
+
* A ward's is followed (the 3.0 bar's Q4), so the scroll moves with it to another element.
|
|
78
|
+
*/
|
|
79
|
+
const elementOf = (source: ElementSource | HookWard | undefined): Option.Option<Element | undefined> =>
|
|
80
|
+
UndefinedOr.match(sensedOf(source), {
|
|
81
|
+
onDefined: (sensed) => Option.fromUndefinedOr(sensed.element()),
|
|
82
|
+
onUndefined: () =>
|
|
83
|
+
Bool.match(Predicate.isFunction(source), {
|
|
84
|
+
onTrue: () => Option.fromUndefinedOr((source as Accessor<Element | undefined>)()),
|
|
85
|
+
onFalse: () => Option.some(source as Element | undefined),
|
|
86
|
+
}),
|
|
75
87
|
})
|
|
76
88
|
|
|
77
89
|
/**
|
|
@@ -79,8 +91,9 @@ const elementOf = (source: ElementSource | undefined): Option.Option<Element | u
|
|
|
79
91
|
* and `scrollYProgress`, from 0 to 1 through its range. The page's, or a `container`'s. With a
|
|
80
92
|
* `target`, the progress is the target's way through, between two `offset`s, on `axis`. Each is set in
|
|
81
93
|
* the scroll's own event, so a value derived from one paints in the frame that shows the scroll. A
|
|
82
|
-
* `container` or `target` given as an accessor of a ref reads 0s until the ref is there
|
|
83
|
-
* server. Motion's
|
|
94
|
+
* `container` or `target` given as an accessor of a ref reads 0s until the ref is there, and a target
|
|
95
|
+
* taken off the page holds the values where they were until one is back. 0s on a server. Motion's
|
|
96
|
+
* `useScroll`.
|
|
84
97
|
*
|
|
85
98
|
* Where the browser has native scroll timelines, an element's `opacity`, `filter`, `clipPath` or
|
|
86
99
|
* transform key given one of these, or a `createTransform` of one through ranges, is drawn by the
|
|
@@ -52,9 +52,13 @@ const Grip = (props: Record<string, unknown>): JSX.Element => elements().Grip(pr
|
|
|
52
52
|
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
53
53
|
*/
|
|
54
54
|
// ADR-0020; the Batch pair, ADR-0072 (#712); the grip, probe: behaviour-runes (Q29).
|
|
55
|
+
// The three going at 3.0 are `@deprecated` until then (the 3.0 bar's Q10 and Q13); the Batch pair is the Batch round's.
|
|
55
56
|
export const Reorder = {
|
|
57
|
+
/** @deprecated `<Reorder.Group>` goes at 3.0: `createReorder({ each, onReorder })` from `@wardic/solid/hooks`, spread on the list. */
|
|
56
58
|
Group: Group as <V, Tag extends ReorderElementTag = "ul">(props: ReorderGroupComponentProps<V, Tag>) => JSX.Element,
|
|
59
|
+
/** @deprecated `<Reorder.Item>` goes at 3.0: `list.item(value)`, a rune of the row's ward (`createReorder` from `@wardic/solid/hooks`). */
|
|
57
60
|
Item: Item as <V, Tag extends ReorderElementTag = "li">(props: ReorderItemComponentProps<V, Tag>) => JSX.Element,
|
|
61
|
+
/** @deprecated `<Reorder.Grip>` goes at 3.0: `createGrip(row)` from `@wardic/solid/hooks`, a rune of the grip's own ward. */
|
|
58
62
|
Grip: Grip as <Tag extends ReorderElementTag = "button">(props: ReorderGripComponentProps<Tag>) => JSX.Element,
|
|
59
63
|
BatchGroup,
|
|
60
64
|
BatchItem,
|
package/src/v1/create-ward.tsx
CHANGED
|
@@ -87,6 +87,7 @@ import * as PresenceRecord from "@wardic/core/unstable/PresenceRecord"
|
|
|
87
87
|
import { createWhenWanted, NEVER_STARTED, type Started, stateOf, type Wants } from "./sensors.tsx"
|
|
88
88
|
import { type GestureCallbacks, gestureCallbacksOf, inViewOptionsOf, wantsFocus, wantsHover, wantsInView, wantsPan, wantsPress } from "../gesture-callbacks.ts"
|
|
89
89
|
import * as Feature from "@wardic/dom/unstable/Feature"
|
|
90
|
+
import type * as VariableValues from "@wardic/core/unstable/VariableValues"
|
|
90
91
|
import { runWatch, useBuiltProjection, useElementFeatures, useFeatureRegistry, useWardicAppear, useWardicDefaultTransition, useWardicGate, useWardicValueReads, useWardicPositionalKeys, useWardicReducedMotion, useWardicRenderer, useWardicRuntime, useWardicSkipAnimations } from "./provider.tsx"
|
|
91
92
|
import { useWardicConfig } from "./wardic-config.tsx"
|
|
92
93
|
import type { WardicRuntime } from "../runtime.ts"
|
|
@@ -468,7 +469,9 @@ export function runSpine(opts: RunSpineOptions): void {
|
|
|
468
469
|
const defaultTransition = useWardicDefaultTransition()
|
|
469
470
|
// How a value is read in the Environment's own terms (#672).
|
|
470
471
|
// Its value reads (PR2-Q6): its caller's, else one context read.
|
|
471
|
-
const
|
|
472
|
+
const valueReads = valueReadsIn(opts.valueReads)
|
|
473
|
+
const { ownValues, measuredPairs } = valueReads
|
|
474
|
+
const variableValues = withUnreadColorWord(valueReads.variableValues, internal.complete === true, features)
|
|
472
475
|
|
|
473
476
|
// Starting style: resolved purely from the config read EXACTLY ONCE (untrack — no
|
|
474
477
|
// reactive dependency, must not re-seed after mount), with the inherited `initial`
|
|
@@ -1005,6 +1008,21 @@ const warnUnreadColors = (registry: Feature.FeatureRegistry, features: Feature.F
|
|
|
1005
1008
|
})
|
|
1006
1009
|
}
|
|
1007
1010
|
|
|
1011
|
+
/**
|
|
1012
|
+
* The element's Variable values, saying so when one resolves to a colour only the `colors` Feature reads
|
|
1013
|
+
* (#1092, ADR-0067 decision 7): {@link warnUnreadColors}' word, once per provider, for a value its check
|
|
1014
|
+
* of values as written can't see. Development only, not on a Complete element, and not while a lazy load
|
|
1015
|
+
* is on its way; otherwise `variableValues` as it is.
|
|
1016
|
+
*/
|
|
1017
|
+
const withUnreadColorWord = (variableValues: VariableValues.Shape, complete: boolean, features: Feature.FeatureSection): VariableValues.Shape => {
|
|
1018
|
+
if (!DEV || complete) return variableValues
|
|
1019
|
+
const registry = useFeatureRegistry()
|
|
1020
|
+
return Feature.tellingUnreadColors(variableValues, (variable, resolved) => {
|
|
1021
|
+
if (untrack(features.pending)) return
|
|
1022
|
+
registry.warnOnce("colors", Feature.missingMessage("colors", `The colour \`${variable}\` (resolved to \`${resolved}\`)`, ENTRY))
|
|
1023
|
+
})
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1008
1026
|
|
|
1009
1027
|
/**
|
|
1010
1028
|
* {@link createWard} with a `<Reorder>` item's additions (internal, ADR-0020; not
|
package/src/v1/index.tsx
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @deprecated Solid 1's binding, deprecated and frozen: it goes at Wardic's next major. Solid 2's is `@wardic/solid` (#566).
|
|
19
19
|
*/
|
|
20
|
-
export const VERSION = "3.0.0-next.
|
|
20
|
+
export const VERSION = "3.0.0-next.5"
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* `WardicProvider` (one Effect runtime + `AtomRegistry` per ADR-0006), the
|
package/src/v1/live-scroll.tsx
CHANGED
|
@@ -78,8 +78,9 @@ const elementOf = (source: ElementSource): Option.Option<Element> =>
|
|
|
78
78
|
* and `scrollYProgress`, from 0 to 1 through its range. The page's, or a `container`'s. With a
|
|
79
79
|
* `target`, the progress is the target's way through, between two `offset`s, on `axis`. Each is set in
|
|
80
80
|
* the scroll's own event, so a value derived from one paints in the frame that shows the scroll. A
|
|
81
|
-
* `container` or `target` given as an accessor of a ref reads 0s until the ref is there
|
|
82
|
-
* server. Motion's
|
|
81
|
+
* `container` or `target` given as an accessor of a ref reads 0s until the ref is there, and a target
|
|
82
|
+
* taken off the page holds the values where they were until one is back. 0s on a server. Motion's
|
|
83
|
+
* `useScroll`.
|
|
83
84
|
*
|
|
84
85
|
* Where the browser has native scroll timelines, an element's `opacity`, `filter`, `clipPath` or
|
|
85
86
|
* transform key given one of these, or a `createTransform` of one through ranges, is drawn by the
|
package/src/ward.tsx
CHANGED
|
@@ -138,6 +138,7 @@ import { neverLands, NO_EVENTS, serverWhen } from "./waiters.ts"
|
|
|
138
138
|
import { usePresenceContext } from "./presence.tsx"
|
|
139
139
|
import { createVariantNode, useVariantContext, type VariantNode, WardicVariantContext } from "./variant-node.ts"
|
|
140
140
|
import type * as DragTrack from "@wardic/dom/unstable/DragTrack"
|
|
141
|
+
import type * as VariableValues from "@wardic/core/unstable/VariableValues"
|
|
141
142
|
|
|
142
143
|
/**
|
|
143
144
|
* A Wardic element's `style`: every CSS property and the transform keys (`x`,
|
|
@@ -387,10 +388,10 @@ export const heldOf = (ward: AnyWard, subject?: Accessor<unknown>): JSX.Element
|
|
|
387
388
|
}) as unknown as JSX.Element
|
|
388
389
|
}
|
|
389
390
|
|
|
390
|
-
/** A client ward's {@link Sensed}: `undefined` for a server's, which has none. */
|
|
391
|
-
export const sensedOf = (ward:
|
|
391
|
+
/** A client ward's {@link Sensed}: `undefined` for a server's, which has none, and for anything that isn't a ward. */
|
|
392
|
+
export const sensedOf = (ward: unknown): Sensed | undefined => {
|
|
392
393
|
if (Bool.not(Predicate.hasProperty(ward, WARD_STATE))) return undefined
|
|
393
|
-
const state = stateOf(ward)
|
|
394
|
+
const state = stateOf(ward as object)
|
|
394
395
|
return { lifecycle: state.lifecycle, element: state.element }
|
|
395
396
|
}
|
|
396
397
|
|
|
@@ -968,6 +969,31 @@ const warnUnreadColors = (registry: Feature.FeatureRegistry, features: Feature.F
|
|
|
968
969
|
)
|
|
969
970
|
}
|
|
970
971
|
|
|
972
|
+
/**
|
|
973
|
+
* The element's Variable values, telling what a `var()` that resolves to a colour only the `colors`
|
|
974
|
+
* Feature reads needs, a value the checks of values as written can't see:
|
|
975
|
+
*
|
|
976
|
+
* - **A ward that asks for its Features as it uses them** (`targeted`, the hooks') asks for `colors`, in
|
|
977
|
+
* every build, as it does for a colour an accessor shows later. That leg has resolved without it, so it
|
|
978
|
+
* may jump; the next one reads the colour.
|
|
979
|
+
* - **Any other** says so in development, {@link warnUnreadColors}' word, once per provider, not on a
|
|
980
|
+
* Complete element, and not while a lazy load is on its way.
|
|
981
|
+
*
|
|
982
|
+
* Otherwise `variableValues` as it is.
|
|
983
|
+
*/
|
|
984
|
+
// #1092, ADR-0067 decision 7 and *Amendment (#1092)*, decision 6. solid-next: the coded word (`warnMissing`).
|
|
985
|
+
const withUnreadColorWord = (variableValues: VariableValues.Shape, internal: WardInternals, features: Feature.FeatureSection): VariableValues.Shape => {
|
|
986
|
+
const targeted = internal.targeted
|
|
987
|
+
// The resolved colour, told as a target's value is: `targeted` asks for `colors` the first time one names it.
|
|
988
|
+
if (Predicate.isNotUndefined(targeted)) return Feature.tellingUnreadColors(variableValues, (variable, resolved) => targeted({ [variable]: resolved }))
|
|
989
|
+
if (!DEV || internal.complete === true) return variableValues
|
|
990
|
+
const registry = useFeatureRegistry()
|
|
991
|
+
return Feature.tellingUnreadColors(variableValues, (variable, resolved) => {
|
|
992
|
+
if (untrack(features.pending)) return
|
|
993
|
+
warnMissing(registry, "colors", `The colour \`${variable}\` (resolved to \`${resolved}\`)`)
|
|
994
|
+
})
|
|
995
|
+
}
|
|
996
|
+
|
|
971
997
|
/** Whether a config carries its variants (#398): it sets `variants` or `inherit`. */
|
|
972
998
|
const carriesVariants = (config: WardConfigValues): boolean => Bool.or(Predicate.isNotUndefined(config.variants), Predicate.isNotUndefined(config.inherit))
|
|
973
999
|
|
|
@@ -1205,7 +1231,9 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
|
|
|
1205
1231
|
const defaultTransition = useWardicDefaultTransition()
|
|
1206
1232
|
// How a value is read in the Environment's own terms (#672).
|
|
1207
1233
|
// Its value reads (PR2-Q6): one context read.
|
|
1208
|
-
const
|
|
1234
|
+
const valueReads = ElementSetup.valueReadsOf(useWardicValueReads())
|
|
1235
|
+
const { ownValues, measuredPairs } = valueReads
|
|
1236
|
+
const variableValues = withUnreadColorWord(valueReads.variableValues, internal, features)
|
|
1209
1237
|
const owner = getOwner()
|
|
1210
1238
|
// What its accessors make at their first call goes under an owner of the ward's own, so a first
|
|
1211
1239
|
// call in a ref makes it as in the body (#566).
|