yaver-feedback-react-native 0.8.1 → 0.8.3

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,6 +1,6 @@
1
1
  # yaver-feedback-react-native
2
2
 
3
- Visual feedback SDK for Yaver. Lets testers and developers shake their phone and then keep a small quick-access icon on screen for hot reload, vibing, screenshot or file upload, and screen recording uploads straight to a Yaver agent running on a dev machine.
3
+ Visual feedback SDK for Yaver. Lets testers and developers shake their phone and then keep a small quick-access icon on screen for hot reload, vibing, and screenshot & fix flows straight to a Yaver agent running on a dev machine.
4
4
 
5
5
  ## Installation
6
6
 
@@ -85,7 +85,7 @@ function App() {
85
85
  }
86
86
  ```
87
87
 
88
- Shake your phone to open the feedback modal. On mobile the quick-access icon stays hidden until that first shake, then remains tappable for the rest of the session unless the user hides it. From there the sheet exposes four core actions: hot reload, vibing, screenshot or file upload, and screen recording upload.
88
+ Shake your phone to open the feedback modal. On mobile the quick-access icon stays hidden until that first shake, then remains tappable for the rest of the session unless the user hides it. For launch, the sheet exposes three actions only: hot reload, vibing, and screenshot & fix.
89
89
 
90
90
  ### Quick Icon Styling
91
91
 
@@ -38,6 +38,7 @@ const react_1 = __importStar(require("react"));
38
38
  const react_native_1 = require("react-native");
39
39
  const LoginScreen_1 = require("./LoginScreen");
40
40
  const MachinePickerScreen_1 = require("./MachinePickerScreen");
41
+ const GuestOnboardingScreen_1 = require("./GuestOnboardingScreen");
41
42
  const YaverFeedback_1 = require("./YaverFeedback");
42
43
  const auth_1 = require("./auth");
43
44
  /**
@@ -56,8 +57,10 @@ const auth_1 = require("./auth");
56
57
  */
57
58
  const AuthOverlay = () => {
58
59
  const [loginVisible, setLoginVisible] = (0, react_1.useState)(false);
60
+ const [guestVisible, setGuestVisible] = (0, react_1.useState)(false);
59
61
  const [pickerVisible, setPickerVisible] = (0, react_1.useState)(false);
60
62
  const [token, setToken] = (0, react_1.useState)(null);
63
+ const [pendingInviteCode, setPendingInviteCode] = (0, react_1.useState)(null);
61
64
  (0, react_1.useEffect)(() => {
62
65
  let mounted = true;
63
66
  (async () => {
@@ -79,25 +82,52 @@ const AuthOverlay = () => {
79
82
  pickerSub.remove();
80
83
  };
81
84
  }, []);
82
- const handleLoggedIn = async (newToken) => {
85
+ const continueAfterAuth = async (newToken, inviteCode) => {
83
86
  setToken(newToken);
84
87
  await YaverFeedback_1.YaverFeedback.setAuthToken(newToken);
88
+ const devices = await (0, auth_1.listReachableDevices)(newToken).catch(() => ({ owned: [], shared: [] }));
85
89
  setLoginVisible(false);
90
+ const cleanedInviteCode = (inviteCode ?? '').trim().toUpperCase();
91
+ if (cleanedInviteCode) {
92
+ setPendingInviteCode(cleanedInviteCode);
93
+ setGuestVisible(true);
94
+ return;
95
+ }
96
+ if (devices.owned.length === 0 && devices.shared.length === 0) {
97
+ setGuestVisible(true);
98
+ return;
99
+ }
86
100
  setPickerVisible(true);
87
101
  };
102
+ const handleLoggedIn = async (newToken, opts) => {
103
+ await continueAfterAuth(newToken, opts?.inviteCode);
104
+ };
88
105
  const handleDevicePicked = async (device) => {
89
106
  await YaverFeedback_1.YaverFeedback.setPreferredDevice(device.deviceId);
90
107
  setPickerVisible(false);
108
+ setGuestVisible(false);
91
109
  // Continue straight into the feedback flow the user originally triggered.
92
110
  react_native_1.DeviceEventEmitter.emit('yaverFeedback:startReport');
93
111
  };
94
112
  return (<>
95
113
  <react_native_1.Modal visible={loginVisible} animationType="slide" presentationStyle="fullScreen" onRequestClose={() => setLoginVisible(false)}>
96
- <LoginScreen_1.YaverLoginScreen onLoggedIn={handleLoggedIn} onCancel={() => setLoginVisible(false)}/>
114
+ <LoginScreen_1.YaverLoginScreen onLoggedIn={handleLoggedIn} onCancel={() => setLoginVisible(false)} initialInviteCode={pendingInviteCode ?? YaverFeedback_1.YaverFeedback.getConfig()?.guestInviteCode}/>
97
115
  </react_native_1.Modal>
98
116
 
99
117
  <react_native_1.Modal visible={pickerVisible && !!token} animationType="slide" presentationStyle="fullScreen" onRequestClose={() => setPickerVisible(false)}>
100
- {token && (<MachinePickerScreen_1.YaverMachinePickerScreen token={token} onPick={handleDevicePicked} onCancel={() => setPickerVisible(false)}/>)}
118
+ {token && (<MachinePickerScreen_1.YaverMachinePickerScreen token={token} currentDeviceId={YaverFeedback_1.YaverFeedback.getConfig()?.preferredDeviceId} onPick={handleDevicePicked} onCancel={() => setPickerVisible(false)}/>)}
119
+ </react_native_1.Modal>
120
+
121
+ <react_native_1.Modal visible={guestVisible && !!token} animationType="slide" presentationStyle="fullScreen" onRequestClose={() => setGuestVisible(false)}>
122
+ {token && (<GuestOnboardingScreen_1.YaverGuestOnboardingScreen token={token} initialInviteCode={pendingInviteCode ?? YaverFeedback_1.YaverFeedback.getConfig()?.guestInviteCode} onContinue={() => {
123
+ setGuestVisible(false);
124
+ setPendingInviteCode(null);
125
+ setPickerVisible(true);
126
+ }} onCancel={() => {
127
+ setGuestVisible(false);
128
+ setPendingInviteCode(null);
129
+ setPickerVisible(true);
130
+ }}/>)}
101
131
  </react_native_1.Modal>
102
132
  </>);
103
133
  };
package/dist/Discovery.js CHANGED
@@ -174,8 +174,10 @@ class YaverDiscovery {
174
174
  runnerDown: !!d.runnerDown,
175
175
  lastHeartbeat: d.lastHeartbeat ?? 0,
176
176
  isGuest: !!d.isGuest,
177
+ hostUserId: d.hostUserId,
177
178
  hostName: d.hostName,
178
179
  hostEmail: d.hostEmail,
180
+ hostUserIdString: d.hostUserIdString,
179
181
  accessScope: d.accessScope ?? 'owner',
180
182
  quicHost: d.quicHost ?? d.host ?? '',
181
183
  quicPort: d.quicPort ?? 0,