@kieransimkin/dancemoves 3.1.16 → 3.1.18
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 +9 -0
- package/docs/phone-motion-connections.md +30 -0
- package/docs/phone-motion-preference.md +3 -0
- package/lib/build-manifest.json +11 -11
- package/lib/dancemoves.min.js +3 -3
- package/lib/index.cjs +249 -19
- package/lib/index.d.ts +4 -1
- package/lib/index.mjs +249 -19
- package/lib/wordpress.js +3 -3
- package/package.json +1 -1
- package/readme.txt +11 -2
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# DanceMoves
|
|
2
2
|
|
|
3
|
+
`connectPhoneMotion()` attaches suitable existing spatial effects to one shared
|
|
4
|
+
phone input route, preserving desktop pointer input. See the
|
|
5
|
+
[connection guide](docs/phone-motion-connections.md) for permission UI, consumer
|
|
6
|
+
fan-out, motion switches and lifecycle verification.
|
|
7
|
+
|
|
3
8
|
[](https://kieransimkin.co.uk/danceflow/)
|
|
4
9
|
|
|
5
10
|
By **[Kieran Simkin](https://kieransimkin.co.uk/)** · [DanceFlow ecosystem](https://kieransimkin.co.uk/danceflow/) · [Vector logo and usage guide](docs/branding/README.md).
|
|
@@ -937,3 +942,7 @@ minimal reproduction, expected/actual result and relevant evidence. Do not put
|
|
|
937
942
|
one-off command mistakes, private workspace paths or resolved incident diaries
|
|
938
943
|
back into this section. Existing release and deployment history remains in Git,
|
|
939
944
|
`migration/` and `qa/`.
|
|
945
|
+
|
|
946
|
+
## WordPress.org publication
|
|
947
|
+
|
|
948
|
+
The release workflow can update the WordPress.org directory automatically after a validated release tag. Initial directory submission and human approval remain required. After approval, configure repository variables `WPORG_PLUGIN_APPROVED=true` and `WPORG_PLUGIN_SLUG` with the directory-assigned slug, plus `WPORG_SVN_USERNAME` and `WPORG_SVN_PASSWORD` secrets in the `wordpress-org` environment. The job verifies the exact tested release artifacts after the matching GitHub release exists, then uploads the packaged plugin through SVN. It remains disabled while the initial submission is queued; it does not install the plugin on a website. Website: https://kieransimkin.co.uk/danceflow/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Connect existing spatial effects to phone input
|
|
2
|
+
|
|
3
|
+
`runtime.connectPhoneMotion()` composes the shared permission-aware orientation controller with existing pointer handles and a narrow appearance callback. It does not select choreography or add artwork. Call it after the mount's `ready` promise so the page's pointer handles exist. Use one connection per page, listing all suitable spatial consumers.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
await runtime.ready;
|
|
7
|
+
const connection = runtime.connectPhoneMotion({
|
|
8
|
+
pointers: ['release:hero-depth', 'release:artwork-depth'],
|
|
9
|
+
enabled: () => root.dataset.motion !== 'off' && root.dataset.quality !== 'static',
|
|
10
|
+
watchAttributes: ['class', 'data-motion', 'data-quality'],
|
|
11
|
+
render: ({x, y}) => {
|
|
12
|
+
root.style.setProperty('--release-light-x', String(x));
|
|
13
|
+
root.style.setProperty('--release-light-y', String(y));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Pointer IDs are resolved for every sample, so a motion switch can replace a pointer without leaving a stale sensor attachment. The render callback may map the same normalized coordinates to other release-owned CSS properties. Keep targets bounded and callbacks nonthrowing. The connection clamps both axes to [-1, 1] and sends zero/reset when suspended. Leave ordinary interactive button hover/focus and scroll controls independent.
|
|
19
|
+
|
|
20
|
+
Options: `pointers` (string array), `render` (callback), `enabled` (predicate), `watchAttributes` (attributes on the mount root that require reconciliation), `controlParent` (default document body) and `windowMilliseconds` (default 10000). Attribute observation deliberately excludes style writes by default. Call `reconcile()` after an application-owned state change that is not represented by the watched attributes.
|
|
21
|
+
|
|
22
|
+
On supported secure mobile/touch devices, browsers requiring permission receive a single **Use phone motion** button. Only its click or an explicit gesture calling `enable()` requests permission. Browsers without that method listen directly unless the visitor previously disabled input. A stored enabled choice restores listening without requesting permission. Finite delivered samples establish `sensorActive` and remove the button. With no readings, the 3.5-second check retains **Use phone motion** for permission browsers or shows **Phone motion unavailable** for a direct-listener browser. Permission denial displays **Phone motion blocked**. These states do not certify hardware or browser permission.
|
|
23
|
+
|
|
24
|
+
If the mount already owns a legacy orientation provider, the connection subscribes to that provider instead of starting a second sensor listener or permission control. That provider retains its existing calibration/window and appearance. Its `subscribe(callback)` returns an unsubscribe function and forwards committed normalized samples plus reset/teardown. `suspend(boolean)` temporarily stops input and controls without changing the visitor's stored choice. No release selectors or identifiers are added to the shared connection.
|
|
25
|
+
|
|
26
|
+
Reduced motion, forced colours, page hiding, pagehide/pageshow, screen rotation, explicit application enable predicates and mount teardown remain authoritative. Generic orientation controllers also expose `setActive(boolean)` for temporary suspension; `disable()` is a persistent opt-out. The connection returns `enable()`, `reconcile()`, `snapshot()` and `destroy()`. Destroying it removes its control/listeners/observer and resets its consumers; an existing shared provider remains owned by the runtime.
|
|
27
|
+
|
|
28
|
+
Desktop or unsupported connections create no sensor listener, UI or appearance writes. Existing desktop pointer controllers remain independent. The connection does not create a new quality monitor; use the page's existing quality predicate. Tests must verify all mapped consumers, permission/no-data paths, preference changes and lifecycle cancellation. Physical iPhone/Safari delivery and full-stack frame-rate acceptance require physical evidence, separately from synthetic browser tests.
|
|
29
|
+
|
|
30
|
+
Quality owners reconcile live preferences while sampling frames as well as on media notifications. A temporarily imposed accessibility tier restores its saved tier promptly; performance recovery cooldowns apply only to measured performance changes.
|
|
@@ -16,6 +16,9 @@ request permission. A denied request stops listening and records disabled.
|
|
|
16
16
|
Pages without a tilt adapter do not acquire a new effect.
|
|
17
17
|
|
|
18
18
|
The reusable `createOrientation()` controller follows the same stored choice.
|
|
19
|
+
Use [`connectPhoneMotion()`](phone-motion-connections.md) to attach suitable existing
|
|
20
|
+
pointer handles and appearance callbacks with shared permission UI and lifecycle
|
|
21
|
+
gates. It reuses an existing orientation provider when one is already mounted.
|
|
19
22
|
Its `enabled` and `listening` snapshot fields describe local intent/listener
|
|
20
23
|
state, not verified browser permission or sensor delivery. Applications retain
|
|
21
24
|
ownership of their enable UI. Reduced motion, forced colours and hidden-page
|
package/lib/build-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "dancemoves-library-build/v1",
|
|
3
3
|
"name": "@kieransimkin/dancemoves",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.18",
|
|
5
5
|
"homepage": "https://kieransimkin.co.uk/my-songs/",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"path": "dancemoves.min.js",
|
|
34
|
-
"bytes":
|
|
35
|
-
"sha256": "
|
|
34
|
+
"bytes": 189980,
|
|
35
|
+
"sha256": "5972c3cf36acf9cdb2781c97044772d946cc9c1f39b7f988b10ede87c75de0e4"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"path": "index.cjs",
|
|
39
|
-
"bytes":
|
|
40
|
-
"sha256": "
|
|
39
|
+
"bytes": 320229,
|
|
40
|
+
"sha256": "c081cee16c6023f768844d8a5f2505b63c959407ad073981fa1d95f51e1b3194"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "index.d.ts",
|
|
44
|
-
"bytes":
|
|
45
|
-
"sha256": "
|
|
44
|
+
"bytes": 10545,
|
|
45
|
+
"sha256": "218096340a1ac20451ce28a04c31c74881a37ff3dad065decfcc8ac03d883143"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"path": "index.mjs",
|
|
49
|
-
"bytes":
|
|
50
|
-
"sha256": "
|
|
49
|
+
"bytes": 319145,
|
|
50
|
+
"sha256": "e6aa6994b440a0eb68894c181428ec4f5fff934ae50c5d84c153eb904a534764"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"path": "react.cjs",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
"path": "wordpress.js",
|
|
109
|
-
"bytes":
|
|
110
|
-
"sha256": "
|
|
109
|
+
"bytes": 188795,
|
|
110
|
+
"sha256": "674ddf2c62e4c183153c52efdfc4ef9ca4b5c962b5f090feea7b166bb4fe8c25"
|
|
111
111
|
}
|
|
112
112
|
]
|
|
113
113
|
}
|