@qratilabs/qrati-connect 2.23.0-beta.10 → 2.23.0-beta.12

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.
Files changed (137) hide show
  1. package/README.md +99 -74
  2. package/element/2CMH9VMM.js +4 -0
  3. package/element/4tMgCiYw.js +41 -0
  4. package/element/6hoD5_Vl2.js +93 -0
  5. package/element/{DN1lg1Z82.js → B70v8cGQ2.js} +1 -1
  6. package/element/B9-WkJUt2.js +1 -0
  7. package/element/{CWO6blVi.js → BE-haWnd.js} +1 -1
  8. package/{umd/B8Ttd5mR.js → element/BFvmiMbV.js} +2 -2
  9. package/element/{XIy-pC_92.js → BGSX-HAY2.js} +29 -29
  10. package/element/{DmMRHXtM2.js → BSHuoVMu2.js} +8 -8
  11. package/{umd/D_4OXo87.js → element/BWFsg0bG.js} +1 -1
  12. package/element/Bd-4kf1_2.js +85 -0
  13. package/element/{LpcU8wdf.js → BezKyBw8.js} +2 -2
  14. package/element/{afmuirs12.js → BkPCorGR2.js} +4 -4
  15. package/element/BsD01BsS2.js +3 -0
  16. package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
  17. package/element/BtZjRMK0.js +1 -0
  18. package/element/{BN5szMnq.js → BxAGmFjz.js} +1 -1
  19. package/element/{DaewbIBn2.js → C1HCUyOY2.js} +1 -1
  20. package/element/C7hsHpwE2.js +3 -0
  21. package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
  22. package/element/CDFn498b2.js +4 -0
  23. package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
  24. package/element/{D6qTsmXL.js → CI6iTXM5.js} +5 -5
  25. package/element/CL_evx_l.js +1 -0
  26. package/{umd/EgJQxiz-2.js → element/CWRQEdBR2.js} +9 -9
  27. package/element/{YcabH-1h.js → CWmhhcUq.js} +2 -2
  28. package/element/{B14kCOq8.js → CZ9iaxjO.js} +1 -1
  29. package/{umd/Dx7bGj8V2.js → element/CZqlO3zh2.js} +1 -1
  30. package/element/CoT7nGQp2.js +4 -0
  31. package/element/{tpr-W9BP.js → CqKs7cYK.js} +1 -1
  32. package/{umd/B8iE0_hM.js → element/CtbuoQ7J.js} +1 -1
  33. package/element/{Bj9UR6Yz2.js → D1PqO8Bd2.js} +1 -1
  34. package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
  35. package/element/D5TKEdBd2.js +3 -0
  36. package/element/DG8EMwNQ.js +1 -0
  37. package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
  38. package/element/{Bnib0POY.js → DIQ9mtoC.js} +1 -1
  39. package/{umd/DA91NKGO.js → element/DX3xkbbX.js} +1 -1
  40. package/element/{DdMTbL2G.js → Da2eagiO.js} +1 -1
  41. package/element/Dik2a7Gm2.js +9 -0
  42. package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
  43. package/element/DnIueBGr2.js +1 -0
  44. package/element/{DmFpR6Ob.js → Dog5Nkhv.js} +1 -1
  45. package/element/{CJeVf0D82.js → DrlwFVJe2.js} +1 -1
  46. package/element/DrrpB4Om.js +1 -0
  47. package/{umd/Cv9xb_-W.js → element/DxS0MPY6.js} +1 -1
  48. package/{umd/DNG5BSHx2.js → element/N4HKgEC52.js} +1 -1
  49. package/element/Rcen6i0h.js +80 -0
  50. package/element/{K0G79z0X.js → U2g1x1CI.js} +3 -3
  51. package/element/{CM4ZH83j.js → WW2XnkWC2.js} +1 -1
  52. package/element/{C6Sp1Jwi.js → Z1XNQctT.js} +1 -1
  53. package/element/{Btu2YRnF2.js → ZvXeEmeW2.js} +1 -1
  54. package/element/mQzpzQ_t.js +3 -0
  55. package/element/sEG-IEXG2.js +35 -0
  56. package/element/web.es.js +26 -105
  57. package/package.json +3 -15
  58. package/react/index.d.mts +182 -6
  59. package/react/index.d.ts +182 -6
  60. package/element/B6PU8eoK2.js +0 -3
  61. package/element/B8Ttd5mR.js +0 -2
  62. package/element/B8iE0_hM.js +0 -3
  63. package/element/BOUg1pW_2.js +0 -93
  64. package/element/BkvtmX4K.js +0 -2
  65. package/element/BsT0vqml.js +0 -1
  66. package/element/C0MGOytI.js +0 -1
  67. package/element/C1LNODkE2.js +0 -37
  68. package/element/C3uDEVBt.js +0 -1
  69. package/element/Cl0iruY72.js +0 -85
  70. package/element/Cv9xb_-W.js +0 -1
  71. package/element/D4fyuPrh2.js +0 -4
  72. package/element/D9FVUgcz.js +0 -1
  73. package/element/DA91NKGO.js +0 -7
  74. package/element/DNG5BSHx2.js +0 -2
  75. package/element/D_4OXo87.js +0 -1
  76. package/element/DkMzhenk2.js +0 -4
  77. package/element/DpKHDt4F2.js +0 -3
  78. package/element/Dx7bGj8V2.js +0 -9
  79. package/element/EgJQxiz-2.js +0 -14
  80. package/element/HO1cwKhZ2.js +0 -9
  81. package/element/LJWh_4Di.js +0 -2
  82. package/element/TOp1kwsu.js +0 -41
  83. package/element/gjXXuILV2.js +0 -3
  84. package/element/gk4TX_a62.js +0 -7
  85. package/element/iWy6455b.js +0 -1
  86. package/element/styles.css +0 -288
  87. package/umd/B14kCOq8.js +0 -2
  88. package/umd/B6PU8eoK2.js +0 -3
  89. package/umd/BCTYvPrD.js +0 -1
  90. package/umd/BN5szMnq.js +0 -1
  91. package/umd/BOUg1pW_2.js +0 -93
  92. package/umd/Bj9UR6Yz2.js +0 -8
  93. package/umd/BkIDQGIs.js +0 -1
  94. package/umd/Bki5T_lb.js +0 -1
  95. package/umd/Bnib0POY.js +0 -1
  96. package/umd/BsT0vqml.js +0 -1
  97. package/umd/Btu2YRnF2.js +0 -13
  98. package/umd/Byk0pccK.js +0 -1
  99. package/umd/C0MGOytI.js +0 -1
  100. package/umd/C1LNODkE2.js +0 -37
  101. package/umd/C3uDEVBt.js +0 -1
  102. package/umd/C6Sp1Jwi.js +0 -9
  103. package/umd/CJeVf0D82.js +0 -16
  104. package/umd/CM4ZH83j.js +0 -3
  105. package/umd/CWO6blVi.js +0 -1
  106. package/umd/CfMNBPpx2.js +0 -1
  107. package/umd/CgUphJWo.js +0 -1
  108. package/umd/Cko4QHwX.js +0 -1
  109. package/umd/Cl0iruY72.js +0 -85
  110. package/umd/D4fyuPrh2.js +0 -4
  111. package/umd/D6qTsmXL.js +0 -5
  112. package/umd/D9FVUgcz.js +0 -1
  113. package/umd/DIYUC8M3.js +0 -2
  114. package/umd/DN1lg1Z82.js +0 -2
  115. package/umd/DaewbIBn2.js +0 -2
  116. package/umd/DdMTbL2G.js +0 -1
  117. package/umd/DkMzhenk2.js +0 -4
  118. package/umd/DmFpR6Ob.js +0 -8
  119. package/umd/DmMRHXtM2.js +0 -8
  120. package/umd/DpKHDt4F2.js +0 -3
  121. package/umd/DvTRhlvs.js +0 -2
  122. package/umd/HO1cwKhZ2.js +0 -9
  123. package/umd/K0G79z0X.js +0 -9
  124. package/umd/LJWh_4Di.js +0 -2
  125. package/umd/LpcU8wdf.js +0 -3
  126. package/umd/TOp1kwsu.js +0 -41
  127. package/umd/XIy-pC_92.js +0 -39
  128. package/umd/YcabH-1h.js +0 -10
  129. package/umd/_ty2jtjs.js +0 -2
  130. package/umd/afmuirs12.js +0 -5
  131. package/umd/gjXXuILV2.js +0 -3
  132. package/umd/iWy6455b.js +0 -1
  133. package/umd/index.d.ts +0 -14
  134. package/umd/rtH8O6Hc.js +0 -1
  135. package/umd/tpr-W9BP.js +0 -1
  136. package/umd/web.es.js +0 -122
  137. package/umd/web.umd.js +0 -1
