@simon-says-build/demo-player 0.13.0 → 0.13.1
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/package.json +1 -1
- package/src/DemoHost.js +9 -2
- package/src/core.js +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simon-says-build/demo-player",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "SimonSays mobile demo player: walks a preview's viewer through a job's change, inside the app. Renders nothing unless the bundle carries a demo.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/src/DemoHost.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import { Linking, NativeModules, Pressable, ScrollView, StyleSheet, Text, TextInput, View, useWindowDimensions } from 'react-native';
|
|
17
17
|
import { pageName } from './page-name.js';
|
|
18
|
-
import { OVERLAY_ID, cardBox, pinnedBox, setTuckedDemo, overlayAnnounced, currentDemo, demoConfig, findTarget, handlerFor, introBody, introOf, onDemo, phoneSteps, playDemo, releaseOf, reviewChangesOf, scalePoint, rescueNote, screenCandidates, stepTitle, targetOfKey } from './core.js';
|
|
18
|
+
import { OVERLAY_ID, cardBox, pinnedBox, setTuckedDemo, overlayAnnounced, tapInside, currentDemo, demoConfig, findTarget, handlerFor, introBody, introOf, onDemo, phoneSteps, playDemo, releaseOf, reviewChangesOf, scalePoint, rescueNote, screenCandidates, stepTitle, targetOfKey } from './core.js';
|
|
19
19
|
import { demoApi, tourOf } from './api.js';
|
|
20
20
|
import { signInFirst, openInApp } from './signin.js';
|
|
21
21
|
import { runEvent, fillStep } from './events.js';
|
|
@@ -337,7 +337,14 @@ function Player({ config, router, insets, onClose, children }) {
|
|
|
337
337
|
}));
|
|
338
338
|
})();
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
// A try step's tap, seen as it passes (never intercepted): the touch that
|
|
341
|
+
// ends on the ringed element is the viewer trying it (core.js tapInside).
|
|
342
|
+
const onTouchEnd = (e) => {
|
|
343
|
+
if (step?.kind !== 'try' || tried || !rect) return;
|
|
344
|
+
const { pageX, pageY } = e.nativeEvent || {};
|
|
345
|
+
if (tapInside(rect, pageX, pageY)) setTimeout(() => setTried(true), 600);
|
|
346
|
+
};
|
|
347
|
+
return h(View, { ref: rootRef, style: s.root, collapsable: false, onTouchEnd },
|
|
341
348
|
children,
|
|
342
349
|
h(View, { pointerEvents: 'box-none', style: StyleSheet.absoluteFill, testID: OVERLAY_ID }, overlay));
|
|
343
350
|
}
|
package/src/core.js
CHANGED
|
@@ -10,7 +10,7 @@ import { bubbleBox } from './step-place.js';
|
|
|
10
10
|
// What this player is, said when the app registers for "Ready to see"
|
|
11
11
|
// (packages/ssb-overlay sends it; functions/in-app-notify.mjs clientOf). Kept
|
|
12
12
|
// equal to package.json by test/core.test.mjs.
|
|
13
|
-
export const PLAYER_VERSION = '0.13.
|
|
13
|
+
export const PLAYER_VERSION = '0.13.1';
|
|
14
14
|
|
|
15
15
|
export const HOST = 5;
|
|
16
16
|
export const TEXT = 6;
|
|
@@ -191,6 +191,17 @@ export function pinnedBox(at, screen, insets, card) {
|
|
|
191
191
|
return { left, width, top: covers ? Math.max(top, bottom) : top };
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// A TAP ON THE RINGED ELEMENT (0.13.1): a `try` step is done when the viewer's
|
|
195
|
+
// touch lands on it (with a little slop for a finger). Watching for the element
|
|
196
|
+
// to leave the screen missed a modal: Connie Ho's profile opens OVER the walks
|
|
197
|
+
// list, the photo stays mounted, and the card kept offering "Show me" after
|
|
198
|
+
// Michael had tapped it (2026-11-05). Pure.
|
|
199
|
+
export function tapInside(rect, x, y, slop = 10) {
|
|
200
|
+
return !!rect && Number.isFinite(x) && Number.isFinite(y)
|
|
201
|
+
&& x >= rect.left - slop && x <= rect.left + rect.width + slop
|
|
202
|
+
&& y >= rect.top - slop && y <= rect.top + rect.height + slop;
|
|
203
|
+
}
|
|
204
|
+
|
|
194
205
|
// COLLAPSED, AND RESUMED FROM THE SSB BUTTON (0.13.0): collapsing leaves only
|
|
195
206
|
// the in-app SSB button (packages/ssb-overlay), whose tap resumes the review.
|
|
196
207
|
// The overlay says it is there (`announceOverlay`); without one the player
|