@simon-says-build/ssb-overlay 0.9.2 → 0.9.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simon-says-build/ssb-overlay",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "SSB inside a native app SimonSays controls: the SSB button for the people who change the app (screenshot, mark, ask for a change), and Help for everyone who uses it.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/SsbHost.js CHANGED
@@ -146,7 +146,6 @@ function Host({ config, getToken, sessionKey, route, capture, storage, pushToken
146
146
  const [shot, setShot] = useState(null); // the screen as it was when the button was tapped
147
147
  const [frozen, setFrozen] = useState(null); // while drawing: { pic, hosts } — the screen held still under the pencil
148
148
  const [items, setItems] = useState([]); // what is drawn: strokes and boxes, in screen points (core.js)
149
- const [openShot, setOpenShot] = useState(null); // the message whose full screen is showing (its preview otherwise)
150
149
  const [live, setLive] = useState(null); // the item under the finger
151
150
  const liveRef = useRef(null);
152
151
  const [tool, setTool] = useState('pencil'); // pencil | box
@@ -519,8 +518,11 @@ function Host({ config, getToken, sessionKey, route, capture, storage, pushToken
519
518
  accessibilityLabel: t === 'box' ? 'Box: drag a box round it' : 'Pencil: scribble on it', style: [s.toolBtn, tool === t && s.toolOn],
520
519
  }, h(Text, { style: [s.toolText, tool === t && s.toolTextOn] }, t === 'box' ? '▭ Box' : '✎ Pencil'))),
521
520
  h(View, { style: s.hintSep }),
522
- items.length ? h(Pressable, { onPress: () => setItems((all) => all.slice(0, -1)), accessibilityRole: 'button', accessibilityLabel: 'Undo the last one', style: s.hintBtn }, h(Text, { style: s.hintLink }, 'Undo')) : null,
523
- h(Pressable, { onPress: stopDrawing, accessibilityRole: 'button', accessibilityLabel: 'Stop drawing', style: s.hintBtn }, h(Text, { style: s.hintLink }, 'Cancel'))),
521
+ // Undo and Cancel are buttons, always there (Michael, 2026-10-26: two
522
+ // small links, Undo only after a mark, read as missing). Undo takes
523
+ // the last mark off; Cancel drops them all and goes back to the panel.
524
+ h(Pressable, { testID: 'ssb-draw-undo', onPress: () => setItems((all) => all.slice(0, -1)), disabled: !items.length, accessibilityRole: 'button', accessibilityLabel: 'Undo the last one', accessibilityState: { disabled: !items.length }, style: [s.hintBtn, !items.length && s.disabled] }, h(Text, { style: s.hintBtnText }, '↶ Undo')),
525
+ h(Pressable, { testID: 'ssb-draw-cancel', onPress: stopDrawing, accessibilityRole: 'button', accessibilityLabel: 'Stop drawing', style: [s.hintBtn, s.hintCancel] }, h(Text, { style: s.hintBtnText }, '✕ Cancel'))),
524
526
  top != null ? h(View, { style: [s.field, { top }] },
525
527
  h(TextInput, {
526
528
  testID: 'ssb-draw-note', value: note, onChangeText: setNote, placeholder: 'What should change here?',
@@ -563,6 +565,7 @@ function Panel({ gate, chat, work, elsewhere, onDemo, screen, insets, draft, set
563
565
  const sheet = useRef(null);
564
566
  const scroll = useRef(null);
565
567
  const [at, setAt] = useState(COMPACT);
568
+ const [openShot, setOpenShot] = useState(null); // the message whose full screen is showing (its preview otherwise)
566
569
  const [footH, setFootH] = useState(120);
567
570
  const [open, setOpen] = useState(null); // the draft whose detail is shown
568
571
  const { flying, waiting, sent } = workView({ inFlight: work, chat });
@@ -700,8 +703,9 @@ const s = StyleSheet.create({
700
703
  toolText: { color: TEXT, fontSize: 14, fontWeight: '600' },
701
704
  toolTextOn: { color: '#fff' },
702
705
  hintSep: { width: 1, height: 18, backgroundColor: LINE, marginHorizontal: 6 },
703
- hintLink: { color: '#8fb3ff', fontSize: 14, fontWeight: '600' },
704
- hintBtn: { paddingHorizontal: 6, paddingVertical: 2 },
706
+ hintBtn: { paddingVertical: 5, paddingHorizontal: 10, borderRadius: 12, marginLeft: 4, borderWidth: 1, borderColor: LINE, backgroundColor: SURFACE },
707
+ hintCancel: { borderColor: 'rgba(255,77,90,0.5)' },
708
+ hintBtnText: { color: TEXT, fontSize: 14, fontWeight: '600' },
705
709
  field: { position: 'absolute', left: 12, right: 12, height: 56, flexDirection: 'row', alignItems: 'center', paddingLeft: 14, paddingRight: 6, borderRadius: 16, backgroundColor: SURFACE, borderWidth: 1, borderColor: LINE, ...shadow },
706
710
  fieldInput: { flex: 1, fontSize: 16, color: TEXT },
707
711
  sendRound: { width: 40, height: 40, borderRadius: 20, backgroundColor: BLUE, alignItems: 'center', justifyContent: 'center', marginLeft: 4, ...glow(BLUE, 10) },
package/src/core.js CHANGED
@@ -5,7 +5,7 @@
5
5
  export const DEFAULT_API = 'https://simonsays.build';
6
6
  // What this overlay is, said when it registers for pushes (clientInfo below).
7
7
  // Kept equal to package.json by test/core.test.mjs.
8
- export const OVERLAY_VERSION = '0.9.2';
8
+ export const OVERLAY_VERSION = '0.9.4';
9
9
  export const HOST = 5;
10
10
  export const TEXT = 6;
11
11
  const PIN_SLOP = 12; // a drag shorter than this is a tap: a pin, not a box