package/README.md CHANGED
@@ -4,15 +4,46 @@ Qrati Connect is a React component library designed to seamlessly integrate Qrat
4
4
 
5
5
  # Features
6
6
 
7
- - **Interactive Media Gallery :** Integrate Qrati's powerful interactive media gallery into your own site without a hassle.
8
- - **Media Upload :** Users can directly upload content from your host site.
9
- - **Reaction :** Engage your users with a completely customizable set of emojis.
10
- - **Curation :** Want to host a photo contest? Our curation feature can be a one stop solution for that.
11
- - **Leaderboard :** Gamify your contest with a precise and fun leaderboard.
7
+ # Qrati Connect Embeddable Media & Engagement SDK
12
8
 
13
- **Qrati Connect** is a compact, production-grade SDK for embedding photo galleries, uploads, curation, and engagement into any website. Built with strict TypeScript, Preact compatibility, and careful bundling to deliver a fast, accessible, and themeable integration.
9
+ **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.
14
10
 
15
- Install `qrati-connect` using npm, yarn, pnpm or bun:
11
+ ---
12
+
13
+ ## Why Qrati Connect?
14
+
15
+ - **Framework-agnostic** — works in React, Vue, Angular, WordPress, or plain HTML.
16
+ - **Style isolation** — Shadow DOM keeps SDK styles separate from the host page.
17
+ - **Small initial payload** — Preact core plus strategic lazy-loading for heavy features (upload, HEIC conversion, maps).
18
+ - **Themeable** — organization colors, fonts, radius, and shadows are fetched from the Qrati API and applied via CSS custom properties.
19
+ - **TypeScript-first** — full typings for the public API.
20
+
21
+ ---
22
+
23
+ ## Highlights
24
+
25
+ - Interactive media gallery with lightbox, blurhash placeholders, infinite scroll, and facial search.
26
+ - Smart uploads: compression, chunked progress, video trimming, and HEIC → JPEG conversion on demand.
27
+ - Reactions, curation workflow, leaderboards, and points-based engagement.
28
+ - Public events page with folder navigation and optional map view (Google Maps, Mapbox, OpenStreetMap).
29
+
30
+ ---
31
+
32
+ ## Distribution Formats
33
+
34
+ | Format | Output | Best for |
35
+ |--------|--------|----------|
36
+ | **React wrapper** | `dist/react/index.mjs` / `index.cjs` | React / Next.js apps |
37
+ | **Web Component** | `dist/element/web.es.js` | Any framework or vanilla JS |
38
+ | **Embed loader** | `dist/embed/embed.js` | Zero-code `<script>` integration |
39
+
40
+ The React wrapper and embed loader dynamically load the element build at runtime, so the same `web.es.js` bundle is always used.
41
+
42
+ ---
43
+
44
+ ## Quick Install & Integration
45
+
46
+ ### React (client component)
16
47
 
