@wardic/solid 2.2.1 → 2.2.3

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 (40) hide show
  1. package/dist/browser/live-scroll.js +3 -2
  2. package/dist/browser/live-scroll.js.map +1 -1
  3. package/dist/browser/v1/create-ward.js +18 -3
  4. package/dist/browser/v1/create-ward.js.map +1 -1
  5. package/dist/browser/v1/index.js +1 -1
  6. package/dist/browser/v1/live-scroll.js +3 -2
  7. package/dist/browser/v1/live-scroll.js.map +1 -1
  8. package/dist/browser/ward.js +18 -3
  9. package/dist/browser/ward.js.map +1 -1
  10. package/dist/server/live-scroll.js +3 -2
  11. package/dist/server/live-scroll.js.map +1 -1
  12. package/dist/server/v1/create-ward.js +18 -3
  13. package/dist/server/v1/create-ward.js.map +1 -1
  14. package/dist/server/v1/index.js +1 -1
  15. package/dist/server/v1/live-scroll.js +3 -2
  16. package/dist/server/v1/live-scroll.js.map +1 -1
  17. package/dist/server/ward.js +18 -3
  18. package/dist/server/ward.js.map +1 -1
  19. package/dist/solid/live-scroll.d.ts +3 -2
  20. package/dist/solid/live-scroll.d.ts.map +1 -1
  21. package/dist/solid/live-scroll.jsx +3 -2
  22. package/dist/solid/live-scroll.jsx.map +1 -1
  23. package/dist/solid/v1/create-ward.d.ts.map +1 -1
  24. package/dist/solid/v1/create-ward.jsx +19 -1
  25. package/dist/solid/v1/create-ward.jsx.map +1 -1
  26. package/dist/solid/v1/index.d.ts +1 -1
  27. package/dist/solid/v1/index.jsx +1 -1
  28. package/dist/solid/v1/live-scroll.d.ts +3 -2
  29. package/dist/solid/v1/live-scroll.d.ts.map +1 -1
  30. package/dist/solid/v1/live-scroll.jsx +3 -2
  31. package/dist/solid/v1/live-scroll.jsx.map +1 -1
  32. package/dist/solid/ward.d.ts.map +1 -1
  33. package/dist/solid/ward.jsx +19 -1
  34. package/dist/solid/ward.jsx.map +1 -1
  35. package/package.json +5 -5
  36. package/src/live-scroll.tsx +3 -2
  37. package/src/v1/create-ward.tsx +19 -1
  38. package/src/v1/index.tsx +1 -1
  39. package/src/v1/live-scroll.tsx +3 -2
  40. package/src/ward.tsx +19 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wardic/solid",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Motion for React's API on Solid 2, and on Solid 1 at @wardic/solid/v1: Wardic's elements, gestures, layout and presence animations.",
5
5
  "keywords": [
6
6
  "animation",
@@ -78,8 +78,8 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "@solid-primitives/refs": "^1.1.3",
81
- "@wardic/core": "1.4.1",
82
- "@wardic/dom": "1.4.1",
81
+ "@wardic/core": "1.4.3",
82
+ "@wardic/dom": "1.4.3",
83
83
  "csstype": "^3.1.0"
84
84
  },
