@simon-says-build/demo-player 0.14.0 → 0.14.2
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 +9 -3
- package/src/DemoHost.js +12 -2
- package/src/core.js +19 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simon-says-build/demo-player",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
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",
|
|
@@ -18,10 +18,16 @@
|
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": ">=18",
|
|
21
|
-
"react-native": ">=0.76"
|
|
21
|
+
"react-native": ">=0.76",
|
|
22
|
+
"react-native-screens": ">=3"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
25
|
"test": "node --test test/*.test.mjs"
|
|
25
26
|
},
|
|
26
|
-
"license": "UNLICENSED"
|
|
27
|
+
"license": "UNLICENSED",
|
|
28
|
+
"peerDependenciesMeta": {
|
|
29
|
+
"react-native-screens": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
27
33
|
}
|
package/src/DemoHost.js
CHANGED
|
@@ -15,7 +15,15 @@
|
|
|
15
15
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import { Linking, NativeModules, Platform, Settings, Pressable, ScrollView, StyleSheet, Text, TextInput, View, useWindowDimensions } from 'react-native';
|
|
17
17
|
import { pageName } from './page-name.js';
|
|
18
|
-
|
|
18
|
+
// ABOVE NATIVE SHEETS (0.14.2, 2026-11-07): a profile that opens as a native
|
|
19
|
+
// sheet (react-native-screens formSheet) covered the card, so Connie Ho's review
|
|
20
|
+
// lost its card at "tap her photo" (demo 16D4S5HqugIonvUSdC5u). On iOS the
|
|
21
|
+
// overlay draws in react-native-screens' FullWindowOverlay — a window above the
|
|
22
|
+
// app's own, sheets and modals included; taps outside the card still reach the
|
|
23
|
+
// app (box-none). An app without react-native-screens keeps the in-tree layer.
|
|
24
|
+
let FullWindowOverlay = null;
|
|
25
|
+
try { FullWindowOverlay = require('react-native-screens').FullWindowOverlay || null; } catch { FullWindowOverlay = null; }
|
|
26
|
+
import { OVERLAY_ID, overlayLayer, chapterOf, 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
27
|
import { demoApi, tourOf } from './api.js';
|
|
20
28
|
import { signInFirst, openInApp } from './signin.js';
|
|
21
29
|
import { runEvent, fillStep } from './events.js';
|
|
@@ -362,7 +370,9 @@ function Player({ config, router, insets, onClose, children }) {
|
|
|
362
370
|
};
|
|
363
371
|
return h(View, { ref: rootRef, style: s.root, collapsable: false, onTouchEnd },
|
|
364
372
|
children,
|
|
365
|
-
|
|
373
|
+
overlayLayer(Platform.OS, FullWindowOverlay) === 'window'
|
|
374
|
+
? h(FullWindowOverlay, null, h(View, { pointerEvents: 'box-none', style: StyleSheet.absoluteFill, testID: OVERLAY_ID }, overlay))
|
|
375
|
+
: h(View, { pointerEvents: 'box-none', style: StyleSheet.absoluteFill, testID: OVERLAY_ID }, overlay));
|
|
366
376
|
}
|
|
367
377
|
|
|
368
378
|
// The review card: every change of the demo, each approved here or discussed
|
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.14.
|
|
13
|
+
export const PLAYER_VERSION = '0.14.2';
|
|
14
14
|
|
|
15
15
|
export const HOST = 5;
|
|
16
16
|
export const TEXT = 6;
|
|
@@ -194,12 +194,28 @@ export function cardBox(place, at, screen, insets, card) {
|
|
|
194
194
|
// pinned to the top by default, but with a collapse button"). The card sits
|
|
195
195
|
// across the top of the screen; only when it would cover the ringed element
|
|
196
196
|
// (`at`) does it move to the bottom. Pure.
|
|
197
|
+
// THE DEV CLIENT'S BUTTON (2026-11-07): a review plays in a development build,
|
|
198
|
+
// and expo-dev-menu draws its floating tools button (the gear) in a native
|
|
199
|
+
// window above the app at the top-right. Its touch area is far bigger than the
|
|
200
|
+
// icon — on SSB's iPhone simulator nothing below it got touches from x ≈ 305
|
|
201
|
+
// to the edge, down to y ≈ 165 — so a short card pinned at the top had its
|
|
202
|
+
// right-aligned primary button under it: "Take me there" did nothing for the
|
|
203
|
+
// playback check and for a person alike (Connie Ho's review, demo
|
|
204
|
+
// 16D4S5HqugIonvUSdC5u; mapped by hand-tapping a grid on the simulator). A card
|
|
205
|
+
// pinned at the TOP stays left of it; one pinned at the bottom is full width.
|
|
206
|
+
export const DEV_FAB_CLEAR = 88;
|
|
207
|
+
|
|
208
|
+
// Where the overlay draws (0.14.2): iOS with react-native-screens → its own
|
|
209
|
+
// window above sheets and modals (DemoHost, FullWindowOverlay); else in-tree.
|
|
210
|
+
export const overlayLayer = (os, fwo) => (os === 'ios' && fwo ? 'window' : 'tree');
|
|
211
|
+
|
|
197
212
|
export function pinnedBox(at, screen, insets, card) {
|
|
198
|
-
const left = 12,
|
|
213
|
+
const left = 12, full = screen.width - 24;
|
|
199
214
|
const top = insets.top + 8;
|
|
200
215
|
const bottom = screen.height - insets.bottom - card.h - 8;
|
|
201
216
|
const covers = at && at.top < top + card.h + 8 && at.bottom > top;
|
|
202
|
-
|
|
217
|
+
const y = covers ? Math.max(top, bottom) : top;
|
|
218
|
+
return { left, width: y === top ? full - DEV_FAB_CLEAR : full, top: y };
|
|
203
219
|
}
|
|
204
220
|
|
|
205
221
|
// A TAP ON THE RINGED ELEMENT (0.13.1): a `try` step is done when the viewer's
|