17
48
  ```bash
18
49
  npm install @qratilabs/qrati-connect
@@ -24,11 +55,10 @@ pnpm add @qratilabs/qrati-connect
24
55
  bun install @qratilabs/qrati-connect
25
56
  ```
26
57
 
27
- Sample react page -
58
+ ```tsx
59
+ 'use client';
28
60
 
29
- ```javascript
30
- import QratiConnect from '@qratilabs/qrati-connect/react';
31
- import '@qratilabs/qrati-connect/react/styles.css';
61
+ import { QratiConnect } from '@qratilabs/qrati-connect';
32
62
 
33
63
  const Page = () => {
34
64
  return (
@@ -41,68 +71,42 @@ const Page = () => {
41
71
  export default Page;
42
72
  ```
43
73
 
44
- **Note**: Add 'use client' directive if you are using any React frameworks which supports Server Side Rendering (SSR) like Next.js.
45
-
46
- # Available props
47
-
48
- - **router :** Custom router configuration for internal navigation ('memory or 'hash').
49
- - **organizationId :** Unique identifier for your organization inside Qrati.
50
- - **fontClassName :** Classes to control custom font for the component.
51
- - **textClassName :** Classes to apply any additional styling to texts inside the component.
52
- - **emptyStateImage :** Link or path to image which will be shown for any empty state in the component.
53
- - **curateLabel :** Label to show in place of 'Curate' in header for contest type events.
54
- - **leaderboardLabel :** Label to show in place of 'Leaders' in header for contest type events.
55
- - **uid :** User id for your application user (applicable for custom auth only).
56
- - **fname :** First name for your application user (applicable for custom auth only).
57
- - **lname :** Last name for your application user (applicable for custom auth only).
58
- - **loginUrl :** The page url inside your web app where we should redirect when authentication is required for user intended action (applicable for custom auth only).
59
-
60
- # Qrati Connect Element (Web Component)
61
-
62
- Qrati Connect is also available as a Web Component (Custom Element) that you can use directly in your HTML without React. This is useful for non-React applications or when you want to embed Qrati Connect in static HTML pages.
63
-
64
- ## Installation via CDN (jsDelivr)
65
-
66
- Add the following script and stylesheet tags to your HTML:
74
+ ### Web Component (framework-agnostic)
67
75
 
68
76
  ```html
69
- <!-- Import the Web Component -->
70
- <script type="module" src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect/element/web.es.js"></script>
71
- <!-- Import the styles -->
72
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect/element/styles.css" />
73
- ```
77
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect@2/element/web.es.js"></script>
74
78
 
75
- ### Embed (Single Script — No Code)
79
+ <qrati-connect organization-id="your-org-id" router="hash"></qrati-connect>
80
+ ```
76
81
 
77
- The simplest integration: one `async` tag, config in `data-*` attributes. Mounts
78
- where the tag sits, or into the element matched by `data-target`.
82
+ ### Embed script (zero-code)
79
83
 
80
84
  ```html
81
85
  <script async
82
- src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect/embed/embed.js"
86
+ src="https://cdn.jsdelivr.net/npm/@qratilabs/qrati-connect@2/embed/embed.js"
83
87
  data-organization-id="your-org-id"
84
88
  data-router="hash"></script>
85
89
  ```
86
90
 
87
- Supported `data-*` attributes: `data-organization-id` (required), `data-router`,
88
- `data-uid`, `data-fname`, `data-lname`, `data-theme`, and `data-target` (CSS
89
- selector for the mount container).
91
+ 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.
90
92
 
91
93
  ---
92
94
 
93
95
  Once imported, you can use the custom element tag `<qrati-connect>` in your HTML:
94
96
 
95
- | Prop / Attribute | Type | Default | Description |
96
- | ------------------- | ------------------------ | ---------- | -------------------------------------- |
97
- | `organizationId` \* | `string` | — | Your Qrati organization ID (required) |
98
- | `router` | `'memory' \| 'hash'` | `'memory'` | Routing strategy for navigation |
99
- | `uid` | `string` | — | Pre-authenticated user ID |
100
- | `fname` | `string` | — | Pre-authenticated user first name |
101
- | `lname` | `string` | — | Pre-authenticated user last name |
102
- | `theme` | `'light' \| 'dark'` | `'light'` | Color scheme |
103
- | `onError` | `(error: Error) => void` | — | Error callback for handling SDK errors |
97
+ | Prop / Attribute | Type | Default | Description |
98
+ |------------------|------|---------|-------------|
99
+ | `organizationId` * | `string` | — | Qrati organization ID |
100
+ | `router` | `'memory' \| 'hash'` | `'memory'` | Routing strategy |
101
+ | `uid` | `string` | — | Pre-authenticated user ID |
102
+ | `fname` | `string` | — | Pre-authenticated first name |
103
+ | `lname` | `string` | — | Pre-authenticated last name |
104
+ | `theme` | `'light' \| 'dark'` | `'light'` | Color scheme |
105
+ | `onError` | `(error: Error) => void` | — | SDK error callback |
106
+
107
+ \* Required.
104
108
 
105
- Note: When using the Web Component version, props are passed as HTML attributes with kebab-case naming (e.g., `organization-id` instead of `organizationId`).
109
+ Custom auth requires `uid` and `fname`; `lname` is optional.
106
110
 
107
111
  3. Tailwindv3 -> Tailwindv4
108
112
 
@@ -112,45 +116,66 @@ text-secondary -> text-muted-foreground
112
116
  bg-brand, text-brand -> bg-primary, text-primary
113
117
  qc-text-lg, qc-bg-red-500 -> qc:text-lg, qc:bg-red-500
114
118
 
115
- 4. IconifyReact -> Iconify Tailwindv4
119
+ | Callback / Event | Payload | Description |
120
+ |------------------|---------|-------------|
121
+ | `onError` | `Error` | Called when an SDK error is caught |
122
+ | `qrati-error` (custom event) | `{ error: Error }` | Dispatched on `window` and the custom element |
123
+
124
+ React wrapper users should use the `onError` prop. Vanilla Web Component users can listen for `qrati-error`.
116
125
 
117
126
  ---
118
127
 
119
128
  ## Performance & Bundling
120
129
 
121
- We optimize for small initial loads and lazy-load heavy features:
130
+ Sizes are approximate and depend on the build output:
122
131
 
123
- - Initial: ~139 KB gzipped (core UI + essentials)
124
- - Upload feature: +~73 KB gzipped (lazy)
125
- - HEIC conversion (heic2any): large dependency loaded only on-demand (~345 KB gzipped)
132
+ - React wrapper: ~1–2 KB gzipped (loads element build at runtime).
133
+ - Initial element bundle: ~139 KB gzipped.
134
+ - Upload feature: loaded on demand.
135
+ - HEIC conversion (`heic2any`): loaded only when a `.heic` file is selected.
136
+ - Maps and heavy UI libraries are split into lazy chunks.
126
137
 
127
138
  ---
128
139
 
129
140
  ## Development
130
141
 
131
- Common commands for contributors:
142
+ This repository uses **pnpm** and **Node.js 24.x**.
132
143
 
133
144
  ```bash
134
- pnpm build # Build all distribution targets (element → umd → react → embed)
135
- pnpm test:unit # Run Vitest unit tests in watch mode
136
- pnpm test:unit:run # Run Vitest unit tests once
137
- pnpm test:production # Build and run Playwright production regression tests
138
- pnpm type-check # TypeScript type checking (no emit)
145
+ pnpm install # install dependencies
146
+ pnpm storybook # start Storybook on http://localhost:6006
147
+ pnpm type-check # TypeScript check (no emit)
139
148
  pnpm lint # ESLint
149
+ pnpm format # Prettier
150
+ pnpm build # build all distribution targets
151
+ pnpm test:unit # Vitest unit tests (watch)
152
+ pnpm test:unit:run # Vitest unit tests (once)
153
+ pnpm test:all # unit tests + Playwright production regression
140
154
  ```
141
155
 
142
- ## Support
156
+ See [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) for the full setup guide and [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for design details.
143
157
 
144
- - Report bugs or request features via GitHub Issues: https://github.com/qrati-labs/qrati-connect-ts/issues
145
- - See `docs/` for architecture, component, and hook references
146
- - For commercial support: support@qrati.com
158
+ ---
159
+
160
+ ## Documentation
161
+
162
+ - [`docs/INDEX.md`](docs/INDEX.md) — documentation map
163
+ - [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — architecture, build system, routing, styling, i18n
164
+ - [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) — environment setup, workflow, testing, Storybook
165
+ - [`docs/API.md`](docs/API.md) — backend API communication
166
+ - [`docs/REFERENCE.md`](docs/REFERENCE.md) — components, hooks, pages, utilities, router API
167
+ - [`docs/DEPLOYMENT.md`](docs/DEPLOYMENT.md) — release process and CDN
168
+ - [`docs/FAQ.md`](docs/FAQ.md) — common questions
147
169
 
148
170
  ---
149
171
 
150
- ## License
172
+ ## Support
151
173
 
152
- Proprietary © Qrati Labs — https://qrati.com. All rights reserved.
174
+ - GitHub Issues: https://github.com/qrati-labs/qrati-connect-ts/issues
175
+ - Email: support@qrati.com
153
176
 
154
177
  ---
155
178
 
156
- Visit `docs/` for full API and integration patterns.
179
+ ## License
180
+
181
+ Proprietary © Qrati Labs — https://qrati.com. All rights reserved.