@superrouteca/slocker-react 0.2.0 → 0.2.1
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 +13 -0
- package/README.md +16 -3
- package/package.json +4 -4
- package/src/index.js +4 -2
- package/types/index.d.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# 0.2.1
|
|
2
|
+
|
|
3
|
+
## SDK
|
|
4
|
+
|
|
5
|
+
### Customer side
|
|
6
|
+
- **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.
|
|
7
|
+
|
|
8
|
+
## UI kits
|
|
9
|
+
|
|
10
|
+
### Flutter, web, React, React Native, SwiftUI, Jetpack Compose, WPF and WinForms
|
|
11
|
+
- **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.
|
|
12
|
+
- **Typed selection**: choosing a locker or a counter also reports its kind, id, name, address and position, beside the event the map already raised.
|
|
13
|
+
|
|
1
14
|
# 0.2.0
|
|
2
15
|
|
|
3
16
|
## 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.
|
|
242
|
+
`implementation("ca.superroute:slocker:0.2.1")` — or, in an Android app, `ca.superroute:slocker-android:0.2.1`.
|
|
243
243
|
|
|
244
244
|
```java
|
|
245
245
|
Client sl = Client.builder().token(token).providerId(4611L).build(); // java.net.http, or HttpURLConnection on Android
|
|
@@ -397,7 +397,7 @@ locker.api.platform_app_pickups(status='ready')
|
|
|
397
397
|
```
|
|
398
398
|
|
|
399
399
|
```swift
|
|
400
|
-
// Package.swift: .package(url: "https://github.com/Goodneo-Solutions/slocker-customer-releases", from: "0.2.
|
|
400
|
+
// Package.swift: .package(url: "https://github.com/Goodneo-Solutions/slocker-customer-releases", from: "0.2.1")
|
|
401
401
|
// in the target: .product(name: "SLockerCustomer", package: "slocker-customer-releases"), and "SLockerUI" for the kit;
|
|
402
402
|
// sApp (sapp-releases) comes with it.
|
|
403
403
|
import SApp
|
|
@@ -423,6 +423,19 @@ client, theme and strings in 14 languages, raise events and never navigate.
|
|
|
423
423
|
| Jetpack Compose (`slocker-ui-android`) | `PickupList` | `LockerMap` with `SrSMapAdapter`, `SrMapAdapter`, `SrMapPoint` |
|
|
424
424
|
| WPF / WinForms (`Superroute.SLocker.Wpf` / `.WinForms`) | `PickupList` (`PickupListViewModel`) | `LockerMap` (`LockerMapViewModel`, `SMapAdapter`, `IMapAdapter`, `MapPoint`) |
|
|
425
425
|
|
|
426
|
+
The locker map reads its points from one of three sources (`source`):
|
|
427
|
+
|
|
428
|
+
- `lockers` (the default): the service provider's smart lockers for the signed-in person, as before.
|
|
429
|
+
- `pickupPoints`: smart lockers **and** pickup point counters, read anonymously with the app key alone — the same list
|
|
430
|
+
the sWidget pickup point picker shows. Each row and map point says which kind it is (*Smart locker* / *Pickup
|
|
431
|
+
point*), and search and the filters work as for lockers.
|
|
432
|
+
- a loader of the app's own, given the search, position, filters and page, answering the rows and whether there are
|
|
433
|
+
more.
|
|
434
|
+
|
|
435
|
+
Choosing a row or a map point raises the select event as before and, beside it, a typed selection: its kind (`locker`
|
|
436
|
+
or `counter`), id, location id, name, address and position, with the row as it came. Map points carry their kind, so
|
|
437
|
+
the app's map can draw counters apart from lockers.
|
|
438
|
+
|
|
426
439
|
```dart
|
|
427
440
|
SuperrouteScope(
|
|
428
441
|
client: sr,
|
|
@@ -468,7 +481,7 @@ cd dart && dart pub get && dart test
|
|
|
468
481
|
Never edit generated files (`generated/`, `Generated/`, `_operations.py`, `operations_gen.go`, `SLockerOperations.kt`):
|
|
469
482
|
change Superroute's spec, sync, and generate again.
|
|
470
483
|
|
|
471
|
-
The customer side has its own spec and generator, and is built against the published sApp packages (0.2.
|
|
484
|
+
The customer side has its own spec and generator, and is built against the published sApp packages (0.2.5); the
|
|
472
485
|
generator and the locker path check read the sApp source:
|
|
473
486
|
|
|
474
487
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superrouteca/slocker-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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.
|
|
22
|
-
"@superrouteca/sapp": "0.2.
|
|
23
|
-
"@superrouteca/sapp-react": "0.2.
|
|
21
|
+
"@superrouteca/slocker-ui": "0.2.1",
|
|
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', {
|
|
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<{
|
|
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
|
+
}>;
|