@robotical/webapp-types 3.25.7 → 3.25.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marty-web-app",
3
- "version": "3.25.7",
3
+ "version": "3.25.9",
4
4
  "private": true,
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -11,6 +11,7 @@ type SimpleButtonProps = {
11
11
  textColour?: string;
12
12
  ariaLabel?: string;
13
13
  buttonType?: "button" | "submit" | "reset";
14
+ className?: string;
14
15
  };
15
- export default function SimpleButton({ onClick, title, titleSize, disabled, colour, otherStyles, borderColour, textColour, ariaLabel, buttonType, }: SimpleButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ export default function SimpleButton({ onClick, title, titleSize, disabled, colour, otherStyles, borderColour, textColour, ariaLabel, buttonType, className, }: SimpleButtonProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -87,8 +87,8 @@ var getAccessibleTextColour = function (backgroundColour) {
87
87
  return blackContrast >= whiteContrast ? BLACK : WHITE;
88
88
  };
89
89
  export default function SimpleButton(_a) {
90
- var onClick = _a.onClick, title = _a.title, titleSize = _a.titleSize, disabled = _a.disabled, colour = _a.colour, otherStyles = _a.otherStyles, borderColour = _a.borderColour, textColour = _a.textColour, ariaLabel = _a.ariaLabel, _b = _a.buttonType, buttonType = _b === void 0 ? "button" : _b;
90
+ var onClick = _a.onClick, title = _a.title, titleSize = _a.titleSize, disabled = _a.disabled, colour = _a.colour, otherStyles = _a.otherStyles, borderColour = _a.borderColour, textColour = _a.textColour, ariaLabel = _a.ariaLabel, _b = _a.buttonType, buttonType = _b === void 0 ? "button" : _b, _c = _a.className, className = _c === void 0 ? "" : _c;
91
91
  var resolvedTextColour = textColour || getAccessibleTextColour(colour);
92
92
  return (_jsx("button", __assign({ type: buttonType, className: "simple-button-component " +
93
- (disabled ? "simple-button-component-disabled" : ""), disabled: disabled, "aria-label": ariaLabel, style: __assign(__assign({}, otherStyles), { fontSize: titleSize, backgroundColor: colour, border: borderColour && "1px solid ".concat(borderColour), color: resolvedTextColour }), onClick: onClick }, { children: title })));
93
+ (disabled ? "simple-button-component-disabled" : "") + " " + className, disabled: disabled, "aria-label": ariaLabel, style: __assign(__assign({}, otherStyles), { fontSize: titleSize, backgroundColor: colour, border: borderColour && "1px solid ".concat(borderColour), color: resolvedTextColour }), onClick: onClick }, { children: title })));
94
94
  }