85
85
  "peerDependencies": {
@@ -101,8 +101,8 @@
101
101
  "@solidjs/router-1": "npm:@solidjs/router@1.0.1",
102
102
  "@solidjs/web": "2.0.1",
103
103
  "@types/babel__core": "^7.20.5",
104
- "@wardic/object": "1.4.1",
105
- "@wardic/test": "1.4.1",
104
+ "@wardic/object": "1.4.3",
105
+ "@wardic/test": "1.4.3",
106
106
  "babel-preset-solid": "1.9.12",
107
107
  "effect": "4.1.4",
108
108
  "solid-js": "2.0.1",
@@ -79,8 +79,9 @@ const elementOf = (source: ElementSource | undefined): Option.Option<Element | u
79
79
  * and `scrollYProgress`, from 0 to 1 through its range. The page's, or a `container`'s. With a
80
80
  * `target`, the progress is the target's way through, between two `offset`s, on `axis`. Each is set in
81
81
  * 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. 0s on a
83
- * server. Motion's `useScroll`.
82
+ * `container` or `target` given as an accessor of a ref reads 0s until the ref is there, and a target
83
+ * taken off the page holds the values where they were until one is back. 0s on a server. Motion's
84
+ * `useScroll`.
84
85
  *
85
86
  * Where the browser has native scroll timelines, an element's `opacity`, `filter`, `clipPath` or
86
87
  * transform key given one of these, or a `createTransform` of one through ranges, is drawn by the
@@ -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 { ownValues, measuredPairs, variableValues } = valueReadsIn(opts.valueReads)
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 = "2.2.1"
20
+ export const VERSION = "2.2.3"
21
21
 
22
22
  /**
23
23
  * `WardicProvider` (one Effect runtime + `AtomRegistry` per ADR-0006), the
@@ -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. 0s on a
82
- * server. Motion's `useScroll`.
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
@@ -135,6 +135,7 @@ import { neverLands, NO_EVENTS, serverWhen } from "./waiters.ts"
135
135
  import { usePresenceContext } from "./presence.tsx"
136
136
  import { createVariantNode, useVariantContext, type VariantNode, WardicVariantContext } from "./variant-node.ts"
137
137
  import type * as DragTrack from "@wardic/dom/unstable/DragTrack"
138
+ import type * as VariableValues from "@wardic/core/unstable/VariableValues"
138
139
 
139
140
  /**
140
141
  * A Wardic element's `style`: every CSS property and the transform keys (`x`,
@@ -775,6 +776,21 @@ const warnUnreadColors = (registry: Feature.FeatureRegistry, features: Feature.F
775
776
  )
776
777
  }
777
778
 
779
+ /**
780
+ * The element's Variable values, saying so when one resolves to a colour only the `colors` Feature reads
781
+ * (#1092, ADR-0067 decision 7): {@link warnUnreadColors}' word, once per provider, for a value its check
782
+ * of values as written can't see. Development only, not on a Complete element, and not while a lazy load
783
+ * is on its way; otherwise `variableValues` as it is.
784
+ */
785
+ const withUnreadColorWord = (variableValues: VariableValues.Shape, complete: boolean, features: Feature.FeatureSection): VariableValues.Shape => {
786
+ if (!DEV || complete) return variableValues
787
+ const registry = useFeatureRegistry()
788
+ return Feature.tellingUnreadColors(variableValues, (variable, resolved) => {
789
+ if (untrack(features.pending)) return
790
+ registry.warnOnce("colors", Feature.missingMessage("colors", `The colour \`${variable}\` (resolved to \`${resolved}\`)`, ENTRY))
791
+ })
792
+ }
793
+
778
794
  /** Whether a config carries its variants (#398): it sets `variants` or `inherit`. */
779
795
  const carriesVariants = (config: WardConfigValues): boolean => Bool.or(Predicate.isNotUndefined(config.variants), Predicate.isNotUndefined(config.inherit))
780
796
 
@@ -975,7 +991,9 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
975
991
  const defaultTransition = useWardicDefaultTransition()
976
992
  // How a value is read in the Environment's own terms (#672).
977
993
  // Its value reads (PR2-Q6): one context read.
978
- const { ownValues, measuredPairs, variableValues } = ElementSetup.valueReadsOf(useWardicValueReads())
994
+ const valueReads = ElementSetup.valueReadsOf(useWardicValueReads())
995
+ const { ownValues, measuredPairs } = valueReads
996
+ const variableValues = withUnreadColorWord(valueReads.variableValues, internal.complete === true, features)
979
997
  const owner = getOwner()
980
998
  // What its accessors make at their first call goes under an owner of the ward's own, so a first
981
999
  // call in a ref makes it as in the body (#566).