@superrouteca/slocker-react 0.2.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # 0.2.2
2
+
3
+ ## SDK
4
+
5
+ ### Customer side
6
+ - **Extend a pickup**: when the service provider allows it, the person extends the pickup time of a parcel waiting in a locker by the hours it sets. A pickup now says when it must be collected by and what extension is offered.
7
+ - **Low compartments**: read whether the service provider offers low compartments and ask for them, or stop asking, for the person's locker parcels.
8
+
9
+ ## UI kits
10
+
11
+ ### Flutter, web, React, React Native, SwiftUI, Jetpack Compose, WPF and WinForms
12
+ - **Pickup list**: shows the pickup deadline and, when an extension is offered, a button that extends it after confirming, in 14 languages.
13
+
14
+ # 0.2.1
15
+
16
+ ## SDK
17
+
18
+ ### Customer side
19
+ - **On sApp 0.2.5**: the customer packages and UI kits now build on sApp 0.2.5, so errors carry the response headers and the seconds to wait, and the native kits follow dark mode and the corner radius.
20
+
21
+ ## UI kits
22
+
23
+ ### Flutter, web, React, React Native, SwiftUI, Jetpack Compose, WPF and WinForms
24
+ - **Locker map with pickup points**: the locker map can show the service provider's pickup point counters beside its smart lockers, read with the app key alone so nobody needs to sign in, or points from the app's own source. Each row and map point names its kind.
25
+ - **Typed selection**: choosing a locker or a counter also reports its kind, id, name, address and position, beside the event the map already raised.
26
+
1
27
  # 0.2.0
2
28
 
3
29
  ## SDK
package/README.md CHANGED
@@ -239,7 +239,7 @@ $sl->partnerLockerDeliveries(status: 'delivered', perPage: 50);
239
239
  ### Java and Kotlin
240
240
 
241
241
  Add the Maven repository `https://goodneo-solutions.github.io/slocker-releases/maven`, then
242
- `implementation("ca.superroute:slocker:0.2.0")` — or, in an Android app, `ca.superroute:slocker-android:0.2.0`.
242
+ `implementation("ca.superroute:slocker:0.2.2")` — or, in an Android app, `ca.superroute:slocker-android:0.2.2`.
243
243
 
244
244
  ```java
245
245
  Client sl = Client.builder().token(token).providerId(4611L).build(); // java.net.http, or HttpURLConnection on Android
@@ -332,7 +332,9 @@ the client scope is `pickups`, `locker-locations`, `locker-storage`, `locker-sho
332
332
 
333
333
  New in sLocker: `lockerResaleTerms`, `lockerResaleDeals`, `lockerResaleDeal`, `createLockerResaleDeal`,
334
334
  `releaseLockerResaleCode`, `revokeLockerResaleCode`, `abortLockerResaleDeal`, `cancelLockerResaleDeal`,
335
- `reportLockerResaleDeal` (`/app/v1/locker-resale/…`).
335
+ `reportLockerResaleDeal` (`/app/v1/locker-resale/…`); from 0.2.2 `platformAppExtendPickup`
336
+ (`POST /app/v1/pickups/{deliveryId}/extend`) and `platformAppPickupPreferences` / `platformAppSavePickupPreferences`
337
+ (`GET` / `PUT /app/v1/pickups/preferences`).
336
338
 
337
339
  ### sLocker on its own
338
340
 
@@ -397,7 +399,7 @@ locker.api.platform_app_pickups(status='ready')
397
399
  ```
398
400
 
399
401
  ```swift
400
- // Package.swift: .package(url: "https://github.com/Goodneo-Solutions/slocker-customer-releases", from: "0.2.0")
402
+ // Package.swift: .package(url: "https://github.com/Goodneo-Solutions/slocker-customer-releases", from: "0.2.2")
401
403
  // in the target: .product(name: "SLockerCustomer", package: "slocker-customer-releases"), and "SLockerUI" for the kit;
402
404
  // sApp (sapp-releases) comes with it.
403
405
  import SApp
@@ -423,6 +425,19 @@ client, theme and strings in 14 languages, raise events and never navigate.
423
425
  | Jetpack Compose (`slocker-ui-android`) | `PickupList` | `LockerMap` with `SrSMapAdapter`, `SrMapAdapter`, `SrMapPoint` |
424
426
  | WPF / WinForms (`Superroute.SLocker.Wpf` / `.WinForms`) | `PickupList` (`PickupListViewModel`) | `LockerMap` (`LockerMapViewModel`, `SMapAdapter`, `IMapAdapter`, `MapPoint`) |
425
427
 