@@ -6,12 +6,14 @@ declare const english: {
6
6
  readonly uploadPending: "Some calibration data is waiting to upload. It is saved on this device and will retry automatically when the connection is available.";
7
7
  readonly uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.";
8
8
  readonly phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.";
9
+ readonly phoneUploadsAutomatic: "Calibration readings upload automatically under this session ID. Keep the app open while calibrating.";
9
10
  readonly retryUpload: "Retry calibration upload";
10
11
  readonly introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.";
11
12
  readonly sensor: "Colour sensor";
12
13
  readonly selectSensor: "Select a colour sensor";
14
+ readonly selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.";
13
15
  readonly step: "Step {{number}} of 2";
14
- readonly air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
16
+ readonly air: "Leave USB power connected. Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
15
17
  readonly white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.";
16
18
  readonly duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.";
17
19
  readonly preparing: "Preparing the sensor…";
@@ -25,16 +27,18 @@ declare const english: {
25
27
  readonly captureAir: "Capture air readings";
26
28
  readonly captureWhite: "Capture white and save calibration";
27
29
  readonly startAgain: "Start again";
28
- readonly restartCalibration: "Calibrate this sensor again";
30
+ readonly restartCalibration: "Start air and white calibration";
31
+ readonly calibrationRequired: "Calibrate the colour sensor";
29
32
  readonly saved: "Calibration saved on Marty: {{count}} readings each for air and white.";
30
33
  readonly reconnectStep: "Final step: reconnect Marty";
31
- readonly reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
32
- readonly disconnectToFinish: "Disconnect Marty to finish calibration";
34
+ readonly reconnect: "Leave the USB cable plugged in. Use Disconnect in app below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
35
+ readonly disconnectToFinish: "Disconnect in app";
33
36
  readonly disconnecting: "Disconnecting Marty…";
34
37
  readonly loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…";
35
38
  readonly calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.";
36
- readonly calibrationSensorChanged: "The attached colour sensor is different from the one that was calibrated. Reattach the original sensor to finish, or use the calibration screen to calibrate this sensor again.";
37
- readonly calibrationSettingsChanged: "The sensor's stored white reference differs from the calibration that was saved. Reconnect Marty once; if this message remains, use the calibration screen to calibrate this sensor again.";
39
+ readonly calibrationSensorChanged: "A different colour sensor is attached. Start calibration for this sensor using air and white.";
40
+ readonly calibrationSettingsChanged: "Marty could not load the saved calibration. Start calibration again using air and white.";
41
+ readonly previousCalibrationChanged: "An earlier calibration no longer matches this sensor. Start a new calibration using air and white.";
38
42
  readonly disconnectFailed: "Marty could not be disconnected. Try the disconnect button again.";
39
43
  readonly reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.";
40
44
  readonly download: "Download a copy (optional)";
@@ -43,6 +47,7 @@ declare const english: {
43
47
  readonly notInAir: "Lift Marty so both feet are clear of the surface, then try again.";
44
48
  readonly sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.";
45
49
  readonly unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.";
50
+ readonly sensorInitialising: "The colour sensor is still getting ready. Keep Marty connected, wait a few seconds and try this step again.";
46
51
  readonly readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.";
47
52
  readonly unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.";
48
53
  readonly saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.";
@@ -6,12 +6,14 @@ var english = {
6
6
  uploadPending: "Some calibration data is waiting to upload. It is saved on this device and will retry automatically when the connection is available.",
7
7
  uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.",
8
8
  phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.",
9
+ phoneUploadsAutomatic: "Calibration readings upload automatically under this session ID. Keep the app open while calibrating.",
9
10
  retryUpload: "Retry calibration upload",
10
11
  introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.",
11
12
  sensor: "Colour sensor",
12
13
  selectSensor: "Select a colour sensor",
14
+ selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.",
13
15
  step: "Step {{number}} of 2",
14
- air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
16
+ air: "Leave USB power connected. Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
15
17
  white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.",
16
18
  duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.",
17
19
  preparing: "Preparing the sensor…",
@@ -25,16 +27,18 @@ var english = {
25
27
  captureAir: "Capture air readings",
26
28
  captureWhite: "Capture white and save calibration",
27
29
  startAgain: "Start again",
28
- restartCalibration: "Calibrate this sensor again",
30
+ restartCalibration: "Start air and white calibration",
31
+ calibrationRequired: "Calibrate the colour sensor",
29
32
  saved: "Calibration saved on Marty: {{count}} readings each for air and white.",
30
33
  reconnectStep: "Final step: reconnect Marty",
31
- reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
32
- disconnectToFinish: "Disconnect Marty to finish calibration",
34
+ reconnect: "Leave the USB cable plugged in. Use Disconnect in app below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
35
+ disconnectToFinish: "Disconnect in app",
33
36
  disconnecting: "Disconnecting Marty…",
34
37
  loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…",
35
38
  calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.",
36
- calibrationSensorChanged: "The attached colour sensor is different from the one that was calibrated. Reattach the original sensor to finish, or use the calibration screen to calibrate this sensor again.",
37
- calibrationSettingsChanged: "The sensor's stored white reference differs from the calibration that was saved. Reconnect Marty once; if this message remains, use the calibration screen to calibrate this sensor again.",
39
+ calibrationSensorChanged: "A different colour sensor is attached. Start calibration for this sensor using air and white.",
40
+ calibrationSettingsChanged: "Marty could not load the saved calibration. Start calibration again using air and white.",
41
+ previousCalibrationChanged: "An earlier calibration no longer matches this sensor. Start a new calibration using air and white.",
38
42
  disconnectFailed: "Marty could not be disconnected. Try the disconnect button again.",
39
43
  reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.",
40
44
  download: "Download a copy (optional)",
@@ -43,6 +47,7 @@ var english = {
43
47
  notInAir: "Lift Marty so both feet are clear of the surface, then try again.",
44
48
  sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.",
45
49
  unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.",
50
+ sensorInitialising: "The colour sensor is still getting ready. Keep Marty connected, wait a few seconds and try this step again.",
46
51
  readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.",
47
52
  unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.",
48
53
  saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.",
@@ -30,7 +30,7 @@ var colourDiagnosticsEnglish = {
30
30
  sensorDisconnected: "The selected sensor disconnected. Reconnect Marty and select the sensor again.",
31
31
  sensorInitialising: "Marty is still loading the sensor settings. Wait a few seconds and try again.",
32
32
  sensorBusy: "The sensor is completing another check. Wait a moment and take the snapshot again.",
33
- calibrationReconnectRequired: "Reconnect Marty to finish calibration before taking more colour snapshots.",
33
+ calibrationReconnectRequired: "Complete colour sensor calibration before taking snapshots.",
34
34
  sensorAsleep: "Marty's sensor power is asleep. Taking a snapshot wakes the sensors before collecting readings.",
35
35
  sensorOffline: "The colour sensor is offline. Take a snapshot to wake it. If it stays offline, check the sensor connection.",
36
36
  sensorPowerFailed: "Marty's colour sensor did not wake up. No snapshot was saved. Check that Marty is powered on and the sensor is connected, then try again.",
@@ -4,6 +4,7 @@ type PendingCalibration = {
4
4
  connectionInstanceId: string;
5
5
  serialNumber: string;
6
6
  whiteCalibrationHex: string;
7
+ savedAtMs?: number;
7
8
  calibrationRecord?: CalibrationRecordRef;
8
9
  };
9
10
  export declare class ColourCalibrationReconnectError extends Error {
@@ -88,7 +88,8 @@ export var getPendingColourCalibration = function (sensor) {
88
88
  }
89
89
  var parsed = JSON.parse(value);
90
90
  if (typeof parsed.connectionInstanceId !== "string" || typeof parsed.serialNumber !== "string" ||
91
- !/^[a-f0-9]{16}$/.test(parsed.whiteCalibrationHex))
91
+ !/^[a-f0-9]{16}$/.test(parsed.whiteCalibrationHex) ||
92
+ (parsed.savedAtMs !== undefined && (!Number.isFinite(parsed.savedAtMs) || parsed.savedAtMs <= 0)))
92
93
  throw new Error("Invalid pending calibration");
93
94
  cached.set(key, parsed);
94
95
  return parsed;
@@ -99,7 +100,7 @@ export var getPendingColourCalibration = function (sensor) {
99
100
  }
100
101
  };
101
102
  export var markColourCalibrationPending = function (sensor, serialNumber, whiteCalibrationHex, calibrationRecord) {
102
- var pending = { connectionInstanceId: sensor.raft.connectionInstanceId || "", serialNumber: serialNumber, whiteCalibrationHex: whiteCalibrationHex, calibrationRecord: calibrationRecord };
103
+ var pending = { connectionInstanceId: sensor.raft.connectionInstanceId || "", serialNumber: serialNumber, whiteCalibrationHex: whiteCalibrationHex, savedAtMs: Date.now(), calibrationRecord: calibrationRecord };
103
104
  restorePendingColourCalibration(sensor, pending);
104
105
  };
105
106
  export var restorePendingColourCalibration = function (sensor, pending) {
@@ -250,9 +250,12 @@ export var readColourSensorReadiness = function (sensor, signal, checkActive) {
250
250
  var result = response;
251
251
  if ((result === null || result === void 0 ? void 0 : result.rslt) === "ok" && result.colourDiagnosticsProtocol === 1 && typeof result.ready === "boolean")
252
252
  ok(result.ready);
253
- else
253
+ // An older bridge forwards this local query to firmware and replies without the diagnostics protocol.
254
+ else if (((result === null || result === void 0 ? void 0 : result.rslt) === "ok" || (result === null || result === void 0 ? void 0 : result.rslt) === "fail") && result.colourDiagnosticsProtocol !== 1)
254
255
  unavailable("unsupported");
255
- }, function () { return unavailable("unsupported"); });
256
+ else
257
+ unavailable((result === null || result === void 0 ? void 0 : result.rslt) === "fail" ? "commandFailed" : "invalidResponse");
258
+ }, function () { return unavailable("commandFailed"); });
256
259
  });
257
260
  };
258
261
  export var collectColourSensorSetup = function (sensor, signal, checkActive) { return __awaiter(void 0, void 0, void 0, function () {
@@ -5,7 +5,7 @@
5
5
  "boundaries": [
6
6
  { "hue": [0, 15], "chroma": [50, 200], "clear": [40, 150], "name": "red" },
7
7
  { "hue": [20, 65], "chroma": [40, 300], "clear": [100, 255], "name": "yellow" },
8
- { "hue": [75, 160], "chroma": [5, 100], "clear": [25, 150], "name": "green" },
8
+ { "hue": [75, 170], "chroma": [5, 100], "clear": [25, 150], "name": "green" },
9
9
  { "hue": [180, 240], "chroma": [40, 260], "clear": [55, 255], "name": "blue" },
10
10
  { "hue": [240, 320], "chroma": [5, 100], "clear": [10, 150], "name": "purple" },
11
11
  { "hue": [345, 361], "chroma": [50, 200], "clear": [40, 150], "name": "red" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/webapp-types",
3
- "version": "3.25.7",
3
+ "version": "3.25.9",
4
4
  "description": "Type definitions for the Application Manager",
5
5
  "main": "dist/application-manager.d.ts",
6
6
  "types": "dist/application-manager.d.ts",