@xsolla/backpack-js 1.6.0 → 1.6.1-rc.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/README.md +7 -1
- package/dist/BackpackElement.d.ts +3 -0
- package/dist/backpack-js.js +37313 -34498
- package/dist/backpack-js.umd.cjs +435 -421
- package/dist/types.d.ts +28 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,12 +12,14 @@ The published package is a self-contained bundle (React inlined). Do **not** ins
|
|
|
12
12
|
"@xsolla/backpack-js": "workspace:*"
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
**Other repositories** —
|
|
15
|
+
**Other repositories** — npmjs, where the package is public, so nothing has to be configured:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
npm install @xsolla/backpack-js@<version>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Every release is published to the GitLab npm registry as well, for hosts that already resolve `@xsolla` there. That one needs auth; see [PUBLISHING.md](PUBLISHING.md) and [`.npmrc.example`](.npmrc.example).
|
|
22
|
+
|
|
21
23
|
## Usage
|
|
22
24
|
|
|
23
25
|
```ts
|
|
@@ -36,8 +38,12 @@ Transfuse (minting an off-chain catalogue item onto the chain) is off by default
|
|
|
36
38
|
|
|
37
39
|
Salvage (destroying an item) is the other way round: it is **on** by default, and an embed turns it off with `enableSalvage` / `enable-salvage`. It signs nothing and costs nothing, the backend refuses the item types it will not destroy, and the drag onto the target is the confirmation, so there is no button a user can hit by accident. The merchant configuration can withhold the seat as well, and wins over the attribute.
|
|
38
40
|
|
|
41
|
+
Set `openItem` / `open-item` to open that inventory item as the element loads, with its action wheel already up. Backpack fetches the item on its own, so it does not have to be on the first page of the grid. A missing row, a failed fetch, or a hidden SKU leaves the grid as it is. Clearing the attribute, or the player closing the wheel, returns to the catalog. Reloading the embed does not open the same id again.
|
|
42
|
+
|
|
39
43
|
The action wheel shows the item's 2D artwork in the middle. An embed can put the 3D model there instead with `enableWheel3dModel` / `enable-wheel-3d-model`, which is off by default: the viewer is a WebGL canvas that keeps rendering for as long as the wheel is open, and it takes frames the wheel's own spin and drag need. Item details is unaffected either way and always shows the model.
|
|
40
44
|
|
|
45
|
+
Xsolla Metrika analytics is off by default. Turn it on with `enableAnalytics` / `enable-analytics`, and pass your project ID as `externalId` / `external-id` so every Backpack event carries it as `eid`. Metrika builds a device fingerprint, so collecting that is your call as the owner of the user's consent. If your page already runs Metrika, Backpack reuses that instance, so initialise it before the element mounts. Otherwise Backpack starts its own, with automatic page tracking off. `external-id` does nothing while analytics is off.
|
|
46
|
+
|
|
41
47
|
Hosts can refresh or remount the mounted Backpack without reloading their page:
|
|
42
48
|
|
|
43
49
|
```ts
|
|
@@ -24,6 +24,9 @@ export declare class BackpackElement extends HTMLElement {
|
|
|
24
24
|
enableSalvage: boolean;
|
|
25
25
|
enableWheel3dModel: boolean;
|
|
26
26
|
pageBackground: string | undefined;
|
|
27
|
+
enableAnalytics: boolean;
|
|
28
|
+
externalId: string | undefined;
|
|
29
|
+
openItem: string | undefined;
|
|
27
30
|
|
|
28
31
|
connectedCallback(): void;
|
|
29
32
|
disconnectedCallback(): void;
|