428
+ The locker map reads its points from one of three sources (`source`):
429
+
430
+ - `lockers` (the default): the service provider's smart lockers for the signed-in person, as before.
431
+ - `pickupPoints`: smart lockers **and** pickup point counters, read anonymously with the app key alone — the same list
432
+ the sWidget pickup point picker shows. Each row and map point says which kind it is (*Smart locker* / *Pickup
433
+ point*), and search and the filters work as for lockers.
434
+ - a loader of the app's own, given the search, position, filters and page, answering the rows and whether there are
435
+ more.
436
+
437
+ Choosing a row or a map point raises the select event as before and, beside it, a typed selection: its kind (`locker`
438
+ or `counter`), id, location id, name, address and position, with the row as it came. Map points carry their kind, so
439
+ the app's map can draw counters apart from lockers.
440
+
426
441
  ```dart
427
442
  SuperrouteScope(
428
443
  client: sr,
@@ -468,7 +483,7 @@ cd dart && dart pub get && dart test
468
483
  Never edit generated files (`generated/`, `Generated/`, `_operations.py`, `operations_gen.go`, `SLockerOperations.kt`):
469
484
  change Superroute's spec, sync, and generate again.
470
485
 
471
- The customer side has its own spec and generator, and is built against the published sApp packages (0.2.2); the
486
+ The customer side has its own spec and generator, and is built against the published sApp packages (0.2.5); the
472
487
  generator and the locker path check read the sApp source:
473
488
 
474
489
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superrouteca/slocker-react",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "sLocker for React: the pickup list and the locker map as React components over the sLocker web UI kit, with the client from sApp's SuperrouteProvider.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Goodneo Solutions",
@@ -18,9 +18,9 @@
18
18
  "files": ["src", "types", "README.md", "LICENSE", "CHANGELOG.md"],
19
19
  "sideEffects": false,
20
20
  "dependencies": {
21
- "@superrouteca/slocker-ui": "0.2.0",
22
- "@superrouteca/sapp": "0.2.2",
23
- "@superrouteca/sapp-react": "0.2.2"
21
+ "@superrouteca/slocker-ui": "0.2.2",
22
+ "@superrouteca/sapp": "0.2.5",
23
+ "@superrouteca/sapp-react": "0.2.5"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=18"
package/src/index.js CHANGED
@@ -5,7 +5,7 @@ import { createElement, forwardRef, useEffect, useImperativeHandle, useRef } fro
5
5
  import '@superrouteca/slocker-ui';
6
6
  import { useOptionalSuperroute } from '@superrouteca/sapp-react';
7
7
 
8
- export { configure, smapAdapter, lockerApiFor } from '@superrouteca/slocker-ui';
8
+ export { configure, smapAdapter, lockerApiFor, lockerSelection, guestPickupPointsOperation } from '@superrouteca/slocker-ui';
9
9
 
10
10
  function wrap(tag, events, properties) {
11
11
  const Component = forwardRef(function SLockerElement(props, ref) {
@@ -47,4 +47,6 @@ function wrap(tag, events, properties) {
47
47
  const signInRequired = { onSignInRequired: ['sr-sign-in-required', () => undefined] };
48
48
 
49
49
  export const PickupList = wrap('sr-pickup-list', { onShowCode: ['sr-show-code', (d) => d.value], ...signInRequired }, []);
50
- export const LockerMap = wrap('sr-locker-map', { onSelect: ['sr-select', (d) => d.location], ...signInRequired }, ['latitude', 'longitude', 'map']);
50
+ export const LockerMap = wrap('sr-locker-map', {
51
+ onSelect: ['sr-select', (d) => d.location], onSelection: ['sr-select', (d) => d.selection], ...signInRequired,
52
+ }, ['latitude', 'longitude', 'map', 'source']);
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { CSSProperties, ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  import type { PartnerClient, ThemeTokens } from '@superrouteca/sapp';
3
- import type { SrMapAdapter } from '@superrouteca/slocker-ui';
3
+ import type { SrMapAdapter, SrLockerSource, SrLockerSelection } from '@superrouteca/slocker-ui';
4
4
 
5
- export { configure, smapAdapter, lockerApiFor } from '@superrouteca/slocker-ui';
6
- export type { SrMapAdapter, SrMapPoint } from '@superrouteca/slocker-ui';
5
+ export { configure, smapAdapter, lockerApiFor, lockerSelection, guestPickupPointsOperation } from '@superrouteca/slocker-ui';
6
+ export type { SrMapAdapter, SrMapPoint, SrLockerSource, SrLockerSelection, SrLockerQuery } from '@superrouteca/slocker-ui';
7
7
 
8
8
  interface Common {
9
9
  client?: PartnerClient;
@@ -17,4 +17,7 @@ interface Common {
17
17
  type Element<P> = ForwardRefExoticComponent<Common & P & RefAttributes<HTMLElement>>;
18
18
 
19
19
  export declare const PickupList: Element<{ onShowCode?: (value: string) => void }>;
20
- export declare const LockerMap: Element<{ latitude?: number; longitude?: number; map?: SrMapAdapter; onSelect?: (location: Record<string, any>) => void }>;
20
+ export declare const LockerMap: Element<{
21
+ latitude?: number; longitude?: number; map?: SrMapAdapter; source?: SrLockerSource;
22
+ onSelect?: (location: Record<string, any>) => void; onSelection?: (selection: SrLockerSelection) => void;
23
+ }>;