@agent-analytics/shared-ui 0.1.0 → 0.3.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.
@@ -1,20 +1,294 @@
1
+ {% set aaFooterData = {
2
+ "en": {
3
+ "title": "Agent Analytics",
4
+ "description": "Agent-ready analytics for builders who ship fast.",
5
+ "copy": "Built for builders who ship fast. Open source under MIT.",
6
+ "logoAlt": "Agent Analytics",
7
+ "logoSrc": "/logo-v2.png",
8
+ "sections": [
9
+ {
10
+ "title": "Product",
11
+ "links": [
12
+ {
13
+ "href": "https://app.agentanalytics.sh",
14
+ "label": "Dashboard",
15
+ "trackingId": "footer_product_dashboard"
16
+ },
17
+ {
18
+ "href": "https://blog.agentanalytics.sh/",
19
+ "label": "Blog",
20
+ "trackingId": "footer_product_blog"
21
+ },
22
+ {
23
+ "href": "https://docs.agentanalytics.sh/",
24
+ "label": "API Docs",
25
+ "trackingId": "footer_product_docs"
26
+ },
27
+ {
28
+ "href": "https://github.com/Agent-Analytics/agent-analytics",
29
+ "label": "GitHub",
30
+ "external": true,
31
+ "trackingId": "footer_product_github"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "title": "Compare",
37
+ "links": [
38
+ {
39
+ "href": "https://agentanalytics.sh/compare/umami",
40
+ "label": "vs Umami",
41
+ "trackingId": "footer_compare_umami"
42
+ },
43
+ {
44
+ "href": "https://agentanalytics.sh/compare/mixpanel",
45
+ "label": "vs Mixpanel",
46
+ "trackingId": "footer_compare_mixpanel"
47
+ },
48
+ {
49
+ "href": "https://agentanalytics.sh/compare/amplitude",
50
+ "label": "vs Amplitude",
51
+ "trackingId": "footer_compare_amplitude"
52
+ },
53
+ {
54
+ "href": "https://agentanalytics.sh/compare/ga4",
55
+ "label": "vs GA4",
56
+ "trackingId": "footer_compare_ga4"
57
+ },
58
+ {
59
+ "href": "https://agentanalytics.sh/compare/heap",
60
+ "label": "vs Heap",
61
+ "trackingId": "footer_compare_heap"
62
+ },
63
+ {
64
+ "href": "https://agentanalytics.sh/compare/adobe-analytics",
65
+ "label": "vs Adobe Analytics",
66
+ "trackingId": "footer_compare_adobe_analytics"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "title": "Company",
72
+ "links": [
73
+ {
74
+ "href": "https://x.com/analytics_90590",
75
+ "label": "X",
76
+ "external": true,
77
+ "trackingId": "footer_company_x"
78
+ },
79
+ {
80
+ "href": "mailto:contact@agentanalytics.sh",
81
+ "label": "Contact",
82
+ "trackingId": "footer_company_contact"
83
+ },
84
+ {
85
+ "href": "mailto:support@agentanalytics.sh",
86
+ "label": "Support",
87
+ "trackingId": "footer_company_support"
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "title": "Legal",
93
+ "links": [
94
+ {
95
+ "href": "https://agentanalytics.sh/privacy",
96
+ "label": "Privacy",
97
+ "trackingId": "footer_legal_privacy"
98
+ },
99
+ {
100
+ "href": "https://agentanalytics.sh/terms",
101
+ "label": "Terms",
102
+ "trackingId": "footer_legal_terms"
103
+ },
104
+ {
105
+ "href": "https://agentanalytics.sh/dpa",
106
+ "label": "DPA",
107
+ "trackingId": "footer_legal_dpa"
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ },
113
+ "he": {
114
+ "title": "Agent Analytics",
115
+ "description": "אנליטיקה מותאמת לסוכנים עבור בונים שמשחררים מהר.",
116
+ "copy": "נבנה עבור בונים שמשחררים מהר. קוד פתוח תחת MIT.",
117
+ "logoAlt": "Agent Analytics",
118
+ "logoSrc": "/logo-v2.png",
119
+ "sections": [
120
+ {
121
+ "title": "מוצר",
122
+ "links": [
123
+ {
124
+ "href": "https://app.agentanalytics.sh",
125
+ "label": "לוח בקרה",
126
+ "trackingId": "footer_product_dashboard"
127
+ },
128
+ {
129
+ "href": "https://blog.agentanalytics.sh/he/",
130
+ "label": "בלוג",
131
+ "trackingId": "footer_product_blog"
132
+ },
133
+ {
134
+ "href": "https://docs.agentanalytics.sh/he/",
135
+ "label": "תיעוד API",
136
+ "trackingId": "footer_product_docs"
137
+ },
138
+ {
139
+ "href": "https://github.com/Agent-Analytics/agent-analytics",
140
+ "label": "GitHub",
141
+ "external": true,
142
+ "trackingId": "footer_product_github"
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ "title": "חברה",
148
+ "links": [
149
+ {
150
+ "href": "https://x.com/analytics_90590",
151
+ "label": "X",
152
+ "external": true,
153
+ "trackingId": "footer_company_x"
154
+ },
155
+ {
156
+ "href": "mailto:contact@agentanalytics.sh",
157
+ "label": "יצירת קשר",
158
+ "trackingId": "footer_company_contact"
159
+ },
160
+ {
161
+ "href": "mailto:support@agentanalytics.sh",
162
+ "label": "תמיכה",
163
+ "trackingId": "footer_company_support"
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "title": "משפטי",
169
+ "links": [
170
+ {
171
+ "href": "https://agentanalytics.sh/privacy",
172
+ "label": "פרטיות",
173
+ "trackingId": "footer_legal_privacy"
174
+ },
175
+ {
176
+ "href": "https://agentanalytics.sh/terms",
177
+ "label": "תנאים",
178
+ "trackingId": "footer_legal_terms"
179
+ },
180
+ {
181
+ "href": "https://agentanalytics.sh/dpa",
182
+ "label": "DPA",
183
+ "trackingId": "footer_legal_dpa"
184
+ }
185
+ ]
186
+ }
187
+ ]
188
+ },
189
+ "zh": {
190
+ "title": "Agent Analytics",
191
+ "description": "为快速交付的构建者打造的智能代理分析。",
192
+ "copy": "为快速交付的构建者打造。MIT 开源许可。",
193
+ "logoAlt": "Agent Analytics",
194
+ "logoSrc": "/logo-v2.png",
195
+ "sections": [
196
+ {
197
+ "title": "产品",
198
+ "links": [
199
+ {
200
+ "href": "https://app.agentanalytics.sh",
201
+ "label": "仪表盘",
202
+ "trackingId": "footer_product_dashboard"
203
+ },
204
+ {
205
+ "href": "https://blog.agentanalytics.sh/zh/",
206
+ "label": "博客",
207
+ "trackingId": "footer_product_blog"
208
+ },
209
+ {
210
+ "href": "https://docs.agentanalytics.sh/zh/",
211
+ "label": "API 文档",
212
+ "trackingId": "footer_product_docs"
213
+ },
214
+ {
215
+ "href": "https://github.com/Agent-Analytics/agent-analytics",
216
+ "label": "GitHub",
217
+ "external": true,
218
+ "trackingId": "footer_product_github"
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "title": "公司",
224
+ "links": [
225
+ {
226
+ "href": "https://x.com/analytics_90590",
227
+ "label": "X",
228
+ "external": true,
229
+ "trackingId": "footer_company_x"
230
+ },
231
+ {
232
+ "href": "mailto:contact@agentanalytics.sh",
233
+ "label": "联系我们",
234
+ "trackingId": "footer_company_contact"
235
+ },
236
+ {
237
+ "href": "mailto:support@agentanalytics.sh",
238
+ "label": "支持",
239
+ "trackingId": "footer_company_support"
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "title": "法律",
245
+ "links": [
246
+ {
247
+ "href": "https://agentanalytics.sh/privacy",
248
+ "label": "隐私",
249
+ "trackingId": "footer_legal_privacy"
250
+ },
251
+ {
252
+ "href": "https://agentanalytics.sh/terms",
253
+ "label": "条款",
254
+ "trackingId": "footer_legal_terms"
255
+ },
256
+ {
257
+ "href": "https://agentanalytics.sh/dpa",
258
+ "label": "DPA",
259
+ "trackingId": "footer_legal_dpa"
260
+ }
261
+ ]
262
+ }
263
+ ]
264
+ }
265
+ } %}
266
+ {% set aaFooter = aaFooterData[locale or 'en'] or aaFooterData.en %}
1
267
  <footer class="aa-footer" data-aa-impression="footer">
2
268
  <div class="aa-footer__inner">
3
- <div class="aa-footer__mark">
4
- <img src="/favicon.png" alt="Agent Analytics">
269
+ <div class="aa-footer__grid">
270
+ <div class="aa-footer__brand">
271
+ <div class="aa-footer__mark">
272
+ <img src="{{ aaFooter.logoSrc }}" alt="{{ aaFooter.logoAlt }}">
273
+ </div>
274
+ <div class="aa-footer__brand-copy">
275
+ <h2 class="aa-footer__title">{{ aaFooter.title }}</h2>
276
+ <p class="aa-footer__description">{{ aaFooter.description }}</p>
277
+ <p class="aa-footer__copy">{{ aaFooter.copy }}</p>
278
+ </div>
279
+ </div>
280
+ <nav class="aa-footer__sections" aria-label="Footer">
281
+ {% for section in aaFooter.sections %}
282
+ <section class="aa-footer__section">
283
+ <h3 class="aa-footer__heading">{{ section.title }}</h3>
284
+ <div class="aa-footer__list">
285
+ {% for link in section.links %}
286
+ <a href="{{ link.href }}" class="aa-footer__link"{% if link.external %} target="_blank" rel="noopener noreferrer"{% endif %}{% if link.trackingId %} onclick="window.aa?.track('cta_click',{id:'{{ link.trackingId }}'})"{% endif %}>{{ link.label }}</a>
287
+ {% endfor %}
288
+ </div>
289
+ </section>
290
+ {% endfor %}
291
+ </nav>
5
292
  </div>
6
- <nav class="aa-footer__links" aria-label="Footer">
7
- <a href="https://github.com/Agent-Analytics/agent-analytics" class="aa-footer__link" target="_blank" rel="noopener noreferrer">GitHub</a>
8
- <a href="https://docs.agentanalytics.sh" class="aa-footer__link">API Docs</a>
9
- <a href="https://blog.agentanalytics.sh" class="aa-footer__link">Blog</a>
10
- <a href="https://app.agentanalytics.sh" class="aa-footer__link">Dashboard</a>
11
- <a href="https://x.com/analytics_90590" class="aa-footer__link" target="_blank" rel="noopener noreferrer">X</a>
12
- <a href="mailto:contact@agentanalytics.sh" class="aa-footer__link">Contact</a>
13
- <a href="mailto:support@agentanalytics.sh" class="aa-footer__link">Support</a>
14
- <a href="https://agentanalytics.sh/privacy" class="aa-footer__link">Privacy</a>
15
- <a href="https://agentanalytics.sh/terms" class="aa-footer__link">Terms</a>
16
- <a href="https://agentanalytics.sh/dpa" class="aa-footer__link">DPA</a>
17
- </nav>
18
- <p class="aa-footer__copy">Built for builders who ship fast. Open source under MIT.</p>
19
293
  </div>
20
294
  </footer>
@@ -0,0 +1,250 @@
1
+ {% set aaHeaderData = {
2
+ "en": {
3
+ "brand": {
4
+ "href": "/",
5
+ "logoAlt": "Agent Analytics",
6
+ "logoSrc": "/logo-v2.png",
7
+ "subtitle": "Agent-ready analytics",
8
+ "title": "AgentAnalytics"
9
+ },
10
+ "links": [
11
+ {
12
+ "href": "https://blog.agentanalytics.sh/",
13
+ "label": "Blog",
14
+ "trackingId": "nav_blog"
15
+ },
16
+ {
17
+ "href": "https://docs.agentanalytics.sh/",
18
+ "label": "Docs",
19
+ "trackingId": "nav_docs"
20
+ },
21
+ {
22
+ "href": "/#pricing",
23
+ "label": "Pricing",
24
+ "trackingId": "nav_pricing"
25
+ }
26
+ ],
27
+ "cta": {
28
+ "href": "https://app.agentanalytics.sh",
29
+ "label": "Start free",
30
+ "trackingId": "nav_start_free"
31
+ },
32
+ "switcher": {
33
+ "label": "Language",
34
+ "options": [
35
+ {
36
+ "id": "en",
37
+ "label": "English",
38
+ "nativeLabel": "English",
39
+ "active": true
40
+ },
41
+ {
42
+ "id": "he",
43
+ "label": "Hebrew",
44
+ "nativeLabel": "עברית",
45
+ "active": false
46
+ },
47
+ {
48
+ "id": "zh",
49
+ "label": "Chinese",
50
+ "nativeLabel": "简体中文",
51
+ "active": false
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ "he": {
57
+ "brand": {
58
+ "href": "/he/",
59
+ "logoAlt": "Agent Analytics",
60
+ "logoSrc": "/logo-v2.png",
61
+ "subtitle": "אנליטיקה מותאמת לסוכנים",
62
+ "title": "AgentAnalytics"
63
+ },
64
+ "links": [
65
+ {
66
+ "href": "https://blog.agentanalytics.sh/he/",
67
+ "label": "בלוג",
68
+ "trackingId": "nav_blog"
69
+ },
70
+ {
71
+ "href": "https://docs.agentanalytics.sh/he/",
72
+ "label": "תיעוד",
73
+ "trackingId": "nav_docs"
74
+ },
75
+ {
76
+ "href": "/he/#pricing",
77
+ "label": "מחירים",
78
+ "trackingId": "nav_pricing"
79
+ }
80
+ ],
81
+ "cta": {
82
+ "href": "https://app.agentanalytics.sh",
83
+ "label": "התחילו בחינם",
84
+ "trackingId": "nav_start_free"
85
+ },
86
+ "switcher": {
87
+ "label": "שפה",
88
+ "options": [
89
+ {
90
+ "id": "en",
91
+ "label": "English",
92
+ "nativeLabel": "English",
93
+ "active": false
94
+ },
95
+ {
96
+ "id": "he",
97
+ "label": "Hebrew",
98
+ "nativeLabel": "עברית",
99
+ "active": true
100
+ },
101
+ {
102
+ "id": "zh",
103
+ "label": "Chinese",
104
+ "nativeLabel": "简体中文",
105
+ "active": false
106
+ }
107
+ ]
108
+ }
109
+ },
110
+ "zh": {
111
+ "brand": {
112
+ "href": "/zh/",
113
+ "logoAlt": "Agent Analytics",
114
+ "logoSrc": "/logo-v2.png",
115
+ "subtitle": "面向智能代理的分析",
116
+ "title": "AgentAnalytics"
117
+ },
118
+ "links": [
119
+ {
120
+ "href": "https://blog.agentanalytics.sh/zh/",
121
+ "label": "博客",
122
+ "trackingId": "nav_blog"
123
+ },
124
+ {
125
+ "href": "https://docs.agentanalytics.sh/zh/",
126
+ "label": "文档",
127
+ "trackingId": "nav_docs"
128
+ },
129
+ {
130
+ "href": "/zh/#pricing",
131
+ "label": "价格",
132
+ "trackingId": "nav_pricing"
133
+ }
134
+ ],
135
+ "cta": {
136
+ "href": "https://app.agentanalytics.sh",
137
+ "label": "免费开始",
138
+ "trackingId": "nav_start_free"
139
+ },
140
+ "switcher": {
141
+ "label": "语言",
142
+ "options": [
143
+ {
144
+ "id": "en",
145
+ "label": "English",
146
+ "nativeLabel": "English",
147
+ "active": false
148
+ },
149
+ {
150
+ "id": "he",
151
+ "label": "Hebrew",
152
+ "nativeLabel": "עברית",
153
+ "active": false
154
+ },
155
+ {
156
+ "id": "zh",
157
+ "label": "Chinese",
158
+ "nativeLabel": "简体中文",
159
+ "active": true
160
+ }
161
+ ]
162
+ }
163
+ }
164
+ } %}
165
+ {% set aaHeader = aaHeaderData[locale or 'en'] or aaHeaderData.en %}
166
+ <header class="aa-site-header aa-utility-header">
167
+ <div class="aa-utility-header__inner">
168
+ <a href="{{ aaHeader.brand.href }}" class="aa-utility-header__brand">
169
+ <span class="aa-utility-header__mark">
170
+ <img src="{{ aaHeader.brand.logoSrc }}" alt="{{ aaHeader.brand.logoAlt }}">
171
+ </span>
172
+ <span class="aa-utility-header__copy">
173
+ <strong>{{ aaHeader.brand.title }}</strong>
174
+ <span>{{ aaHeader.brand.subtitle }}</span>
175
+ </span>
176
+ </a>
177
+ <nav class="aa-utility-header__nav" aria-label="Primary">
178
+ {% for link in aaHeader.links %}
179
+ <a href="{{ link.href }}" class="aa-utility-header__link aa-link-muted"{% if link.trackingId %} onclick="window.aa?.track('cta_click',{id:'{{ link.trackingId }}'})"{% endif %}>{{ link.label }}</a>
180
+ {% endfor %}
181
+ <div class="aa-utility-header__controls">
182
+ <div class="aa-utility-header__locale" role="group" aria-label="{{ aaHeader.switcher.label }}">
183
+ {% for option in aaHeader.switcher.options %}
184
+ <button type="button" class="aa-utility-header__locale-option{% if option.active %} is-active{% endif %}" data-aa-locale-option="{{ option.id }}" aria-pressed="{% if option.active %}true{% else %}false{% endif %}">{{ option.nativeLabel }}</button>
185
+ {% endfor %}
186
+ </div>
187
+ <a href="{{ aaHeader.cta.href }}" class="aa-utility-header__cta aa-button-dark"{% if aaHeader.cta.trackingId %} onclick="window.aa?.track('cta_click',{id:'{{ aaHeader.cta.trackingId }}'})"{% endif %}>{{ aaHeader.cta.label }}</a>
188
+ </div>
189
+ </nav>
190
+ </div>
191
+ </header>
192
+ <script>
193
+ (function () {
194
+ if (window.__aaLocaleSwitcherInitialized) return;
195
+ window.__aaLocaleSwitcherInitialized = true;
196
+
197
+ var COOKIE_NAME = "aa_locale";
198
+ var COOKIE_DOMAIN = ".agentanalytics.sh";
199
+ var COOKIE_MAX_AGE = 31536000;
200
+
201
+ function normalizeLocale(locale) {
202
+ var value = String(locale || '').trim().toLowerCase();
203
+ if (value === 'iw') return 'he';
204
+ if (value === 'zh-cn' || value === 'zh-hans' || value === 'zh-sg') return 'zh';
205
+ if (value === 'en' || value === 'he' || value === 'zh') return value;
206
+ return 'en';
207
+ }
208
+
209
+ function getCookieDomain() {
210
+ var hostname = window.location.hostname || '';
211
+ if (hostname === 'agentanalytics.sh' || hostname.endsWith('.agentanalytics.sh')) {
212
+ return COOKIE_DOMAIN;
213
+ }
214
+ return '';
215
+ }
216
+
217
+ function stripLocalePrefix(pathname) {
218
+ var source = pathname || '/';
219
+ return source.replace(/^\/(?:he|zh)(?=\/|$)/, '') || '/';
220
+ }
221
+
222
+ function localizePath(locale, pathname) {
223
+ var targetLocale = normalizeLocale(locale);
224
+ var value = String(pathname || '/');
225
+ var hashIndex = value.indexOf('#');
226
+ var hash = hashIndex === -1 ? '' : value.slice(hashIndex);
227
+ var pathAndQuery = hashIndex === -1 ? value : value.slice(0, hashIndex);
228
+ var queryIndex = pathAndQuery.indexOf('?');
229
+ var query = queryIndex === -1 ? '' : pathAndQuery.slice(queryIndex);
230
+ var pathOnly = queryIndex === -1 ? pathAndQuery : pathAndQuery.slice(0, queryIndex);
231
+ var normalizedPath = stripLocalePrefix(pathOnly.charAt(0) === '/' ? pathOnly : '/' + pathOnly);
232
+
233
+ if (targetLocale === 'en') return normalizedPath + query + hash;
234
+ return (normalizedPath === '/' ? '/' + targetLocale + '/' : '/' + targetLocale + normalizedPath) + query + hash;
235
+ }
236
+
237
+ document.addEventListener('click', function (event) {
238
+ var button = event.target.closest('[data-aa-locale-option]');
239
+ if (!button) return;
240
+
241
+ var nextLocale = normalizeLocale(button.getAttribute('data-aa-locale-option'));
242
+ var domain = getCookieDomain();
243
+ var secure = window.location.protocol === 'https:' ? '; Secure' : '';
244
+ var domainAttr = domain ? '; Domain=' + domain : '';
245
+
246
+ document.cookie = COOKIE_NAME + '=' + nextLocale + '; Path=/; Max-Age=' + COOKIE_MAX_AGE + '; SameSite=Lax' + domainAttr + secure;
247
+ window.location.assign(localizePath(nextLocale, window.location.pathname + window.location.search + window.location.hash));
248
+ });
249
+ })();
250
+ </script>