@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.
Files changed (137) hide show
  1. package/README.md +84 -54
  2. package/element/2CMH9VMM.js +4 -0
  3. package/element/BKDqpSN62.js +3 -0
  4. package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
  5. package/element/{BqHk5hDM.js → BOQzjiMV.js} +3 -3
  6. package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
  7. package/element/{-p_JqYFM2.js → BP2rYgya2.js} +9 -9
  8. package/element/BZu3c37u.js +1 -0
  9. package/element/{srDF4VyG.js → Bb7nx5xF.js} +1 -1
  10. package/element/Bh8kXbe92.js +93 -0
  11. package/{umd/BvNf2yif2.js → element/Bow6F3212.js} +29 -29
  12. package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
  13. package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
  14. package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
  15. package/element/C52SUIvC2.js +35 -0
  16. package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
  17. package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
  18. package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
  19. package/element/CHTzn6mh2.js +4 -0
  20. package/element/CL_evx_l.js +1 -0
  21. package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
  22. package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
  23. package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
  24. package/{umd/9QY9BKOL2.js → element/CWhnvMey2.js} +8 -8
  25. package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
  26. package/element/CaX2xgrP.js +41 -0
  27. package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
  28. package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
  29. package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
  30. package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
  31. package/element/D5TKEdBd2.js +3 -0
  32. package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
  33. package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
  34. package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
  35. package/element/DN26AtHL2.js +4 -0
  36. package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
  37. package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
  38. package/{umd/D0VKfxwE.js → element/DdOwRfWG.js} +2 -2
  39. package/element/DkG0zv7_2.js +9 -0
  40. package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
  41. package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
  42. package/element/DnIueBGr2.js +1 -0
  43. package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
  44. package/element/DrrpB4Om.js +1 -0
  45. package/element/DtRwaUYF2.js +85 -0
  46. package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
  47. package/{umd/DNG5BSHx2.js → element/N4HKgEC52.js} +1 -1
  48. package/element/Rcen6i0h.js +80 -0
  49. package/element/{MpvHkxaz2.js → Z0-Tddye2.js} +1 -1
  50. package/element/dT6WSX65.js +1 -0
  51. package/element/h4ZjZXfe2.js +1 -0
  52. package/element/kiL9JENf2.js +3 -0
  53. package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
  54. package/element/{DdmVPlUC2.js → mIANlVHi2.js} +1 -1
  55. package/element/mQzpzQ_t.js +3 -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/9QY9BKOL2.js +0 -8
  61. package/element/B14kCOq8.js +0 -2
  62. package/element/BItJQVdK.js +0 -41
  63. package/element/BYoa-kpQ2.js +0 -9
  64. package/element/Be1e_ATJ.js +0 -1
  65. package/element/BfkCwRAR2.js +0 -3
  66. package/element/BkvtmX4K.js +0 -2
  67. package/element/BsT0vqml.js +0 -1
  68. package/element/BtN9y353.js +0 -1
  69. package/element/BvNf2yif2.js +0 -39
  70. package/element/C030L_Hu2.js +0 -4
  71. package/element/C0MGOytI.js +0 -1
  72. package/element/C3tT7YRo2.js +0 -37
  73. package/element/C3uDEVBt.js +0 -1
  74. package/element/CJ5ChvJ52.js +0 -93
  75. package/element/CiiNqDJq.js +0 -3
  76. package/element/CnoPTYOO.js +0 -1
  77. package/element/D0VKfxwE.js +0 -10
  78. package/element/D4apO9G62.js +0 -4
  79. package/element/DB1jhaAe2.js +0 -85
  80. package/element/DNG5BSHx2.js +0 -2
  81. package/element/LJWh_4Di.js +0 -2
  82. package/element/gjXXuILV2.js +0 -3
  83. package/element/gk4TX_a62.js +0 -7
  84. package/element/qNDy94Dr2.js +0 -3
  85. package/element/styles.css +0 -288
  86. package/umd/-p_JqYFM2.js +0 -14
  87. package/umd/4VTPoA38.js +0 -1
  88. package/umd/BCTYvPrD.js +0 -1
  89. package/umd/BItJQVdK.js +0 -41
  90. package/umd/BQuhYd4G2.js +0 -2
  91. package/umd/BYEF5Khs.js +0 -1
  92. package/umd/BYoa-kpQ2.js +0 -9
  93. package/umd/BdOzsWR32.js +0 -9
  94. package/umd/Be1e_ATJ.js +0 -1
  95. package/umd/BfkCwRAR2.js +0 -3
  96. package/umd/BglDIiFp.js +0 -3
  97. package/umd/BkIDQGIs.js +0 -1
  98. package/umd/Bki5T_lb.js +0 -1
  99. package/umd/BqHk5hDM.js +0 -9
  100. package/umd/BsT0vqml.js +0 -1
  101. package/umd/Byk0pccK.js +0 -1
  102. package/umd/C030L_Hu2.js +0 -4
  103. package/umd/C0MGOytI.js +0 -1
  104. package/umd/C3tT7YRo2.js +0 -37
  105. package/umd/C3uDEVBt.js +0 -1
  106. package/umd/C8_zGNAf.js +0 -1
  107. package/umd/CCLXmMXp.js +0 -3
  108. package/umd/CJ5ChvJ52.js +0 -93
  109. package/umd/CSO2IaJ1.js +0 -2
  110. package/umd/Cb1JRT_1.js +0 -1
  111. package/umd/CfMNBPpx2.js +0 -1
  112. package/umd/CgUphJWo.js +0 -1
  113. package/umd/Cko4QHwX.js +0 -1
  114. package/umd/CnoPTYOO.js +0 -1
  115. package/umd/D4apO9G62.js +0 -4
  116. package/umd/D9NypPiv.js +0 -7
  117. package/umd/DB1jhaAe2.js +0 -85
  118. package/umd/DIYUC8M3.js +0 -2
  119. package/umd/DXx41__x2.js +0 -2
  120. package/umd/DdmVPlUC2.js +0 -13
  121. package/umd/DsvRTvCp.js +0 -8
  122. package/umd/DvTRhlvs.js +0 -2
  123. package/umd/LJWh_4Di.js +0 -2
  124. package/umd/MpvHkxaz2.js +0 -16
  125. package/umd/_ty2jtjs.js +0 -2
  126. package/umd/b6CwQBFC.js +0 -5
  127. package/umd/e_wwJ5wx2.js +0 -5
  128. package/umd/ekog7y-V.js +0 -1
  129. package/umd/gjXXuILV2.js +0 -3
  130. package/umd/index.d.ts +0 -14
  131. package/umd/lrjV8c1G2.js +0 -8
  132. package/umd/qNDy94Dr2.js +0 -3
  133. package/umd/qWp4ucdT.js +0 -1
  134. package/umd/rtH8O6Hc.js +0 -1
  135. package/umd/srDF4VyG.js +0 -9
  136. package/umd/web.es.js +0 -122
  137. 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. Built with strict TypeScript, Preact compatibility, and careful bundling to deliver a fast, accessible, and themeable integration.
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
- - **Plug & Play**: Use the Web Component anywhere, or import the React wrapper for rapid integration.
23
- - **Strict TypeScript**: Full typings for safer integration and better DX.
24
- - **Performance-first**: Small initial bundle, strategic lazy-loading for heavy features (HEIC conversion, upload tooling).
25
- - **Accessible & Themeable**: ARIA-friendly; visual theme is centrally configured via the Qrati Organization Settings page and applied to the component (exposed via CSS variables and className hooks).
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 — What’s inside ✨
30
+ ## Highlights
30
31
 
