@attabot/complaint-app 1.0.1 → 1.0.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 +12 -2
- package/dist/complaint-app.js +2476 -2234
- package/dist/complaint-app.js.map +1 -1
- package/dist/complaint-app.umd.js +7 -7
- package/dist/complaint-app.umd.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ npm install @attabot/complaint-app
|
|
|
11
11
|
Peer dependencies:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install react react-dom
|
|
14
|
+
npm install react react-dom react-redux @reduxjs/toolkit
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
@@ -132,10 +132,20 @@ import { Button, SearchBar, SystemCard, api } from '@attabot/complaint-app';
|
|
|
132
132
|
## Auth & API
|
|
133
133
|
|
|
134
134
|
1. Parent passes `apiUrl` + `authToken` into `ComplaintApp` / `ApiProvider`.
|
|
135
|
-
2. Package axios client (`api`) attaches `Authorization: Bearer …`
|
|
135
|
+
2. Package axios client (`api`) keeps the passed token in memory and attaches `Authorization: Bearer …` immediately before every request. It does not overwrite the parent app's auth cookie.
|
|
136
136
|
3. Optional token refresh against `POST /api/v1/auth/refresh` when a `refreshToken` cookie exists.
|
|
137
137
|
4. No product/business APIs are hardcoded — provide `systems` or `systemsEndpoint`.
|
|
138
138
|
|
|
139
|
+
## Redux and router integration
|
|
140
|
+
|
|
141
|
+
When mounted inside a parent `react-redux` Provider, `ComplaintApp` automatically
|
|
142
|
+
reuses that Provider instead of adding a second competing Redux context. When used
|
|
143
|
+
standalone it falls back to its own store. Pass the `store` prop only when you
|
|
144
|
+
explicitly want an isolated store.
|
|
145
|
+
|
|
146
|
+
The same rule applies to React Router: an existing parent router is reused; a
|
|
147
|
+
`BrowserRouter` is only created for standalone use.
|
|
148
|
+
|
|
139
149
|
## Development
|
|
140
150
|
|
|
141
151
|
```bash
|