abuzaid-adaptive-motion 0.1.0-alpha.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,14 +1,28 @@
1
1
  # abuzaid-adaptive-motion
2
- Coach Abuzaid Open Source Labs — Experimental public alpha. Not production-ready.
2
+ Coach Abuzaid Open Source Labs — Stable Node.js API for the limited documented scope.
3
3
 
4
4
  Pure logical swipe classification and motion preference policy
5
5
 
6
- Experimental gesture math, not a pointer-event handler or animation framework. The caller must handle scrolling, pointer cancellation, accessibility, keyboard equivalents and event coordination. Logical inline directions respect RTL. Reduced-motion policy sets duration to zero.
6
+ Gesture math, not a pointer-event handler or animation framework. The caller must handle scrolling, pointer cancellation, accessibility, keyboard equivalents and event coordination. Logical inline directions respect RTL. Reduced-motion policy sets duration to zero.
7
7
 
8
- Node.js 20+, no runtime dependencies. Run npm test. Review security, documentation, license and test coverage before a stable release.
8
+ Node.js 20+, no runtime dependencies. Run npm test. Review integration requirements before production use.
9
9
 
10
10
  ## Release status
11
- This repository is an early open-source preview by Coach Abuzaid Open Source Labs. The current functionality is deliberately limited to the documented scope. Passing unit tests is not evidence of clinical safety, security certification, browser compatibility or production readiness. No package has been published to npm. No guarantees are made.
11
+
12
+ Pure logical swipe classification and duration preference arithmetic. Does not implement native gestures, event handling, rendering, accessibility or animations.
13
+
14
+ Scope: stable public functions for the narrow documented API, not a certification of a complete application or independent security or clinical validation. Source logic unchanged from qualified alpha.3. Tested on Windows, Linux and macOS with Node 20, 22 and 24; Node 20 is a legacy compatibility test, use a currently supported runtime. Browser smoke checks on Chrome and Edge only; no claim of native device support.
15
+
16
+ Qualification: https://github.com/coachabuzaid-spec/abuzaid-intelligent-training-system/actions/runs/47681002368
17
+
18
+ Local source screening, artifact integrity and targeted adversarial checks passed. Future changes will follow semantic versioning for the documented API. No production guarantees. Use bounded inputs; callers own security boundaries and integration testing.
19
+
20
+ Installation from this GitHub release: npm install https://github.com/coachabuzaid-spec/abuzaid-adaptive-motion/releases/download/v1.0.0/abuzaid-adaptive-motion-1.0.0.tgz
21
+ Registry publication is separate and not yet confirmed.
22
+
12
23
 
13
24
  ## License and attribution
14
25
  Source code is licensed under Apache-2.0; see LICENSE and NOTICE. The Coach Abuzaid name and branding are not licensed for implying endorsement. Project website: https://coachabuzaid.uk.
26
+
27
+ ## Alpha.3 changes
28
+ Rejects non-finite swipe velocity and adds RTL, ambiguity and exact-threshold coverage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abuzaid-adaptive-motion",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "Pure logical swipe classification and motion preference policy",
6
6
  "exports": "./src/index.mjs",
@@ -19,13 +19,13 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/coachabuzaid-spec/abuzaid-adaptive-motion/issues"
21
21
  },
22
+ "files": [
23
+ "src",
24
+ "NOTICE"
25
+ ],
22
26
  "publishConfig": {
23
27
  "access": "public",
24
- "tag": "alpha",
28
+ "tag": "latest",
25
29
  "registry": "https://registry.npmjs.org/"
26
- },
27
- "files": [
28
- "NOTICE",
29
- "src"
30
- ]
30
+ }
31
31
  }
package/src/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  function finite(v){if(typeof v!=='number'||!Number.isFinite(v))throw new TypeError('finite number required');return v}
2
- export function classifySwipe({dx,dy,elapsedMs,direction='ltr',thresholdPx=40,minDominance=1.4}){[dx,dy,elapsedMs,thresholdPx,minDominance].forEach(finite);if(elapsedMs<=0||thresholdPx<=0||minDominance<1||!['ltr','rtl'].includes(direction))throw new RangeError('invalid gesture parameters');const ax=Math.abs(dx),ay=Math.abs(dy);if(Math.max(ax,ay)<thresholdPx)return {axis:'none'};if(ax>=ay*minDominance&&ax>ay){const towardEnd=direction==='ltr'?dx>0:dx<0;return {axis:'inline',direction:towardEnd?'end':'start',velocityPxPerMs:ax/elapsedMs}}if(ay>=ax*minDominance&&ay>ax)return {axis:'block',direction:dy>0?'end':'start',velocityPxPerMs:ay/elapsedMs};return {axis:'none'}}
2
+ export function classifySwipe({dx,dy,elapsedMs,direction='ltr',thresholdPx=40,minDominance=1.4}){[dx,dy,elapsedMs,thresholdPx,minDominance].forEach(finite);if(elapsedMs<=0||thresholdPx<=0||minDominance<1||!['ltr','rtl'].includes(direction))throw new RangeError('invalid gesture parameters');const ax=Math.abs(dx),ay=Math.abs(dy);if(Math.max(ax,ay)<thresholdPx)return {axis:'none'};if(ax>=ay*minDominance&&ax>ay){const towardEnd=direction==='ltr'?dx>0:dx<0;return {axis:'inline',direction:towardEnd?'end':'start',velocityPxPerMs:finite(ax/elapsedMs)}}if(ay>=ax*minDominance&&ay>ax)return {axis:'block',direction:dy>0?'end':'start',velocityPxPerMs:finite(ay/elapsedMs)};return {axis:'none'}}
3
3
  export function resolveMotion({durationMs,reducedMotion=false}){finite(durationMs);if(durationMs<0||typeof reducedMotion!=='boolean')throw new RangeError('invalid motion preference');return {durationMs:reducedMotion?0:durationMs,reducedMotion}}