31
- - Interactive media gallery with lightbox, blurhash placeholders and infinite scroll
32
- - Smart uploads: compression, chunked progress, HEIC → JPEG conversion (on-demand)
33
- - Reactions, curation workflow, and leaderboards for engagement
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
- ### Install
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 (Framework Agnostic)
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 (Single Script — No Code)
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
- Supported `data-*` attributes: `data-organization-id` (required), `data-router`,
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 | Type | Default | Description |
86
- | ------------------- | ------------------------ | ---------- | -------------------------------------- |
87
- | `organizationId` \* | `string` | — | Your Qrati organization ID (required) |
88
- | `router` | `'memory' \| 'hash'` | `'memory'` | Routing strategy for navigation |
89
- | `uid` | `string` | — | Pre-authenticated user ID |
90
- | `fname` | `string` | — | Pre-authenticated user first name |
91
- | `lname` | `string` | — | Pre-authenticated user last name |
92
- | `theme` | `'light' \| 'dark'` | `'light'` | Color scheme |
93
- | `onError` | `(error: Error) => void` | — | Error callback for handling SDK errors |
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 | Payload | Description |
102
- | --------- | ------- | ------------------------------------- |
103
- | `onError` | `Error` | Fires when an error occurs in the SDK |
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
- We optimize for small initial loads and lazy-load heavy features:
123
+ Sizes are approximate and depend on the build output:
110
124
 
111
- - Initial: ~139 KB gzipped (core UI + essentials)
112
- - Upload feature: +~73 KB gzipped (lazy)
113
- - HEIC conversion (heic2any): large dependency loaded only on-demand (~345 KB gzipped)
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
- Common commands for contributors:
135
+ This repository uses **pnpm** and **Node.js 24.x**.
120
136
 
121
137
  ```bash
122
- pnpm build # Build all distribution targets (element → umd → react → embed)
123
- pnpm test:unit # Run Vitest unit tests in watch mode
124
- pnpm test:unit:run # Run Vitest unit tests once
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
- ## Support
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
- - Report bugs or request features via GitHub Issues: https://github.com/qrati-labs/qrati-connect-ts/issues
133
- - See `docs/` for architecture, component, and hook references
134
- - For commercial support: support@qrati.com
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
- ## License
165
+ ## Support
139
166
 
140
- Proprietary © Qrati Labs — https://qrati.com. All rights reserved.
167
+ - GitHub Issues: https://github.com/qrati-labs/qrati-connect-ts/issues
168
+ - Email: support@qrati.com
141
169
 
142
170
  ---
143
171
 
144
- Visit `docs/` for full API and integration patterns.
172
+ ## License
173
+
174
+ Proprietary © Qrati Labs — https://qrati.com. All rights reserved.