@qratilabs/qrati-connect 2.23.9 → 2.24.0
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 +84 -54
- package/element/2CMH9VMM.js +4 -0
- package/element/BKDqpSN62.js +3 -0
- package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
- package/element/{BqHk5hDM.js → BOQzjiMV.js} +3 -3
- package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
- package/element/{-p_JqYFM2.js → BP2rYgya2.js} +9 -9
- package/element/BZu3c37u.js +1 -0
- package/element/{srDF4VyG.js → Bb7nx5xF.js} +1 -1
- package/element/Bh8kXbe92.js +93 -0
- package/{umd/BvNf2yif2.js → element/Bow6F3212.js} +29 -29
- package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
- package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
- package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
- package/element/C52SUIvC2.js +35 -0
- package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
- package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
- package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
- package/element/CHTzn6mh2.js +4 -0
- package/element/CL_evx_l.js +1 -0
- package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
- package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
- package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
- package/{umd/9QY9BKOL2.js → element/CWhnvMey2.js} +8 -8
- package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
- package/element/CaX2xgrP.js +41 -0
- package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
- package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
- package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
- package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
- package/element/D5TKEdBd2.js +3 -0
- package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
- package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
- package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
- package/element/DN26AtHL2.js +4 -0
- package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
- package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
- package/{umd/D0VKfxwE.js → element/DdOwRfWG.js} +2 -2
- package/element/DkG0zv7_2.js +9 -0
- package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
- package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
- package/element/DnIueBGr2.js +1 -0
- package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
- package/element/DrrpB4Om.js +1 -0
- package/element/DtRwaUYF2.js +85 -0
- package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
- package/{umd/DNG5BSHx2.js → element/N4HKgEC52.js} +1 -1
- package/element/Rcen6i0h.js +80 -0
- package/element/{MpvHkxaz2.js → Z0-Tddye2.js} +1 -1
- package/element/dT6WSX65.js +1 -0
- package/element/h4ZjZXfe2.js +1 -0
- package/element/kiL9JENf2.js +3 -0
- package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
- package/element/{DdmVPlUC2.js → mIANlVHi2.js} +1 -1
- package/element/mQzpzQ_t.js +3 -0
- package/element/web.es.js +26 -105
- package/package.json +3 -15
- package/react/index.d.mts +182 -6
- package/react/index.d.ts +182 -6
- package/element/9QY9BKOL2.js +0 -8
- package/element/B14kCOq8.js +0 -2
- package/element/BItJQVdK.js +0 -41
- package/element/BYoa-kpQ2.js +0 -9
- package/element/Be1e_ATJ.js +0 -1
- package/element/BfkCwRAR2.js +0 -3
- package/element/BkvtmX4K.js +0 -2
- package/element/BsT0vqml.js +0 -1
- package/element/BtN9y353.js +0 -1
- package/element/BvNf2yif2.js +0 -39
- package/element/C030L_Hu2.js +0 -4
- package/element/C0MGOytI.js +0 -1
- package/element/C3tT7YRo2.js +0 -37
- package/element/C3uDEVBt.js +0 -1
- package/element/CJ5ChvJ52.js +0 -93
- package/element/CiiNqDJq.js +0 -3
- package/element/CnoPTYOO.js +0 -1
- package/element/D0VKfxwE.js +0 -10
- package/element/D4apO9G62.js +0 -4
- package/element/DB1jhaAe2.js +0 -85
- package/element/DNG5BSHx2.js +0 -2
- package/element/LJWh_4Di.js +0 -2
- package/element/gjXXuILV2.js +0 -3
- package/element/gk4TX_a62.js +0 -7
- package/element/qNDy94Dr2.js +0 -3
- package/element/styles.css +0 -288
- package/umd/-p_JqYFM2.js +0 -14
- package/umd/4VTPoA38.js +0 -1
- package/umd/BCTYvPrD.js +0 -1
- package/umd/BItJQVdK.js +0 -41
- package/umd/BQuhYd4G2.js +0 -2
- package/umd/BYEF5Khs.js +0 -1
- package/umd/BYoa-kpQ2.js +0 -9
- package/umd/BdOzsWR32.js +0 -9
- package/umd/Be1e_ATJ.js +0 -1
- package/umd/BfkCwRAR2.js +0 -3
- package/umd/BglDIiFp.js +0 -3
- package/umd/BkIDQGIs.js +0 -1
- package/umd/Bki5T_lb.js +0 -1
- package/umd/BqHk5hDM.js +0 -9
- package/umd/BsT0vqml.js +0 -1
- package/umd/Byk0pccK.js +0 -1
- package/umd/C030L_Hu2.js +0 -4
- package/umd/C0MGOytI.js +0 -1
- package/umd/C3tT7YRo2.js +0 -37
- package/umd/C3uDEVBt.js +0 -1
- package/umd/C8_zGNAf.js +0 -1
- package/umd/CCLXmMXp.js +0 -3
- package/umd/CJ5ChvJ52.js +0 -93
- package/umd/CSO2IaJ1.js +0 -2
- package/umd/Cb1JRT_1.js +0 -1
- package/umd/CfMNBPpx2.js +0 -1
- package/umd/CgUphJWo.js +0 -1
- package/umd/Cko4QHwX.js +0 -1
- package/umd/CnoPTYOO.js +0 -1
- package/umd/D4apO9G62.js +0 -4
- package/umd/D9NypPiv.js +0 -7
- package/umd/DB1jhaAe2.js +0 -85
- package/umd/DIYUC8M3.js +0 -2
- package/umd/DXx41__x2.js +0 -2
- package/umd/DdmVPlUC2.js +0 -13
- package/umd/DsvRTvCp.js +0 -8
- package/umd/DvTRhlvs.js +0 -2
- package/umd/LJWh_4Di.js +0 -2
- package/umd/MpvHkxaz2.js +0 -16
- package/umd/_ty2jtjs.js +0 -2
- package/umd/b6CwQBFC.js +0 -5
- package/umd/e_wwJ5wx2.js +0 -5
- package/umd/ekog7y-V.js +0 -1
- package/umd/gjXXuILV2.js +0 -3
- package/umd/index.d.ts +0 -14
- package/umd/lrjV8c1G2.js +0 -8
- package/umd/qNDy94Dr2.js +0 -3
- package/umd/qWp4ucdT.js +0 -1
- package/umd/rtH8O6Hc.js +0 -1
- package/umd/srDF4VyG.js +0 -9
- package/umd/web.es.js +0 -122
- package/umd/web.umd.js +0 -1
package/README.md
CHANGED
|
@@ -11,32 +11,46 @@
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
# Qrati Connect — Embeddable Media & Engagement SDK
|
|
14
|
+
# Qrati Connect — Embeddable Media & Engagement SDK
|
|
15
15
|
|
|
16
|
-
**Qrati Connect** is a compact, production-grade SDK for embedding photo galleries, uploads, curation, and engagement into any website.
|
|
16
|
+
**Qrati Connect** is a compact, production-grade SDK for embedding photo galleries, media uploads, curation, and engagement into any website. It is built with [Preact](https://preactjs.com/), strict TypeScript, and Shadow-DOM style isolation, then distributed as a Web Component, React wrapper, and zero-code embed script.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
## Why Qrati Connect?
|
|
20
|
+
## Why Qrati Connect?
|
|
21
21
|
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
22
|
+
- **Framework-agnostic** — works in React, Vue, Angular, WordPress, or plain HTML.
|
|
23
|
+
- **Style isolation** — Shadow DOM keeps SDK styles separate from the host page.
|
|
24
|
+
- **Small initial payload** — Preact core plus strategic lazy-loading for heavy features (upload, HEIC conversion, maps).
|
|
25
|
+
- **Themeable** — organization colors, fonts, radius, and shadows are fetched from the Qrati API and applied via CSS custom properties.
|
|
26
|
+
- **TypeScript-first** — full typings for the public API.
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
29
|
-
## Highlights
|
|
30
|
+
## Highlights
|
|
30
31
|
|
|
31
|
-
- Interactive media gallery with lightbox, blurhash placeholders and
|
|
32
|
-
- Smart uploads: compression, chunked progress, HEIC → JPEG conversion
|
|
33
|
-
- Reactions, curation workflow, and
|
|
32
|
+
- Interactive media gallery with lightbox, blurhash placeholders, infinite scroll, and facial search.
|
|
33
|
+
- Smart uploads: compression, chunked progress, video trimming, and HEIC → JPEG conversion on demand.
|
|
34
|
+
- Reactions, curation workflow, leaderboards, and points-based engagement.
|
|
35
|
+
- Public events page with folder navigation and optional map view (Google Maps, Mapbox, OpenStreetMap).
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Distribution Formats
|
|
40
|
+
|
|
41
|
+
| Format | Output | Best for |
|
|
42
|
+
|--------|--------|----------|
|
|
43
|
+
| **React wrapper** | `dist/react/index.mjs` / `index.cjs` | React / Next.js apps |
|
|
44
|
+
| **Web Component** | `dist/element/web.es.js` | Any framework or vanilla JS |
|
|
45
|
+
| **Embed loader** | `dist/embed/embed.js` | Zero-code `<script>` integration |
|
|
46
|
+
|
|
47
|
+
The React wrapper and embed loader dynamically load the element build at runtime, so the same `web.es.js` bundle is always used.
|
|
34
48
|
|
|
35
49
|
---
|
|
36
50
|
|
|
37
51
|
## Quick Install & Integration
|
|
38
52
|
|
|
39
|
-
###
|
|
53
|
+
### React (client component)
|
|
40
54
|
|
|
41
55
|
```bash
|
|
42
56
|
pnpm add @qratilabs/qrati-connect
|
|
@@ -44,10 +58,9 @@ pnpm add @qratilabs/qrati-connect
|
|
|
44
58
|
npm install @qratilabs/qrati-connect
|
|
45
59
|
```
|
|
46
60
|
|
|
47
|
-
### React (Client Component)
|
|
48
|
-
|
|
49
61
|
```tsx
|
|
50
62
|
'use client';
|
|
63
|
+
|
|
51
64
|
import { QratiConnect } from '@qratilabs/qrati-connect';
|
|
52
65
|
|
|
53
66
|
export default function Page() {
|
|
@@ -55,90 +68,107 @@ export default function Page() {
|
|
|
55
68
|
}
|
|
56
69
|
```
|
|
57
70
|
|
|
58
|
-
### Web Component (
|
|
71
|
+
### Web Component (framework-agnostic)
|
|
59
72
|
|
|
60
73
|
```html
|
|
61
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect/element/web.es.js"></script>
|
|
74
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect@2/element/web.es.js"></script>
|
|
75
|
+
|
|
62
76
|
<qrati-connect organization-id="your-org-id" router="hash"></qrati-connect>
|
|
63
77
|
```
|
|
64
78
|
|
|
65
|
-
### Embed (
|
|
66
|
-
|
|
67
|
-
The simplest integration: one `async` tag, config in `data-*` attributes. Mounts
|
|
68
|
-
where the tag sits, or into the element matched by `data-target`.
|
|
79
|
+
### Embed script (zero-code)
|
|
69
80
|
|
|
70
81
|
```html
|
|
71
82
|
<script async
|
|
72
|
-
src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect/embed/embed.js"
|
|
83
|
+
src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect@2/embed/embed.js"
|
|
73
84
|
data-organization-id="your-org-id"
|
|
74
85
|
data-router="hash"></script>
|
|
75
86
|
```
|
|
76
87
|
|
|
77
|
-
|
|
78
|
-
`data-uid`, `data-fname`, `data-lname`, `data-theme`, and `data-target` (CSS
|
|
79
|
-
selector for the mount container).
|
|
88
|
+
The embed script inserts a `<qrati-connect>` element next to the script tag (or into the element matched by `data-target`) and lazy-loads the element build.
|
|
80
89
|
|
|
81
90
|
---
|
|
82
91
|
|
|
83
92
|
## Props & Attributes
|
|
84
93
|
|
|
85
|
-
| Prop / Attribute
|
|
86
|
-
|
|
87
|
-
| `organizationId`
|
|
88
|
-
| `router`
|
|
89
|
-
| `uid`
|
|
90
|
-
| `fname`
|
|
91
|
-
| `lname`
|
|
92
|
-
| `theme`
|
|
93
|
-
| `onError`
|
|
94
|
+
| Prop / Attribute | Type | Default | Description |
|
|
95
|
+
|------------------|------|---------|-------------|
|
|
96
|
+
| `organizationId` * | `string` | — | Qrati organization ID |
|
|
97
|
+
| `router` | `'memory' \| 'hash'` | `'memory'` | Routing strategy |
|
|
98
|
+
| `uid` | `string` | — | Pre-authenticated user ID |
|
|
99
|
+
| `fname` | `string` | — | Pre-authenticated first name |
|
|
100
|
+
| `lname` | `string` | — | Pre-authenticated last name |
|
|
101
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | Color scheme |
|
|
102
|
+
| `onError` | `(error: Error) => void` | — | SDK error callback |
|
|
94
103
|
|
|
95
|
-
\* Required
|
|
104
|
+
\* Required.
|
|
105
|
+
|
|
106
|
+
Custom auth requires `uid` and `fname`; `lname` is optional.
|
|
96
107
|
|
|
97
108
|
---
|
|
98
109
|
|
|
99
110
|
## Events & Callbacks
|
|
100
111
|
|
|
101
|
-
| Callback
|
|
102
|
-
|
|
103
|
-
| `onError` | `Error` |
|
|
112
|
+
| Callback / Event | Payload | Description |
|
|
113
|
+
|------------------|---------|-------------|
|
|
114
|
+
| `onError` | `Error` | Called when an SDK error is caught |
|
|
115
|
+
| `qrati-error` (custom event) | `{ error: Error }` | Dispatched on `window` and the custom element |
|
|
116
|
+
|
|
117
|
+
React wrapper users should use the `onError` prop. Vanilla Web Component users can listen for `qrati-error`.
|
|
104
118
|
|
|
105
119
|
---
|
|
106
120
|
|
|
107
121
|
## Performance & Bundling
|
|
108
122
|
|
|
109
|
-
|
|
123
|
+
Sizes are approximate and depend on the build output:
|
|
110
124
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
125
|
+
- React wrapper: ~1–2 KB gzipped (loads element build at runtime).
|
|
126
|
+
- Initial element bundle: ~139 KB gzipped.
|
|
127
|
+
- Upload feature: loaded on demand.
|
|
128
|
+
- HEIC conversion (`heic2any`): loaded only when a `.heic` file is selected.
|
|
129
|
+
- Maps and heavy UI libraries are split into lazy chunks.
|
|
114
130
|
|
|
115
131
|
---
|
|
116
132
|
|
|
117
133
|
## Development
|
|
118
134
|
|
|
119
|
-
|
|
135
|
+
This repository uses **pnpm** and **Node.js 24.x**.
|
|
120
136
|
|
|
121
137
|
```bash
|
|
122
|
-
pnpm
|
|
123
|
-
pnpm
|
|
124
|
-
pnpm
|
|
125
|
-
pnpm test:production # Build and run Playwright production regression tests
|
|
126
|
-
pnpm type-check # TypeScript type checking (no emit)
|
|
138
|
+
pnpm install # install dependencies
|
|
139
|
+
pnpm storybook # start Storybook on http://localhost:6006
|
|
140
|
+
pnpm type-check # TypeScript check (no emit)
|
|
127
141
|
pnpm lint # ESLint
|
|
142
|
+
pnpm format # Prettier
|
|
143
|
+
pnpm build # build all distribution targets
|
|
144
|
+
pnpm test:unit # Vitest unit tests (watch)
|
|
145
|
+
pnpm test:unit:run # Vitest unit tests (once)
|
|
146
|
+
pnpm test:all # unit tests + Playwright production regression
|
|
128
147
|
```
|
|
129
148
|
|
|
130
|
-
|
|
149
|
+
See [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) for the full setup guide and [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for design details.
|
|
150
|
+
|
|
151
|
+
---
|
|
131
152
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
153
|
+
## Documentation
|
|
154
|
+
|
|
155
|
+
- [`docs/INDEX.md`](docs/INDEX.md) — documentation map
|
|
156
|
+
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — architecture, build system, routing, styling, i18n
|
|
157
|
+
- [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) — environment setup, workflow, testing, Storybook
|
|
158
|
+
- [`docs/API.md`](docs/API.md) — backend API communication
|
|
159
|
+
- [`docs/REFERENCE.md`](docs/REFERENCE.md) — components, hooks, pages, utilities, router API
|
|
160
|
+
- [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md) — release process and CDN
|
|
161
|
+
- [`docs/FAQ.md`](docs/FAQ.md) — common questions
|
|
135
162
|
|
|
136
163
|
---
|
|
137
164
|
|
|
138
|
-
##
|
|
165
|
+
## Support
|
|
139
166
|
|
|
140
|
-
|
|
167
|
+
- GitHub Issues: https://github.com/qrati-labs/qrati-connect-ts/issues
|
|
168
|
+
- Email: support@qrati.com
|
|
141
169
|
|
|
142
170
|
---
|
|
143
171
|
|
|
144
|
-
|
|
172
|
+
## License
|
|
173
|
+
|
|
174
|
+
Proprietary © Qrati Labs — https://qrati.com. All rights reserved.
|